mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 01:32:49 -04:00
Update examples/exercises/8p6/8p6.S
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
11ff08d0ac
commit
0a4e70339a
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ trap_handler:
|
||||||
|
|
||||||
# check if instruction is mul (op = 0110011, funct3 = 000, funct7 = 0000001)
|
# check if instruction is mul (op = 0110011, funct3 = 000, funct7 = 0000001)
|
||||||
csrr t0, mtval # fetch instruction that caused trap
|
csrr t0, mtval # fetch instruction that caused trap
|
||||||
andi t1, t0, 127 # get op field (instr[7:0])
|
andi t1, t0, 127 # get op field (instr[6:0])
|
||||||
xori t1, t1, 0b0110011 # set to 0 if op is 0110011
|
xori t1, t1, 0b0110011 # set to 0 if op is 0110011
|
||||||
srli t2, t0, 12 # get funct3 field (instr[14:12])
|
srli t2, t0, 12 # get funct3 field (instr[14:12])
|
||||||
andi t2, t2, 7 # mask off other bits. Should be 0 if funct3 = 000
|
andi t2, t2, 7 # mask off other bits. Should be 0 if funct3 = 000
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue