
RadMAC is an 8-bit unsigned, iterative multiply-accumulate (MAC) unit. It multiplies two 8-bit operands and adds the product to a 16-bit initial accumulator value:
RESULT = (ACC0 + A × B) mod 2^16
The multiplier uses an 8-cycle shift-and-add datapath. The 16-bit result is retained internally and can be read through the Tiny Tapeout bidirectional pins, one byte at a time.
The operating mode is selected through configuration register 0x04:
MODE |
Mode | Behaviour |
|---|---|---|
00 |
Normal | Performs the MAC operation without the residue-check and retry sequence. |
01 |
Protected | Checks the completed result using a modulo-3 residue checker. If a mismatch is detected, the working datapath is restored from its checkpoint and the operation is retried. |
10 |
Fault Injection | Enables the configured XOR fault-injection event so the detection and recovery behaviour can be exercised. |
11 |
Reserved | START is rejected. |
In Protected and Fault Injection modes, the design checkpoints the operation's inputs and initial accumulator state and calculates an independent reference residue. The checker compares the residue of the computed 16-bit result with the expected residue. The design allows up to three retries after the initial attempt. If all attempts fail, it asserts FATAL_FAULT and requires a hardware reset to leave the fatal state.
The modulo-3 check detects a single-bit inversion in the checked 16-bit result word, provided the reference and checker logic are operating correctly. It does not detect every possible multi-bit error, nor does it guarantee detection of faults in every control, reference, or checker element. RadMAC is a small demonstrator of error detection, fault injection, and retry, not a complete radiation-tolerant processor.
RadMAC uses the standard Tiny Tapeout GPIO interface:
| Signal | Function |
|---|---|
ui_in[7:0] |
Data byte for configuration writes. |
uio_in[7:0] |
Command byte from the host when the host owns the bidirectional pins. |
uo_out[7:0] |
Status byte. |
uio_out[7:0] |
Result data during readback. |
uio_oe[7:0] |
Bidirectional-pin output enable. 8'h00 means the host may drive the bus; 8'hFF means RadMAC is driving it. |
clk |
System clock. |
rst_n |
Active-low reset. |
ena |
Standard Tiny Tapeout enable. |
The project metadata specifies an initial clock target of 25 MHz. The host must not drive uio while uio_oe indicates that RadMAC owns the bus.
When the host owns the bidirectional pins, uio_in is interpreted as a command byte:
| Bits | Field | Description |
|---|---|---|
[7] |
VALID |
Marks a command. |
[6:5] |
CLASS |
00 for a configuration write; 01 for a control command. |
[4:0] |
CODE |
Configuration-register address or control-command opcode. |
For a configuration write, place the data byte on ui_in[7:0]. A command is accepted on a rising clock edge when VALID and READY are both high. The interface accepts one command per assertion of VALID: after a command is accepted, lower VALID and allow its low level to be sampled on a rising edge while the readback interface is idle (RD_IDLE). Wait for READY to return high before issuing the next command. Lowering VALID during chip-owned result readback does not re-arm the interface.
Use CLASS = 2'b00 for the following configuration writes. The data byte is carried on ui_in[7:0].
CODE |
Register | Data field |
|---|---|---|
0x00 |
Operand A | ui_in[7:0] |
0x01 |
Operand B | ui_in[7:0] |
0x02 |
Initial accumulator, low byte | ui_in[7:0] |
0x03 |
Initial accumulator, high byte | ui_in[7:0] |
0x04 |
Operating mode | ui_in[1:0] |
0x05 |
Fault-injection target | ui_in[2:0] |
0x06 |
Fault-injection cycle | ui_in[3:0] |
0x07 |
Fault mask, low byte | ui_in[7:0] |
0x08 |
Fault mask, high byte | ui_in[7:0] |
0x09 |
Fault-injection control | Bit 0 enables injection; bit 1 selects repeated injection. Bits [7:2] must be zero or the write is rejected. |
The fault-injection target codes are:
| Target | Register or logic affected |
|---|---|
000 |
Multiplicand working register (mcand). |
001 |
Multiplier working register (mult). |
010 |
Accumulator low byte. |
011 |
Accumulator high byte. |
100 |
Expected-residue working state. |
101 |
Checker state, including the actual residue and wrap indication. |
110, 111 |
Reserved. |
Fault-injection cycle values 0 to 7 select one of the eight MAC iterations. Value 8 selects the checker phase; values 9 to 15 are reserved. The mask selects which bits are inverted at the selected target. In one-shot mode the fault is injected on the first attempt, allowing a retry to run without that injection. In repeated mode the XOR event is applied on each attempt. Repeated XOR injection is a test stimulus, not a model of a physical stuck-at fault.
Use CLASS = 2'b01 for control commands:
CODE |
Command | Behaviour |
|---|---|---|
0x00 |
START |
Starts a MAC operation when the interface is ready, the mode is valid, and the design is not in the fatal state. |
0x01 |
READ_RESULT |
Starts result readback after a successful operation. |
0x02 |
CLEAR_STATUS |
When not in the fatal state, clears DONE, ERROR_DETECTED, and RETRY_COUNT. It is ignored in the fatal state and does not clear FATAL_FAULT. |
uo_out[7:0] reports the current status:
| Bit(s) | Signal | Meaning |
|---|---|---|
[0] |
READY |
The command interface can accept a command. |
[2:1] |
RETRY_COUNT |
Number of retries used by the current or most recently completed operation. |
[3] |
RETRY_ACTIVE |
A retry attempt is in progress. |
[4] |
ERROR_DETECTED |
A residue mismatch has been detected during the operation. |
[5] |
DONE |
The operation completed successfully. |
[6] |
BUSY |
The MAC operation or result-readback sequence is active. |
[7] |
FATAL_FAULT |
The retry limit was exhausted. This flag remains set until hardware reset. |
DONE, ERROR_DETECTED, and RETRY_COUNT remain visible after an operation until a new START, CLEAR_STATUS, or reset clears the corresponding state. In the fatal state, configuration writes can still be accepted, but control commands that would start, read, or clear an operation are ignored. FATAL_FAULT is sticky and can only be cleared by reset.
Send READ_RESULT only after DONE is asserted. RadMAC first provides a bus-turnaround interval, then drives the 16-bit result on uio_out[7:0] as two bytes: the low byte first, followed by the high byte. During both data bytes, uio_oe is 8'hFF. The host must sample the bytes while the chip is driving the bus and must not drive uio during this interval. RadMAC releases the bus after the high byte.
The project includes a Cocotb testbench in test/test.py. Run it from the Tiny Tapeout project environment:
cd test
make clean
make
The regression exercises reset and command handling, MAC arithmetic, accumulator wraparound, all operating modes, the VALID re-arm handshake, result readback, status reporting, fault-injection targets/cycles/masks, one-shot fault recovery, persistent-fault retry termination, and reset during an operation. The latest supplied regression run completed with 35 tests passed, 0 failed, and 0 skipped. This reports the tested simulation cases; it is not an exhaustive test of every possible operand combination or every possible fault.
A basic hardware demonstration can be performed using a Tiny Tapeout board and a host controller:
rst_n low for at least one rising clock edge, then release reset.0x00, operand B to 0x01, the low and high bytes of ACC0 to 0x02 and 0x03, and the desired mode to 0x04.VALID while READY is high. After it is accepted, deassert VALID and wait for the interface to re-arm before sending the next command.START (CLASS = 01, CODE = 0x00). Monitor uo_out until DONE is asserted or FATAL_FAULT is reported.READ_RESULT (CLASS = 01, CODE = 0x01). Wait for uio_oe to become 8'hFF, then capture the low result byte followed by the high result byte from uio_out.For example, with A = 3, B = 5, and ACC0 = 0, the expected result is 15 (16'h000F). The readback bytes are therefore 8'h0F followed by 8'h00.
To demonstrate recovery, select Fault Injection mode (MODE = 2'b10), configure a target, cycle, and non-zero mask, and enable one-shot injection in register 0x09. Start the operation and observe the error/retry status. A persistent injection can be selected by setting bit 1 of FI_CONTROL; a fault that continues to cause a mismatch through all allowed attempts leads to FATAL_FAULT.
No external hardware such as a PMOD, sensor, memory device, or display is required by RadMAC itself. The design uses the standard Tiny Tapeout GPIO interface. A host microcontroller, FPGA, or other digital test controller may be used to send commands and read status/result bytes during a physical demonstration, but it is optional. The Cocotb regression requires only the Tiny Tapeout simulation environment.
We gratefully acknowledge the Center of Excellence (CoE) in Integrated Circuits and Systems (ICAS) and the Department of Electronics and Communication Engineering (ECE) for providing the necessary resources and guidance.
Special thanks to Dr. H V Ravish Aradhya (HoD - ECE), Dr. K R Usha Rani (Associate Dean - PG), Dr. K. S. Geetha (Vice Principal) and Dr. K. N. Subramanya (Principal) for their constant encouragement and support in facilitating this Tiny Tapeout SKY26C submission.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | DATA_IN[0] | STATUS[0] READY | CTRL_IN[0] CODE[0] / DATA_OUT[0] |
| 1 | DATA_IN[1] | STATUS[1] RETRY_COUNT[0] | CTRL_IN[1] CODE[1] / DATA_OUT[1] |
| 2 | DATA_IN[2] | STATUS[2] RETRY_COUNT[1] | CTRL_IN[2] CODE[2] / DATA_OUT[2] |
| 3 | DATA_IN[3] | STATUS[3] RETRY_ACTIVE | CTRL_IN[3] CODE[3] / DATA_OUT[3] |
| 4 | DATA_IN[4] | STATUS[4] ERROR_DETECTED | CTRL_IN[4] CODE[4] / DATA_OUT[4] |
| 5 | DATA_IN[5] | STATUS[5] DONE | CTRL_IN[5] CLASS[0] / DATA_OUT[5] |
| 6 | DATA_IN[6] | STATUS[6] BUSY | CTRL_IN[6] CLASS[1] / DATA_OUT[6] |
| 7 | DATA_IN[7] | STATUS[7] FATAL_FAULT | CTRL_IN[7] VALID / DATA_OUT[7] |