Skip to content

Base64 fx68k gateware — v1.2.1

Choose a tag to compare

@jbilander jbilander released this 12 Oct 18:21
· 2 commits to main since this release

Base64 fx68k gateware — v1.2.1

Bug fix release. Holds /VMA past E's falling edge in the 6800-synchronised
bus cycle, so CIA register writes are no longer at risk of being dropped.

On some motherboards the previous builds could silently lose a write to a CIA
register. Whether it happened came down to board layout, which is why it never
showed on original Commodore boards here but broke on a replica. Recommended
for everyone
— a dropped CIA write is silent, and the affected path carries
every CIA, serial, parallel and floppy-control register access the machine
makes.

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


What changed

The symptom. On an A500++ (bobsbits A500 replica), AmigaTestKit 1.21's CIA
Timer Test reported every tick count correct — within 0.005% — and every
interrupt count zero:

Expect 1421031 Ticks and 21-22 IRQs during 100 VBLs:
CIAATA 1420966 -> OK;  0 IRQs -> FAIL
CIAATB 1420702 -> OK;  0 IRQs -> FAIL
CIABTA 1420702 -> OK;  0 IRQs -> FAIL
CIABTB 1420702 -> OK;  0 IRQs -> FAIL
CIAA TOD IRQ Failure!
CIAB TOD IRQ Failure!

The timers were counting E correctly, so E, VMA/VPA handshaking and CIA reads
were all working — but no timer interrupt was ever raised. Putting the original
68000 DIP back in the socket made the test pass, which placed the fault here
rather than on the motherboard.

The cause. An 8520 latches a write on E's falling edge, with its chip select
still asserted. Gary gates the CIA chip selects with /VMA. The RETIME path was
negating /VMA on the same 85.13 MHz clock edge that E falls — both are
flip-flops clocked by that edge, so the designed hold time was zero, and
whether /VMA survived E's fall at the CIA came down to Gary's VMA→CS
propagation racing the E distribution path. That is a board-layout property,
hence the same bitstream passing on one Rev 8A and failing on another. A real
68000 negates VMA in S7, with E already low, and has no such race.

What made it hard to see is that the only register write ATK's CIA timer test
performs is the CIA interrupt mask. Lose it and the timers keep counting
perfectly while the CIA never raises /IRQ — all ticks OK, all IRQ counts zero,
and an otherwise completely well machine.

The fix. /VMA is now held to the next half-7M tick, 70 ns past E's falling
edge, which is what the bridge FSM already did before the RETIME path replaced
it. Deferring the ack along with it also holds /AS, /UDS, /LDS, R/W, the write
data and the address, because the core cannot negate AS until it has seen
DTACK. Measured in simulation: 0 ns before, 70.8 ns after. It costs 70 ns on a
cycle that already takes about 1.4 µs, so there is no throughput change — CIA
access is E-rate limited either way.

New VMA_HOLD parameter in base64_top.sv, default 1'b1. Setting it to
1'b0 restores the old behaviour, which is useful for reproducing the fault and
for nothing else.

Only base64_top.sv changed, by eight lines. The RTL elsewhere, the ROM images,
the autoconfig layout and the product IDs are all the same, mapROM is unchanged,
and sfsd.device still binds unmodified.

Build

Fmax 88.629 MHz against the 85.900 MHz constraint
Timing 0 setup errors, 0 hold errors, 99.41% coverage
SLICEs 5080 of 12144 (42%)
Registers 3077 of 24879
Block RAMs 21 of 56
I/O 116 of 197 PIO sites

Testing

Board Result
A500++ (bobsbits replica, Rev 8A) ATK 1.21 CIA test all passed — was all-IRQs-zero before
A500 Rev 5 ATK CIA test all passed
A500+ Rev 8A (original) unchanged, all passed
A500 Rev 6A (original) unchanged, all passed

Thanks to Matt Harlum (LIV2) for the original report and for testing the
fix on the A500++, and to the tester who checked Rev 6 and Rev 5.

The failure was found by AmigaTestKit by Keir Fraser, which is the only
thing sharp enough to have caught it — DiagROM reports interrupts as OK on an
affected machine.


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.

⚠ 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. 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.

MapROM from v1.1.0 is unchanged and works with this bitstream, so there is
no need to replace it.


Known limitations

Carried over from v1.2.0: no DMA into the Zorro II fast RAM (set the mountlist
Mask to 0x001FFFFE), passive mode untested, and place-and-route variance
comparable to the timing margin.

New, and worth recording honestly:

  • Rämixx500 is not confirmed. It was one of the two boards that originally
    reported the failure. The tester hit unrelated problems with that board and
    could not run a reliable comparison, so whether this fixes that board is
    still open. If you have one, a CIA test result either way would be welcome.
  • One detail of the old failure is unexplained. The ICR mask write was
    being lost while the TOD register writes a few lines later in the same test
    landed correctly — and a per-board timing race ought to affect every CIA
    write equally. The fix widened the hold on /VMA, /AS, /UDS, /LDS, R/W, the
    write data and the address all at once, so which of those was actually being
    clipped is not established. The hold violation was real and removing it fixed
    the fault; the mechanism is recorded as not fully pinned down rather than
    presented as understood.

Checksums

SHA256  f2d7f555c5aa3cee6de9b1e6110153a7509bd0e07ce7c9994e2f5c8c11258855  base64_fx68k_v1.2.1.bit