Skip to content

Base64 fx68k gateware v1.1.0 — mapROM

Choose a tag to compare

@jbilander jbilander released this 26 Aug 10:38
· 6 commits to main since this release

Base64 fx68k gateware — v1.1.0

Adds mapROM: Kickstart is shadowed into SDRAM at boot and served from
the FPGA instead of the motherboard, so it runs at fast RAM speed.

Everything in v1.0.0 is unchanged: 42.5 MHz
fx68k, 24 MB of fast RAM, SD card boot, cold boot from power-on. Requires
Base64 carrier board Rev C and an iCESugar-Pro module.


mapROM

Kickstart lives on the motherboard and answers at 7 MHz with a wait state,
while the core runs at 42.5 MHz. Since most of what the OS executes is ROM
code, this is the largest speedup left in the design.

Measured with bustest on the $F80000 bank:

before after
readw 583.2 ns 278.2 ns
readl 1169.5 ns 400.8 ns
readm 1270.9 ns 293.6 ns
bandwidth 3.4 MB/s up to 13.6 MB/s

bustest fast on the Zorro II fast RAM gives readw 282.8 ns — so Kickstart
now runs at the same speed as fast RAM, which is the point.

It happens automatically. The board's autoconfig ROM does the copy during
expansion configuration, before DOS and before anything loads from disk. There
is nothing to run and nothing to add to your startup-sequence. It costs about
half a second of boot time and produces no visible sign that it happened.

Tested on Kickstart 1.3 and on a 1 MB Hyperion 3.1.4, from cold boot.

How it works

1 MB of the 32 MB SDRAM is reserved as the shadow. It is reachable from no CPU
window — the only way in is through the gateware, using two control bits:

  • LOAD — writes to $F80000-$FFFFFF and $E00000-$E7FFFF land in the
    shadow. Reads are untouched, so they still come from the real ROM.
  • ACTIVE — reads come from the shadow.
    So the copy is an ordinary move loop with both pointers at $F80000: the read
    fetches motherboard ROM, the write goes to the shadow. Same address, different
    destination.

Both banks are always copied verbatim, with no attempt to work out what is in
them. Whatever the motherboard returns — real ROM, an alias of the other bank
because the chip has no A19 to tell them apart, or nothing at all — is
reproduced exactly, so switching over cannot change what the machine sees.

The switchover checksums the shadow against the ROM with interrupts disabled.
On a mismatch it turns mapROM back off and the machine boots from the
motherboard ROM as before, having never executed a byte of a bad shadow.

No second reset is needed, unlike mapROM on a Blizzard with BlizKick. This
shadows the same Kickstart rather than loading a different one, so nothing
the system has built from ROM goes stale — which is also why it can be
switched on and off on a running machine.


MapROM (optional tool)

Not needed for normal use. It is there for checking and for A/B comparisons.

MapROM STATUS     report, change nothing
MapROM OFF        switch back to the motherboard ROM
MapROM            copy and switch over

Straight after boot, MapROM STATUS should say active on. If it says
active off, the shadow did not verify and the machine is running from the
motherboard ROM — no harm done, but worth reporting.

Copy it anywhere on your boot volume. If AmigaDOS refuses to run it, the
executable bit was lost in transit: protect MapROM +e.


Timing

This build closes with 0 setup errors and 0 hold errors, 87.222 MHz
against the 85.900 MHz constraint.

v1.0.0's notes described the margin as thin and warned that rebuilding might
not close. That turned out to be a constraints bug rather than a design limit.
The condition-code paths in the fx68k ALU run from enT3 to enT3 — a whole
microcycle — but three of the four register combinations were never given a
multicycle exception, so they were being held to four times tighter than
required. They are now stated correctly, and the previously critical paths
have around 11 ns of slack rather than being marginal.

The worst-case path is still close to the line, and place-and-route variance
between builds remains comparable to the margin, so a rebuild from source may
still land differently. The underlying constraint is the -6 speed grade of
the part on the iCESugar-Pro.


Installing

Plug a USB-C cable into the FPGA module. The on-board iCELink appears as a
virtual disk — drop the .bit file onto it and wait a few seconds while it
writes the SPI flash. No adapter, no drivers, no extra tools.

⚠ Do this with the module OUT of the Amiga

There is no protection on the module between its 5V rail and USB 5V.
Plugging in USB while it is seated ties the Amiga's 5V to your PC's with
nothing in between, and whichever is higher back-drives the other. In
practice USB sits closer to a true 5.0V and the Amiga nearer 4.9V, so the
result is your PC powering the Amiga's 5V rail — which is not what you want
either.

If USB has to stay attached while the module is installed, use a data-only
cable
with the 5V conductor cut, leaving D+, D- and GND.

Program it, then seat it in the SO-DIMM socket.


Known limitations

  • DMA into the Zorro II fast RAM is not supported. A Zorro II DMA device
    targeting that range will hang. Set the mountlist Mask so the filesystem
    bounces through chip RAM — 0x001FFFFE — which is needed for the 32-bit
    fast RAM regardless, since Kickstart 1.3 has no MEMF_24BITDMA.
  • Passive mode is untested. The gateware will hand the bus over to a
    second accelerator that asserts and holds /BR, but that path has not yet
    been exercised on hardware.
  • Place-and-route variance, as above.

Building from source

See fx68k/BUILD.md. Two things worth knowing:

  • The four .mem files (microrom, nanorom, turbomem, sfsd) must be
    members of the Diamond project, typically reside in the impl1 folder.
  • The fx68k submodule points at
    fredrequin/fx68k, which needs three
    bug fixes applied before it will boot on an Amiga. Without them you get a
    deterministic Guru 81000005 during Exec init.
    mapROM in the autoconfig ROM is a build option: make rom DIAG_MAPROM=1, then
    make install-mem. It is off by default in the source; the released bitstream
    has it on.

Credits

  • Jorge Cwik (ijor) — the fx68k core.
  • Frédéric Requin (frenchshark) — the fx68k performance and size rework
    (PR #6) that makes 85 MHz possible.
  • Niklas Ekström and Matt Harlum — the SF2000 SD card design and
    sfsd.device, ported here unchanged.
  • Alastair M. Robinson — the parent project, and the TG68k gateware that
    shares this repository.

Checksums

SHA256  aa90ca65eb5472dd31f591d108720825b23238631bbfea5b54936b6bda3239f7  base64_fx68k_v1.1.0.bit
SHA256  648d9ea521249383ae53b76f79666664e66b83cc3f86b255f33ba8d1f4730bce  MapROM