Build and check
The tools to install and the commands that check the spec, the gateware, the firmware, the whole chain in simulation, the DUT supply and the enclosure.
Tools#
| Tool | Used for |
|---|---|
| Python 3 | The spec and the enclosure |
| Icarus Verilog | Gateware simulation |
| OSS CAD Suite: yosys, nextpnr-ecp5, ecppack, verilator | The bitstream and the whole-chain simulation |
| A C++ compiler | The whole-chain simulation |
| ngspice | The DUT supply simulation |
| Rust | Firmware. The RP2350 binary needs the thumbv8m.main-none-eabihf target |
| uv | The enclosure's Python environment |
| gh | Fetches the logo for the enclosure. If gh has no access, the build makes the case with a blank top |
Check the spec#
python3 spec/ramspec.py --checkspec ok: 116 IO lines, 90 legacy roles, 8 socket maps, DIMM needs 109 linesSimulate the gateware#
gateware/sim/run.shEach scenario prints one line. The run takes several minutes.
ok speed_83: PASS: speed within one tick
ok detect_fpm: PASS: mode detected
ok detect_edo: PASS: mode detected
ok retention: PASS: retention loss detected (64 errors)A scenario that fails prints a line that starts with FAIL, and the script exits with status 1.
Build the bitstream#
gateware/build.shThe script tries placement seeds until one meets timing and prints seed N meets timing. It fails if no seed reaches 162.5 MHz. The last build reached 163.2 MHz.
Prove the gateware#
gateware/formal/run.shPASS mutant start_dropped: caught by tester_core_props.vh:46
PASS mutant abort_dropped: caught by tester_core_props.vh:70
PASS mutant oe_in_write: caught by tester_core_props.vh:83
PASS mutant drive_no_power: caught by tester_core_props.vh:77The script proves 43 properties of the timing engine and 4 of the SPI register bus for every input, by induction. The run takes about four minutes.
| Property | Meaning |
|---|---|
| A start is never lost | A start request in any state runs the step, including during a background refresh |
| An abort is never lost | An abort request ends the access in progress |
| Busy and done | Done never reads true for a step that has not run |
| No dead state | Every state leads back to idle |
| Write and output enable | They never overlap |
| Power-good | Every bus line is released while DUT_PG is low |
The four mutant lines inject a fault into the engine and check that a proof catches it. The proofs assume the cycle length is not rewritten in the middle of a cycle. They do not cover the order of the RAS and CAS edges, which depends on register values.
Simulate the synthesised gateware#
gateware/sim/run_gate.sh # four scenarios, about 12 minutes
gateware/sim/run_gate.sh all # all 14, about 47 minutesThe script synthesises the top level for the ECP5 and runs the scenarios on that netlist. All 14 pass, with no difference from the source-level run. Yosys has no simulation models for the PLL, the DDR cells or the input delay, so sim/ecp5_prims_sim.v stands in for them. Pad latency and PLL behaviour stay unverified until a board runs.
Test the firmware logic#
cd firmware
./update-design.sh
cargo test --features simupdate-design.sh downloads the design system release and generates the display's palette and fonts into rt-hal/src/generated/. It needs gh and uv. Run it once, and again to take a new release.
test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outThe three groups are the test algorithms, the JSON console and the front-panel screens. They run rt-core against a software model of the engine and a DRAM. The next section runs the same logic against the real gateware. rt-fw, the RP2350 binary, compiles but has not run.
Simulate the whole chain#
cd firmware/rt-cosim
cargo testtest result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outrt-cosim runs the firmware's own tests through the real board driver (rt-hal) against the real gateware. Verilator compiles spi_regs.v and tester_core.v, and the crate clocks them at the real tick of 3.077 ns. The run takes about two minutes.
| Part | In the simulation |
|---|---|
| Test logic and board driver | The real code: rt-core and rt-hal |
| SPI register bus | Bit by bit at 4 MHz into the real spi_regs.v |
| Timing engine | The real tester_core.v |
| DDR pad cells | A software model: two output phases, two input samples, the fine input delay |
| Cartridge | A software model: drive and receive buffers with fixed delays, byte-lane enables, weak pulls, sense read-back |
| DRAM | A pin-level model: access time, FPM or EDO outputs, retention, injected faults |
| DUT supply | Ideal parts: DAC, regulator set point, switch, over-voltage veto, current monitor |
The scenarios cover a 4-bit chip, a 1-bit chip with separate data in and out, a 30-pin SIMM with parity and a 36-bit EDO 72-pin SIMM. The fault scenarios are a stuck cell, shorted data lines, a dead address line, and shorted and stuck control lines. The rest are an empty socket, a part that is too slow, an overcurrent, the supply margin test and the retention test.
The simulation does not model signal quality, the PLL, the ECP5 pad primitives or supply ramps. rt-fw is not part of it.
Simulate the DUT supply#
hardware/spice/run.shThe script prints one PASS, FAIL or INFO line per check and exits with status 1 if a check fails. The regulator is a behavioural model and the transistors are generic models. The lines marked ASSUMED in hardware/spice/rail.inc list every value that does not come from the board.
All checks pass. Limits of revision A lists the figures to measure on the first board.
PASS 5 V cartridge: rail limit: the rail reaches 5.600 V at DAC code 0; the comparator trips at 5.863 V
PASS trip to switch open: 0.1 ms after the comparator trips; cartridge saw 6.47 V of a 6.5 V fault
PASS inrush: peak 0.4 A, above 2 A for 0 us; supply side dips to 5.00 V
PASS discharge (weak AO3400A): cartridge at 0.05 V after the firmware's 50 ms (below 0.5 V after 24.7 ms); supply side left at 4.88 VAn earlier circuit failed four of these checks: 24 A of inrush, 17.8 ms to open the switch, no limit between 5.5 V and 5.86 V, and a discharge that depended on the transistor. The switch, its two transistors and the feedback divider were changed until the checks passed.
Study the supplies and the bus#
Five more scripts go beyond nominal values. Each prints PASS, FAIL and INFO lines and exits with status 1 if a check fails. All five fail today: Open design faults lists what they found.
| Script | Subject | Result |
|---|---|---|
hardware/spice/run_tolerance.sh | The DUT rail and its comparator over part tolerances: 2000 random units and 8192 corners | 3 pass, 6 fail |
hardware/spice/run_sequence.sh | Power-up, a cartridge pulled or plugged under power, brown-out, input-pad leakage | 10 pass, 2 fail |
hardware/spice/reg/run.sh | The regulators as switching converters, and the impedance of the FPGA supplies | 29 pass, 5 fail |
hardware/spice/dip/run.sh | The three supply rails of the DIP cartridge and their order | 11 pass, 7 fail |
hardware/spice/si/run.sh | Overshoot, ringing and delay on the bus lines from the FPGA to the socket and back | 7 pass, 15 fail |
The regulator model is this project's own, built from the datasheets, because the manufacturer publishes no SPICE model. Its loop compensation is assumed, so the stability results are indicative. The bus script downloads Texas Instruments' IBIS models for the two buffer types on the first run. The FPGA pad and the DRAM are generic models. The copper length of every bus line is in hardware/spice/si/lengths.json, taken from the routed boards.
Preview the display#
cd firmware
cargo run -p rt-hal --features host --example lcd_preview -- /tmp/lcd1-select
2-testing
3-pass
4-fail
5-details
6-no-device
7-aboutThe files use the same fonts and colours as the display.
Web interface#
python3 web/build.py
python3 web/dev.py 808014 files in web/dist, 140129 bytes gzipped in web_assets.h
http://localhost:8080/web/build.py downloads the Jupiter stylesheet, fonts and logo with gh. web/dev.py answers the same requests as the Wi-Fi module and runs the firmware's console against its software model. Post good, edo, empty, cell or short to /api/memory to change the simulated memory.
Wi-Fi module firmware#
python3 web/build.py
cd wifi
pio runThis firmware has not been compiled yet. The ESP32 toolchain needs about 4 GB of disk.
RP2350 firmware#
rustup target add thumbv8m.main-none-eabihf
gateware/build.sh
cd firmware/rt-fw
cargo build --releaseFinished `release` profile [optimized + debuginfo] target(s)The binary compiles and links. It has not run on a board.
Build the enclosure#
cd enclosure
uv venv
uv pip install -e .
.venv/bin/python enclosure.py --checkenclosure checks passedThe command writes the STEP and STL files to enclosure/out/.
Documentation#
The pages are Markdown in docs-src. jupiter-docs from belikh/docs generates docs/*.md and the site from them. Edit docs-src only.
git clone https://github.com/belikh/docs .jupiter-docs
(cd .jupiter-docs && npm ci && npm run update:design)
export JUPITER_DESIGN_DIR="$PWD/.jupiter-docs/vendor/design"
node .jupiter-docs/packages/docs/bin/jupiter-docs.mjs check
node .jupiter-docs/packages/docs/bin/jupiter-docs.mjs build16 page(s) OKCommit docs-src and the regenerated docs together. .jupiter-docs and dist are in .gitignore.
Workflows#
| Workflow | Runs on | Checks |
|---|---|---|
docs.yaml | Push to main and pull request that touch the pages | jupiter-docs check, build --check and the site build |