-
Notifications
You must be signed in to change notification settings - Fork 141
Conversation
- separate trap type - stop execution on trap hit
Actually, |
There is no such entity as 'stop reason', Halt is just a one of the trap types.
|
Codecov Report
@@ Coverage Diff @@
## master #601 +/- ##
=========================================
Coverage ? 91.22%
=========================================
Files ? 46
Lines ? 1550
Branches ? 0
=========================================
Hits ? 1414
Misses ? 136
Partials ? 0
Continue to review full report at Codecov.
|
simulator/mips/mips_instr.h
Outdated
@@ -450,7 +446,9 @@ class BaseMIPSInstr | |||
|
|||
bool is_special() const { return operation == OUT_R_SPECIAL; } | |||
|
|||
bool has_trap() const { return trap != TrapType::NO_TRAP; } | |||
bool has_trap() const { return trap != Trap::NO_TRAP; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use functionality of other methods, i.e.
return trap_type() != Trap::NO_TRAP;
simulator/infra/trap_types.h
Outdated
@@ -0,0 +1,21 @@ | |||
/* trap_types.h - Trap types for MIPS and RISC-V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That file should be moved to.... FuncSim directory, I believe.
In my opinion, infra
should contain generic things, unrelated to system and ISA stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's used by mips_instr
and riscv_instr
. If we had a base ISA-independent class for instruction, it would fit well in it. Also, it can be moved to trap implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see now, it should be moved to trap class. At this moment, should it be moved to FuncSim directory, or I can leave it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep "everything related to functional state" in func_sim: RF, system calls, trap handler etc.. Later we'll use better name, I believe.
simulator/func_sim/func_sim.cpp
Outdated
@@ -64,15 +64,19 @@ void FuncSim<ISA>::init( const std::string& tr) | |||
} | |||
|
|||
template <typename ISA> | |||
void FuncSim<ISA>::run( const std::string& tr, uint64 instrs_to_run) | |||
Simulator::RunResult FuncSim<ISA>::run( const std::string& tr, uint64 instrs_to_run) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, it's worth to return FuncInstr here....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this moment, it would be hard to return FuncInstr from PerfSim. I think we may change it later, when traps would be implemented in PerfSim.
Breakpoint, syscall and other traps stops FuncSim execution (as I did it in #557).