aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-11-27 08:00:22 -0800
committerGitHub <noreply@github.com>2019-11-27 08:00:22 -0800
commit6464dc35ec0c57b55aa19345b17eb34f47c15986 (patch)
tree134e9c86e1b6ee1b276e6318e2f0d040a9890878 /passes
parent41e0ddf4f4ac69b0c586b1c71e3ee200e1c892ce (diff)
parentde3476cc233c1c78d3e956aa7e9bd1003ac37f66 (diff)
downloadyosys-6464dc35ec0c57b55aa19345b17eb34f47c15986.tar.gz
yosys-6464dc35ec0c57b55aa19345b17eb34f47c15986.tar.bz2
yosys-6464dc35ec0c57b55aa19345b17eb34f47c15986.zip
Merge pull request #1536 from YosysHQ/eddie/xilinx_dsp_muladd
xilinx_dsp: consider sign and zero-extension when packing post-multiplier adder
Diffstat (limited to 'passes')
-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