Skip to content

Commit d3245d0

Browse files
committed
ebmc: --ranking-function now honors --property
The ranking function facility now allows selecting a specific property using the --property command-line option.
1 parent e429921 commit d3245d0

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
counter_with_reset1.sv
3+
--property main.property.p0 --ranking-function 10-counter
4+
^\[main\.property\.p0\] always \(eventually main.counter == 10\): UNKNOWN$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
counter_with_reset1.sv
3+
--property main.property.p1 --ranking-function 10-counter
4+
^\[main\.property\.p1\] always \(eventually main.reset \|\| main.counter == 10\): SUCCESS$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// count up from 0 to 10
2+
3+
module main(input clk, input reset);
4+
5+
reg [3:0] counter;
6+
7+
initial counter = 0;
8+
9+
always @(posedge clk)
10+
if(reset)
11+
counter = 0;
12+
else if(counter != 10)
13+
counter = counter + 1;
14+
15+
// expected to fail, owing to reset
16+
p0: assert property (eventually counter == 10);
17+
18+
// expected to pass
19+
p1: assert property (eventually (reset || counter == 10));
20+
21+
endmodule

src/ebmc/ranking_function.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ int do_ranking_function(
102102
cmdline.get_value("ranking-function"), transition_system, message_handler);
103103

104104
// find the property
105-
auto properties = ebmc_propertiest::from_transition_system(
106-
transition_system, message_handler);
105+
auto properties = ebmc_propertiest::from_command_line(
106+
cmdline, transition_system, message_handler);
107107

108108
auto &property = find_property(properties);
109109

0 commit comments

Comments
 (0)