passes quick test: slt, slti, sltu, sltiu

This commit is contained in:
Brendan Haines 2020-10-16 18:51:51 -06:00
parent 48c8b035bd
commit c98881c5d7
2 changed files with 52 additions and 7 deletions

View File

@ -218,7 +218,7 @@ always @(*) begin
casex ({s_id_funct3, s_id_funct7}) casex ({s_id_funct3, s_id_funct7})
10'b000xxxxxxx: s_id_aluop = ALUOP_ADD; // ADDI 10'b000xxxxxxx: s_id_aluop = ALUOP_ADD; // ADDI
10'b010xxxxxxx: s_id_aluop = ALUOP_SLT; // SLTI 10'b010xxxxxxx: s_id_aluop = ALUOP_SLT; // SLTI
10'b011xxxxxxx: s_id_aluop = ALUOP_SLTU; // SLTUI 10'b011xxxxxxx: s_id_aluop = ALUOP_SLTU; // SLTIU
10'b100xxxxxxx: s_id_aluop = ALUOP_XOR; // XORI 10'b100xxxxxxx: s_id_aluop = ALUOP_XOR; // XORI
10'b110xxxxxxx: s_id_aluop = ALUOP_OR; // ORI 10'b110xxxxxxx: s_id_aluop = ALUOP_OR; // ORI
10'b111xxxxxxx: s_id_aluop = ALUOP_AND; // ANDI 10'b111xxxxxxx: s_id_aluop = ALUOP_AND; // ANDI

View File

@ -8,12 +8,6 @@ _start:
# JAL # JAL
# JALR # JALR
# SLTI
# SLTUI
# SLT
# SLTU
# lui # lui
lui x1, 0xfedcb # x1 = 0xfedcb000 lui x1, 0xfedcb # x1 = 0xfedcb000
nop nop
@ -154,6 +148,57 @@ _start:
nop nop
nop nop
# slti
addi x3, x0, 1 # x3 = 0x00000001
addi x4, x0, 0x010 # x4 = 0x00000010
addi x5, x0, 0x100 # x5 = 0x00000100
nop
sub x6, x0, x3 # x6 = 0xffffffff
sub x7, x0, x4 # x7 = 0xfffffff0
sub x8, x0, x5 # x7 = 0xffffff00
nop
slti x9, x3, 0 # x9 = 0x00000000
slti x10, x3, 1 # x10 = 0x00000000
slti x11, x3, 2 # x11 = 0x00000001
slti x12, x3, -1 # x12 = 0x00000000
slti x13, x7, 0 # x13 = 0x00000001
slti x14, x7, -17 # x14 = 0x00000000
nop
nop
nop
# sltiu
sltiu x15, x3, 0 # x15 = 0x00000000
sltiu x16, x3, 1 # x16 = 0x00000000
sltiu x17, x3, 2 # x17 = 0x00000001
sltiu x18, x3, -1 # x18 = 0x00000001 # -1=0xffffffff
sltiu x19, x7, 0 # x19 = 0x00000000
sltiu x20, x7, -15 # x20 = 0x00000001 # -15=0xfffffff1
nop
nop
nop
# slt
slt x21, x0, x3 # x21 = 0x00000001
slt x22, x3, x0 # x22 = 0x00000000
slt x23, x3, x3 # x23 = 0x00000000
slt x24, x3, x6 # x24 = 0x00000000
slt x25, x6, x3 # x25 = 0x00000001
nop
nop
nop
# sltu
sltu x26, x0, x3 # x26 = 0x00000001
sltu x27, x3, x0 # x27 = 0x00000000
sltu x28, x3, x3 # x28 = 0x00000000
sltu x29, x3, x6 # x29 = 0x00000001
sltu x30, x6, x3 # x30 = 0x00000000
nop
nop
nop
# counter and infinite loop # counter and infinite loop
nop nop
nop nop