Repository navigation
Phase 9: iCE40 FPGA synthesis, UART top level and timing - #4
Merged
Merged
Conversation
fpga/ice40/fpga_top.sv runs the 5-stage pipeline on a program preloaded into block RAM, prints console output over a 115200-baud UART through a FIFO, and shows the run on five LEDs. fpga/ice40/build.sh runs Yosys (with a latch check) and nextpnr: 4958 of 5280 logic cells (93%), 17 of 30 block RAMs, and 14.98 MHz post-route against the 12 MHz oscillator. The netlist has no latches. The memories take an optional $readmemh image (IMEM_INIT, DMEM_INIT); empty leaves simulation unchanged. The data memory's read-new bypass moved out of mem_sync into a merge after the read register, which gives the same values and maps to block RAM (it had mapped to flip-flops, about 72,000 logic cells). Two functions were written in the plain form Yosys reads. fpga/prepare_rtl.py converts a copy of the RTL for Yosys, which cannot parse package imports in module headers, typed string parameters or ANSI function ports. Checks: `bash sim/run.sh fpga` decodes the UART in simulation and gets 6765 for fib (and fails on the hello image); unit, pipeline and single-cycle lockstep suites pass with the new memory; the WASM module rebuilds and passes its 534 checks. The programs view shows time on the iCE40 from the measured clock. The board itself is not yet tested: the UART and LED pins are unconstrained.
The synthesis step pipes build output through tee into fpga/ice40/build/, which build.sh creates only after tee has opened its file. tee failed on the missing directory, and pipefail failed the step after a successful build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 9: the iCE40UP5K (iCEBreaker) build of the pipelined core.
fpga/ice40/fpga_top.sv: the pipeline runs a program preloaded into block RAM and prints console output over a 115200-baud UART. Five LEDs show running, done, pass, fault and overflow.fpga/ice40/build.sh: Yosys with a latch check, then nextpnr. Result: 4958 of 5280 logic cells (93%), 17 of 30 block RAMs, 14.98 MHz post-route against the 12 MHz oscillator. No latches.RTL changes
$readmemhimage. Empty (the default) leaves simulation unchanged.mem_syncinto a merge after the read register. The values are the same at every edge. Without this the data memory mapped to flip-flops (about 72,000 logic cells). The pipelined core's lockstep and hazard suites pass.fpga/prepare_rtl.pyconverts a copy of the RTL for Yosys, which cannot parse package imports in module headers, typed string parameters, or ANSI function ports. The simulators read the originals.Verification
bash sim/run.sh fpga: the UART is decoded in simulation and carries6765, and the LEDs report pass. The same test fails on the hello image.Not done
--pcf-allow-unconstrained), and no bitstream is generated.fpga.yml) has not run on GitHub yet.