aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-09-06 09:59:35 -0700
committerEddie Hung <eddie@fpgeh.com>2019-09-06 09:59:35 -0700
commit91f68c4de2c1c9823e5c6a6257ded09144dfcbd6 (patch)
tree44f6256f5a04bdde20b3e070596ed08be2eaffe9 /passes
parent4fe24b20f9c42e81bf0539c4b3bde9c4a471c5ea (diff)
downloadyosys-91f68c4de2c1c9823e5c6a6257ded09144dfcbd6.tar.gz
yosys-91f68c4de2c1c9823e5c6a6257ded09144dfcbd6.tar.bz2
yosys-91f68c4de2c1c9823e5c6a6257ded09144dfcbd6.zip
Check nusers for M and P enable muxes
Diffstat (limited to 'passes')
-rw-r--r--passes/pmgen/xilinx_dsp.pmg19
1 files changed, 17 insertions, 2 deletions
diff --git a/passes/pmgen/xilinx_dsp.pmg b/passes/pmgen/xilinx_dsp.pmg
index 15343e21e..8f83a2a50 100644
--- a/passes/pmgen/xilinx_dsp.pmg
+++ b/passes/pmgen/xilinx_dsp.pmg
@@ -134,10 +134,17 @@ endmatch
match ffMmux
select ffMmux->type.in($mux)
+ choice <IdString> BA {\B, \A}
+ // new-value net must have exactly two users: dsp and ffM
+ select nusers(port(ffMmux, BA)) == 2
+ define <IdString> AB (BA == \B ? \A : \B)
+ // keep-last-value net must have at least three users: ffMmux, ffM, downstream sink(s)
+ select nusers(port(ffMmux, AB)) >= 3
+ // ffMmux output must have two users: ffMmux and ffM.D
select nusers(port(ffMmux, \Y)) == 2
filter GetSize(port(ffMmux, \Y)) <= GetSize(sigM)
- choice <IdString> BA {\B, \A}
filter port(ffMmux, BA) == sigM.extract(0, GetSize(port(ffMmux, \Y)))
+ // Remaining bits on sigM must not have any other users
filter nusers(sigM.extract_end(GetSize(port(ffMmux, BA)))) <= 1
define <bool> pol (BA == \B)
set ffMenpol pol
@@ -157,6 +164,7 @@ match ffM
select nusers(port(ffM, \D)) == 2
filter GetSize(port(ffM, \D)) <= GetSize(sigM)
filter port(ffM, \D) == sigM.extract(0, GetSize(port(ffM, \D)))
+ // Remaining bits on sigM must not have any other users
filter nusers(sigM.extract_end(GetSize(port(ffM, \D)))) <= 1
// Check ffMmux (when present) is a $dff enable mux
filter !ffMmux || port(ffM, \Q) == port(ffMmux, ffMenpol ? \A : \B)
@@ -221,10 +229,17 @@ endcode
match ffPmux
select ffPmux->type.in($mux)
+ choice <IdString> BA {\B, \A}
+ // new-value net must have exactly two users: dsp and ffP
+ select nusers(port(ffPmux, BA)) == 2
+ define <IdString> AB (BA == \B ? \A : \B)
+ // keep-last-value net must have at least three users: ffPmux, ffP, downstream sink(s)
+ select nusers(port(ffPmux, AB)) >= 3
+ // ffPmux output must have two users: ffPmux and ffP.D
select nusers(port(ffPmux, \Y)) == 2
filter GetSize(port(ffPmux, \Y)) <= GetSize(sigP)
- choice <IdString> BA {\B, \A}
filter port(ffPmux, BA) == sigP.extract(0, GetSize(port(ffPmux, \Y)))
+ // Remaining bits on sigP must not have any other users
filter nusers(sigP.extract_end(GetSize(port(ffPmux, BA)))) <= 1
define <bool> pol (BA == \B)
set ffPenpol pol