Skip to content

Commit

Permalink
Add "no output verified" error for Block IR sim;
Browse files Browse the repository at this point in the history
already present for Proc IR sim.

PiperOrigin-RevId: 700763961
  • Loading branch information
Sean Purser-Haskell authored and copybara-github committed Nov 27, 2024
1 parent 1f104be commit 8b7f8f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xls/tools/eval_proc_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ static absl::Status RunBlock(

int64_t last_output_cycle = 0;
int64_t matched_outputs = 0;
bool checked_any_output = false;
absl::Time start_time = absl::Now();
if (signature.reset().name().empty()) {
LOG(WARNING) << "No reset found in signature!";
Expand Down Expand Up @@ -947,6 +948,7 @@ static absl::Status RunBlock(
name, outputs.at(info.channel_data).ToString()));
continue;
}
checked_any_output = true;
if (info.width != 0) {
const Value& data_value = outputs.at(info.channel_data);
const Value& match_value = queue.front();
Expand Down Expand Up @@ -1061,7 +1063,9 @@ static absl::Status RunBlock(
"expected outputs were produced. Remaining inputs:\n"
<< ChannelValuesToString(unconsumed_inputs);
}

if (!checked_any_output) {
return absl::UnknownError("No output verified (empty expected values?)");
}
if (!output_stats_path.empty()) {
XLS_RETURN_IF_ERROR(xls::SetFileContents(
output_stats_path, absl::StrFormat("%i", last_output_cycle)));
Expand Down

0 comments on commit 8b7f8f9

Please sign in to comment.