diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-06-26 17:42:00 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-06-26 17:42:00 +0200 |
commit | 1b49380f6bd79cb037fb36a3d06adf386968dc47 (patch) | |
tree | 8e5a5a75ac0157d7c31e6746b3e86f1cfee90a06 | |
parent | f6053b88103bfc652dec1959f30bfb1880613f61 (diff) | |
download | yosys-1b49380f6bd79cb037fb36a3d06adf386968dc47.tar.gz yosys-1b49380f6bd79cb037fb36a3d06adf386968dc47.tar.bz2 yosys-1b49380f6bd79cb037fb36a3d06adf386968dc47.zip |
Improve BTOR2 handling of undriven wires
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r-- | backends/btor/btor.cc | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc index 511a11942..a507b120b 100644 --- a/backends/btor/btor.cc +++ b/backends/btor/btor.cc @@ -17,6 +17,11 @@ * */ +// [[CITE]] Btor2 , BtorMC and Boolector 3.0 +// Aina Niemetz, Mathias Preiner, Clifford Wolf, Armin Biere +// Computer Aided Verification - 30th International Conference, CAV 2018 +// https://cs.stanford.edu/people/niemetz/publication/2018/niemetzpreinerwolfbiere-cav18/ + #include "kernel/rtlil.h" #include "kernel/register.h" #include "kernel/sigtools.h" @@ -875,9 +880,28 @@ struct BtorWorker else { if (bit_cell.count(bit) == 0) - log_error("No driver for signal bit %s.\n", log_signal(bit)); - export_cell(bit_cell.at(bit)); - log_assert(bit_nid.count(bit)); + { + SigSpec s = bit; + + while (i+GetSize(s) < GetSize(sig) && sig[i+GetSize(s)].wire != nullptr && + bit_cell.count(sig[i+GetSize(s)]) == 0) + s.append(sig[i+GetSize(s)]); + + log_warning("No driver for signal %s.\n", log_signal(s)); + + int sid = get_bv_sid(GetSize(s)); + int nid = next_nid++; + btorf("%d input %d %s\n", nid, sid); + nid_width[nid] = GetSize(s); + + i += GetSize(s)-1; + continue; + } + else + { + export_cell(bit_cell.at(bit)); + log_assert(bit_nid.count(bit)); + } } } |