aboutsummaryrefslogtreecommitdiffstats
path: root/passes/pmgen/xilinx_dsp.pmg
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-09-18 09:34:42 -0700
committerEddie Hung <eddie@fpgeh.com>2019-09-18 09:34:42 -0700
commit0932e23dffe0a270d4e41a0f09c0bf06b6998091 (patch)
tree0ac369b175dc2a927a742f733bdbaafb754725e0 /passes/pmgen/xilinx_dsp.pmg
parent681be20ca219fc64e2bf0f9d2c24937f98903455 (diff)
downloadyosys-0932e23dffe0a270d4e41a0f09c0bf06b6998091.tar.gz
yosys-0932e23dffe0a270d4e41a0f09c0bf06b6998091.tar.bz2
yosys-0932e23dffe0a270d4e41a0f09c0bf06b6998091.zip
Separate dffrstmux from dffcemux, fix typos
Diffstat (limited to 'passes/pmgen/xilinx_dsp.pmg')
-rw-r--r--passes/pmgen/xilinx_dsp.pmg52
1 files changed, 32 insertions, 20 deletions
diff --git a/passes/pmgen/xilinx_dsp.pmg b/passes/pmgen/xilinx_dsp.pmg
index fa845b593..407489658 100644
--- a/passes/pmgen/xilinx_dsp.pmg
+++ b/passes/pmgen/xilinx_dsp.pmg
@@ -63,11 +63,13 @@ code argQ ffAD ffADcemux ffADrstmux ffADcepol ffADrstpol sigA clock
if (dff) {
ffAD = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffADrstmux = dffrstmux;
+ ffADrstpol = dffrstpol;
+ }
if (dffcemux) {
ffADcemux = dffcemux;
- ffADrstmux = dffrstmux;
ffADcepol = dffcepol;
- ffADrstpol = dffrstpol;
}
sigA = dffD;
}
@@ -115,12 +117,12 @@ code argQ ffAD ffADcemux ffADrstmux ffADcepol ffADrstpol sigA clock ffA2 ffA2cem
ffA2 = dff;
clock = dffclock;
if (dffrstmux) {
- ffA2cepol = dffcepol;
+ ffA2rstmux = dffrstmux;
ffArstpol = dffrstpol;
}
if (dffcemux) {
+ ffA2cepol = dffcepol;
ffA2cemux = dffcemux;
- ffA2rstmux = dffrstmux;
}
sigA = dffD;
}
@@ -173,11 +175,13 @@ code argQ ffB2 ffB2cemux ffB2rstmux ffB2cepol ffBrstpol sigB clock ffB1 ffB1cemu
if (dff) {
ffB2 = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffB2rstmux = dffrstmux;
+ ffBrstpol = dffrstpol;
+ }
if (dffcemux) {
ffB2cemux = dffcemux;
- ffB2rstmux = dffrstmux;
ffB2cepol = dffcepol;
- ffBrstpol = dffrstpol;
}
sigB = dffD;
@@ -220,11 +224,13 @@ code argQ ffD ffDcemux ffDrstmux ffDcepol ffDrstpol sigD clock
if (dff) {
ffD = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffDrstmux = dffrstmux;
+ ffDrstpol = dffrstpol;
+ }
if (dffcemux) {
ffDcemux = dffcemux;
- ffDrstmux = dffrstmux;
ffDcepol = dffcepol;
- ffDrstpol = dffrstpol;
}
sigD = dffD;
}
@@ -238,11 +244,13 @@ code argD ffM ffMcemux ffMrstmux ffMcepol ffMrstpol sigM sigP clock
if (dff) {
ffM = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffMrstmux = dffrstmux;
+ ffMrstpol = dffrstpol;
+ }
if (dffcemux) {
ffMcemux = dffcemux;
- ffMrstmux = dffrstmux;
ffMcepol = dffcepol;
- ffMrstpol = dffrstpol;
}
sigM = dffQ;
}
@@ -288,20 +296,22 @@ endcode
code argD ffP ffPcemux ffPrstmux ffPcepol ffPrstpol sigP clock
if (param(dsp, \PREG).as_int() == 0) {
- // If ffMcemux and no postAdd new-value net must have exactly three users: ffMcemux, ffM and ffPcemux
- if ((ffMcemux && !postAdd && nusers(sigP) == 3) ||
- // Otherwise new-value net must have exactly two users: dsp and ffPcemux
- ((!ffMcemux || postAdd) && nusers(sigP) == 2)) {
+ int users = 2;
+ // If ffMcemux and no postAdd new-value net must have three users: ffMcemux, ffM and ffPcemux
+ if (ffMcemux && !postAdd) users++;
+ if (nusers(sigP) == users) {
argD = sigP;
subpattern(out_dffe);
if (dff) {
ffP = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffPrstmux = dffrstmux;
+ ffPrstpol = dffrstpol;
+ }
if (dffcemux) {
ffPcemux = dffcemux;
ffPcepol = dffcepol;
- ffPrstmux = dffrstmux;
- ffPrstpol = dffrstpol;
}
sigP = dffQ;
}
@@ -333,11 +343,13 @@ code argQ ffC ffCcemux ffCrstmux ffCcepol ffCrstpol sigC clock
if (dff) {
ffC = dff;
clock = dffclock;
+ if (dffrstmux) {
+ ffCrstmux = dffrstmux;
+ ffCrstpol = dffrstpol;
+ }
if (dffcemux) {
ffCcemux = dffcemux;
- ffCrstmux = dffrstmux;
ffCcepol = dffcepol;
- ffCrstpol = dffrstpol;
}
sigC = dffD;
}
@@ -421,7 +433,7 @@ code argD
argD = port(ffrstmux, ffrstpol ? \A : \B);
dffD.replace(port(ffrstmux, \Y), argD);
- // Only search for ffrstmux if argQ has at
+ // Only search for ffcemux if argQ has at
// least 3 users (ff, <upstream>, ffrstmux) and
// dffD only has two (ff, ffrstmux)
if (!(nusers(argQ) >= 3 && nusers(dffD) == 2))
@@ -525,7 +537,7 @@ endmatch
code argD argQ
dffrstmux = ffrstmux;
if (ffrstmux) {
- SigSpec AB = port(ffrstmux, ffcepol ? \A : \B);
+ SigSpec AB = port(ffrstmux, ffrstpol ? \A : \B);
if (ffoffset + GetSize(argD) > GetSize(AB))
reject;