Module board

Module board 

Source
Expand description

The board: one timeline in master clocks, the page table, and the devices around the CPU (board.py).

The CPU core (huc6280-rust) calls read, write and idle once per CPU cycle with a 21-bit physical address. The board prices the cycle: 12 master clocks at low speed, 3 at high speed (pins.high_speed), plus the VDC/VCE stretch and any hold, all inside the callback; it never adds step()’s return on top (the reference’s docs/handoff-brief.md, the bus contract).

Where inside a cycle a device sees the access is U21 (provisional): the base cycle elapses, then the access happens at that instant, then the stretch cycle for a VDC or VCE address elapses.

Differences forced by Rust:

  • The CPU owns the board (cpu.bus), so the board cannot hold the CPU. What the reference’s board does to its CPU (set_irq_lines, irq_disable, reading high_speed) goes through the Pins each bus callback is handed, at the same points of the cycle and in the same order; attach_cpu is System::new’s. With no CPU (advance called on a bare board, as the reference’s tests do) the lines are tracked and nothing is delivered.
  • The decode is here: page_read and page_write turn the page table’s Handler names into calls (pagetable.rs).
  • The constructor’s keyword arguments are the fields of BoardOptions, which also carries the switches the reference keeps as class attributes (Psg’s, Timer’s).
  • The pixel path is the board’s field (pixel_path); the capture is handed the mixed row. The mixer is handed the sources in the reference’s order: the PSG, the port device’s own, then audio_sources.
  • bus_log is the tap the reference’s scripts make by wrapping the three callables (scripts/state_roundtrip.py, observe): when it is Some, every cycle appends the same words.

Structs§

Board
BoardOptions
The reference’s Board(...) arguments, with its defaults.