Skip to content

Commit 2179210

Browse files
authored
Add diagrams
1 parent 8ddd0da commit 2179210

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

docs/info.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,51 @@ A cocoTB testbench is used to run tests in Python. Each test uses the following
147147
- alu_1bit.v
148148
- **Features:** Full FSM flow; end-to-end bit-serial execution; regfile store/load; instruction-decode logic
149149

150-
#### alu_ops.py
150+
**Example**:
151+
- Operation: `LOADI 0x2D`
152+
- Expected result: `0x2D`
153+
<img width="1217" height="869" alt="image" src="https://github.com/user-attachments/assets/685b6ed6-9bf2-432a-b280-d606e5539934" />
154+
155+
156+
#### alu_ops.py
151157
- **Instructions:** ADD, SUB, AND, OR, XOR, LOADI, STORE
152158
- **Strategy:** Loads fixed values into registers; runs R-type ALU instructions; checks accumulator result.
153159
- **Modules:** fsm_control.v, cpu_core.v, regfile_serial.v, accumulator.v, alu_1bit.v
154-
- **Features:** Bit-serial ALU correctness; regfile serial access; R-type decode; accumulator correctness
160+
- **Features:** Bit-serial ALU correctness; regfile serial access; R-type decode; accumulator correctness
161+
162+
**Example**:
163+
- Setup: `R3` contains `0x73`, `R4` contains `0x2D`
164+
- Operation: `XOR R3, R4`
165+
- Expected result: `0x5E`
166+
<img width="1684" height="856" alt="image" src="https://github.com/user-attachments/assets/41db3e04-fcba-4719-9a9c-b11cd0cde3a1" />
167+
155168

156-
#### imm_alu_ops.py
169+
#### imm_alu_ops.py
157170
- **Instructions:** ADDI, SUBI, ANDI, ORI, XORI, LOADI, STORE
158171
- **Strategy:** Sets known register values; executes I-type ops with immediates; checks accumulator output.
159172
- **Modules:** fsm_control.v, cpu_core.v, regfile_serial.v, accumulator.v, alu_1bit.v
160173
- **Features:** Immediate-decode logic; bit-serial ALU with immediate operand; regfile serial access; accumulator correctness
161174

175+
**Example**:
176+
- Setup: `R3` contains `0x73`
177+
- Operation: `SUBI R3, 0x2C`
178+
- Expected result: `0x47`
179+
<img width="1684" height="901" alt="image" src="https://github.com/user-attachments/assets/f4138d6a-19f4-46eb-b4e2-71315d5c8499" />
180+
181+
162182
#### shift_ops.py
163183
- **Instructions:** SLLI, SRLI, LOADI, STORE
164184
- **Strategy:** Loads values into registers; shifts left/right by various immediates; checks accumulator.
165185
- **Modules:** fsm_control.v, cpu_core.v, regfile_serial.v, accumulator.v
166186
- **Features:** Shift-index calculation; bit-serial offset-shifting; regfile serial access; accumulator correctness
167187

188+
**Example**:
189+
- Setup: `R6` contains `0x12`
190+
- Operation: `SLLI R6, 0x02`
191+
- Expected result: `0x48`
192+
<img width="1717" height="888" alt="image" src="https://github.com/user-attachments/assets/9b64fd95-4092-4d5a-bcf6-ff4758816b37" />
193+
194+
168195

169196
### Test Results
170197

0 commit comments

Comments
 (0)