1 // See LICENSE for license details.
3 #ifndef _RISCV_COPROCESSOR_H
4 #define _RISCV_COPROCESSOR_H
14 virtual std::vector
<insn_desc_t
> get_instructions() = 0;
15 virtual std::vector
<disasm_insn_t
*> get_disasms() = 0;
16 virtual const char* name() = 0;
17 virtual void reset() {};
18 virtual void set_debug(bool value
) {};
19 virtual ~extension_t();
21 void set_processor(processor_t
* _p
) { p
= _p
; }
25 void illegal_instruction();
26 void raise_interrupt();
27 void clear_interrupt();
30 std::function
<extension_t
*()> find_extension(const char* name
);
31 void register_extension(const char* name
, std::function
<extension_t
*()> f
);
33 #define REGISTER_EXTENSION(name, constructor) \
34 class register_##name { \
35 public: register_##name() { register_extension(#name, constructor); } \
36 }; static register_##name dummy_##name;