1 #ifndef _RISCV_COPROCESSOR_H
2 #define _RISCV_COPROCESSOR_H
12 virtual std::vector
<insn_desc_t
> get_instructions() = 0;
13 virtual std::vector
<disasm_insn_t
*> get_disasms() = 0;
14 virtual const char* name() = 0;
15 virtual void reset() {};
16 virtual void set_debug(bool value
) {};
17 virtual ~extension_t();
19 void set_processor(processor_t
* _p
) { p
= _p
; }
23 void illegal_instruction();
24 void raise_interrupt();
25 void clear_interrupt();
28 std::function
<extension_t
*()> find_extension(const char* name
);
29 void register_extension(const char* name
, std::function
<extension_t
*()> f
);
31 #define REGISTER_EXTENSION(name, constructor) \
32 class register_##name { \
33 public: register_##name() { register_extension(#name, constructor); } \
34 }; static register_##name dummy_##name;