21 NAND Docs 中文

FPGA port

The Bard's full chip v8g routes on an XC7A100T with an open-source toolchain, with timing at 21.19 MHz. It is not on a real board yet.

Results

DeviceSynthesisPlace and routeTiming
XC7A100T-1FTG256CLUT about 45.0k / 63.4k, FF 21.4k (17%), RAMB18 107 + RAMB36 10Routed, about 12 minutes, under 1 GB of memory21.19 MHz, required above 16.7 MHz, passes
LFE5U-85F (ECP5)LUT4 69.4k / 83.6k (83%)Routing did not converge, stopped on 10-30—
XC7A75TEstimated from the 100T result, LUT about 96%Not tried—

Toolchain

All open-source tools:

Build

Synthesize to a Xilinx 7 series netlist
yosys -p "read_verilog top_tang138k_ce.v uart_shell_ce.v machine_ce.v body_ram2_ce.v; synth_xilinx -family xc7 -top top -json syn_xc7.json; stat"
Place and route on XC7A100T-FTG256, with a single-cycle target of 17 MHz
nextpnr-xilinx --chipdb xc7a100tftg256.bin --xdc xc7a100t.xdc --json syn_xc7.json --fasm pnr_xc7.fasm --freq 17 --timing-allow-fail --report pnr_xc7_report.json

Then use fasm2frames and xc7frames2bit to turn pnr_xc7.fasm into a bitstream.

Pin constraints xc7a100t.xdc (for verification only):

set_property PACKAGE_PIN D13 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property PACKAGE_PIN A3 [get_ports rx]
set_property IOSTANDARD LVCMOS33 [get_ports rx]
set_property PACKAGE_PIN A2 [get_ports tx]
set_property IOSTANDARD LVCMOS33 [get_ports tx]

Timing recheck

We walked the paths ourselves on the post-route SDF. The endpoints include the CE and SR pins, which nextpnr's own report does not check.

CheckLongest (raw SDF)Longest (with Artix-7 cell delays)RequiredResult
Single-cycle: the 5 flip-flops that toggle every cycle → 21,988 endpoints9.489 ns9.701 ns< 20 nsPasses
Three-cycle: all sequential cells47.187 ns47.390 ns< 60 nsPasses

Gate-level cycle comparison

We ran the whole-board netlist in Verilator and fed it the three test cases L1, L2 and L3 over the serial port.

NetlistL1 (expects 32)L2 (expects 5)L3 (expects 128)
After synthesisPassesPassesNo result
After routingPassesPassesNo result
Negative control one: a RAM's read address tied to 0FailsFailsStopped
Negative control two: 35 shift register addresses changed back to their synthesis valuesFailsFailsStopped

Not verified yet

  1. Gate-level cycle comparison on L3.
  2. The bitstream itself: the comparison checks the post-route netlist, not a netlist recovered from the bitstream.
  3. ECP5: routing did not converge, so there was no cycle comparison or timing recheck.
  4. Real hardware: there is no board. The schematic and PCB of a small XC7A100T board are drawn, but the board has not been made.

Next