diff options
| author | cheapie <cheapiephp@gmail.com> | 2026-06-22 17:23:11 -0500 |
|---|---|---|
| committer | cheapie <cheapiephp@gmail.com> | 2026-06-22 17:23:11 -0500 |
| commit | 41a6282fb32a3a7dbeca64191ddd804585bca5f4 (patch) | |
| tree | ba733109241dd56c2e71064bd284a7eb69727539 | |
| parent | 69a7cb520189e910ba85123275d025704beee4e6 (diff) | |
| download | rvcontroller-41a6282fb32a3a7dbeca64191ddd804585bca5f4.tar rvcontroller-41a6282fb32a3a7dbeca64191ddd804585bca5f4.tar.gz rvcontroller-41a6282fb32a3a7dbeca64191ddd804585bca5f4.tar.bz2 rvcontroller-41a6282fb32a3a7dbeca64191ddd804585bca5f4.tar.xz rvcontroller-41a6282fb32a3a7dbeca64191ddd804585bca5f4.zip | |
Make custom extensions mutable
| -rw-r--r-- | rvcontroller.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rvcontroller.lua b/rvcontroller.lua index 6130659..56b800b 100644 --- a/rvcontroller.lua +++ b/rvcontroller.lua @@ -655,7 +655,8 @@ local function writecsr(address,data) mem.isa.c = bits[2] mem.isa.i = bits[8] mem.isa.m = bits[12] - local newbits = {[0] = mem.isa.a,mem.isa.b,mem.isa.c,[4] = not mem.isa.i,[8] = mem.isa.i,[12] = mem.isa.m,[30] = true} + mem.isa.x = bits[23] + local newbits = {[0] = mem.isa.a,mem.isa.b,mem.isa.c,[4] = not mem.isa.i,[8] = mem.isa.i,[12] = mem.isa.m,[23] = mem.isa.x,[30] = true} mem.csr[0x301] = implodebits(newbits,32) return elseif address == 0x801 then @@ -2418,7 +2419,7 @@ local function runinst(instruction) --pause return false,true end - elseif opcode == 0x0b then + elseif opcode == 0x0b and mem.isa.x then --Custom0 instruction (currently all R-type) local f3 = implodebits({[0] = bits[12],bits[13],bits[14]},3) local xh3bextmsize = implodebits({[0] = bits[26],bits[27],bits[28]},3)+1 @@ -2893,7 +2894,7 @@ if event.type == "program" or event.iid == "reset" then [0xf13] = 0x6f435652, --mimpid ("RVCo") [0xf14] = 0, --mhartid [0x300] = 0, --mstatus - [0x301] = 0x40001107, --misa (RV32IMACB) + [0x301] = 0x40801107, --misa (RV32IMACBX) [0x304] = 0, --mie [0x305] = 0, --mtvec [0x340] = 0, --mscratch @@ -2927,6 +2928,7 @@ if event.type == "program" or event.iid == "reset" then c = true, i = true, m = true, + x = true, } mem.meseconsdir = {} mem.meseconsdata = {} |
