diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-09-04 17:06:17 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-09-04 17:06:17 -0700 |
commit | 42548d979018c4bc3b71d4faa0900b18d2d290ec (patch) | |
tree | 6c0a9a0f1c5d5d3fce3ad9d28e6391ec68c73399 /passes/pmgen/xilinx_dsp.pmg | |
parent | 93d798272d027f15aa930766bc3f9553f448f5cf (diff) | |
download | yosys-42548d979018c4bc3b71d4faa0900b18d2d290ec.tar.gz yosys-42548d979018c4bc3b71d4faa0900b18d2d290ec.tar.bz2 yosys-42548d979018c4bc3b71d4faa0900b18d2d290ec.zip |
Get rid of sigPused
Diffstat (limited to 'passes/pmgen/xilinx_dsp.pmg')
-rw-r--r-- | passes/pmgen/xilinx_dsp.pmg | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/passes/pmgen/xilinx_dsp.pmg b/passes/pmgen/xilinx_dsp.pmg index c45e92d6f..375b5a492 100644 --- a/passes/pmgen/xilinx_dsp.pmg +++ b/passes/pmgen/xilinx_dsp.pmg @@ -19,8 +19,16 @@ code sigAset sigBset endcode code sigM - sigM = port(dsp, \P); - //if (GetSize(sigH) <= 10) + SigSpec P = port(dsp, \P); + // Only care about those bits that are used + int i; + for (i = 0; i < GetSize(P); i++) { + if (nusers(P[i]) <= 1) + break; + sigM.append(P[i]); + } + log_assert(nusers(P.extract_end(i)) <= 1); + //if (GetSize(sigM) <= 10) // reject; endcode @@ -156,23 +164,14 @@ code sigC sigP } endcode -// Extract the bits of P that actually have a consumer -// (as opposed to being a dummy) -code sigPused - for (int i = 0; i < GetSize(sigP); i++) - if (sigP[i].wire && nusers(sigP[i]) > 1) - sigPused.append(sigP[i]); -endcode - match ffP if param(dsp, \PREG).as_int() == 0 - if !sigPused.empty() - if nusers(sigPused) == 2 select ffP->type.in($dff) // DSP48E1 does not support clock inversion select param(ffP, \CLK_POLARITY).as_bool() - filter param(ffP, \WIDTH).as_int() >= GetSize(sigPused) - filter includes(port(ffP, \D).to_sigbit_set(), sigPused.to_sigbit_set()) + filter GetSize(port(ffP, \D)) >= GetSize(sigP) + slice offset GetSize(port(ffP, \D)) + filter offset+GetSize(sigP) <= GetSize(port(ffP, \D)) && port(ffP, \D).extract(offset, GetSize(sigP)) == sigP optional endmatch |