WRITE_RD, formerly a macro, now replaced with a function.
also required a redirector function rd
bool zeroingtarg = false;
#endif
sv_insn_t insn(p, bits, floatintmap, PRED_ARGS, OFFS_ARGS);
+ p->s.insn = insn;
#ifdef INSN_TYPE_BRANCH
sv_pred_entry *r = insn.get_predentry(s_insn.rs2(), true);
reg_t _target_reg = 0;
: debug(false), halt_request(false), sim(sim), ext(NULL), id(id),
halt_on_reset(halt_on_reset), last_pc(1), executions(1)
#ifdef SPIKE_SIMPLEV
- , s()
+ , s(this)
#endif
{
parse_isa_string(isa);
#include "sv.h"
#include "sv_decode.h"
+#include "processor.h"
sv_pred_entry* sv_insn_t::get_predentry(uint64_t reg, bool intreg)
{
#include "sv.h"
#include "decode.h"
-#include "processor.h"
+//#include "processor.h"
#define REG_RD 0x1
#define REG_RS1 0x2
#define REG_RVC_RS2S 0x80
+class processor_t;
+
class sv_insn_t: public insn_t
{
public:
#include "sv_insn_redirect.h"
+#include "processor.h"
-/*
-void (WRITE_RD)(reg_t value)
+void (sv_proc_t::WRITE_RD)(reg_t value)
{
WRITE_RD( value );
}
-*/
#define SV_INSN_REDIRECT_H
#include "decode.h"
-
-//extern void (WRITE_RD)(reg_t value);
+#include "sv_decode.h"
class processor_t;
+class insn_t;
class sv_proc_t
{
public:
- sv_proc_t() {}
+ sv_proc_t(processor_t *_p) : p(_p) {}
+ void (WRITE_RD)(reg_t value);
+
+ processor_t *p;
+
+ class {
+ public:
+ sv_insn_t *_insn;
+ sv_insn_t & operator = (sv_insn_t &i)
+ { _insn = &i; return i; }
+ operator sv_insn_t () const { return *_insn; }
+ uint64_t rd() { return _insn->rd(); }
+ } insn;
+
#include "sv_insn_decl.h"
};