File tree Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,8 @@ void processor_t::step(size_t n)
247
247
{
248
248
take_pending_interrupt ();
249
249
250
+ check_if_lpad_required ();
251
+
250
252
if (unlikely (slow_path ()))
251
253
{
252
254
// Main simulation loop, slow path.
@@ -280,7 +282,6 @@ void processor_t::step(size_t n)
280
282
281
283
in_wfi = false ;
282
284
insn_fetch_t fetch = mmu->load_insn (pc);
283
- execute_insn_prehook (fetch.insn );
284
285
if (debug && !state.serialized )
285
286
disasm (fetch.insn );
286
287
pc = execute_insn_logged (this , pc, fetch);
@@ -292,7 +293,6 @@ void processor_t::step(size_t n)
292
293
// Main simulation loop, fast path.
293
294
for (auto ic_entry = _mmu->access_icache (pc); ; ) {
294
295
auto fetch = ic_entry->data ;
295
- execute_insn_prehook (fetch.insn );
296
296
pc = execute_insn_fast (this , pc, fetch);
297
297
ic_entry = ic_entry->next ;
298
298
if (unlikely (ic_entry->tag != pc))
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ WRITE_REG(X_RA, tmp);
6
6
7
7
if (ZICFILP_xLPE (STATE .v , STATE .prv )) {
8
8
STATE .elp = ZICFILP_IS_LP_EXPECTED (insn .rvc_rs1 ());
9
+ serialize ();
9
10
}
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ set_pc(RVC_RS1 & ~reg_t(1));
4
4
5
5
if (ZICFILP_xLPE (STATE .v , STATE .prv )) {
6
6
STATE .elp = ZICFILP_IS_LP_EXPECTED (insn .rvc_rs1 ());
7
+ serialize ();
7
8
}
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ WRITE_RD(tmp);
4
4
5
5
if (ZICFILP_xLPE (STATE .v , STATE .prv )) {
6
6
STATE .elp = ZICFILP_IS_LP_EXPECTED (insn .rs1 ());
7
+ serialize ();
7
8
}
Original file line number Diff line number Diff line change @@ -94,14 +94,6 @@ processor_t::~processor_t()
94
94
delete disassembler;
95
95
}
96
96
97
- static void zicfilp_check_if_lpad_required (const elp_t elp, insn_t insn)
98
- {
99
- if (unlikely (elp == elp_t ::LP_EXPECTED)) {
100
- // also see riscv/lpad.h for more checks performed
101
- software_check ((insn.bits () & MASK_LPAD) == MATCH_LPAD, LANDING_PAD_FAULT);
102
- }
103
- }
104
-
105
97
static void bad_option_string (const char *option, const char *value,
106
98
const char *msg)
107
99
{
@@ -991,10 +983,12 @@ const char* processor_t::get_symbol(uint64_t addr)
991
983
return sim->get_symbol (addr);
992
984
}
993
985
994
- void processor_t::execute_insn_prehook ( insn_t insn )
986
+ void processor_t::check_if_lpad_required ( )
995
987
{
996
- if (extension_enabled (EXT_ZICFILP)) {
997
- zicfilp_check_if_lpad_required (state.elp , insn);
988
+ if (unlikely (state.elp == elp_t ::LP_EXPECTED)) {
989
+ // also see insns/lpad.h for more checks performed
990
+ insn_fetch_t fetch = mmu->load_insn (state.pc );
991
+ software_check ((fetch.insn .bits () & MASK_LPAD) == MATCH_LPAD, LANDING_PAD_FAULT);
998
992
}
999
993
}
1000
994
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ class processor_t : public abstract_device_t
319
319
void clear_waiting_for_interrupt () { in_wfi = false ; };
320
320
bool is_waiting_for_interrupt () { return in_wfi; };
321
321
322
- void execute_insn_prehook ( insn_t insn );
322
+ void check_if_lpad_required ( );
323
323
324
324
private:
325
325
const isa_parser_t * const isa;
You can’t perform that action at this time.
0 commit comments