| Item | Value |
|---|---|
| Applies to | every file under cores/, scripts/, cpu/, boards/ and demos/ |
Read documentation/rtlnet_architecture.md first (bus, register conventions, address map, leaf contract,
section 15 port lists). This page lists the rules a core must follow to be accepted.
- No other company is named anywhere — sources, comments, documents, file and module names, commit
messages. Prior designs used as references are not cited by path or name. Silicon and tool vendors are named
only for the part or tool meant (AMD/Xilinx, Intel/Altera, Lattice, Realtek RTL8211E, Digilent Nexys Video).
Before every commit
scripts/rtlnet_name_check.ps1must reportRTLNET_NAMES: PASS(its pattern list is kept outside the repository, in%LOCALAPPDATA%/RTLNet/forbidden_names.txt, so the names never enter RTLNet files). - SystemVerilog-2012 only (
.sv,.svh), synthesizable subset for RTL:logic,always_ff,always_comb,assign, packages,localparam, functions. No interfaces or classes in synthesizable ports. - Folder structure:
cores/<core>/{hdl,driver,testbench,documentation}— nothing else at core level. - Technology: never put a vendor primitive, vendor macro or vendor-only attribute in a generic core. Use
rtlnet_ram_corefor every memory,rtlnet_sync/rtlnet_pulse_sync/rtlnet_gray_sync/rtlnet_axil_cdc/rtlnet_packet_fifofor every crossing,rtlnet_reset_syncfor every reset release. Technology comes fromrtlnet_technology.svhonly; noTARGETparameter exists. - Memories: every buffer has a
*_KBtotal-size parameter and aRAM_STYLEparameter ("block"default,"distributed"); derive depths from them and$fatal(in a generate branch, so synthesis fails too) on a size that cannot be built. - Buses: data is the RTLNet stream (64-bit AXI4-Stream, architecture section 4); control is AXI4-Lite through
rtlnet_axil_slave(architecture section 5, standard ID/VERSION/CAPS header). - Commit regularly: one commit per coherent step (RTL, bench passing, driver, doc). Commit messages end with
the
Co-Authored-Byline the session supplies.
- Header block on every file: purpose, overview of behaviours, language, revision as a
MM-DD-YYYYdate code with a change list, clocks. Comments state current function in present tense. - Ports in commented groups (clock domain, protocol, polarity, width contract), clocks and resets first.
- Synchronous, active-low resets (
resetn,aresetn); the only asynchronous-assert process is insidertlnet_reset_sync. - Clocked blocks
always_ffwith<=only; combinational logic inassignoralways_combwith defaults first. - One registered state variable per FSM,
S_*localparams, single clocked process,defaultrecovers. - No latches, no combinational loops, no internal tri-states, no logic-generated clocks.
- 2-space indent, no tabs, lines up to 130 columns, one declaration per line, no commented-out code, no magic
numbers (named localparams or
rtlnet_pkgconstants). - Precede every process and instance with a comment saying what it does in context.
- FIFO and RAM overflow made impossible structurally and made visible by a simulation-only check
(
// synthesis translate_off...translate_on). - Instance names that constraints depend on (
u_*_fifo,u_rgmii_io, synchronizer instances) are stable.
- Offsets and bit positions are defined once, in the core's driver header
<core>.h; the register file carrieslocalparams with a comment naming the header. Keep both in step in the same commit. - Standard header at 0x000
ID(four ASCII characters viartlnet_pkg::id4), 0x004VERSION(0xMMDDYYYY), 0x008CAPS. Read mux registered. Counters 32-bit with aCNT_CLEARpulse.
cores/<core>/driver/<core>.hand<core>.c: the only code that touches the core's registers. Public functions<core>_*lower_snake_case,staticfile state withg_prefix, constantsALL_CAPSwith a domain prefix andusuffixes, fixed-width types,constpointer parameters, 4-space indent, function commentsname -- summary,Steps:,Returns:.- Register access only through
rtlnet_mmio.h(rtlnet_reg_read32(base, off),rtlnet_reg_write32(base, off, v)) fromcores/rtlnet_common/driver/; the base address is passed in, never hard-coded in a driver. - Loops that wait on hardware are bounded by named constants and return an error on timeout.
- Drivers must compile warning-free with
mb-gcc -std=c11 -Wall -Wextra -Werrorand with hostgccfor unit tests.
- One self-checking bench per core at least,
cores/<core>/testbench/tb_<core>.sv, with a filelisttb_<core>.f(paths relative to the repository root; nested-f cores/rtlnet_common/hdl/rtlnet_common.fand-f cores/rtlnet_common/testbench/rtlnet_tb_common.f). - Use
rtlnet_tb_pkg(tb_check,tb_error,tb_verdict), the AXI-Stream source/sink, the AXI4-Lite master and, for protocol leaves,rtlnet_tb_leaf_busy_monitor. Oracles must be independent of the RTL (bench-built frames,crc32_serial_fcs,inet_sum). - End with exactly one
tb_verdict("<bench>"); add a watchdog that calls it on timeout. - Never use
foreachin bench code (Active-HDL 11.1 bug, seecores/rtlnet_common/documentation); usefor (int i = 0; i < $size(q); i++). - Register every run in
cores/<core>/testbench/regression.txt, including oneplusargs=INJECT_FAILURE expectfailnegative-control line. - Run:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/rtlnet_run_sim.ps1 -Bench <tb> -Filelist <f>. The runner serializes the single Active-HDL seat machine-wide; just call it. Do not start the Active-HDL GUI. - Prove each new check can fail (perturb the bench once, see TEST FAIL, restore).
- Board integration benches drive register and DMA transactions through the matching processor stub. The Ethernet configuration uses
cpu/microblaze_v_ethernet/rtlnet_cpu_eth_sim_stub.sv. The media configuration usescpu/microblaze_v_h264/rtlnet_microblaze_sim_stub.sv. Check lwIP and CLI behavior on hardware and in host-side tests.
Always launch Vivado through scripts/rtlnet_vivado.ps1 (machine-wide limit of two concurrent Vivado jobs):
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/rtlnet_vivado.ps1 -Tcl scripts/rtlnet_synth_check.tcl `
-Log .sim/synth/<top>.log -TclArgs <top>,<filelist>[,<part>][,NAME=VALUE,...]
The part is optional (default xc7a200tsbg484-1, the part of the reference board).
It must report rtlnet_synth_check: PASS with 0 critical warnings for every new synthesizable top. Record the
utilization in the core documentation.
cores/<core>/documentation/<core>.md: purpose, interface (port groups), parameters, register map (offsets, bits,
reset values, access), design (state machines, data path, latency), clocks/resets/crossings, verification
(benches, what each proves, recorded results with date and check count), synthesis results, limitations,
revision history.
The repository has one branch, main; all work is committed on it. Folders keep the board-independent code apart from a board:
| Folder | Holds |
|---|---|
cores/ |
RTLNet-owned RTL, drivers, benches and core documents |
scripts/ |
generic scripts (simulation, regression, synthesis check, tool discovery) |
documentation/, diagrams/ |
the generic documents and drawings |
boards/<board>/ |
Board tops, constraints, scripts and benches for Nexys Video (RGMII, Ethernet and media variants) and Arty A7-100T (MII Ethernet). |
cpu/ |
Shared Ethernet processor and firmware in microblaze_v_ethernet/. Nexys media firmware and DDR-capable processor integration in microblaze_v_h264/. |
media-sources.json, ip/ |
Manifest and checkout-local bindings for the receiver in IronCapture and the encoder in IronH264. |
demos/ |
released demonstration bitstreams |
Rules:
cores/and genericscripts/never depend onboards/,cpu/ordemos/. The regression of the cores (scripts/rtlnet_regression.ps1) runs with those folders absent; it runs everycpu/<cpu>/andboards/<board>/testbenchwhen they exist. It also discovers tests in the two bound media core directories when available.- Board-specific files live under
boards/<board>/: board top, constraints, MIG project file, build and test scripts. No board path, pin, part or board address in core RTL, drivers, benches, generic scripts or filelists. The cores take such data as parameters or arguments (for examplertlnet_ddr_mig_create <dir> <prj>takes the MIG project file of the board). A default part in a script is a documented parameter default. If a board needs a different version of a shared file, the board gets its own file underboards/<board>/instead of a variant of the shared one. - Demos. Keep approved images and release metadata under
demos/. The Nexys High Profile evaluation image enforces its 30-minute limit. The Ethernet and Baseline images run continuously. Keep private High Profile sources and netlists in their owning repository. - No build output is tracked in git (bitstreams,
.mmi,.xsa, firmware images, reports). The released images are the files underdemos/. - Work is committed on
main.
Edit and test the CSI-2 receiver in IronCapture or the encoder in IronH264. Record the accepted upstream commit and core tree in media-sources.json, then run scripts/resolve_media.ps1 from the RTLNet checkout. The resolver checks the origin, the tracked core tree and local edits before binding ip/rtlnet_csi2_rx and ip/rtlnet_h264_enc. A documentation-only upstream commit can retain the same core tree. Keep local bindings out of Git.
For a change to either core, build the Nexys Baseline image and check that the color-bar source reaches DDR, the encoder emits access units and a network receiver decodes the stream. Record the hardware and firmware revisions with the test result.