diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2014-11-25 13:39:53 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2014-11-25 14:40:51 -0800 |
commit | 590417bec978bfc3fbf35d303760494395eb65b2 (patch) | |
tree | e264e60f8ad9eba772257c9b2676997cd02b7140 /riscv/extension.h | |
parent | c31742961bdab9094c35ef6c1b33186892aa34d1 (diff) | |
download | spike-590417bec978bfc3fbf35d303760494395eb65b2.zip spike-590417bec978bfc3fbf35d303760494395eb65b2.tar.gz spike-590417bec978bfc3fbf35d303760494395eb65b2.tar.bz2 |
Factor out the dummy RoCC accelerator
Diffstat (limited to 'riscv/extension.h')
-rw-r--r-- | riscv/extension.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/riscv/extension.h b/riscv/extension.h index cce8345..f73a5a8 100644 --- a/riscv/extension.h +++ b/riscv/extension.h @@ -3,8 +3,6 @@ #include "processor.h" #include "disasm.h" -#include <map> -#include <string> #include <vector> #include <functional> @@ -27,11 +25,12 @@ class extension_t void clear_interrupt(); }; -std::map<std::string, std::function<extension_t*()>>& extensions(); +std::function<extension_t*()> find_extension(const char* name); +void register_extension(const char* name, std::function<extension_t*()> f); #define REGISTER_EXTENSION(name, constructor) \ class register_##name { \ - public: register_##name() { extensions()[#name] = constructor; } \ + public: register_##name() { register_extension(#name, constructor); } \ }; static register_##name dummy_##name; #endif |