3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-13 04:28:18 +00:00

ffAmuxAB -> ffAenpol

This commit is contained in:
Eddie Hung 2019-09-05 21:28:28 -07:00
parent 5a2fc6fcb5
commit 53ca536d67
2 changed files with 9 additions and 6 deletions

View file

@ -83,9 +83,10 @@ void pack_xilinx_dsp(dict<SigBit, Cell*> &bit_to_driver, xilinx_dsp_pm &pm)
A.replace(Q, D); A.replace(Q, D);
if (st.ffAmux) { if (st.ffAmux) {
SigSpec Y = st.ffAmux->getPort("\\Y"); SigSpec Y = st.ffAmux->getPort("\\Y");
SigSpec AB = st.ffAmux->getPort(st.ffAmuxAB == "\\A" ? "\\B" : "\\A"); SigSpec AB = st.ffAmux->getPort(st.ffAenpol ? "\\A" : "\\B");
A.replace(Y, AB); A.replace(Y, AB);
cell->setPort("\\CEA2", st.ffAmux->getPort("\\S")); SigSpec S = st.ffAmux->getPort("\\S");
cell->setPort("\\CEA2", st.ffAenpol ? S : pm.module->Not(NEW_ID, S));
} }
else else
cell->setPort("\\CEA2", State::S1); cell->setPort("\\CEA2", State::S1);

View file

@ -2,7 +2,8 @@ pattern xilinx_dsp
state <SigBit> clock state <SigBit> clock
state <SigSpec> sigA sigffAmux sigB sigffBmux sigC sigM sigP state <SigSpec> sigA sigffAmux sigB sigffBmux sigC sigM sigP
state <IdString> ffAmuxAB ffBmuxAB ffMmuxAB ffPmuxAB postAddAB postAddMuxAB state <IdString> ffBmuxAB ffMmuxAB ffPmuxAB postAddAB postAddMuxAB
state <bool> ffAenpol
match dsp match dsp
select dsp->type.in(\DSP48E1) select dsp->type.in(\DSP48E1)
@ -69,9 +70,10 @@ match ffAmux
filter GetSize(port(ffAmux, \Y)) >= GetSize(sigA) filter GetSize(port(ffAmux, \Y)) >= GetSize(sigA)
slice offset GetSize(port(ffAmux, \Y)) slice offset GetSize(port(ffAmux, \Y))
filter offset+GetSize(sigA) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, \Y).extract(offset, GetSize(sigA)) == sigA filter offset+GetSize(sigA) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, \Y).extract(offset, GetSize(sigA)) == sigA
choice <IdString> AB {\A, \B} choice <IdString> BA {\B, \A}
filter offset+GetSize(sigffAmux) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, AB).extract(offset, GetSize(sigffAmux)) == sigffAmux filter offset+GetSize(sigffAmux) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, BA).extract(offset, GetSize(sigffAmux)) == sigffAmux
set ffAmuxAB AB define <bool> pol (BA == \B)
set ffAenpol pol
semioptional semioptional
endmatch endmatch