Skip to content

ebmc: random traces with waveform output #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions regression/ebmc/random-traces/counter_with_initial_value.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CORE broken-smt-backend
counter_with_initial_value.v
--random-traces --trace-steps 10 --waveform --number-of-traces 2
^\*\*\* Trace 1$
^ 0 1 2 3 4 5 6 7 8 9 10$
^ main.clk $
^ main\.input1 111 228 22 122 182 95 94 154 131 26 95$
^main\.some_reg 111 110 109 108 107 106 105 104 103 102 101$
^\*\*\* Trace 2$
^ 0 1 2 3 4 5 6 7 8 9 10$
^ main\.clk $
^ main\.input1 178 105 26 10 251 217 12 188 93 44 170$
^main\.some_reg 178 177 176 175 174 173 172 171 170 169 168$
^EXIT=0$
^SIGNAL=0$
--
11 changes: 11 additions & 0 deletions regression/ebmc/random-traces/counter_with_initial_value.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module main(input [7:0] input1);

wire clk;
reg [7:0] some_reg;
initial some_reg = input1;

always @(posedge clk)
if(some_reg != 0)
some_reg = some_reg - 1;

endmodule
9 changes: 8 additions & 1 deletion src/ebmc/random_traces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,15 @@ int random_traces(const cmdlinet &cmdline, message_handlert &message_handler)
transition_systemt transition_system =
get_transition_system(cmdline, message_handler);

if(cmdline.isset("waveform") && cmdline.isset("vcd"))
throw ebmc_errort() << "cannot do VCD and ASCII waveform simultaneously";

auto output = cmdline.isset("waveform") ? random_tracest::WAVEFORM
: cmdline.isset("vcd") ? random_tracest::VCD
: random_tracest::TRACE;

random_tracest(transition_system, message_handler)(
outfile_prefix.has_value() ? random_tracest::VCD : random_tracest::TRACE,
output,
outfile_prefix,
random_seed,
number_of_traces,
Expand Down