Test neq
This commit is contained in:
35
05test_neq.asm
Normal file
35
05test_neq.asm
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
addi $s1, $zero, 1
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
bne $s1, $s2, bne_target
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
addi $s3, $zero, 1
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
|
||||||
|
bne_target:
|
||||||
|
addi $s2, $zero, 1
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
bne $s1, $s2, bne_target2
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
addi $s3, $zero, 2
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
|
||||||
|
bne_target2:
|
||||||
|
j bne_target2
|
||||||
7
05test_neq_mars.txt
Normal file
7
05test_neq_mars.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
20110001
|
||||||
|
16320009
|
||||||
|
20130001
|
||||||
|
20120001
|
||||||
|
16320009
|
||||||
|
20130002
|
||||||
|
0810001e
|
||||||
5
create_verilog_from_asm.py
Normal file
5
create_verilog_from_asm.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
file_name = input("File name: ")
|
||||||
|
with open(file_name) as fl:
|
||||||
|
file_content = fl.readlines()
|
||||||
|
for idx, inst in enumerate(file_content):
|
||||||
|
print("20'd%d: instruction <= 32'h%s;" % (idx, inst.strip()))
|
||||||
Reference in New Issue
Block a user