Skip to content

Commit 71e636b

Browse files
authored
Sparta Assert for Target Pipe without Execution Unit (#151)
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.
1 parent bf5ae7e commit 71e636b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/Dispatch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ namespace olympia
239239
<< " not found in dispatchers, make sure pipe is "
240240
"defined and has an assigned dispatcher");
241241
auto & dispatchers = dispatchers_[static_cast<size_t>(target_pipe)];
242+
sparta_assert(dispatchers.size() > 0,
243+
"Pipe Target: "
244+
<< target_pipe
245+
<< " doesn't have any execution unit that can handle that target "
246+
"pipe. Did you define it in the yaml properly?");
242247
// so we have a map here that checks for which valid dispatchers for that
243248
// instruction target pipe map needs to be: "int": [exe0, exe1, exe2]
244249
if (target_pipe != InstArchInfo::TargetPipe::LSU)

0 commit comments

Comments
 (0)