print("abc -g AND -fast", file=f)
print("opt_clean", file=f)
print("stat", file=f)
- print("write_aiger -I -B -zinit -map design_aiger.aim design_aiger.aig", file=f)
+ print("write_aiger -I -B -zinit -no-startoffset -map design_aiger.aim design_aiger.aig", file=f)
proc = SbyProc(
self,
raise KeyError(f"Could not find assert at {location} in properties list!")
return prop
- def find_property_by_cellname(self, cell_name):
+ def find_property_by_cellname(self, cell_name, trans_dict=dict()):
+ # backends may need to mangle names irreversibly, so allow applying
+ # the same transformation here
for prop in self:
- if prop.name == cell_name:
+ if cell_name == prop.name.translate(str.maketrans(trans_dict)):
return prop
- raise KeyError(f"No such property: {cell_name}")
+ raise KeyError(f"No such property: {smt2_name}")
def design_hierarchy(filename):
design_json = json.load(filename)
task.induction_procs.append(proc)
proc_status = None
- last_prop = None
+ last_prop = []
def output_callback(line):
nonlocal proc_status
nonlocal last_prop
+ smt2_trans = {'\\':'/', '|':'/'}
match = re.match(r"^## [0-9: ]+ Status: FAILED", line)
if match:
match = re.match(r"^## [0-9: ]+ Assert failed in (\S+): (\S+) \((\S+)\)", line)
if match:
cell_name = match[3]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
- last_prop = prop
+ last_prop.append(prop)
return line
match = re.match(r"^## [0-9: ]+ Reached cover statement at (\S+) \((\S+)\) in step \d+.", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "PASS"
- last_prop = prop
+ last_prop.append(prop)
return line
match = re.match(r"^## [0-9: ]+ Writing trace to VCD file: (\S+)", line)
if match and last_prop:
- last_prop.tracefile = match[1]
- last_prop = None
+ for p in last_prop:
+ p.tracefile = match[1]
+ last_prop = []
return line
match = re.match(r"^## [0-9: ]+ Unreached cover statement at (\S+) \((\S+)\).", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
return line
/junit_*/
/submod_props*/
/multi_assert*/
+/aim_vs_smt2_nonzero_start_offset*/
--- /dev/null
+[options]
+mode bmc
+depth 1
+expect fail
+
+[engines]
+smtbmc
+
+[script]
+read -sv top.sv
+prep -top top
+
+[file top.sv]
+module top(
+input foo,
+input bar
+);
+always @(*) begin
+ assert (foo);
+ assert (bar);
+end
+endmodule
--- /dev/null
+[tasks]
+bmc
+prove
+
+[options]
+bmc: mode bmc
+prove: mode prove
+expect fail
+wait on
+
+[engines]
+bmc: abc bmc3
+bmc: abc sim3
+prove: aiger avy
+prove: aiger suprove
+prove: abc pdr
+
+[script]
+read -sv test.sv
+prep -top test
+
+[file test.sv]
+module test (
+ input clk,
+ input [8:1] nonzero_offset
+);
+ reg [7:0] counter = 0;
+
+ always @(posedge clk) begin
+ if (counter == 3) assert(nonzero_offset[1]);
+ counter <= counter + 1;
+ end
+endmodule
[tasks]
bmc
cover
+flatten
[options]
bmc: mode bmc
cover: mode cover
+flatten: mode bmc
expect fail
[script]
read -sv test.sv
prep -top top
+flatten: flatten
[file test.sv]
module test(input foo);