Skip to content

Commit

Permalink
Merge pull request #4627 from RCoeurjoly/roland/assume_x
Browse files Browse the repository at this point in the history
  • Loading branch information
nakengelhardt authored Nov 6, 2024
2 parents 2de24dc + 5ea2c6e commit 9068ec5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/fstdata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ void FstData::reconstructAllAtTimes(std::vector<fstHandle> &signal, uint64_t sta

std::string FstData::valueOf(fstHandle signal)
{
if (past_data.find(signal) == past_data.end())
log_error("Signal id %d not found\n", (int)signal);
if (past_data.find(signal) == past_data.end()) {
return std::string(handle_to_var[signal].width, 'x');
}
return past_data[signal];
}
2 changes: 2 additions & 0 deletions tests/sim/assume_x_first_step.ys
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
read_verilog simple_assign.v
sim -r simple_assign.vcd -scope simple_assign
8 changes: 8 additions & 0 deletions tests/sim/simple_assign.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module simple_assign (
input wire in,
output wire out
);

assign out = in;

endmodule
13 changes: 13 additions & 0 deletions tests/sim/simple_assign.vcd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$version Yosys $end
$scope module simple_assign $end
$var wire 1 n2 in $end
$var wire 1 n1 out $end
$upscope $end
$enddefinitions $end
#0
#5
b1 n1
b1 n2
#10
b0 n1
b0 n2

0 comments on commit 9068ec5

Please sign in to comment.