Skip to content

Commit

Permalink
Sparta Assert for Target Pipe without Execution Unit (#151)
Browse files Browse the repository at this point in the history
Forgot to add an assert to check that there is a dispatcher (thus a
subsequent issue queue/execution unit) that can handle a target pipe of
an instruction. If one forgets to define one, i.e you forget to define
an execution unit to handle `DIV` target pipe, the simulator will end
early, but no error will be thrown.
  • Loading branch information
aarongchan authored Feb 12, 2024
1 parent bf5ae7e commit 71e636b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/Dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ namespace olympia
<< " not found in dispatchers, make sure pipe is "
"defined and has an assigned dispatcher");
auto & dispatchers = dispatchers_[static_cast<size_t>(target_pipe)];
sparta_assert(dispatchers.size() > 0,
"Pipe Target: "
<< target_pipe
<< " doesn't have any execution unit that can handle that target "
"pipe. Did you define it in the yaml properly?");
// so we have a map here that checks for which valid dispatchers for that
// instruction target pipe map needs to be: "int": [exe0, exe1, exe2]
if (target_pipe != InstArchInfo::TargetPipe::LSU)
Expand Down

0 comments on commit 71e636b

Please sign in to comment.