§ 4.3.3. RV32I ALU¶
RV32IALU is the arithmetic and logic unit of every RV32I and RV32IM core in this project: the single-cycle core, both pipelines and the RV32IM core. It performs the 13 operations that RV32I instructions need and reports the three comparisons that branches test. It is a fixed 32-bit circuit, because RV32I fixes the register width, and it always uses the parallel-prefix adder.
It differs from the Chapter 2 ALU<W> in the ways RISC-V differs from a classic flag-based processor: there is no carry input, no flag outputs and no invalid-opcode output, and comparisons are output pins rather than flags. Multiplication and division are not part of it; the RV32IM execute stage places MulDivUnit<32> beside it and selects that unit's result for M instructions.
| Component | Description | Structural | Behavioral |
|---|---|---|---|
RV32IALUControl |
Turns the five-bit operation code into selector and control bits | Yes | Yes |
RV32IALUAddSub |
32-bit addition or subtraction, with SUB as the carry input | Yes | Yes |
RV32IALULogic |
AND, OR and XOR of two words, all at once | Yes | Yes |
RV32IALUShifter |
Logical left, logical right and arithmetic right shifts | Yes | Yes |
RV32IALUCompare |
Equality and signed/unsigned less-than from a subtraction | Yes | Yes |
RV32IALUResultSelect |
Picks the result word for the operation code | Yes | Yes |
RV32IALU |
The complete RV32I ALU | Yes | Yes |
The six parts are documented first, in the order the ALU uses them; § 4.3.3.7 assembles them. Execute builds the ALU with b.add(circuit::families::rv32iALU(), "ALU"), so a build profile chooses its fidelity; its contract is rv32i.alu, and the parts are rv32i.alu.control, rv32i.alu.add-sub, rv32i.alu.logic, rv32i.alu.shifter, rv32i.alu.compare and rv32i.alu.result-select. Each part is chosen by the build profile like any other family, so a structural RV32IALU may hold compact parts; each part's compact form follows its own gates bit for bit, including X and Z. Python creates the ALU with create_rv32i_alu(name, fidelity). The operation codes are named in rv32i::ALUOp in include/modules/rv32i/RV32IALU.hpp.
4.3.3.1. RV32IALUControl¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
OP |
Input | 5 | Operation code |
LOCAL_OP |
Output | 3 | OP[2:0], the index within a result group |
HIGH_HALF |
Output | 1 | OP[3], selects the upper result group |
OUT_OF_RANGE |
Output | 1 | OP[4], forces the result to zero |
SUB |
Output | 1 | Subtract, and enable the comparisons |
SHIFT_LEFT, SHIFT_ARITHMETIC |
Output | 1 each | Shifter direction and sign fill |
Behavior¶
SUB is 1 for SUB (1), SLT (8) and SLTU (9). The shift controls are plain functions of the opcode bits, not shift enables: they can be high while another result is selected, which is harmless because the result selector ignores the shifter then. OUT_OF_RANGE detects codes 16–31; the result selector also maps 13–15 to zero.
C++ example¶
These binary references share the namespace rv32i_alu_example. They omit propagation delays and X/Z values.
#include <array>
#include <cstdint>
namespace rv32i_alu_example {
constexpr uint64_t MASK = 0xffffffffu, SIGN = 0x80000000u;
struct Control {
unsigned LOCAL_OP;
bool HIGH_HALF, OUT_OF_RANGE, SUB, SHIFT_LEFT, SHIFT_ARITHMETIC;
};
Control control(unsigned op) { // OP is a five-bit input.
const bool arithmetic = !(op & 16) && !(op & 4) && !(op & 2);
return {op & 7, bool(op & 8), bool(op & 16),
arithmetic && bool(op & 9), !(op & 2), bool(op & 1)};
}
}
Unknown inputs¶
LOCAL_OP, HIGH_HALF and OUT_OF_RANGE are wiring and pass X and Z through unchanged. SUB and the shift controls follow their NOT/AND/OR gates.
Implementation¶
Structural implementation¶
A splitter and a joiner expose the opcode bits. NOT gates on bits 1, 2 and 4 and two AND gates detect the arithmetic codes 0, 1, 8 and 9; an OR of bits 3 and 0 and a final AND give SUB.
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 32 recorded rows of RV32IALUControlTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | OPInput · 5 bit |
HIGH_HALFExpected output · 1 bit |
LOCAL_OPExpected output · 3 bit |
OUT_OF_RANGEExpected output · 1 bit |
SHIFT_ARITHMETICExpected output · 1 bit |
SHIFT_LEFTExpected output · 1 bit |
SUBExpected output · 1 bit |
|---|---|---|---|---|---|---|---|---|
#0row-0 | 4 | 0x00 |
0 |
0x0 |
0 |
0 |
1 |
0 |
#1row-1 | 7 | 0x01 |
0 |
0x1 |
0 |
1 |
1 |
1 |
#2row-2 | 11 | 0x02 |
0 |
0x2 |
0 |
0 |
0 |
0 |
#3row-3 | 14 | 0x03 |
0 |
0x3 |
0 |
1 |
0 |
0 |
#4row-4 | 19 | 0x04 |
0 |
0x4 |
0 |
0 |
1 |
0 |
#5row-5 | 22 | 0x05 |
0 |
0x5 |
0 |
1 |
1 |
0 |
#6row-6 | 25 | 0x06 |
0 |
0x6 |
0 |
0 |
0 |
0 |
#7row-7 | 28 | 0x07 |
0 |
0x7 |
0 |
1 |
0 |
0 |
#8row-8 | 33 | 0x08 |
1 |
0x0 |
0 |
0 |
1 |
1 |
#9row-9 | 35 | 0x09 |
1 |
0x1 |
0 |
1 |
1 |
1 |
#10row-10 | 39 | 0x0A |
1 |
0x2 |
0 |
0 |
0 |
0 |
#11row-11 | 41 | 0x0B |
1 |
0x3 |
0 |
1 |
0 |
0 |
#12row-12 | 46 | 0x0C |
1 |
0x4 |
0 |
0 |
1 |
0 |
#13row-13 | 48 | 0x0D |
1 |
0x5 |
0 |
1 |
1 |
0 |
#14row-14 | 51 | 0x0E |
1 |
0x6 |
0 |
0 |
0 |
0 |
#15row-15 | 53 | 0x0F |
1 |
0x7 |
0 |
1 |
0 |
0 |
#16row-16 | 56 | 0x10 |
0 |
0x0 |
1 |
0 |
1 |
0 |
#17row-17 | 59 | 0x11 |
0 |
0x1 |
1 |
1 |
1 |
0 |
#18row-18 | 62 | 0x12 |
0 |
0x2 |
1 |
0 |
0 |
0 |
#19row-19 | 65 | 0x13 |
0 |
0x3 |
1 |
1 |
0 |
0 |
#20row-20 | 68 | 0x14 |
0 |
0x4 |
1 |
0 |
1 |
0 |
#21row-21 | 71 | 0x15 |
0 |
0x5 |
1 |
1 |
1 |
0 |
#22row-22 | 74 | 0x16 |
0 |
0x6 |
1 |
0 |
0 |
0 |
#23row-23 | 77 | 0x17 |
0 |
0x7 |
1 |
1 |
0 |
0 |
#24row-24 | 80 | 0x18 |
1 |
0x0 |
1 |
0 |
1 |
0 |
#25row-25 | 82 | 0x19 |
1 |
0x1 |
1 |
1 |
1 |
0 |
#26row-26 | 85 | 0x1A |
1 |
0x2 |
1 |
0 |
0 |
0 |
#27row-27 | 87 | 0x1B |
1 |
0x3 |
1 |
1 |
0 |
0 |
#28row-28 | 90 | 0x1C |
1 |
0x4 |
1 |
0 |
1 |
0 |
#29row-29 | 92 | 0x1D |
1 |
0x5 |
1 |
1 |
1 |
0 |
#30row-30 | 95 | 0x1E |
1 |
0x6 |
1 |
0 |
0 |
0 |
#31row-31 | 97 | 0x1F |
1 |
0x7 |
1 |
1 |
0 |
0 |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
All 32 binary opcodes are recorded, each checking every output.
Embedded simulation¶
Open RV32IALUControl in the simulator
Tests¶
RV32IALUControlTest checks every binary opcode and every output. Source: RV32IALU.cpp.
4.3.3.2. RV32IALUAddSub¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
A, B |
Input | 32 each | Operands |
SUB |
Input | 1 | 0: addition; 1: subtraction |
OUT |
Output | 32 | Wrapped result |
C_OUT |
Output | 1 | Addition carry; for subtraction, 1 means no borrow |
OVERFLOW |
Output | 1 | Signed overflow |
Behavior¶
The adder computes A + (B XOR {32{SUB}}) + SUB. Unlike the Chapter 2 AddSub<W>, SUB is also the carry input, so subtraction needs no separate carry pin. Subtraction sets C_OUT when unsigned A >= B. Overflow is independent of the unsigned carry.
C++ example¶
namespace rv32i_alu_example {
struct Arithmetic { uint32_t OUT; bool C_OUT, OVERFLOW; };
Arithmetic addsub(uint32_t a, uint32_t b, bool sub) {
const uint64_t wide = uint64_t(a) + (sub ? (uint64_t(b) ^ MASK) : b) + sub;
const uint32_t out = uint32_t(wide & MASK);
const bool overflow = ((sub ? (a ^ b) : ~(a ^ b)) & (a ^ out) & SIGN) != 0;
return {out, bool(wide >> 32), overflow};
}
}
Unknown inputs¶
Each bit follows the adder's XOR/AND/OR logic, so a known controlling value can mask an unknown one; the whole word is not automatically discarded.
Implementation¶
Structural implementation¶
The word gate B_XOR_SUB (XORGate<32>, one XOR per bit) inverts B when SUB is high; the wiring part SUB_WORD spreads SUB across the word (word gates). SUB also drives the carry input of one ParallelPrefixAdder<32> named PREFIX_ADDER. Overflow is C_SIGN XOR C_OUT: the carry into the sign bit against the carry out of it.
The carry crosses 32 bits in five prefix levels instead of 32 ripple stages:
Latest time each path can still change after its input (for a setup row: how long before the edge the input must be stable), proven on the gate-level form.
| Path | unitticks | embeddedps | desktopps |
|---|---|---|---|
Prefix adder, operand to carry out A → C_OUT | 12 | 682 | 475 |
Ripple adder, operand to carry out A → C_OUT | 65 | 3,384 | 2,356 |
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 80 recorded rows of RV32IALUAddSubTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | AInput · 32 bit |
BInput · 32 bit |
SUBInput · 1 bit |
C_OUTExpected output · 1 bit |
OUTExpected output · 32 bit |
OVERFLOWExpected output · 1 bit |
|---|---|---|---|---|---|---|---|
#0row-0 | 10 | 0x00000000 |
0x00000000 |
0 |
0 |
0x00000000 |
0 |
#1row-1 | 15 | 0x00000001 |
0x00000002 |
0 |
0 |
0x00000003 |
0 |
#2row-2 | 30 | 0xFFFFFFFF |
0x00000001 |
0 |
1 |
0x00000000 |
0 |
#3row-3 | 39 | 0xFFFFFFFF |
0xFFFFFFFF |
0 |
1 |
0xFFFFFFFE |
0 |
#4row-4 | 54 | 0x55555555 |
0xAAAAAAAA |
0 |
0 |
0xFFFFFFFF |
0 |
#5row-5 | 65 | 0x55555555 |
0xAAAAAAAA |
1 |
0 |
0xAAAAAAAB |
1 |
#6row-6 | 79 | 0x7FFFFFFF |
0x00000001 |
0 |
0 |
0x80000000 |
1 |
#7row-7 | 89 | 0x80000000 |
0x80000000 |
0 |
1 |
0x00000000 |
1 |
#8row-8 | 100 | 0x7FFFFFFF |
0xFFFFFFFF |
0 |
1 |
0x7FFFFFFE |
0 |
#9row-9 | 113 | 0x00000005 |
0x00000003 |
1 |
1 |
0x00000002 |
0 |
#10row-10 | 126 | 0x00000000 |
0x00000001 |
1 |
0 |
0xFFFFFFFF |
0 |
#11row-11 | 135 | 0x80000000 |
0x00000001 |
1 |
1 |
0x7FFFFFFF |
1 |
#12row-12 | 146 | 0x7FFFFFFF |
0xFFFFFFFF |
1 |
0 |
0x80000000 |
1 |
#13row-13 | 156 | 0x80000000 |
0x7FFFFFFF |
1 |
1 |
0x00000001 |
1 |
#14row-14 | 167 | 0xFFFFFFFF |
0xFFFFFFFF |
1 |
1 |
0x00000000 |
0 |
#15row-15 | 177 | 0x00000001 |
0x00000001 |
0 |
0 |
0x00000002 |
0 |
#16row-16 | 191 | 0x00000002 |
0x00000001 |
1 |
1 |
0x00000001 |
0 |
#17row-17 | 202 | 0x00000003 |
0x00000001 |
0 |
0 |
0x00000004 |
0 |
#18row-18 | 216 | 0x00000004 |
0x00000001 |
1 |
1 |
0x00000003 |
0 |
#19row-19 | 227 | 0x00000007 |
0x00000001 |
0 |
0 |
0x00000008 |
0 |
#20row-20 | 241 | 0x00000008 |
0x00000001 |
1 |
1 |
0x00000007 |
0 |
#21row-21 | 252 | 0x0000000F |
0x00000001 |
0 |
0 |
0x00000010 |
0 |
#22row-22 | 266 | 0x00000010 |
0x00000001 |
1 |
1 |
0x0000000F |
0 |
#23row-23 | 277 | 0x0000001F |
0x00000001 |
0 |
0 |
0x00000020 |
0 |
#24row-24 | 291 | 0x00000020 |
0x00000001 |
1 |
1 |
0x0000001F |
0 |
#25row-25 | 302 | 0x0000003F |
0x00000001 |
0 |
0 |
0x00000040 |
0 |
#26row-26 | 316 | 0x00000040 |
0x00000001 |
1 |
1 |
0x0000003F |
0 |
#27row-27 | 327 | 0x0000007F |
0x00000001 |
0 |
0 |
0x00000080 |
0 |
#28row-28 | 341 | 0x00000080 |
0x00000001 |
1 |
1 |
0x0000007F |
0 |
#29row-29 | 352 | 0x000000FF |
0x00000001 |
0 |
0 |
0x00000100 |
0 |
#30row-30 | 366 | 0x00000100 |
0x00000001 |
1 |
1 |
0x000000FF |
0 |
#31row-31 | 377 | 0x000001FF |
0x00000001 |
0 |
0 |
0x00000200 |
0 |
#32row-32 | 391 | 0x00000200 |
0x00000001 |
1 |
1 |
0x000001FF |
0 |
#33row-33 | 402 | 0x000003FF |
0x00000001 |
0 |
0 |
0x00000400 |
0 |
#34row-34 | 416 | 0x00000400 |
0x00000001 |
1 |
1 |
0x000003FF |
0 |
#35row-35 | 427 | 0x000007FF |
0x00000001 |
0 |
0 |
0x00000800 |
0 |
#36row-36 | 441 | 0x00000800 |
0x00000001 |
1 |
1 |
0x000007FF |
0 |
#37row-37 | 452 | 0x00000FFF |
0x00000001 |
0 |
0 |
0x00001000 |
0 |
#38row-38 | 466 | 0x00001000 |
0x00000001 |
1 |
1 |
0x00000FFF |
0 |
#39row-39 | 477 | 0x00001FFF |
0x00000001 |
0 |
0 |
0x00002000 |
0 |
#40row-40 | 491 | 0x00002000 |
0x00000001 |
1 |
1 |
0x00001FFF |
0 |
#41row-41 | 502 | 0x00003FFF |
0x00000001 |
0 |
0 |
0x00004000 |
0 |
#42row-42 | 516 | 0x00004000 |
0x00000001 |
1 |
1 |
0x00003FFF |
0 |
#43row-43 | 528 | 0x00007FFF |
0x00000001 |
0 |
0 |
0x00008000 |
0 |
#44row-44 | 542 | 0x00008000 |
0x00000001 |
1 |
1 |
0x00007FFF |
0 |
#45row-45 | 555 | 0x0000FFFF |
0x00000001 |
0 |
0 |
0x00010000 |
0 |
#46row-46 | 569 | 0x00010000 |
0x00000001 |
1 |
1 |
0x0000FFFF |
0 |
#47row-47 | 582 | 0x0001FFFF |
0x00000001 |
0 |
0 |
0x00020000 |
0 |
#48row-48 | 595 | 0x00020000 |
0x00000001 |
1 |
1 |
0x0001FFFF |
0 |
#49row-49 | 608 | 0x0003FFFF |
0x00000001 |
0 |
0 |
0x00040000 |
0 |
#50row-50 | 621 | 0x00040000 |
0x00000001 |
1 |
1 |
0x0003FFFF |
0 |
#51row-51 | 634 | 0x0007FFFF |
0x00000001 |
0 |
0 |
0x00080000 |
0 |
#52row-52 | 647 | 0x00080000 |
0x00000001 |
1 |
1 |
0x0007FFFF |
0 |
#53row-53 | 660 | 0x000FFFFF |
0x00000001 |
0 |
0 |
0x00100000 |
0 |
#54row-54 | 673 | 0x00100000 |
0x00000001 |
1 |
1 |
0x000FFFFF |
0 |
#55row-55 | 686 | 0x001FFFFF |
0x00000001 |
0 |
0 |
0x00200000 |
0 |
#56row-56 | 699 | 0x00200000 |
0x00000001 |
1 |
1 |
0x001FFFFF |
0 |
#57row-57 | 712 | 0x003FFFFF |
0x00000001 |
0 |
0 |
0x00400000 |
0 |
#58row-58 | 725 | 0x00400000 |
0x00000001 |
1 |
1 |
0x003FFFFF |
0 |
#59row-59 | 738 | 0x007FFFFF |
0x00000001 |
0 |
0 |
0x00800000 |
0 |
#60row-60 | 751 | 0x00800000 |
0x00000001 |
1 |
1 |
0x007FFFFF |
0 |
#61row-61 | 764 | 0x00FFFFFF |
0x00000001 |
0 |
0 |
0x01000000 |
0 |
#62row-62 | 777 | 0x01000000 |
0x00000001 |
1 |
1 |
0x00FFFFFF |
0 |
#63row-63 | 790 | 0x01FFFFFF |
0x00000001 |
0 |
0 |
0x02000000 |
0 |
#64row-64 | 802 | 0x02000000 |
0x00000001 |
1 |
1 |
0x01FFFFFF |
0 |
#65row-65 | 815 | 0x03FFFFFF |
0x00000001 |
0 |
0 |
0x04000000 |
0 |
#66row-66 | 827 | 0x04000000 |
0x00000001 |
1 |
1 |
0x03FFFFFF |
0 |
#67row-67 | 840 | 0x07FFFFFF |
0x00000001 |
0 |
0 |
0x08000000 |
0 |
#68row-68 | 852 | 0x08000000 |
0x00000001 |
1 |
1 |
0x07FFFFFF |
0 |
#69row-69 | 865 | 0x0FFFFFFF |
0x00000001 |
0 |
0 |
0x10000000 |
0 |
#70row-70 | 877 | 0x10000000 |
0x00000001 |
1 |
1 |
0x0FFFFFFF |
0 |
#71row-71 | 890 | 0x1FFFFFFF |
0x00000001 |
0 |
0 |
0x20000000 |
0 |
#72row-72 | 901 | 0x20000000 |
0x00000001 |
1 |
1 |
0x1FFFFFFF |
0 |
#73row-73 | 914 | 0x3FFFFFFF |
0x00000001 |
0 |
0 |
0x40000000 |
0 |
#74row-74 | 925 | 0x40000000 |
0x00000001 |
1 |
1 |
0x3FFFFFFF |
0 |
#75row-75 | 939 | 0x7FFFFFFF |
0x00000001 |
0 |
0 |
0x80000000 |
1 |
#76row-76 | 949 | 0x80000000 |
0x00000001 |
1 |
1 |
0x7FFFFFFF |
1 |
#77row-77 | 960 | 0b00000000000000000000000000X00000 |
0x00000000 |
0 |
0 |
0b00000000000000000000000000X00000 |
0 |
#78row-78 | 962 | 0b00000000000000000000000000Z00000 |
0x00000000 |
0 |
0 |
0b00000000000000000000000000X00000 |
0 |
#79row-79 | 973 | 0x00000000 |
0x00000000 |
X |
X |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
X |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases cover addition and subtraction at the carry, borrow and signed-overflow boundaries, and full-length carry chains.
Embedded simulation¶
Open RV32IALUAddSub in the simulator
Tests¶
RV32IALUAddSubTest checks arithmetic boundaries and all three outputs; RV32IALUSliceTest checks a representative four-bit add/subtract slice exhaustively. Source: RV32IALUAddSub.cpp.
4.3.3.3. RV32IALULogic¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
A, B |
Input | 32 each | Operands |
AND_OUT, OR_OUT, XOR_OUT |
Output | 32 each | The three bitwise results |
Behavior¶
All three outputs are always active; there is no opcode. The result selector picks one of them.
C++ example¶
namespace rv32i_alu_example {
struct Logic { uint32_t AND_OUT, OR_OUT, XOR_OUT; };
Logic logic(uint32_t a, uint32_t b) { return {a & b, a | b, a ^ b}; }
}
Unknown inputs¶
AND with zero gives zero and OR with one gives one; other cases with X or Z give X, including XOR. Each bit is independent.
Implementation¶
Structural implementation¶
Three word gates, AND (ANDGate<32>), OR (ORGate<32>) and XOR (XORGate<32>), take the whole operands and drive the three outputs. Each is 32 one-bit gates, grouped as a word, so the three paths are independent per bit.
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 69 recorded rows of RV32IALULogicTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | AInput · 32 bit |
BInput · 32 bit |
AND_OUTExpected output · 32 bit |
OR_OUTExpected output · 32 bit |
XOR_OUTExpected output · 32 bit |
|---|---|---|---|---|---|---|
#0row-0 | 1 | 0xF0F0F0F0 |
0x0FF00FF0 |
0x00F000F0 |
0xFFF0FFF0 |
0xFF00FF00 |
#1row-1 | 3 | 0xFFFFFFFF |
0x00000000 |
0x00000000 |
0xFFFFFFFF |
0xFFFFFFFF |
#2row-2 | 5 | 0xAAAAAAAA |
0x55555555 |
0x00000000 |
0xFFFFFFFF |
0xFFFFFFFF |
#3row-3 | 7 | 0x80000000 |
0x7FFFFFFF |
0x00000000 |
0xFFFFFFFF |
0xFFFFFFFF |
#4row-4 | 9 | 0x00000001 |
0x00000000 |
0x00000000 |
0x00000001 |
0x00000001 |
#5row-5 | 11 | 0x00000001 |
0x00000001 |
0x00000001 |
0x00000001 |
0x00000000 |
#6row-6 | 13 | 0x00000002 |
0x00000000 |
0x00000000 |
0x00000002 |
0x00000002 |
#7row-7 | 15 | 0x00000002 |
0x00000002 |
0x00000002 |
0x00000002 |
0x00000000 |
#8row-8 | 17 | 0x00000004 |
0x00000000 |
0x00000000 |
0x00000004 |
0x00000004 |
#9row-9 | 19 | 0x00000004 |
0x00000004 |
0x00000004 |
0x00000004 |
0x00000000 |
#10row-10 | 21 | 0x00000008 |
0x00000000 |
0x00000000 |
0x00000008 |
0x00000008 |
#11row-11 | 23 | 0x00000008 |
0x00000008 |
0x00000008 |
0x00000008 |
0x00000000 |
#12row-12 | 25 | 0x00000010 |
0x00000000 |
0x00000000 |
0x00000010 |
0x00000010 |
#13row-13 | 27 | 0x00000010 |
0x00000010 |
0x00000010 |
0x00000010 |
0x00000000 |
#14row-14 | 29 | 0x00000020 |
0x00000000 |
0x00000000 |
0x00000020 |
0x00000020 |
#15row-15 | 31 | 0x00000020 |
0x00000020 |
0x00000020 |
0x00000020 |
0x00000000 |
#16row-16 | 33 | 0x00000040 |
0x00000000 |
0x00000000 |
0x00000040 |
0x00000040 |
#17row-17 | 35 | 0x00000040 |
0x00000040 |
0x00000040 |
0x00000040 |
0x00000000 |
#18row-18 | 37 | 0x00000080 |
0x00000000 |
0x00000000 |
0x00000080 |
0x00000080 |
#19row-19 | 39 | 0x00000080 |
0x00000080 |
0x00000080 |
0x00000080 |
0x00000000 |
#20row-20 | 41 | 0x00000100 |
0x00000000 |
0x00000000 |
0x00000100 |
0x00000100 |
#21row-21 | 43 | 0x00000100 |
0x00000100 |
0x00000100 |
0x00000100 |
0x00000000 |
#22row-22 | 45 | 0x00000200 |
0x00000000 |
0x00000000 |
0x00000200 |
0x00000200 |
#23row-23 | 47 | 0x00000200 |
0x00000200 |
0x00000200 |
0x00000200 |
0x00000000 |
#24row-24 | 49 | 0x00000400 |
0x00000000 |
0x00000000 |
0x00000400 |
0x00000400 |
#25row-25 | 51 | 0x00000400 |
0x00000400 |
0x00000400 |
0x00000400 |
0x00000000 |
#26row-26 | 53 | 0x00000800 |
0x00000000 |
0x00000000 |
0x00000800 |
0x00000800 |
#27row-27 | 55 | 0x00000800 |
0x00000800 |
0x00000800 |
0x00000800 |
0x00000000 |
#28row-28 | 57 | 0x00001000 |
0x00000000 |
0x00000000 |
0x00001000 |
0x00001000 |
#29row-29 | 59 | 0x00001000 |
0x00001000 |
0x00001000 |
0x00001000 |
0x00000000 |
#30row-30 | 61 | 0x00002000 |
0x00000000 |
0x00000000 |
0x00002000 |
0x00002000 |
#31row-31 | 63 | 0x00002000 |
0x00002000 |
0x00002000 |
0x00002000 |
0x00000000 |
#32row-32 | 65 | 0x00004000 |
0x00000000 |
0x00000000 |
0x00004000 |
0x00004000 |
#33row-33 | 67 | 0x00004000 |
0x00004000 |
0x00004000 |
0x00004000 |
0x00000000 |
#34row-34 | 69 | 0x00008000 |
0x00000000 |
0x00000000 |
0x00008000 |
0x00008000 |
#35row-35 | 71 | 0x00008000 |
0x00008000 |
0x00008000 |
0x00008000 |
0x00000000 |
#36row-36 | 73 | 0x00010000 |
0x00000000 |
0x00000000 |
0x00010000 |
0x00010000 |
#37row-37 | 75 | 0x00010000 |
0x00010000 |
0x00010000 |
0x00010000 |
0x00000000 |
#38row-38 | 77 | 0x00020000 |
0x00000000 |
0x00000000 |
0x00020000 |
0x00020000 |
#39row-39 | 79 | 0x00020000 |
0x00020000 |
0x00020000 |
0x00020000 |
0x00000000 |
#40row-40 | 81 | 0x00040000 |
0x00000000 |
0x00000000 |
0x00040000 |
0x00040000 |
#41row-41 | 83 | 0x00040000 |
0x00040000 |
0x00040000 |
0x00040000 |
0x00000000 |
#42row-42 | 85 | 0x00080000 |
0x00000000 |
0x00000000 |
0x00080000 |
0x00080000 |
#43row-43 | 87 | 0x00080000 |
0x00080000 |
0x00080000 |
0x00080000 |
0x00000000 |
#44row-44 | 89 | 0x00100000 |
0x00000000 |
0x00000000 |
0x00100000 |
0x00100000 |
#45row-45 | 91 | 0x00100000 |
0x00100000 |
0x00100000 |
0x00100000 |
0x00000000 |
#46row-46 | 93 | 0x00200000 |
0x00000000 |
0x00000000 |
0x00200000 |
0x00200000 |
#47row-47 | 95 | 0x00200000 |
0x00200000 |
0x00200000 |
0x00200000 |
0x00000000 |
#48row-48 | 97 | 0x00400000 |
0x00000000 |
0x00000000 |
0x00400000 |
0x00400000 |
#49row-49 | 99 | 0x00400000 |
0x00400000 |
0x00400000 |
0x00400000 |
0x00000000 |
#50row-50 | 101 | 0x00800000 |
0x00000000 |
0x00000000 |
0x00800000 |
0x00800000 |
#51row-51 | 103 | 0x00800000 |
0x00800000 |
0x00800000 |
0x00800000 |
0x00000000 |
#52row-52 | 105 | 0x01000000 |
0x00000000 |
0x00000000 |
0x01000000 |
0x01000000 |
#53row-53 | 107 | 0x01000000 |
0x01000000 |
0x01000000 |
0x01000000 |
0x00000000 |
#54row-54 | 109 | 0x02000000 |
0x00000000 |
0x00000000 |
0x02000000 |
0x02000000 |
#55row-55 | 111 | 0x02000000 |
0x02000000 |
0x02000000 |
0x02000000 |
0x00000000 |
#56row-56 | 113 | 0x04000000 |
0x00000000 |
0x00000000 |
0x04000000 |
0x04000000 |
#57row-57 | 115 | 0x04000000 |
0x04000000 |
0x04000000 |
0x04000000 |
0x00000000 |
#58row-58 | 117 | 0x08000000 |
0x00000000 |
0x00000000 |
0x08000000 |
0x08000000 |
#59row-59 | 119 | 0x08000000 |
0x08000000 |
0x08000000 |
0x08000000 |
0x00000000 |
#60row-60 | 121 | 0x10000000 |
0x00000000 |
0x00000000 |
0x10000000 |
0x10000000 |
#61row-61 | 123 | 0x10000000 |
0x10000000 |
0x10000000 |
0x10000000 |
0x00000000 |
#62row-62 | 125 | 0x20000000 |
0x00000000 |
0x00000000 |
0x20000000 |
0x20000000 |
#63row-63 | 127 | 0x20000000 |
0x20000000 |
0x20000000 |
0x20000000 |
0x00000000 |
#64row-64 | 129 | 0x40000000 |
0x00000000 |
0x00000000 |
0x40000000 |
0x40000000 |
#65row-65 | 131 | 0x40000000 |
0x40000000 |
0x40000000 |
0x40000000 |
0x00000000 |
#66row-66 | 133 | 0x80000000 |
0x00000000 |
0x00000000 |
0x80000000 |
0x80000000 |
#67row-67 | 135 | 0x80000000 |
0x80000000 |
0x80000000 |
0x80000000 |
0x00000000 |
#68row-68 | 137 | 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 |
0b10ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX |
0bX0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0 |
0b1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases include complementary patterns and four-state inputs.
Embedded simulation¶
Open RV32IALULogic in the simulator
Tests¶
RV32IALULogicTest checks all three outputs, including four-state cases. Source: RV32IALULogic.cpp.
4.3.3.4. RV32IALUShifter¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
A |
Input | 32 | Word to shift |
B |
Input | 32 | Shift amount; only B[4:0] is used |
LEFT |
Input | 1 | 1: left; 0: right |
ARITHMETIC |
Input | 1 | Sign fill for right shifts; ignored for left shifts |
OUT |
Output | 32 | Shifted word |
Behavior¶
The distance is 0–31. Left shifts and logical right shifts fill with zero; arithmetic right shifts fill with the original sign bit. Distance zero keeps the word. There is no rotation and no shifted-out carry, unlike the Chapter 2 BarrelShifter<W>.
C++ example¶
namespace rv32i_alu_example {
uint32_t shift(uint32_t a, uint32_t b, bool left, bool arithmetic) {
const unsigned n = b & 31;
if (left) return uint32_t((uint64_t(a) << n) & MASK);
uint32_t out = a >> n;
if (n && arithmetic && (a & SIGN)) out |= uint32_t(MASK << (32 - n));
return out;
}
}
Unknown inputs¶
B[31:5] is unused even when unknown. The distance bits drive gate-built muxes, so an unknown distance bit does not necessarily keep equal data. Left shifting disables sign fill.
Implementation¶
Structural implementation¶
One right-shift network selects distances 1, 2, 4, 8 and 16 in five stages, SHIFT_S0 … SHIFT_S4. Each stage is one 2:1 word mux (Mux<2,32>, one 2:1 mux per bit) choosing between the word and the word moved down by its distance, with the fill bit entering at the top; the moved word is wiring only (a splitter and the joiner SHIFT_Sk_MOVED). The word muxes INPUT_REVERSE and OUTPUT_REVERSE, selected by LEFT, reverse the bit order at the input and output, so the same network performs left shifts. The fill bit is A[31] AND ARITHMETIC AND NOT LEFT.
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 447 recorded rows of RV32IALUShifterTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | AInput · 32 bit |
ARITHMETICInput · 1 bit |
BInput · 32 bit |
LEFTInput · 1 bit |
OUTExpected output · 32 bit |
|---|---|---|---|---|---|---|
#0row-0 | 14 | 0x80000001 |
0 |
0x00000000 |
1 |
0x80000001 |
#1row-1 | 30 | 0x80000001 |
0 |
0x00000000 |
0 |
0x80000001 |
#2row-2 | 34 | 0x80000001 |
1 |
0x00000000 |
0 |
0x80000001 |
#3row-3 | 50 | 0x7FFFFFFF |
0 |
0x00000000 |
1 |
0x7FFFFFFF |
#4row-4 | 66 | 0x7FFFFFFF |
0 |
0x00000000 |
0 |
0x7FFFFFFF |
#5row-5 | 68 | 0x7FFFFFFF |
1 |
0x00000000 |
0 |
0x7FFFFFFF |
#6row-6 | 83 | 0xFFFFFFFF |
0 |
0x00000000 |
1 |
0xFFFFFFFF |
#7row-7 | 99 | 0xFFFFFFFF |
0 |
0x00000000 |
0 |
0xFFFFFFFF |
#8row-8 | 103 | 0xFFFFFFFF |
1 |
0x00000000 |
0 |
0xFFFFFFFF |
#9row-9 | 119 | 0x00000001 |
0 |
0x00000000 |
1 |
0x00000001 |
#10row-10 | 135 | 0x00000001 |
0 |
0x00000000 |
0 |
0x00000001 |
#11row-11 | 137 | 0x00000001 |
1 |
0x00000000 |
0 |
0x00000001 |
#12row-12 | 152 | 0x80000001 |
0 |
0x00000001 |
1 |
0x00000002 |
#13row-13 | 168 | 0x80000001 |
0 |
0x00000001 |
0 |
0x40000000 |
#14row-14 | 183 | 0x80000001 |
1 |
0x00000001 |
0 |
0xC0000000 |
#15row-15 | 198 | 0x7FFFFFFF |
0 |
0x00000001 |
1 |
0xFFFFFFFE |
#16row-16 | 214 | 0x7FFFFFFF |
0 |
0x00000001 |
0 |
0x3FFFFFFF |
#17row-17 | 216 | 0x7FFFFFFF |
1 |
0x00000001 |
0 |
0x3FFFFFFF |
#18row-18 | 231 | 0xFFFFFFFF |
0 |
0x00000001 |
1 |
0xFFFFFFFE |
#19row-19 | 247 | 0xFFFFFFFF |
0 |
0x00000001 |
0 |
0x7FFFFFFF |
#20row-20 | 262 | 0xFFFFFFFF |
1 |
0x00000001 |
0 |
0xFFFFFFFF |
#21row-21 | 277 | 0x00000001 |
0 |
0x00000001 |
1 |
0x00000002 |
#22row-22 | 292 | 0x00000001 |
0 |
0x00000001 |
0 |
0x00000000 |
#23row-23 | 294 | 0x00000001 |
1 |
0x00000001 |
0 |
0x00000000 |
#24row-24 | 309 | 0x80000001 |
0 |
0x00000002 |
1 |
0x00000004 |
#25row-25 | 325 | 0x80000001 |
0 |
0x00000002 |
0 |
0x20000000 |
#26row-26 | 338 | 0x80000001 |
1 |
0x00000002 |
0 |
0xE0000000 |
#27row-27 | 353 | 0x7FFFFFFF |
0 |
0x00000002 |
1 |
0xFFFFFFFC |
#28row-28 | 369 | 0x7FFFFFFF |
0 |
0x00000002 |
0 |
0x1FFFFFFF |
#29row-29 | 371 | 0x7FFFFFFF |
1 |
0x00000002 |
0 |
0x1FFFFFFF |
#30row-30 | 386 | 0xFFFFFFFF |
0 |
0x00000002 |
1 |
0xFFFFFFFC |
#31row-31 | 402 | 0xFFFFFFFF |
0 |
0x00000002 |
0 |
0x3FFFFFFF |
#32row-32 | 415 | 0xFFFFFFFF |
1 |
0x00000002 |
0 |
0xFFFFFFFF |
#33row-33 | 430 | 0x00000001 |
0 |
0x00000002 |
1 |
0x00000004 |
#34row-34 | 445 | 0x00000001 |
0 |
0x00000002 |
0 |
0x00000000 |
#35row-35 | 447 | 0x00000001 |
1 |
0x00000002 |
0 |
0x00000000 |
#36row-36 | 462 | 0x80000001 |
0 |
0x00000003 |
1 |
0x00000008 |
#37row-37 | 478 | 0x80000001 |
0 |
0x00000003 |
0 |
0x10000000 |
#38row-38 | 493 | 0x80000001 |
1 |
0x00000003 |
0 |
0xF0000000 |
#39row-39 | 508 | 0x7FFFFFFF |
0 |
0x00000003 |
1 |
0xFFFFFFF8 |
#40row-40 | 524 | 0x7FFFFFFF |
0 |
0x00000003 |
0 |
0x0FFFFFFF |
#41row-41 | 526 | 0x7FFFFFFF |
1 |
0x00000003 |
0 |
0x0FFFFFFF |
#42row-42 | 541 | 0xFFFFFFFF |
0 |
0x00000003 |
1 |
0xFFFFFFF8 |
#43row-43 | 557 | 0xFFFFFFFF |
0 |
0x00000003 |
0 |
0x1FFFFFFF |
#44row-44 | 572 | 0xFFFFFFFF |
1 |
0x00000003 |
0 |
0xFFFFFFFF |
#45row-45 | 587 | 0x00000001 |
0 |
0x00000003 |
1 |
0x00000008 |
#46row-46 | 602 | 0x00000001 |
0 |
0x00000003 |
0 |
0x00000000 |
#47row-47 | 604 | 0x00000001 |
1 |
0x00000003 |
0 |
0x00000000 |
#48row-48 | 619 | 0x80000001 |
0 |
0x00000004 |
1 |
0x00000010 |
#49row-49 | 635 | 0x80000001 |
0 |
0x00000004 |
0 |
0x08000000 |
#50row-50 | 646 | 0x80000001 |
1 |
0x00000004 |
0 |
0xF8000000 |
#51row-51 | 661 | 0x7FFFFFFF |
0 |
0x00000004 |
1 |
0xFFFFFFF0 |
#52row-52 | 677 | 0x7FFFFFFF |
0 |
0x00000004 |
0 |
0x07FFFFFF |
#53row-53 | 679 | 0x7FFFFFFF |
1 |
0x00000004 |
0 |
0x07FFFFFF |
#54row-54 | 694 | 0xFFFFFFFF |
0 |
0x00000004 |
1 |
0xFFFFFFF0 |
#55row-55 | 710 | 0xFFFFFFFF |
0 |
0x00000004 |
0 |
0x0FFFFFFF |
#56row-56 | 721 | 0xFFFFFFFF |
1 |
0x00000004 |
0 |
0xFFFFFFFF |
#57row-57 | 736 | 0x00000001 |
0 |
0x00000004 |
1 |
0x00000010 |
#58row-58 | 751 | 0x00000001 |
0 |
0x00000004 |
0 |
0x00000000 |
#59row-59 | 753 | 0x00000001 |
1 |
0x00000004 |
0 |
0x00000000 |
#60row-60 | 768 | 0x80000001 |
0 |
0x00000005 |
1 |
0x00000020 |
#61row-61 | 784 | 0x80000001 |
0 |
0x00000005 |
0 |
0x04000000 |
#62row-62 | 799 | 0x80000001 |
1 |
0x00000005 |
0 |
0xFC000000 |
#63row-63 | 814 | 0x7FFFFFFF |
0 |
0x00000005 |
1 |
0xFFFFFFE0 |
#64row-64 | 830 | 0x7FFFFFFF |
0 |
0x00000005 |
0 |
0x03FFFFFF |
#65row-65 | 832 | 0x7FFFFFFF |
1 |
0x00000005 |
0 |
0x03FFFFFF |
#66row-66 | 847 | 0xFFFFFFFF |
0 |
0x00000005 |
1 |
0xFFFFFFE0 |
#67row-67 | 863 | 0xFFFFFFFF |
0 |
0x00000005 |
0 |
0x07FFFFFF |
#68row-68 | 878 | 0xFFFFFFFF |
1 |
0x00000005 |
0 |
0xFFFFFFFF |
#69row-69 | 893 | 0x00000001 |
0 |
0x00000005 |
1 |
0x00000020 |
#70row-70 | 908 | 0x00000001 |
0 |
0x00000005 |
0 |
0x00000000 |
#71row-71 | 910 | 0x00000001 |
1 |
0x00000005 |
0 |
0x00000000 |
#72row-72 | 925 | 0x80000001 |
0 |
0x00000006 |
1 |
0x00000040 |
#73row-73 | 941 | 0x80000001 |
0 |
0x00000006 |
0 |
0x02000000 |
#74row-74 | 954 | 0x80000001 |
1 |
0x00000006 |
0 |
0xFE000000 |
#75row-75 | 969 | 0x7FFFFFFF |
0 |
0x00000006 |
1 |
0xFFFFFFC0 |
#76row-76 | 985 | 0x7FFFFFFF |
0 |
0x00000006 |
0 |
0x01FFFFFF |
#77row-77 | 987 | 0x7FFFFFFF |
1 |
0x00000006 |
0 |
0x01FFFFFF |
#78row-78 | 1002 | 0xFFFFFFFF |
0 |
0x00000006 |
1 |
0xFFFFFFC0 |
#79row-79 | 1018 | 0xFFFFFFFF |
0 |
0x00000006 |
0 |
0x03FFFFFF |
#80row-80 | 1031 | 0xFFFFFFFF |
1 |
0x00000006 |
0 |
0xFFFFFFFF |
#81row-81 | 1046 | 0x00000001 |
0 |
0x00000006 |
1 |
0x00000040 |
#82row-82 | 1061 | 0x00000001 |
0 |
0x00000006 |
0 |
0x00000000 |
#83row-83 | 1063 | 0x00000001 |
1 |
0x00000006 |
0 |
0x00000000 |
#84row-84 | 1078 | 0x80000001 |
0 |
0x00000007 |
1 |
0x00000080 |
#85row-85 | 1094 | 0x80000001 |
0 |
0x00000007 |
0 |
0x01000000 |
#86row-86 | 1109 | 0x80000001 |
1 |
0x00000007 |
0 |
0xFF000000 |
#87row-87 | 1124 | 0x7FFFFFFF |
0 |
0x00000007 |
1 |
0xFFFFFF80 |
#88row-88 | 1140 | 0x7FFFFFFF |
0 |
0x00000007 |
0 |
0x00FFFFFF |
#89row-89 | 1142 | 0x7FFFFFFF |
1 |
0x00000007 |
0 |
0x00FFFFFF |
#90row-90 | 1157 | 0xFFFFFFFF |
0 |
0x00000007 |
1 |
0xFFFFFF80 |
#91row-91 | 1173 | 0xFFFFFFFF |
0 |
0x00000007 |
0 |
0x01FFFFFF |
#92row-92 | 1188 | 0xFFFFFFFF |
1 |
0x00000007 |
0 |
0xFFFFFFFF |
#93row-93 | 1203 | 0x00000001 |
0 |
0x00000007 |
1 |
0x00000080 |
#94row-94 | 1218 | 0x00000001 |
0 |
0x00000007 |
0 |
0x00000000 |
#95row-95 | 1220 | 0x00000001 |
1 |
0x00000007 |
0 |
0x00000000 |
#96row-96 | 1235 | 0x80000001 |
0 |
0x00000008 |
1 |
0x00000100 |
#97row-97 | 1251 | 0x80000001 |
0 |
0x00000008 |
0 |
0x00800000 |
#98row-98 | 1260 | 0x80000001 |
1 |
0x00000008 |
0 |
0xFF800000 |
#99row-99 | 1275 | 0x7FFFFFFF |
0 |
0x00000008 |
1 |
0xFFFFFF00 |
#100row-100 | 1291 | 0x7FFFFFFF |
0 |
0x00000008 |
0 |
0x007FFFFF |
#101row-101 | 1293 | 0x7FFFFFFF |
1 |
0x00000008 |
0 |
0x007FFFFF |
#102row-102 | 1308 | 0xFFFFFFFF |
0 |
0x00000008 |
1 |
0xFFFFFF00 |
#103row-103 | 1324 | 0xFFFFFFFF |
0 |
0x00000008 |
0 |
0x00FFFFFF |
#104row-104 | 1333 | 0xFFFFFFFF |
1 |
0x00000008 |
0 |
0xFFFFFFFF |
#105row-105 | 1348 | 0x00000001 |
0 |
0x00000008 |
1 |
0x00000100 |
#106row-106 | 1363 | 0x00000001 |
0 |
0x00000008 |
0 |
0x00000000 |
#107row-107 | 1365 | 0x00000001 |
1 |
0x00000008 |
0 |
0x00000000 |
#108row-108 | 1380 | 0x80000001 |
0 |
0x00000009 |
1 |
0x00000200 |
#109row-109 | 1396 | 0x80000001 |
0 |
0x00000009 |
0 |
0x00400000 |
#110row-110 | 1411 | 0x80000001 |
1 |
0x00000009 |
0 |
0xFFC00000 |
#111row-111 | 1426 | 0x7FFFFFFF |
0 |
0x00000009 |
1 |
0xFFFFFE00 |
#112row-112 | 1442 | 0x7FFFFFFF |
0 |
0x00000009 |
0 |
0x003FFFFF |
#113row-113 | 1444 | 0x7FFFFFFF |
1 |
0x00000009 |
0 |
0x003FFFFF |
#114row-114 | 1459 | 0xFFFFFFFF |
0 |
0x00000009 |
1 |
0xFFFFFE00 |
#115row-115 | 1475 | 0xFFFFFFFF |
0 |
0x00000009 |
0 |
0x007FFFFF |
#116row-116 | 1490 | 0xFFFFFFFF |
1 |
0x00000009 |
0 |
0xFFFFFFFF |
#117row-117 | 1505 | 0x00000001 |
0 |
0x00000009 |
1 |
0x00000200 |
#118row-118 | 1520 | 0x00000001 |
0 |
0x00000009 |
0 |
0x00000000 |
#119row-119 | 1522 | 0x00000001 |
1 |
0x00000009 |
0 |
0x00000000 |
#120row-120 | 1537 | 0x80000001 |
0 |
0x0000000A |
1 |
0x00000400 |
#121row-121 | 1553 | 0x80000001 |
0 |
0x0000000A |
0 |
0x00200000 |
#122row-122 | 1566 | 0x80000001 |
1 |
0x0000000A |
0 |
0xFFE00000 |
#123row-123 | 1581 | 0x7FFFFFFF |
0 |
0x0000000A |
1 |
0xFFFFFC00 |
#124row-124 | 1597 | 0x7FFFFFFF |
0 |
0x0000000A |
0 |
0x001FFFFF |
#125row-125 | 1599 | 0x7FFFFFFF |
1 |
0x0000000A |
0 |
0x001FFFFF |
#126row-126 | 1614 | 0xFFFFFFFF |
0 |
0x0000000A |
1 |
0xFFFFFC00 |
#127row-127 | 1630 | 0xFFFFFFFF |
0 |
0x0000000A |
0 |
0x003FFFFF |
#128row-128 | 1643 | 0xFFFFFFFF |
1 |
0x0000000A |
0 |
0xFFFFFFFF |
#129row-129 | 1658 | 0x00000001 |
0 |
0x0000000A |
1 |
0x00000400 |
#130row-130 | 1673 | 0x00000001 |
0 |
0x0000000A |
0 |
0x00000000 |
#131row-131 | 1675 | 0x00000001 |
1 |
0x0000000A |
0 |
0x00000000 |
#132row-132 | 1690 | 0x80000001 |
0 |
0x0000000B |
1 |
0x00000800 |
#133row-133 | 1706 | 0x80000001 |
0 |
0x0000000B |
0 |
0x00100000 |
#134row-134 | 1721 | 0x80000001 |
1 |
0x0000000B |
0 |
0xFFF00000 |
#135row-135 | 1736 | 0x7FFFFFFF |
0 |
0x0000000B |
1 |
0xFFFFF800 |
#136row-136 | 1752 | 0x7FFFFFFF |
0 |
0x0000000B |
0 |
0x000FFFFF |
#137row-137 | 1754 | 0x7FFFFFFF |
1 |
0x0000000B |
0 |
0x000FFFFF |
#138row-138 | 1769 | 0xFFFFFFFF |
0 |
0x0000000B |
1 |
0xFFFFF800 |
#139row-139 | 1785 | 0xFFFFFFFF |
0 |
0x0000000B |
0 |
0x001FFFFF |
#140row-140 | 1800 | 0xFFFFFFFF |
1 |
0x0000000B |
0 |
0xFFFFFFFF |
#141row-141 | 1815 | 0x00000001 |
0 |
0x0000000B |
1 |
0x00000800 |
#142row-142 | 1830 | 0x00000001 |
0 |
0x0000000B |
0 |
0x00000000 |
#143row-143 | 1832 | 0x00000001 |
1 |
0x0000000B |
0 |
0x00000000 |
#144row-144 | 1847 | 0x80000001 |
0 |
0x0000000C |
1 |
0x00001000 |
#145row-145 | 1863 | 0x80000001 |
0 |
0x0000000C |
0 |
0x00080000 |
#146row-146 | 1874 | 0x80000001 |
1 |
0x0000000C |
0 |
0xFFF80000 |
#147row-147 | 1889 | 0x7FFFFFFF |
0 |
0x0000000C |
1 |
0xFFFFF000 |
#148row-148 | 1905 | 0x7FFFFFFF |
0 |
0x0000000C |
0 |
0x0007FFFF |
#149row-149 | 1907 | 0x7FFFFFFF |
1 |
0x0000000C |
0 |
0x0007FFFF |
#150row-150 | 1922 | 0xFFFFFFFF |
0 |
0x0000000C |
1 |
0xFFFFF000 |
#151row-151 | 1938 | 0xFFFFFFFF |
0 |
0x0000000C |
0 |
0x000FFFFF |
#152row-152 | 1949 | 0xFFFFFFFF |
1 |
0x0000000C |
0 |
0xFFFFFFFF |
#153row-153 | 1964 | 0x00000001 |
0 |
0x0000000C |
1 |
0x00001000 |
#154row-154 | 1979 | 0x00000001 |
0 |
0x0000000C |
0 |
0x00000000 |
#155row-155 | 1981 | 0x00000001 |
1 |
0x0000000C |
0 |
0x00000000 |
#156row-156 | 1996 | 0x80000001 |
0 |
0x0000000D |
1 |
0x00002000 |
#157row-157 | 2012 | 0x80000001 |
0 |
0x0000000D |
0 |
0x00040000 |
#158row-158 | 2027 | 0x80000001 |
1 |
0x0000000D |
0 |
0xFFFC0000 |
#159row-159 | 2042 | 0x7FFFFFFF |
0 |
0x0000000D |
1 |
0xFFFFE000 |
#160row-160 | 2058 | 0x7FFFFFFF |
0 |
0x0000000D |
0 |
0x0003FFFF |
#161row-161 | 2060 | 0x7FFFFFFF |
1 |
0x0000000D |
0 |
0x0003FFFF |
#162row-162 | 2075 | 0xFFFFFFFF |
0 |
0x0000000D |
1 |
0xFFFFE000 |
#163row-163 | 2091 | 0xFFFFFFFF |
0 |
0x0000000D |
0 |
0x0007FFFF |
#164row-164 | 2106 | 0xFFFFFFFF |
1 |
0x0000000D |
0 |
0xFFFFFFFF |
#165row-165 | 2121 | 0x00000001 |
0 |
0x0000000D |
1 |
0x00002000 |
#166row-166 | 2136 | 0x00000001 |
0 |
0x0000000D |
0 |
0x00000000 |
#167row-167 | 2138 | 0x00000001 |
1 |
0x0000000D |
0 |
0x00000000 |
#168row-168 | 2153 | 0x80000001 |
0 |
0x0000000E |
1 |
0x00004000 |
#169row-169 | 2169 | 0x80000001 |
0 |
0x0000000E |
0 |
0x00020000 |
#170row-170 | 2182 | 0x80000001 |
1 |
0x0000000E |
0 |
0xFFFE0000 |
#171row-171 | 2197 | 0x7FFFFFFF |
0 |
0x0000000E |
1 |
0xFFFFC000 |
#172row-172 | 2213 | 0x7FFFFFFF |
0 |
0x0000000E |
0 |
0x0001FFFF |
#173row-173 | 2215 | 0x7FFFFFFF |
1 |
0x0000000E |
0 |
0x0001FFFF |
#174row-174 | 2230 | 0xFFFFFFFF |
0 |
0x0000000E |
1 |
0xFFFFC000 |
#175row-175 | 2246 | 0xFFFFFFFF |
0 |
0x0000000E |
0 |
0x0003FFFF |
#176row-176 | 2259 | 0xFFFFFFFF |
1 |
0x0000000E |
0 |
0xFFFFFFFF |
#177row-177 | 2274 | 0x00000001 |
0 |
0x0000000E |
1 |
0x00004000 |
#178row-178 | 2289 | 0x00000001 |
0 |
0x0000000E |
0 |
0x00000000 |
#179row-179 | 2291 | 0x00000001 |
1 |
0x0000000E |
0 |
0x00000000 |
#180row-180 | 2306 | 0x80000001 |
0 |
0x0000000F |
1 |
0x00008000 |
#181row-181 | 2322 | 0x80000001 |
0 |
0x0000000F |
0 |
0x00010000 |
#182row-182 | 2337 | 0x80000001 |
1 |
0x0000000F |
0 |
0xFFFF0000 |
#183row-183 | 2352 | 0x7FFFFFFF |
0 |
0x0000000F |
1 |
0xFFFF8000 |
#184row-184 | 2368 | 0x7FFFFFFF |
0 |
0x0000000F |
0 |
0x0000FFFF |
#185row-185 | 2370 | 0x7FFFFFFF |
1 |
0x0000000F |
0 |
0x0000FFFF |
#186row-186 | 2385 | 0xFFFFFFFF |
0 |
0x0000000F |
1 |
0xFFFF8000 |
#187row-187 | 2401 | 0xFFFFFFFF |
0 |
0x0000000F |
0 |
0x0001FFFF |
#188row-188 | 2416 | 0xFFFFFFFF |
1 |
0x0000000F |
0 |
0xFFFFFFFF |
#189row-189 | 2431 | 0x00000001 |
0 |
0x0000000F |
1 |
0x00008000 |
#190row-190 | 2446 | 0x00000001 |
0 |
0x0000000F |
0 |
0x00000000 |
#191row-191 | 2448 | 0x00000001 |
1 |
0x0000000F |
0 |
0x00000000 |
#192row-192 | 2463 | 0x80000001 |
0 |
0x00000010 |
1 |
0x00010000 |
#193row-193 | 2479 | 0x80000001 |
0 |
0x00000010 |
0 |
0x00008000 |
#194row-194 | 2486 | 0x80000001 |
1 |
0x00000010 |
0 |
0xFFFF8000 |
#195row-195 | 2501 | 0x7FFFFFFF |
0 |
0x00000010 |
1 |
0xFFFF0000 |
#196row-196 | 2517 | 0x7FFFFFFF |
0 |
0x00000010 |
0 |
0x00007FFF |
#197row-197 | 2519 | 0x7FFFFFFF |
1 |
0x00000010 |
0 |
0x00007FFF |
#198row-198 | 2534 | 0xFFFFFFFF |
0 |
0x00000010 |
1 |
0xFFFF0000 |
#199row-199 | 2550 | 0xFFFFFFFF |
0 |
0x00000010 |
0 |
0x0000FFFF |
#200row-200 | 2557 | 0xFFFFFFFF |
1 |
0x00000010 |
0 |
0xFFFFFFFF |
#201row-201 | 2572 | 0x00000001 |
0 |
0x00000010 |
1 |
0x00010000 |
#202row-202 | 2587 | 0x00000001 |
0 |
0x00000010 |
0 |
0x00000000 |
#203row-203 | 2589 | 0x00000001 |
1 |
0x00000010 |
0 |
0x00000000 |
#204row-204 | 2604 | 0x80000001 |
0 |
0x00000011 |
1 |
0x00020000 |
#205row-205 | 2620 | 0x80000001 |
0 |
0x00000011 |
0 |
0x00004000 |
#206row-206 | 2635 | 0x80000001 |
1 |
0x00000011 |
0 |
0xFFFFC000 |
#207row-207 | 2650 | 0x7FFFFFFF |
0 |
0x00000011 |
1 |
0xFFFE0000 |
#208row-208 | 2666 | 0x7FFFFFFF |
0 |
0x00000011 |
0 |
0x00003FFF |
#209row-209 | 2668 | 0x7FFFFFFF |
1 |
0x00000011 |
0 |
0x00003FFF |
#210row-210 | 2683 | 0xFFFFFFFF |
0 |
0x00000011 |
1 |
0xFFFE0000 |
#211row-211 | 2699 | 0xFFFFFFFF |
0 |
0x00000011 |
0 |
0x00007FFF |
#212row-212 | 2714 | 0xFFFFFFFF |
1 |
0x00000011 |
0 |
0xFFFFFFFF |
#213row-213 | 2729 | 0x00000001 |
0 |
0x00000011 |
1 |
0x00020000 |
#214row-214 | 2744 | 0x00000001 |
0 |
0x00000011 |
0 |
0x00000000 |
#215row-215 | 2746 | 0x00000001 |
1 |
0x00000011 |
0 |
0x00000000 |
#216row-216 | 2761 | 0x80000001 |
0 |
0x00000012 |
1 |
0x00040000 |
#217row-217 | 2777 | 0x80000001 |
0 |
0x00000012 |
0 |
0x00002000 |
#218row-218 | 2790 | 0x80000001 |
1 |
0x00000012 |
0 |
0xFFFFE000 |
#219row-219 | 2805 | 0x7FFFFFFF |
0 |
0x00000012 |
1 |
0xFFFC0000 |
#220row-220 | 2821 | 0x7FFFFFFF |
0 |
0x00000012 |
0 |
0x00001FFF |
#221row-221 | 2823 | 0x7FFFFFFF |
1 |
0x00000012 |
0 |
0x00001FFF |
#222row-222 | 2838 | 0xFFFFFFFF |
0 |
0x00000012 |
1 |
0xFFFC0000 |
#223row-223 | 2854 | 0xFFFFFFFF |
0 |
0x00000012 |
0 |
0x00003FFF |
#224row-224 | 2867 | 0xFFFFFFFF |
1 |
0x00000012 |
0 |
0xFFFFFFFF |
#225row-225 | 2882 | 0x00000001 |
0 |
0x00000012 |
1 |
0x00040000 |
#226row-226 | 2897 | 0x00000001 |
0 |
0x00000012 |
0 |
0x00000000 |
#227row-227 | 2899 | 0x00000001 |
1 |
0x00000012 |
0 |
0x00000000 |
#228row-228 | 2914 | 0x80000001 |
0 |
0x00000013 |
1 |
0x00080000 |
#229row-229 | 2930 | 0x80000001 |
0 |
0x00000013 |
0 |
0x00001000 |
#230row-230 | 2945 | 0x80000001 |
1 |
0x00000013 |
0 |
0xFFFFF000 |
#231row-231 | 2960 | 0x7FFFFFFF |
0 |
0x00000013 |
1 |
0xFFF80000 |
#232row-232 | 2976 | 0x7FFFFFFF |
0 |
0x00000013 |
0 |
0x00000FFF |
#233row-233 | 2978 | 0x7FFFFFFF |
1 |
0x00000013 |
0 |
0x00000FFF |
#234row-234 | 2993 | 0xFFFFFFFF |
0 |
0x00000013 |
1 |
0xFFF80000 |
#235row-235 | 3009 | 0xFFFFFFFF |
0 |
0x00000013 |
0 |
0x00001FFF |
#236row-236 | 3024 | 0xFFFFFFFF |
1 |
0x00000013 |
0 |
0xFFFFFFFF |
#237row-237 | 3039 | 0x00000001 |
0 |
0x00000013 |
1 |
0x00080000 |
#238row-238 | 3054 | 0x00000001 |
0 |
0x00000013 |
0 |
0x00000000 |
#239row-239 | 3056 | 0x00000001 |
1 |
0x00000013 |
0 |
0x00000000 |
#240row-240 | 3071 | 0x80000001 |
0 |
0x00000014 |
1 |
0x00100000 |
#241row-241 | 3087 | 0x80000001 |
0 |
0x00000014 |
0 |
0x00000800 |
#242row-242 | 3098 | 0x80000001 |
1 |
0x00000014 |
0 |
0xFFFFF800 |
#243row-243 | 3113 | 0x7FFFFFFF |
0 |
0x00000014 |
1 |
0xFFF00000 |
#244row-244 | 3129 | 0x7FFFFFFF |
0 |
0x00000014 |
0 |
0x000007FF |
#245row-245 | 3131 | 0x7FFFFFFF |
1 |
0x00000014 |
0 |
0x000007FF |
#246row-246 | 3146 | 0xFFFFFFFF |
0 |
0x00000014 |
1 |
0xFFF00000 |
#247row-247 | 3162 | 0xFFFFFFFF |
0 |
0x00000014 |
0 |
0x00000FFF |
#248row-248 | 3173 | 0xFFFFFFFF |
1 |
0x00000014 |
0 |
0xFFFFFFFF |
#249row-249 | 3188 | 0x00000001 |
0 |
0x00000014 |
1 |
0x00100000 |
#250row-250 | 3203 | 0x00000001 |
0 |
0x00000014 |
0 |
0x00000000 |
#251row-251 | 3205 | 0x00000001 |
1 |
0x00000014 |
0 |
0x00000000 |
#252row-252 | 3220 | 0x80000001 |
0 |
0x00000015 |
1 |
0x00200000 |
#253row-253 | 3236 | 0x80000001 |
0 |
0x00000015 |
0 |
0x00000400 |
#254row-254 | 3251 | 0x80000001 |
1 |
0x00000015 |
0 |
0xFFFFFC00 |
#255row-255 | 3266 | 0x7FFFFFFF |
0 |
0x00000015 |
1 |
0xFFE00000 |
#256row-256 | 3282 | 0x7FFFFFFF |
0 |
0x00000015 |
0 |
0x000003FF |
#257row-257 | 3284 | 0x7FFFFFFF |
1 |
0x00000015 |
0 |
0x000003FF |
#258row-258 | 3299 | 0xFFFFFFFF |
0 |
0x00000015 |
1 |
0xFFE00000 |
#259row-259 | 3315 | 0xFFFFFFFF |
0 |
0x00000015 |
0 |
0x000007FF |
#260row-260 | 3330 | 0xFFFFFFFF |
1 |
0x00000015 |
0 |
0xFFFFFFFF |
#261row-261 | 3345 | 0x00000001 |
0 |
0x00000015 |
1 |
0x00200000 |
#262row-262 | 3360 | 0x00000001 |
0 |
0x00000015 |
0 |
0x00000000 |
#263row-263 | 3362 | 0x00000001 |
1 |
0x00000015 |
0 |
0x00000000 |
#264row-264 | 3377 | 0x80000001 |
0 |
0x00000016 |
1 |
0x00400000 |
#265row-265 | 3393 | 0x80000001 |
0 |
0x00000016 |
0 |
0x00000200 |
#266row-266 | 3406 | 0x80000001 |
1 |
0x00000016 |
0 |
0xFFFFFE00 |
#267row-267 | 3421 | 0x7FFFFFFF |
0 |
0x00000016 |
1 |
0xFFC00000 |
#268row-268 | 3437 | 0x7FFFFFFF |
0 |
0x00000016 |
0 |
0x000001FF |
#269row-269 | 3439 | 0x7FFFFFFF |
1 |
0x00000016 |
0 |
0x000001FF |
#270row-270 | 3454 | 0xFFFFFFFF |
0 |
0x00000016 |
1 |
0xFFC00000 |
#271row-271 | 3470 | 0xFFFFFFFF |
0 |
0x00000016 |
0 |
0x000003FF |
#272row-272 | 3483 | 0xFFFFFFFF |
1 |
0x00000016 |
0 |
0xFFFFFFFF |
#273row-273 | 3498 | 0x00000001 |
0 |
0x00000016 |
1 |
0x00400000 |
#274row-274 | 3513 | 0x00000001 |
0 |
0x00000016 |
0 |
0x00000000 |
#275row-275 | 3515 | 0x00000001 |
1 |
0x00000016 |
0 |
0x00000000 |
#276row-276 | 3530 | 0x80000001 |
0 |
0x00000017 |
1 |
0x00800000 |
#277row-277 | 3546 | 0x80000001 |
0 |
0x00000017 |
0 |
0x00000100 |
#278row-278 | 3561 | 0x80000001 |
1 |
0x00000017 |
0 |
0xFFFFFF00 |
#279row-279 | 3576 | 0x7FFFFFFF |
0 |
0x00000017 |
1 |
0xFF800000 |
#280row-280 | 3592 | 0x7FFFFFFF |
0 |
0x00000017 |
0 |
0x000000FF |
#281row-281 | 3594 | 0x7FFFFFFF |
1 |
0x00000017 |
0 |
0x000000FF |
#282row-282 | 3609 | 0xFFFFFFFF |
0 |
0x00000017 |
1 |
0xFF800000 |
#283row-283 | 3625 | 0xFFFFFFFF |
0 |
0x00000017 |
0 |
0x000001FF |
#284row-284 | 3640 | 0xFFFFFFFF |
1 |
0x00000017 |
0 |
0xFFFFFFFF |
#285row-285 | 3655 | 0x00000001 |
0 |
0x00000017 |
1 |
0x00800000 |
#286row-286 | 3670 | 0x00000001 |
0 |
0x00000017 |
0 |
0x00000000 |
#287row-287 | 3672 | 0x00000001 |
1 |
0x00000017 |
0 |
0x00000000 |
#288row-288 | 3687 | 0x80000001 |
0 |
0x00000018 |
1 |
0x01000000 |
#289row-289 | 3703 | 0x80000001 |
0 |
0x00000018 |
0 |
0x00000080 |
#290row-290 | 3712 | 0x80000001 |
1 |
0x00000018 |
0 |
0xFFFFFF80 |
#291row-291 | 3727 | 0x7FFFFFFF |
0 |
0x00000018 |
1 |
0xFF000000 |
#292row-292 | 3743 | 0x7FFFFFFF |
0 |
0x00000018 |
0 |
0x0000007F |
#293row-293 | 3745 | 0x7FFFFFFF |
1 |
0x00000018 |
0 |
0x0000007F |
#294row-294 | 3760 | 0xFFFFFFFF |
0 |
0x00000018 |
1 |
0xFF000000 |
#295row-295 | 3776 | 0xFFFFFFFF |
0 |
0x00000018 |
0 |
0x000000FF |
#296row-296 | 3785 | 0xFFFFFFFF |
1 |
0x00000018 |
0 |
0xFFFFFFFF |
#297row-297 | 3800 | 0x00000001 |
0 |
0x00000018 |
1 |
0x01000000 |
#298row-298 | 3815 | 0x00000001 |
0 |
0x00000018 |
0 |
0x00000000 |
#299row-299 | 3817 | 0x00000001 |
1 |
0x00000018 |
0 |
0x00000000 |
#300row-300 | 3832 | 0x80000001 |
0 |
0x00000019 |
1 |
0x02000000 |
#301row-301 | 3848 | 0x80000001 |
0 |
0x00000019 |
0 |
0x00000040 |
#302row-302 | 3863 | 0x80000001 |
1 |
0x00000019 |
0 |
0xFFFFFFC0 |
#303row-303 | 3878 | 0x7FFFFFFF |
0 |
0x00000019 |
1 |
0xFE000000 |
#304row-304 | 3894 | 0x7FFFFFFF |
0 |
0x00000019 |
0 |
0x0000003F |
#305row-305 | 3896 | 0x7FFFFFFF |
1 |
0x00000019 |
0 |
0x0000003F |
#306row-306 | 3911 | 0xFFFFFFFF |
0 |
0x00000019 |
1 |
0xFE000000 |
#307row-307 | 3927 | 0xFFFFFFFF |
0 |
0x00000019 |
0 |
0x0000007F |
#308row-308 | 3942 | 0xFFFFFFFF |
1 |
0x00000019 |
0 |
0xFFFFFFFF |
#309row-309 | 3957 | 0x00000001 |
0 |
0x00000019 |
1 |
0x02000000 |
#310row-310 | 3972 | 0x00000001 |
0 |
0x00000019 |
0 |
0x00000000 |
#311row-311 | 3974 | 0x00000001 |
1 |
0x00000019 |
0 |
0x00000000 |
#312row-312 | 3989 | 0x80000001 |
0 |
0x0000001A |
1 |
0x04000000 |
#313row-313 | 4005 | 0x80000001 |
0 |
0x0000001A |
0 |
0x00000020 |
#314row-314 | 4018 | 0x80000001 |
1 |
0x0000001A |
0 |
0xFFFFFFE0 |
#315row-315 | 4033 | 0x7FFFFFFF |
0 |
0x0000001A |
1 |
0xFC000000 |
#316row-316 | 4049 | 0x7FFFFFFF |
0 |
0x0000001A |
0 |
0x0000001F |
#317row-317 | 4051 | 0x7FFFFFFF |
1 |
0x0000001A |
0 |
0x0000001F |
#318row-318 | 4066 | 0xFFFFFFFF |
0 |
0x0000001A |
1 |
0xFC000000 |
#319row-319 | 4082 | 0xFFFFFFFF |
0 |
0x0000001A |
0 |
0x0000003F |
#320row-320 | 4095 | 0xFFFFFFFF |
1 |
0x0000001A |
0 |
0xFFFFFFFF |
#321row-321 | 4110 | 0x00000001 |
0 |
0x0000001A |
1 |
0x04000000 |
#322row-322 | 4125 | 0x00000001 |
0 |
0x0000001A |
0 |
0x00000000 |
#323row-323 | 4127 | 0x00000001 |
1 |
0x0000001A |
0 |
0x00000000 |
#324row-324 | 4142 | 0x80000001 |
0 |
0x0000001B |
1 |
0x08000000 |
#325row-325 | 4158 | 0x80000001 |
0 |
0x0000001B |
0 |
0x00000010 |
#326row-326 | 4173 | 0x80000001 |
1 |
0x0000001B |
0 |
0xFFFFFFF0 |
#327row-327 | 4188 | 0x7FFFFFFF |
0 |
0x0000001B |
1 |
0xF8000000 |
#328row-328 | 4204 | 0x7FFFFFFF |
0 |
0x0000001B |
0 |
0x0000000F |
#329row-329 | 4206 | 0x7FFFFFFF |
1 |
0x0000001B |
0 |
0x0000000F |
#330row-330 | 4221 | 0xFFFFFFFF |
0 |
0x0000001B |
1 |
0xF8000000 |
#331row-331 | 4237 | 0xFFFFFFFF |
0 |
0x0000001B |
0 |
0x0000001F |
#332row-332 | 4252 | 0xFFFFFFFF |
1 |
0x0000001B |
0 |
0xFFFFFFFF |
#333row-333 | 4267 | 0x00000001 |
0 |
0x0000001B |
1 |
0x08000000 |
#334row-334 | 4282 | 0x00000001 |
0 |
0x0000001B |
0 |
0x00000000 |
#335row-335 | 4284 | 0x00000001 |
1 |
0x0000001B |
0 |
0x00000000 |
#336row-336 | 4299 | 0x80000001 |
0 |
0x0000001C |
1 |
0x10000000 |
#337row-337 | 4315 | 0x80000001 |
0 |
0x0000001C |
0 |
0x00000008 |
#338row-338 | 4326 | 0x80000001 |
1 |
0x0000001C |
0 |
0xFFFFFFF8 |
#339row-339 | 4341 | 0x7FFFFFFF |
0 |
0x0000001C |
1 |
0xF0000000 |
#340row-340 | 4357 | 0x7FFFFFFF |
0 |
0x0000001C |
0 |
0x00000007 |
#341row-341 | 4359 | 0x7FFFFFFF |
1 |
0x0000001C |
0 |
0x00000007 |
#342row-342 | 4374 | 0xFFFFFFFF |
0 |
0x0000001C |
1 |
0xF0000000 |
#343row-343 | 4390 | 0xFFFFFFFF |
0 |
0x0000001C |
0 |
0x0000000F |
#344row-344 | 4401 | 0xFFFFFFFF |
1 |
0x0000001C |
0 |
0xFFFFFFFF |
#345row-345 | 4416 | 0x00000001 |
0 |
0x0000001C |
1 |
0x10000000 |
#346row-346 | 4431 | 0x00000001 |
0 |
0x0000001C |
0 |
0x00000000 |
#347row-347 | 4433 | 0x00000001 |
1 |
0x0000001C |
0 |
0x00000000 |
#348row-348 | 4448 | 0x80000001 |
0 |
0x0000001D |
1 |
0x20000000 |
#349row-349 | 4464 | 0x80000001 |
0 |
0x0000001D |
0 |
0x00000004 |
#350row-350 | 4479 | 0x80000001 |
1 |
0x0000001D |
0 |
0xFFFFFFFC |
#351row-351 | 4494 | 0x7FFFFFFF |
0 |
0x0000001D |
1 |
0xE0000000 |
#352row-352 | 4510 | 0x7FFFFFFF |
0 |
0x0000001D |
0 |
0x00000003 |
#353row-353 | 4512 | 0x7FFFFFFF |
1 |
0x0000001D |
0 |
0x00000003 |
#354row-354 | 4527 | 0xFFFFFFFF |
0 |
0x0000001D |
1 |
0xE0000000 |
#355row-355 | 4543 | 0xFFFFFFFF |
0 |
0x0000001D |
0 |
0x00000007 |
#356row-356 | 4558 | 0xFFFFFFFF |
1 |
0x0000001D |
0 |
0xFFFFFFFF |
#357row-357 | 4573 | 0x00000001 |
0 |
0x0000001D |
1 |
0x20000000 |
#358row-358 | 4588 | 0x00000001 |
0 |
0x0000001D |
0 |
0x00000000 |
#359row-359 | 4590 | 0x00000001 |
1 |
0x0000001D |
0 |
0x00000000 |
#360row-360 | 4605 | 0x80000001 |
0 |
0x0000001E |
1 |
0x40000000 |
#361row-361 | 4621 | 0x80000001 |
0 |
0x0000001E |
0 |
0x00000002 |
#362row-362 | 4634 | 0x80000001 |
1 |
0x0000001E |
0 |
0xFFFFFFFE |
#363row-363 | 4649 | 0x7FFFFFFF |
0 |
0x0000001E |
1 |
0xC0000000 |
#364row-364 | 4665 | 0x7FFFFFFF |
0 |
0x0000001E |
0 |
0x00000001 |
#365row-365 | 4667 | 0x7FFFFFFF |
1 |
0x0000001E |
0 |
0x00000001 |
#366row-366 | 4682 | 0xFFFFFFFF |
0 |
0x0000001E |
1 |
0xC0000000 |
#367row-367 | 4698 | 0xFFFFFFFF |
0 |
0x0000001E |
0 |
0x00000003 |
#368row-368 | 4711 | 0xFFFFFFFF |
1 |
0x0000001E |
0 |
0xFFFFFFFF |
#369row-369 | 4726 | 0x00000001 |
0 |
0x0000001E |
1 |
0x40000000 |
#370row-370 | 4741 | 0x00000001 |
0 |
0x0000001E |
0 |
0x00000000 |
#371row-371 | 4743 | 0x00000001 |
1 |
0x0000001E |
0 |
0x00000000 |
#372row-372 | 4758 | 0x80000001 |
0 |
0x0000001F |
1 |
0x80000000 |
#373row-373 | 4774 | 0x80000001 |
0 |
0x0000001F |
0 |
0x00000001 |
#374row-374 | 4789 | 0x80000001 |
1 |
0x0000001F |
0 |
0xFFFFFFFF |
#375row-375 | 4804 | 0x7FFFFFFF |
0 |
0x0000001F |
1 |
0x80000000 |
#376row-376 | 4819 | 0x7FFFFFFF |
0 |
0x0000001F |
0 |
0x00000000 |
#377row-377 | 4821 | 0x7FFFFFFF |
1 |
0x0000001F |
0 |
0x00000000 |
#378row-378 | 4836 | 0xFFFFFFFF |
0 |
0x0000001F |
1 |
0x80000000 |
#379row-379 | 4852 | 0xFFFFFFFF |
0 |
0x0000001F |
0 |
0x00000001 |
#380row-380 | 4867 | 0xFFFFFFFF |
1 |
0x0000001F |
0 |
0xFFFFFFFF |
#381row-381 | 4882 | 0x00000001 |
0 |
0x0000001F |
1 |
0x80000000 |
#382row-382 | 4897 | 0x00000001 |
0 |
0x0000001F |
0 |
0x00000000 |
#383row-383 | 4899 | 0x00000001 |
1 |
0x0000001F |
0 |
0x00000000 |
#384row-384 | 4914 | 0x80000001 |
0 |
0x00000020 |
1 |
0x80000001 |
#385row-385 | 4930 | 0x80000001 |
0 |
0x00000020 |
0 |
0x80000001 |
#386row-386 | 4934 | 0x80000001 |
1 |
0x00000020 |
0 |
0x80000001 |
#387row-387 | 4950 | 0x7FFFFFFF |
0 |
0x00000020 |
1 |
0x7FFFFFFF |
#388row-388 | 4966 | 0x7FFFFFFF |
0 |
0x00000020 |
0 |
0x7FFFFFFF |
#389row-389 | 4968 | 0x7FFFFFFF |
1 |
0x00000020 |
0 |
0x7FFFFFFF |
#390row-390 | 4983 | 0xFFFFFFFF |
0 |
0x00000020 |
1 |
0xFFFFFFFF |
#391row-391 | 4999 | 0xFFFFFFFF |
0 |
0x00000020 |
0 |
0xFFFFFFFF |
#392row-392 | 5003 | 0xFFFFFFFF |
1 |
0x00000020 |
0 |
0xFFFFFFFF |
#393row-393 | 5019 | 0x00000001 |
0 |
0x00000020 |
1 |
0x00000001 |
#394row-394 | 5035 | 0x00000001 |
0 |
0x00000020 |
0 |
0x00000001 |
#395row-395 | 5037 | 0x00000001 |
1 |
0x00000020 |
0 |
0x00000001 |
#396row-396 | 5052 | 0x80000001 |
0 |
0x00000021 |
1 |
0x00000002 |
#397row-397 | 5068 | 0x80000001 |
0 |
0x00000021 |
0 |
0x40000000 |
#398row-398 | 5083 | 0x80000001 |
1 |
0x00000021 |
0 |
0xC0000000 |
#399row-399 | 5098 | 0x7FFFFFFF |
0 |
0x00000021 |
1 |
0xFFFFFFFE |
#400row-400 | 5114 | 0x7FFFFFFF |
0 |
0x00000021 |
0 |
0x3FFFFFFF |
#401row-401 | 5116 | 0x7FFFFFFF |
1 |
0x00000021 |
0 |
0x3FFFFFFF |
#402row-402 | 5131 | 0xFFFFFFFF |
0 |
0x00000021 |
1 |
0xFFFFFFFE |
#403row-403 | 5147 | 0xFFFFFFFF |
0 |
0x00000021 |
0 |
0x7FFFFFFF |
#404row-404 | 5162 | 0xFFFFFFFF |
1 |
0x00000021 |
0 |
0xFFFFFFFF |
#405row-405 | 5177 | 0x00000001 |
0 |
0x00000021 |
1 |
0x00000002 |
#406row-406 | 5192 | 0x00000001 |
0 |
0x00000021 |
0 |
0x00000000 |
#407row-407 | 5194 | 0x00000001 |
1 |
0x00000021 |
0 |
0x00000000 |
#408row-408 | 5209 | 0x80000001 |
0 |
0x0000003F |
1 |
0x80000000 |
#409row-409 | 5225 | 0x80000001 |
0 |
0x0000003F |
0 |
0x00000001 |
#410row-410 | 5240 | 0x80000001 |
1 |
0x0000003F |
0 |
0xFFFFFFFF |
#411row-411 | 5255 | 0x7FFFFFFF |
0 |
0x0000003F |
1 |
0x80000000 |
#412row-412 | 5270 | 0x7FFFFFFF |
0 |
0x0000003F |
0 |
0x00000000 |
#413row-413 | 5272 | 0x7FFFFFFF |
1 |
0x0000003F |
0 |
0x00000000 |
#414row-414 | 5287 | 0xFFFFFFFF |
0 |
0x0000003F |
1 |
0x80000000 |
#415row-415 | 5303 | 0xFFFFFFFF |
0 |
0x0000003F |
0 |
0x00000001 |
#416row-416 | 5318 | 0xFFFFFFFF |
1 |
0x0000003F |
0 |
0xFFFFFFFF |
#417row-417 | 5333 | 0x00000001 |
0 |
0x0000003F |
1 |
0x80000000 |
#418row-418 | 5348 | 0x00000001 |
0 |
0x0000003F |
0 |
0x00000000 |
#419row-419 | 5350 | 0x00000001 |
1 |
0x0000003F |
0 |
0x00000000 |
#420row-420 | 5365 | 0x80000001 |
0 |
0xFFFFFFFF |
1 |
0x80000000 |
#421row-421 | 5381 | 0x80000001 |
0 |
0xFFFFFFFF |
0 |
0x00000001 |
#422row-422 | 5396 | 0x80000001 |
1 |
0xFFFFFFFF |
0 |
0xFFFFFFFF |
#423row-423 | 5411 | 0x7FFFFFFF |
0 |
0xFFFFFFFF |
1 |
0x80000000 |
#424row-424 | 5426 | 0x7FFFFFFF |
0 |
0xFFFFFFFF |
0 |
0x00000000 |
#425row-425 | 5428 | 0x7FFFFFFF |
1 |
0xFFFFFFFF |
0 |
0x00000000 |
#426row-426 | 5443 | 0xFFFFFFFF |
0 |
0xFFFFFFFF |
1 |
0x80000000 |
#427row-427 | 5459 | 0xFFFFFFFF |
0 |
0xFFFFFFFF |
0 |
0x00000001 |
#428row-428 | 5474 | 0xFFFFFFFF |
1 |
0xFFFFFFFF |
0 |
0xFFFFFFFF |
#429row-429 | 5489 | 0x00000001 |
0 |
0xFFFFFFFF |
1 |
0x80000000 |
#430row-430 | 5504 | 0x00000001 |
0 |
0xFFFFFFFF |
0 |
0x00000000 |
#431row-431 | 5506 | 0x00000001 |
1 |
0xFFFFFFFF |
0 |
0x00000000 |
#432row-432 | 5522 | 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 |
0 |
0x00000000 |
1 |
0bXX10XX10XX10XX10XX10XX10XX10XX10 |
#433row-433 | 5538 | 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 |
0 |
0x00000000 |
0 |
0bXX10XX10XX10XX10XX10XX10XX10XX10 |
#434row-434 | 5542 | 0bZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10 |
1 |
0x00000000 |
0 |
0bXX10XX10XX10XX10XX10XX10XX10XX10 |
#435row-435 | 5558 | 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 |
0 |
0x00000005 |
1 |
0bXX10XX10XX10XX10XX10XX10XX100000 |
#436row-436 | 5574 | 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 |
0 |
0x00000005 |
0 |
0b000000XX10XX10XX10XX10XX10XX10XX |
#437row-437 | 5576 | 0b0ZX10ZX10ZX10ZX10ZX10ZX10ZX10ZX1 |
1 |
0x00000005 |
0 |
0b000000XX10XX10XX10XX10XX10XX10XX |
#438row-438 | 5591 | 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z |
0 |
0x0000001F |
1 |
0bX0000000000000000000000000000000 |
#439row-439 | 5607 | 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z |
0 |
0x0000001F |
0 |
0b0000000000000000000000000000000X |
#440row-440 | 5622 | 0bX10ZX10ZX10ZX10ZX10ZX10ZX10ZX10Z |
1 |
0x0000001F |
0 |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
#441row-441 | 5637 | 0x00000000 |
0 |
0b00000000000000000000000000000X00 |
1 |
0x00000000 |
#442row-442 | 5640 | 0x00000000 |
0 |
0b00000000000000000000000000000X00 |
0 |
0x00000000 |
#443row-443 | 5642 | 0x00000000 |
1 |
0b00000000000000000000000000000X00 |
0 |
0x00000000 |
#444row-444 | 5645 | 0x00000000 |
0 |
0b00000000000000000000000000000Z00 |
1 |
0x00000000 |
#445row-445 | 5648 | 0x00000000 |
0 |
0b00000000000000000000000000000Z00 |
0 |
0x00000000 |
#446row-446 | 5650 | 0x00000000 |
1 |
0b00000000000000000000000000000Z00 |
0 |
0x00000000 |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases cover both directions, sign fill, every interesting distance and ignored upper amount bits.
Embedded simulation¶
Open RV32IALUShifter in the simulator
Tests¶
RV32IALUShifterTest checks directions, sign fill, distances, ignored upper amount bits and four-state inputs. Source: RV32IALUShifter.cpp.
4.3.3.5. RV32IALUCompare¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
DIFF |
Input | 32 | A − B from the add/subtract part |
CARRY_IN, OVERFLOW_IN |
Input | 1 each | The subtraction's no-borrow and signed overflow |
ENABLE |
Input | 1 | Enables the comparisons |
EQ, LT_SIGNED, LT_UNSIGNED |
Output | 1 each | Comparison results |
SLT_RESULT, SLTU_RESULT |
Output | 32 each | The less-than results as words: bit 0 holds the result, bits 31:1 are zero |
Behavior¶
The part reads an existing subtraction instead of comparing two operands itself. Signed less-than corrects the sign of the difference with the overflow bit. When ENABLE is low, every comparison is zero, so EQ is not an always-valid equality test; branches select SUB to obtain all three.
C++ example¶
namespace rv32i_alu_example {
struct Compare { bool EQ, LT_SIGNED, LT_UNSIGNED; uint32_t SLT_RESULT, SLTU_RESULT; };
Compare compare(uint32_t diff, bool carry, bool overflow, bool enable) {
const bool s = enable && (bool(diff & SIGN) != overflow);
const bool u = enable && !carry;
return {enable && diff == 0, s, u, uint32_t(s), uint32_t(u)};
}
}
Unknown inputs¶
A low ENABLE masks unknown subtraction inputs. When enabled, the outputs follow four-state zero detection, XOR and inversion. The upper bits of the result words stay 0.
Implementation¶
Structural implementation¶
A Chapter 2 ZeroDetect<32> named ARITHMETIC_ZERO gives equality. A sign splitter, XOR, NOT and AND gates give the less-than results, and joiners widen them into words.
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 34 recorded rows of RV32IALUCompareTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | CARRY_INInput · 1 bit |
DIFFInput · 32 bit |
ENABLEInput · 1 bit |
OVERFLOW_INInput · 1 bit |
EQExpected output · 1 bit |
LT_SIGNEDExpected output · 1 bit |
LT_UNSIGNEDExpected output · 1 bit |
SLTU_RESULTExpected output · 32 bit |
SLT_RESULTExpected output · 32 bit |
|---|---|---|---|---|---|---|---|---|---|---|
#0row-0 | 7 | 0 |
0x00000000 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#1row-1 | 15 | 0 |
0x00000001 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#2row-2 | 21 | 0 |
0x80000000 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#3row-3 | 27 | 0 |
0xFFFFFFFF |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#4row-4 | 35 | 0 |
0x00000000 |
1 |
0 |
1 |
0 |
1 |
0x00000001 |
0x00000000 |
#5row-5 | 43 | 0 |
0x00000001 |
1 |
0 |
0 |
0 |
1 |
0x00000001 |
0x00000000 |
#6row-6 | 49 | 0 |
0x80000000 |
1 |
0 |
0 |
1 |
1 |
0x00000001 |
0x00000001 |
#7row-7 | 55 | 0 |
0xFFFFFFFF |
1 |
0 |
0 |
1 |
1 |
0x00000001 |
0x00000001 |
#8row-8 | 63 | 1 |
0x00000000 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#9row-9 | 71 | 1 |
0x00000001 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#10row-10 | 77 | 1 |
0x80000000 |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#11row-11 | 83 | 1 |
0xFFFFFFFF |
0 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#12row-12 | 91 | 1 |
0x00000000 |
1 |
0 |
1 |
0 |
0 |
0x00000000 |
0x00000000 |
#13row-13 | 99 | 1 |
0x00000001 |
1 |
0 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#14row-14 | 105 | 1 |
0x80000000 |
1 |
0 |
0 |
1 |
0 |
0x00000000 |
0x00000001 |
#15row-15 | 111 | 1 |
0xFFFFFFFF |
1 |
0 |
0 |
1 |
0 |
0x00000000 |
0x00000001 |
#16row-16 | 119 | 0 |
0x00000000 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#17row-17 | 127 | 0 |
0x00000001 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#18row-18 | 133 | 0 |
0x80000000 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#19row-19 | 139 | 0 |
0xFFFFFFFF |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#20row-20 | 147 | 0 |
0x00000000 |
1 |
1 |
1 |
1 |
1 |
0x00000001 |
0x00000001 |
#21row-21 | 155 | 0 |
0x00000001 |
1 |
1 |
0 |
1 |
1 |
0x00000001 |
0x00000001 |
#22row-22 | 161 | 0 |
0x80000000 |
1 |
1 |
0 |
0 |
1 |
0x00000001 |
0x00000000 |
#23row-23 | 167 | 0 |
0xFFFFFFFF |
1 |
1 |
0 |
0 |
1 |
0x00000001 |
0x00000000 |
#24row-24 | 175 | 1 |
0x00000000 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#25row-25 | 183 | 1 |
0x00000001 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#26row-26 | 189 | 1 |
0x80000000 |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#27row-27 | 195 | 1 |
0xFFFFFFFF |
0 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#28row-28 | 203 | 1 |
0x00000000 |
1 |
1 |
1 |
1 |
0 |
0x00000000 |
0x00000001 |
#29row-29 | 211 | 1 |
0x00000001 |
1 |
1 |
0 |
1 |
0 |
0x00000000 |
0x00000001 |
#30row-30 | 217 | 1 |
0x80000000 |
1 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#31row-31 | 223 | 1 |
0xFFFFFFFF |
1 |
1 |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#32row-32 | 231 | X |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0 |
X |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
#33row-33 | 233 | Z |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0 |
Z |
0 |
0 |
0 |
0x00000000 |
0x00000000 |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases combine every enable, carry and overflow value with zero, one and sign-boundary differences, then add four-state inputs with the comparisons disabled.
Embedded simulation¶
Open RV32IALUCompare in the simulator
Tests¶
RV32IALUCompareTest checks enable masking, equality, the sign/overflow correction and the result words. Source: RV32IALUCompare.cpp.
4.3.3.6. RV32IALUResultSelect¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
ARITHMETIC_RESULT, AND_RESULT, OR_RESULT, XOR_RESULT, SHIFT_RESULT |
Input | 32 each | Part results |
SLT_RESULT, SLTU_RESULT, A, B |
Input | 32 each | Comparison words and pass-through operands |
LOCAL_OP |
Input | 3 | Index within a group |
HIGH_HALF |
Input | 1 | Selects the upper group |
OUT_OF_RANGE |
Input | 1 | Forces zero |
OUT |
Output | 32 | Selected word |
Behavior¶
The lower group, by LOCAL_OP, is arithmetic, arithmetic, AND, OR, XOR, shift, shift, shift. The upper group is SLT, SLTU, A, B, and zero for indices 4–7. OUT_OF_RANGE overrides both groups with zero.
C++ example¶
namespace rv32i_alu_example {
uint32_t select(uint32_t arithmetic, uint32_t and_result, uint32_t or_result,
uint32_t xor_result, uint32_t shifted, uint32_t slt, uint32_t sltu,
uint32_t a, uint32_t b, unsigned local, bool high, bool invalid) {
const std::array<uint32_t,8> low{arithmetic,arithmetic,and_result,or_result,xor_result,shifted,shifted,shifted};
const std::array<uint32_t,8> upper{slt,sltu,a,b,0,0,0,0};
return invalid ? 0 : (high ? upper : low).at(local);
}
}
Unknown inputs¶
Known controls mask the unselected words; unknown controls follow the selector's AND/OR gates. The repeated arithmetic and shift choices keep separate gate terms, so an unknown selector bit gives the same outputs as the equivalent gate-built mux.
Implementation¶
Structural implementation¶
Opcode minterms qualify nine result sources. Nine word gates MASK_0 … MASK_8 (ANDGate<32>) mask the nine source words with their selects, each spread across the word by wiring, and word ORs (ORGate<32>) combine them in a balanced tree (RESULT_…): per bit the same nine ANDs and OR tree as a bit-by-bit circuit. Reserved codes select no source and give zero. RV32ILogicOptimizationTest compares this circuit with a gate-built mux reference for all 1,024 four-state selector combinations, each with four data patterns.
Behavioral implementation¶
The compact form evaluates the same gates bit by bit with the gate rules (a low input forces AND low, a high input forces OR high, other X or Z inputs give X; wiring passes Z unchanged), so it gives the same outputs as the structural circuit for every four-state input, and it runs on delays proven on that circuit (delay model). CompactFormEquivalenceTest runs both forms on binary, dense four-state and single-unknown vectors.
Examples¶
All 66 recorded rows of RV32IALUResultSelectTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | AInput · 32 bit |
AND_RESULTInput · 32 bit |
ARITHMETIC_RESULTInput · 32 bit |
BInput · 32 bit |
HIGH_HALFInput · 1 bit |
LOCAL_OPInput · 3 bit |
OR_RESULTInput · 32 bit |
OUT_OF_RANGEInput · 1 bit |
SHIFT_RESULTInput · 32 bit |
SLTU_RESULTInput · 32 bit |
SLT_RESULTInput · 32 bit |
XOR_RESULTInput · 32 bit |
OUTExpected output · 32 bit |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
#0row-0 | 10 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x0 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x12345678 |
#1row-1 | 16 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x1 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x12345678 |
#2row-2 | 26 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x2 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x03254769 |
#3row-3 | 36 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x3 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x3016745A |
#4row-4 | 46 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x4 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x2107654B |
#5row-5 | 57 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x5 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x5670123C |
#6row-6 | 69 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x6 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x5670123C |
#7row-7 | 76 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x7 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x5670123C |
#8row-8 | 86 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x0 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x4761032D |
#9row-9 | 96 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x1 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x7452301E |
#10row-10 | 106 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x2 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x6543210F |
#11row-11 | 116 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x3 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x9ABCDEF0 |
#12row-12 | 122 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x4 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#13row-13 | 126 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x5 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#14row-14 | 130 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x6 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#15row-15 | 134 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x7 |
0x3016745A |
0 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#16row-16 | 139 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x0 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#17row-17 | 144 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x1 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#18row-18 | 149 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x2 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#19row-19 | 154 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x3 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#20row-20 | 159 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x4 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#21row-21 | 164 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x5 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#22row-22 | 169 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x6 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#23row-23 | 174 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
0 |
0x7 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#24row-24 | 179 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x0 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#25row-25 | 184 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x1 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#26row-26 | 189 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x2 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#27row-27 | 194 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x3 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#28row-28 | 198 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x4 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#29row-29 | 202 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x5 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#30row-30 | 206 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x6 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#31row-31 | 210 | 0x6543210F |
0x03254769 |
0x12345678 |
0x9ABCDEF0 |
1 |
0x7 |
0x3016745A |
1 |
0x5670123C |
0x7452301E |
0x4761032D |
0x2107654B |
0x00000000 |
#32row-32 | 221 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x0 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xEDCBA987 |
#33row-33 | 227 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x1 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xEDCBA987 |
#34row-34 | 237 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x2 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xFCDAB896 |
#35row-35 | 247 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x3 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xCFE98BA5 |
#36row-36 | 257 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x4 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xDEF89AB4 |
#37row-37 | 268 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x5 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xA98FEDC3 |
#38row-38 | 280 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x6 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xA98FEDC3 |
#39row-39 | 287 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x7 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xA98FEDC3 |
#40row-40 | 297 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x0 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0xB89EFCD2 |
#41row-41 | 307 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x1 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x8BADCFE1 |
#42row-42 | 317 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x2 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x9ABCDEF0 |
#43row-43 | 327 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x3 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x6543210F |
#44row-44 | 333 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x4 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#45row-45 | 337 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x5 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#46row-46 | 341 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x6 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#47row-47 | 345 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x7 |
0xCFE98BA5 |
0 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#48row-48 | 350 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x0 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#49row-49 | 355 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x1 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#50row-50 | 360 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x2 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#51row-51 | 365 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x3 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#52row-52 | 370 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x4 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#53row-53 | 375 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x5 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#54row-54 | 380 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x6 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#55row-55 | 385 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
0 |
0x7 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#56row-56 | 390 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x0 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#57row-57 | 395 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x1 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#58row-58 | 400 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x2 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#59row-59 | 405 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x3 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#60row-60 | 409 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x4 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#61row-61 | 413 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x5 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#62row-62 | 417 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x6 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#63row-63 | 421 | 0x9ABCDEF0 |
0xFCDAB896 |
0xEDCBA987 |
0x6543210F |
1 |
0x7 |
0xCFE98BA5 |
1 |
0xA98FEDC3 |
0x8BADCFE1 |
0xB89EFCD2 |
0xDEF89AB4 |
0x00000000 |
#64row-64 | 426 | 0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0 |
0x0 |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
1 |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
0x00000000 |
#65row-65 | 428 | 0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0 |
0x0 |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
1 |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0bZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
0x00000000 |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases use distinguishable source words with every binary opcode, then four-state source words.
Embedded simulation¶
Open RV32IALUResultSelect in the simulator
Tests¶
RV32IALUResultSelectTest checks every local index with both groups and the zero override. Source: RV32IALUResultSelect.cpp.
4.3.3.7. RV32IALU¶
IO pins¶
| Pin | Direction | Width | Description |
|---|---|---|---|
A, B |
Input | 32 each | Operands |
OP |
Input | 5 | Operation code |
OUT |
Output | 32 | Result |
EQ, LT_SIGNED, LT_UNSIGNED |
Output | 1 each | Comparisons, valid for SUB, SLT and SLTU; otherwise 0 |
Behavior¶
| OP | Name | OUT | Comparisons |
|---|---|---|---|
| 0 | ADD | A + B |
0 |
| 1 | SUB | A − B |
Valid |
| 2 | AND | A & B |
0 |
| 3 | OR | A \| B |
0 |
| 4 | XOR | A ^ B |
0 |
| 5 | SLL | A << B[4:0] |
0 |
| 6 | SRL | Logical A >> B[4:0] |
0 |
| 7 | SRA | Arithmetic A >> B[4:0] |
0 |
| 8 | SLT | 1 if signed A < B, else 0 |
Valid |
| 9 | SLTU | 1 if unsigned A < B, else 0 |
Valid |
| 10 | PASS_A | A |
0 |
| 11 | PASS_B | B |
0 |
| 12 | CLEAR | 0 | 0 |
| 13–31 | Reserved | 0 | 0 |
The decoder selects SUB for conditional branches and reads all three comparisons; it selects ADD for addresses and jump targets, PASS_B for LUI and CLEAR for instructions that write no ALU result. Instruction legality is the decoder's job, so reserved codes simply give zero.
C++ example¶
This reference combines the part references above.
namespace rv32i_alu_example {
struct Result { uint32_t OUT; bool EQ, LT_SIGNED, LT_UNSIGNED; };
Result alu(uint32_t a, uint32_t b, unsigned op) {
const auto c = control(op);
const auto ar = addsub(a, b, c.SUB);
const auto l = logic(a, b);
const auto sh = shift(a, b, c.SHIFT_LEFT, c.SHIFT_ARITHMETIC);
const auto cmp = compare(ar.OUT, ar.C_OUT, ar.OVERFLOW, c.SUB);
const auto out = select(ar.OUT, l.AND_OUT, l.OR_OUT, l.XOR_OUT, sh,
cmp.SLT_RESULT, cmp.SLTU_RESULT, a, b, c.LOCAL_OP, c.HIGH_HALF, c.OUT_OF_RANGE);
return {out, cmp.EQ, cmp.LT_SIGNED, cmp.LT_UNSIGNED};
}
}
Unknown inputs¶
The structural ALU can mask unknown values in parts whose result is not selected. The compact form instead makes every output unknown if any bit of A, B or OP is X or Z, even an unused operand. Its equivalence with the gates therefore covers known (0/1) inputs only.
Implementation¶
Structural implementation¶
The root contains CONTROL, ARITHMETIC (the add/subtract part), LOGIC, SHIFT, COMPARE and RESULT_SELECT. The subtraction result, carry and overflow feed the compare part, and every part's result feeds the selector.
Behavioral implementation¶
The compact form computes the result and comparisons with the RISC-V value rule that the compact cores also use, then publishes them on delays proven on the gates, one set per operation code. The instruction oracle checks the same operations independently.
Timing. Paths of the complete ALU in each timing profile:
Latest time each path can still change after its input (for a setup row: how long before the edge the input must be stable), proven on the gate-level form.
| Path | unitticks | embeddedps | desktopps |
|---|---|---|---|
Operation to result OP → OUT | 25 | 1,530 | 1,067 |
Operand to result A → OUT | 20 | 1,230 | 857 |
Operand to equality A → EQ | 19 | 1,092 | 760 |
Examples¶
All 46 recorded rows of RV32IALUTest, in checkpoint order. Outputs are test expectations verified against the simulation. Time is the absolute settled checkpoint time in simulator units, not milliseconds or CPU cycles.
Default scenario profile: fidelity-gate-v1 / structural (ed03f70afe360dba). Changing fidelity or the circuit can change these times.
| Checkpointzero-based number · timeline label | Timesimulator units | AInput · 32 bit |
BInput · 32 bit |
OPInput · 5 bit |
EQExpected output · 1 bit |
LT_SIGNEDExpected output · 1 bit |
LT_UNSIGNEDExpected output · 1 bit |
OUTExpected output · 32 bit |
|---|---|---|---|---|---|---|---|---|
#0row-0 | 17 | 0x00000001 |
0x00000002 |
0x00 |
0 |
0 |
0 |
0x00000003 |
#1row-1 | 37 | 0xFFFFFFFF |
0x00000001 |
0x00 |
0 |
0 |
0 |
0x00000000 |
#2row-2 | 50 | 0xFFFFFFFF |
0xFFFFFFFF |
0x00 |
0 |
0 |
0 |
0xFFFFFFFE |
#3row-3 | 71 | 0x7FFFFFFF |
0x00000001 |
0x00 |
0 |
0 |
0 |
0x80000000 |
#4row-4 | 88 | 0x80000000 |
0x80000000 |
0x00 |
0 |
0 |
0 |
0x00000000 |
#5row-5 | 108 | 0x00000005 |
0x00000005 |
0x01 |
1 |
0 |
0 |
0x00000000 |
#6row-6 | 124 | 0x00000000 |
0x00000001 |
0x01 |
0 |
1 |
1 |
0xFFFFFFFF |
#7row-7 | 136 | 0x80000000 |
0x7FFFFFFF |
0x01 |
0 |
1 |
0 |
0x00000001 |
#8row-8 | 152 | 0x7FFFFFFF |
0xFFFFFFFF |
0x01 |
0 |
0 |
1 |
0x80000000 |
#9row-9 | 171 | 0xF0F0F0F0 |
0x0FF00FF0 |
0x02 |
0 |
0 |
0 |
0x00F000F0 |
#10row-10 | 180 | 0xF0F0F0F0 |
0x0FF00FF0 |
0x03 |
0 |
0 |
0 |
0xFFF0FFF0 |
#11row-11 | 198 | 0xF0F0F0F0 |
0x0FF00FF0 |
0x04 |
0 |
0 |
0 |
0xFF00FF00 |
#12row-12 | 218 | 0x00000001 |
0x0000001F |
0x05 |
0 |
0 |
0 |
0x80000000 |
#13row-13 | 237 | 0x00000001 |
0x00000020 |
0x05 |
0 |
0 |
0 |
0x00000001 |
#14row-14 | 259 | 0x80000000 |
0x0000001F |
0x06 |
0 |
0 |
0 |
0x00000001 |
#15row-15 | 276 | 0x80000000 |
0x00000021 |
0x06 |
0 |
0 |
0 |
0x40000000 |
#16row-16 | 296 | 0x80000000 |
0x0000001F |
0x07 |
0 |
0 |
0 |
0xFFFFFFFF |
#17row-17 | 313 | 0x80000000 |
0x00000021 |
0x07 |
0 |
0 |
0 |
0xC0000000 |
#18row-18 | 334 | 0xFFFFFFFF |
0x00000001 |
0x08 |
0 |
1 |
0 |
0x00000001 |
#19row-19 | 350 | 0x80000000 |
0x00000000 |
0x08 |
0 |
1 |
0 |
0x00000001 |
#20row-20 | 368 | 0x7FFFFFFF |
0x80000000 |
0x08 |
0 |
0 |
1 |
0x00000000 |
#21row-21 | 384 | 0xFFFFFFFF |
0x00000001 |
0x09 |
0 |
1 |
0 |
0x00000000 |
#22row-22 | 400 | 0x00000000 |
0xFFFFFFFF |
0x09 |
0 |
0 |
1 |
0x00000001 |
#23row-23 | 416 | 0x7FFFFFFF |
0x80000000 |
0x09 |
0 |
0 |
1 |
0x00000001 |
#24row-24 | 434 | 0x12345678 |
0x9ABCDEF0 |
0x0A |
0 |
0 |
0 |
0x12345678 |
#25row-25 | 444 | 0x12345678 |
0x9ABCDEF0 |
0x0B |
0 |
0 |
0 |
0x9ABCDEF0 |
#26row-26 | 462 | 0x12345678 |
0x9ABCDEF0 |
0x0C |
0 |
0 |
0 |
0x00000000 |
#27row-27 | 466 | 0x12345678 |
0x9ABCDEF0 |
0x0D |
0 |
0 |
0 |
0x00000000 |
#28row-28 | 484 | 0x12345678 |
0x9ABCDEF0 |
0x0E |
0 |
0 |
0 |
0x00000000 |
#29row-29 | 488 | 0x12345678 |
0x9ABCDEF0 |
0x0F |
0 |
0 |
0 |
0x00000000 |
#30row-30 | 506 | 0x12345678 |
0x9ABCDEF0 |
0x10 |
0 |
0 |
0 |
0x00000000 |
#31row-31 | 511 | 0x12345678 |
0x9ABCDEF0 |
0x11 |
0 |
0 |
0 |
0x00000000 |
#32row-32 | 529 | 0x12345678 |
0x9ABCDEF0 |
0x12 |
0 |
0 |
0 |
0x00000000 |
#33row-33 | 534 | 0x12345678 |
0x9ABCDEF0 |
0x13 |
0 |
0 |
0 |
0x00000000 |
#34row-34 | 552 | 0x12345678 |
0x9ABCDEF0 |
0x14 |
0 |
0 |
0 |
0x00000000 |
#35row-35 | 557 | 0x12345678 |
0x9ABCDEF0 |
0x15 |
0 |
0 |
0 |
0x00000000 |
#36row-36 | 575 | 0x12345678 |
0x9ABCDEF0 |
0x16 |
0 |
0 |
0 |
0x00000000 |
#37row-37 | 580 | 0x12345678 |
0x9ABCDEF0 |
0x17 |
0 |
0 |
0 |
0x00000000 |
#38row-38 | 598 | 0x12345678 |
0x9ABCDEF0 |
0x18 |
0 |
0 |
0 |
0x00000000 |
#39row-39 | 603 | 0x12345678 |
0x9ABCDEF0 |
0x19 |
0 |
0 |
0 |
0x00000000 |
#40row-40 | 621 | 0x12345678 |
0x9ABCDEF0 |
0x1A |
0 |
0 |
0 |
0x00000000 |
#41row-41 | 626 | 0x12345678 |
0x9ABCDEF0 |
0x1B |
0 |
0 |
0 |
0x00000000 |
#42row-42 | 644 | 0x12345678 |
0x9ABCDEF0 |
0x1C |
0 |
0 |
0 |
0x00000000 |
#43row-43 | 648 | 0x12345678 |
0x9ABCDEF0 |
0x1D |
0 |
0 |
0 |
0x00000000 |
#44row-44 | 666 | 0x12345678 |
0x9ABCDEF0 |
0x1E |
0 |
0 |
0 |
0x00000000 |
#45row-45 | 670 | 0x12345678 |
0x9ABCDEF0 |
0x1F |
0 |
0 |
0 |
0x00000000 |
Scroll within the table for all rows and pins. Buses use hexadecimal; values containing X/Z use MSB-first binary. Inputs show the declared values in effect at each checkpoint, including retained inputs. Sequential tests also replay preparation changes between checkpoints, such as lowering the clock. Use the matching checkpoint label in the simulation below.
The recorded cases cover every operation at its boundaries and every reserved code.
Embedded simulation¶
Open RV32IALU in the simulator
Tests¶
RV32IALUTest checks all outputs on the structural and compact forms. RV32IALUSweepTest adds an 8 × 8 boundary grid on every operation and 1,024 seeded random vectors over all 32 operation codes, against C++ integer results on both forms. ALUHierarchyTest checks the six named parts and the single shared prefix adder. RV32IBuildingBlocksDocumentationTest compiles the C++ examples on this page and replays them against the recorded binary cases. Sources: RV32IALU.hpp, RV32IALU.cpp.