
DOT4 is the datapath of a custom INT8 dot-product instruction for RISC-V edge-AI workloads. It computes
rd = a0*b0 + a1*b1 + a2*b2 + a3*b3
where rs1 = {a3,a2,a1,a0} and rs2 = {b3,b2,b1,b0} each pack four signed 8-bit values into 32 bits. The result is a signed 32-bit value. The largest possible magnitude is 4 x 128 x 128 = 65536, so no overflow or saturation logic is needed.
The intended RISC-V encoding is R-type in the custom-0 opcode space (0001011). This is documentation only: only the DOT4 datapath is on this chip. There is no RISC-V core on the chip.
Because the Tiny Tapeout interface has only 8 data input pins, the 64 operand bits are loaded one byte at a time:
ui_in[7:0] is the data byte.uio_in[0] is the LOAD strobe. It passes through a 2-flop synchroniser, and each rising edge captures ui_in as the next operand byte. A 3-bit counter selects the byte. The load order is a0, a1, a2, a3, b0, b1, b2, b3.uio_out[7] (VALID) goes high.uo_out, changes.uio_in[2:1] selects which result byte appears on uo_out[7:0] (0 = bits 7:0, 1 = bits 15:8, 2 = bits 23:16, 3 = bits 31:24, little-endian).rst_n low clears the byte counter, VALID and the accumulator (result).Only uio[7] is an output (uio_oe = 8'b1000_0000). uio[6:3] are unused.
rst_n low for a few cycles, then release it.ui_in, raise LOAD (uio_in[0]), then lower it. Keep ui_in steady while LOAD is high, for about 3 clocks (synchroniser latency plus capture). Leave at least 2 clocks with LOAD low between bytes.uio_out[7]) is high.uio_in[2:1] to 0, 1, 2, 3 and reading uo_out each time.Worked example: a = (-128, 127, 3, -4), b = (2, -1, 100, 50).
Expected result: (-128)(2) + (127)(-1) + (3)(100) + (-4)(50) = -256 - 127 + 300 - 200 = -283 = 0xFFFFFEE5.
| Load # | Operand | Value | Byte on ui_in |
|---|---|---|---|
| 1 | a0 | -128 | 0x80 |
| 2 | a1 | 127 | 0x7F |
| 3 | a2 | 3 | 0x03 |
| 4 | a3 | -4 | 0xFC |
| 5 | b0 | 2 | 0x02 |
| 6 | b1 | -1 | 0xFF |
| 7 | b2 | 100 | 0x64 |
| 8 | b3 | 50 | 0x32 |
uio_in[2:1] |
Result bits | uo_out |
|---|---|---|
| 0 | 7:0 | 0xE5 |
| 1 | 15:8 | 0xFE |
| 2 | 23:16 | 0xFF |
| 3 | 31:24 | 0xFF |
The cocotb testbench in test/ checks the design against a Python golden model. It covers random vectors, corner cases (all lanes -128 x -128 = 65536, -128 x 127, zeros), back-to-back operations, and reset in the middle of a load sequence. This is RTL simulation only. The chip itself is to be tested after fabrication.
None. Any microcontroller or the Tiny Tapeout demo board can drive the 8 data inputs and LOAD/byte-select pins and read the outputs.
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 TTSKY26E submission.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | DATA_IN[0] | RESULT_BYTE[0] | LOAD |
| 1 | DATA_IN[1] | RESULT_BYTE[1] | BYTE_SEL[0] |
| 2 | DATA_IN[2] | RESULT_BYTE[2] | BYTE_SEL[1] |
| 3 | DATA_IN[3] | RESULT_BYTE[3] | unused |
| 4 | DATA_IN[4] | RESULT_BYTE[4] | unused |
| 5 | DATA_IN[5] | RESULT_BYTE[5] | unused |
| 6 | DATA_IN[6] | RESULT_BYTE[6] | unused |
| 7 | DATA_IN[7] | RESULT_BYTE[7] | VALID |