Skip to content

Commit bc8eb24

Browse files
authored
Merge pull request #11 from xiaohan484/master
Support RISC-V Compressed Instructions
2 parents 90879d5 + 807aa73 commit bc8eb24

File tree

5 files changed

+723
-59
lines changed

5 files changed

+723
-59
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CFLAGS += -D ENABLE_Zicsr
1616
CFLAGS += -D ENABLE_Zifencei
1717
CFLAGS += -D ENABLE_RV32A
1818
CFLAGS += -D DEFAULT_STACK_ADDR=0xFFFFF000
19+
CFLAGS += -D ENABLE_RV32C
1920

2021
# Experimental SDL oriented system calls
2122
CFLAGS += -D ENABLE_SDL

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RISC-V RV32I[MA] emulator with ELF support
1+
# RISC-V RV32I[MAC] emulator with ELF support
22

33
`rv32emu` is an instruction set architecture (ISA) emulator implementing the 32 bit RISC-V processor model.
44

@@ -35,6 +35,7 @@ should appear when Doom is loaded and executed.
3535
`rv32emu` is configurable, and you can modify `Makefile` to fit your expectations:
3636
* `ENABLE_RV32M`: Standard Extension for Integer Multiplication and Division
3737
* `ENABLE_RV32A`: Standard Extension for Atomic Instructions
38+
* `ENABLE_RV32C`: Standard Extension for Compressed Instructions (RV32C.F excluded)
3839
* `Zicsr`: Control and Status Register (CSR)
3940
* `Zifencei`: Instruction-Fetch Fence
4041

io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ uint32_t memory_read_str(memory_t *m, uint8_t *dst, uint32_t addr, uint32_t max)
7070
uint32_t memory_read_ifetch(memory_t *m, uint32_t addr)
7171
{
7272
const uint32_t addr_lo = addr & mask_lo;
73-
assert((addr_lo & 3) == 0);
73+
assert((addr_lo & 1) == 0);
7474

7575
chunk_t *c = m->chunks[addr >> 16];
7676
assert(c);

0 commit comments

Comments
 (0)