aboutsummaryrefslogtreecommitdiffstats
path: root/backends/btor
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-12-10 08:11:08 +0100
committerClifford Wolf <clifford@clifford.at>2017-12-10 08:11:08 +0100
commit133a0f497865c76e3e9c42ced93eb7f5d349ade6 (patch)
tree6297a8c6d61200ded718ef86721aeb5ad266a190 /backends/btor
parent83cf7363096ba1454c2f7cc810df808a96794d82 (diff)
downloadyosys-133a0f497865c76e3e9c42ced93eb7f5d349ade6.tar.gz
yosys-133a0f497865c76e3e9c42ced93eb7f5d349ade6.tar.bz2
yosys-133a0f497865c76e3e9c42ced93eb7f5d349ade6.zip
Add support for $pmux in btor back-end
Diffstat (limited to 'backends/btor')
-rw-r--r--backends/btor/btor.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc
index 768ff0292..6e8da4707 100644
--- a/backends/btor/btor.cc
+++ b/backends/btor/btor.cc
@@ -417,6 +417,29 @@ struct BtorWorker
goto okay;
}
+ if (cell->type == "$pmux")
+ {
+ SigSpec sig_a = sigmap(cell->getPort("\\A"));
+ SigSpec sig_b = sigmap(cell->getPort("\\B"));
+ SigSpec sig_s = sigmap(cell->getPort("\\S"));
+ SigSpec sig_y = sigmap(cell->getPort("\\Y"));
+
+ int width = GetSize(sig_a);
+ int sid = get_bv_sid(width);
+ int nid = get_sig_nid(sig_a);
+
+ for (int i = 0; i < GetSize(sig_s); i++) {
+ int nid_b = get_sig_nid(sig_b.extract(i*width, width));
+ int nid_s = get_sig_nid(sig_s.extract(i));
+ int nid2 = next_nid++;
+ btorf("%d ite %d %d %d %d\n", nid2, sid, nid_s, nid_b, nid);
+ nid = nid2;
+ }
+
+ add_nid_sig(nid, sig_y);
+ goto okay;
+ }
+
if (cell->type.in("$dff", "$ff", "$_DFF_P_", "$_DFF_N", "$_FF_"))
{
SigSpec sig_d = sigmap(cell->getPort("\\D"));