diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-08-13 00:51:07 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-08-13 00:51:07 -0700 |
commit | bbb0f2179c858c77918ef37dbfcd7bb5f3fd0417 (patch) | |
tree | 63bcac40261140f5628d1e12182d658005eae300 /riscv/extension.cc | |
parent | 04c2d491c4bbb424a59273d4ebee62ddfe3379f9 (diff) | |
download | spike-bbb0f2179c858c77918ef37dbfcd7bb5f3fd0417.zip spike-bbb0f2179c858c77918ef37dbfcd7bb5f3fd0417.tar.gz spike-bbb0f2179c858c77918ef37dbfcd7bb5f3fd0417.tar.bz2 |
Implement RoCC and add a dummy RoCC
Enable it with --extension=dummy
Diffstat (limited to 'riscv/extension.cc')
-rw-r--r-- | riscv/extension.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/riscv/extension.cc b/riscv/extension.cc new file mode 100644 index 0000000..718ef6d --- /dev/null +++ b/riscv/extension.cc @@ -0,0 +1,29 @@ +#include "extension.h" +#include "trap.h" +#include "dummy-rocc.h" + +std::map<std::string, std::function<extension_t*()>>& extensions() +{ + static std::map<std::string, std::function<extension_t*()>> v; + return v; +} + +extension_t::~extension_t() +{ +} + +void extension_t::illegal_instruction() +{ + throw trap_illegal_instruction(); +} + +void extension_t::raise_interrupt() +{ + p->set_interrupt(IRQ_COP, true); + p->take_interrupt(); +} + +void extension_t::clear_interrupt() +{ + p->set_interrupt(IRQ_COP, false); +} |