@@ -4,27 +4,30 @@ A implementation of a 32-bit single cycle MIPS processor in Verilog. This versio
4
4
5
5
To tun the test bench:
6
6
7
+ ```
7
8
$ iverilog *.v
8
9
$ ./a.out; gtkwave dump.vcd test.gtkw
10
+ ```
9
11
10
12
Each of the memories is a 64-word × 32-bit array. The instruction memory contains some initial values representing a test program.
11
13
12
- ## Test MIPS instructions.
13
-
14
+ ## Test MIPS instructions
15
+ ```
14
16
main: addi $2, $0, 5 # 20020005
15
- addi $7, $0, 3 # 20070003
16
- addi $3, $0, 0xc # 2003000c
17
- or $4, $7, $2 # 00e22025
18
- and $5, $3, $4 # 00642824
19
- add $5, $5, $4 # 00a42820
20
- beq $5, $7, end # 10a70008
21
- slt $6, $3, $4 # 0064302a
22
- beq $6, $0, around # 10c00001
23
- addi $5, $0, 10 # 2005000a
17
+ addi $7, $0, 3 # 20070003
18
+ addi $3, $0, 0xc # 2003000c
19
+ or $4, $7, $2 # 00e22025
20
+ and $5, $3, $4 # 00642824
21
+ add $5, $5, $4 # 00a42820
22
+ beq $5, $7, end # 10a70008
23
+ slt $6, $3, $4 # 0064302a
24
+ beq $6, $0, around # 10c00001
25
+ addi $5, $0, 10 # 2005000a
24
26
around: slt $6, $7, $2 # 00e2302a
25
- add $7, $6, $5 # 00c53820
26
- sub $7, $7, $2 # 00e23822
27
- j end # 0800000f
28
- lw $7, 0($0) # 8c070000
27
+ add $7, $6, $5 # 00c53820
28
+ sub $7, $7, $2 # 00e23822
29
+ j end # 0800000f
30
+ lw $7, 0($0) # 8c070000
29
31
end: sw $7, 71($2) # ac470047
32
+ ```
30
33
0 commit comments