1 #ifndef _RISCV_COPROCESSOR_H
2 #define _RISCV_COPROCESSOR_H
13 virtual std::vector
<insn_desc_t
> get_instructions() = 0;
14 virtual const char* name() = 0;
15 virtual ~extension_t();
17 void set_processor(processor_t
* _p
) { p
= _p
; }
21 void illegal_instruction();
22 void raise_interrupt();
23 void clear_interrupt();
26 std::map
<std::string
, std::function
<extension_t
*()>>& extensions();
28 #define REGISTER_EXTENSION(name, constructor) \
29 class register_##name { \
30 public: register_##name() { extensions()[#name] = constructor; } \
31 }; static register_##name dummy_##name;