mirror of https://github.com/YosysHQ/yosys.git
Compare commits
6 Commits
520f8c244f
...
da47bda9af
Author | SHA1 | Date |
---|---|---|
KrystalDelusion | da47bda9af | |
Miodrag Milanović | 29e8812bab | |
Miodrag Milanović | 9512ec4bbc | |
Miodrag Milanovic | d6bd521487 | |
Miodrag Milanovic | df391f5816 | |
Krystine Sherwin | 884f40df11 |
|
@ -97,6 +97,8 @@ struct BtorWorker
|
|||
vector<ywmap_btor_sig> ywmap_states;
|
||||
dict<SigBit, int> ywmap_clock_bits;
|
||||
dict<SigBit, int> ywmap_clock_inputs;
|
||||
vector<Cell *> ywmap_asserts;
|
||||
vector<Cell *> ywmap_assumes;
|
||||
|
||||
|
||||
PrettyJson ywmap_json;
|
||||
|
@ -1281,6 +1283,8 @@ struct BtorWorker
|
|||
btorf("%d or %d %d %d\n", nid_a_or_not_en, sid, nid_a, nid_not_en);
|
||||
btorf("%d constraint %d\n", nid, nid_a_or_not_en);
|
||||
|
||||
if (ywmap_json.active()) ywmap_assumes.emplace_back(cell);
|
||||
|
||||
btorf_pop(log_id(cell));
|
||||
}
|
||||
|
||||
|
@ -1305,6 +1309,8 @@ struct BtorWorker
|
|||
} else {
|
||||
int nid = next_nid++;
|
||||
btorf("%d bad %d%s\n", nid, nid_en_and_not_a, getinfo(cell, true).c_str());
|
||||
|
||||
if (ywmap_json.active()) ywmap_asserts.emplace_back(cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1462,6 +1468,7 @@ struct BtorWorker
|
|||
log_assert(cursor == 0);
|
||||
log_assert(GetSize(todo) == 1);
|
||||
btorf("%d bad %d\n", nid, todo[cursor]);
|
||||
// What do we do with ywmap_asserts when using single_bad?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1527,6 +1534,18 @@ struct BtorWorker
|
|||
emit_ywmap_btor_sig(entry);
|
||||
ywmap_json.end_array();
|
||||
|
||||
ywmap_json.name("asserts");
|
||||
ywmap_json.begin_array();
|
||||
for (Cell *cell : ywmap_asserts)
|
||||
ywmap_json.value(witness_path(cell));
|
||||
ywmap_json.end_array();
|
||||
|
||||
ywmap_json.name("assumes");
|
||||
ywmap_json.begin_array();
|
||||
for (Cell *cell : ywmap_assumes)
|
||||
ywmap_json.value(witness_path(cell));
|
||||
ywmap_json.end_array();
|
||||
|
||||
ywmap_json.end_object();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2126,12 +2126,6 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
|
|||
log(" assert condition %s.\n", log_signal(cond));
|
||||
|
||||
Cell *cell = module->addAssert(new_verific_id(inst), cond, State::S1);
|
||||
// Initialize FF feeding condition to 1, in case it is not
|
||||
// used by rest of design logic, to prevent failing on
|
||||
// initial uninitialized state
|
||||
if (cond.is_wire() && !cond.wire->name.isPublic())
|
||||
cond.wire->attributes[ID::init] = Const(1,1);
|
||||
|
||||
import_attributes(cell->attributes, inst);
|
||||
continue;
|
||||
}
|
||||
|
@ -3428,6 +3422,7 @@ struct VerificPass : public Pass {
|
|||
RuntimeFlags::SetVar("veri_preserve_assignments", 1);
|
||||
RuntimeFlags::SetVar("veri_preserve_comments", 1);
|
||||
RuntimeFlags::SetVar("veri_preserve_drivers", 1);
|
||||
RuntimeFlags::SetVar("veri_create_empty_box", 1);
|
||||
|
||||
// Workaround for VIPER #13851
|
||||
RuntimeFlags::SetVar("veri_create_name_for_unnamed_gen_block", 1);
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
verific -sv -lib <<EOF
|
||||
module TEST_CELL(input clk, input a, input b, output reg c);
|
||||
parameter PATH = "DEFAULT";
|
||||
always @(posedge clk) begin
|
||||
if (PATH=="DEFAULT")
|
||||
c <= a;
|
||||
else
|
||||
c <= b;
|
||||
end
|
||||
|
||||
endmodule
|
||||
EOF
|
||||
|
||||
verific -sv <<EOF
|
||||
module top(input clk, input a, input b, output c, output d);
|
||||
TEST_CELL #(.PATH("TEST")) test1(.clk(clk),.a(a),.b(1'b1),.c(c));
|
||||
TEST_CELL #(.PATH("DEFAULT")) test2(.clk(clk),.a(a),.b(1'bx),.c(d));
|
||||
endmodule
|
||||
EOF
|
||||
|
||||
verific -import top
|
||||
hierarchy -top top
|
||||
stat
|
||||
select -assert-count 2 t:TEST_CELL
|
Loading…
Reference in New Issue