aboutsummaryrefslogtreecommitdiffstats
path: root/passes/pmgen/xilinx_dsp.pmg
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-11-26 21:26:53 -0800
committerEddie Hung <eddie@fpgeh.com>2019-11-26 22:51:00 -0800
commit2105ae176a73a9839670bf8120b462d06151dae5 (patch)
treeb33b373471edecc2da7fecbd7af89f223f38cc28 /passes/pmgen/xilinx_dsp.pmg
parent222e199b7342818cc4265e21ff8910ceb42fb421 (diff)
downloadyosys-2105ae176a73a9839670bf8120b462d06151dae5.tar.gz
yosys-2105ae176a73a9839670bf8120b462d06151dae5.tar.bz2
yosys-2105ae176a73a9839670bf8120b462d06151dae5.zip
Check for either sign or zero extension for postAdd packing
Diffstat (limited to 'passes/pmgen/xilinx_dsp.pmg')
-rw-r--r--passes/pmgen/xilinx_dsp.pmg6
1 files changed, 3 insertions, 3 deletions
diff --git a/passes/pmgen/xilinx_dsp.pmg b/passes/pmgen/xilinx_dsp.pmg
index 0ba529011..5d3b9c2eb 100644
--- a/passes/pmgen/xilinx_dsp.pmg
+++ b/passes/pmgen/xilinx_dsp.pmg
@@ -347,9 +347,9 @@ match postAdd
index <SigBit> port(postAdd, AB)[0] === sigP[0]
filter GetSize(port(postAdd, AB)) >= GetSize(sigP)
filter port(postAdd, AB).extract(0, GetSize(sigP)) == sigP
- // Check that remainder of AB is a sign-extension
- define <bool> AB_SIGNED (param(postAdd, AB == \A ? \A_SIGNED : \B_SIGNED).as_bool())
- filter port(postAdd, AB).extract_end(GetSize(sigP)) == SigSpec(AB_SIGNED ? sigP[GetSize(sigP)-1] : State::S0, GetSize(port(postAdd, AB))-GetSize(sigP))
+ // Check that remainder of AB is a sign- or zero-extension
+ filter port(postAdd, AB).extract_end(GetSize(sigP)) == SigSpec(sigP[GetSize(sigP)-1], GetSize(port(postAdd, AB))-GetSize(sigP)) || port(postAdd, AB).extract_end(GetSize(sigP)) == SigSpec(State::S0, GetSize(port(postAdd, AB))-GetSize(sigP))
+
set postAddAB AB
optional
endmatch