diff options
author | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-04-13 15:22:41 +0800 |
---|---|---|
committer | Weiwei Li <liweiwei@iscas.ac.cn> | 2022-04-14 09:40:17 +0800 |
commit | 750f008e723bb3b20cec41a47ed5cec549447665 (patch) | |
tree | b2f2bc14c74ea90073803517579465c7c7f368a2 /riscv/processor.h | |
parent | c3c04a8be2c641de2b198b90df6c1538eb204120 (diff) | |
download | spike-750f008e723bb3b20cec41a47ed5cec549447665.zip spike-750f008e723bb3b20cec41a47ed5cec549447665.tar.gz spike-750f008e723bb3b20cec41a47ed5cec549447665.tar.bz2 |
add support for overlap instructions
* add DECLARE_OVERLAP_INSN to bind instructions with extension
* add overlap_list.h to contain the declare of all overlapping instructions
* make func function for overlapping instruction return NULL when the coresponding
extension(s) is not supported.
Diffstat (limited to 'riscv/processor.h')
-rw-r--r-- | riscv/processor.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/processor.h b/riscv/processor.h index 98ff399..8797ab1 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -29,6 +29,7 @@ reg_t illegal_instruction(processor_t* p, insn_t insn, reg_t pc); struct insn_desc_t { + bool supported; insn_bits_t match; insn_bits_t mask; insn_func_t rv32i; @@ -38,6 +39,9 @@ struct insn_desc_t insn_func_t func(int xlen, bool rve) { + if (!supported) + return NULL; + if (rve) return xlen == 64 ? rv64e : rv32e; else @@ -46,7 +50,7 @@ struct insn_desc_t static insn_desc_t illegal() { - return {0, 0, &illegal_instruction, &illegal_instruction, &illegal_instruction, &illegal_instruction}; + return {true, 0, 0, &illegal_instruction, &illegal_instruction, &illegal_instruction, &illegal_instruction}; } }; |