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

Rename {A,B} -> {A2,B2}

This commit is contained in:
Eddie Hung 2019-09-11 16:21:24 -07:00
parent 63431fe42a
commit 6fa6bf483c
2 changed files with 34 additions and 33 deletions

View file

@ -258,8 +258,8 @@ void pack_xilinx_dsp(dict<SigBit, Cell*> &bit_to_driver, xilinx_dsp_pm &pm)
log("\n"); log("\n");
log("preAdd: %s\n", log_id(st.preAdd, "--")); log("preAdd: %s\n", log_id(st.preAdd, "--"));
log("ffAD: %s %s %s\n", log_id(st.ffAD, "--"), log_id(st.ffADcemux, "--"), log_id(st.ffADrstmux, "--")); log("ffAD: %s %s %s\n", log_id(st.ffAD, "--"), log_id(st.ffADcemux, "--"), log_id(st.ffADrstmux, "--"));
log("ffA: %s %s %s\n", log_id(st.ffA, "--"), log_id(st.ffAcemux, "--"), log_id(st.ffArstmux, "--")); log("ffA2: %s %s %s\n", log_id(st.ffA2, "--"), log_id(st.ffA2cemux, "--"), log_id(st.ffA2rstmux, "--"));
log("ffB: %s %s %s\n", log_id(st.ffB, "--"), log_id(st.ffBcemux, "--"), log_id(st.ffBrstmux, "--")); log("ffB2: %s %s %s\n", log_id(st.ffB2, "--"), log_id(st.ffB2cemux, "--"), log_id(st.ffB2rstmux, "--"));
log("ffC: %s %s %s\n", log_id(st.ffC, "--"), log_id(st.ffCcemux, "--"), log_id(st.ffCrstmux, "--")); log("ffC: %s %s %s\n", log_id(st.ffC, "--"), log_id(st.ffCcemux, "--"), log_id(st.ffCrstmux, "--"));
log("ffD: %s %s %s\n", log_id(st.ffD, "--"), log_id(st.ffDcemux, "--"), log_id(st.ffDrstmux, "--")); log("ffD: %s %s %s\n", log_id(st.ffD, "--"), log_id(st.ffDcemux, "--"), log_id(st.ffDrstmux, "--"));
log("dsp: %s\n", log_id(st.dsp, "--")); log("dsp: %s\n", log_id(st.dsp, "--"));
@ -367,16 +367,16 @@ void pack_xilinx_dsp(dict<SigBit, Cell*> &bit_to_driver, xilinx_dsp_pm &pm)
} }
}; };
if (st.ffA) { if (st.ffA2) {
SigSpec &A = cell->connections_.at("\\A"); SigSpec &A2 = cell->connections_.at("\\A");
f(A, st.ffA, st.ffAcemux, st.ffAcepol, "\\CEA2", st.ffArstmux, st.ffArstpol, "\\RSTA"); f(A2, st.ffA2, st.ffA2cemux, st.ffA2cepol, "\\CEA2", st.ffA2rstmux, st.ffArstpol, "\\RSTA");
pm.add_siguser(A, cell); pm.add_siguser(A2, cell);
cell->setParam("\\AREG", 1); cell->setParam("\\AREG", 1);
} }
if (st.ffB) { if (st.ffB2) {
SigSpec &B = cell->connections_.at("\\B"); SigSpec &B2 = cell->connections_.at("\\B");
f(B, st.ffB, st.ffBcemux, st.ffBcepol, "\\CEB2", st.ffBrstmux, st.ffBrstpol, "\\RSTB"); f(B2, st.ffB2, st.ffB2cemux, st.ffB2cepol, "\\CEB2", st.ffB2rstmux, st.ffBrstpol, "\\RSTB");
pm.add_siguser(B, cell); pm.add_siguser(B2, cell);
cell->setParam("\\BREG", 1); cell->setParam("\\BREG", 1);
} }
if (st.ffC) { if (st.ffC) {
@ -406,14 +406,14 @@ void pack_xilinx_dsp(dict<SigBit, Cell*> &bit_to_driver, xilinx_dsp_pm &pm)
log(" clock: %s (%s)", log_signal(st.clock), "posedge"); log(" clock: %s (%s)", log_signal(st.clock), "posedge");
if (st.ffA) if (st.ffA2)
log(" ffA:%s", log_id(st.ffA)); log(" ffA2:%s", log_id(st.ffA2));
if (st.ffAD) if (st.ffAD)
log(" ffAD:%s", log_id(st.ffAD)); log(" ffAD:%s", log_id(st.ffAD));
if (st.ffB) if (st.ffB2)
log(" ffB:%s", log_id(st.ffB)); log(" ffB2:%s", log_id(st.ffB2));
if (st.ffC) if (st.ffC)
log(" ffC:%s", log_id(st.ffC)); log(" ffC:%s", log_id(st.ffC));

View file

@ -4,10 +4,11 @@ udata <std::function<SigSpec(const SigSpec&)>> unextend
state <SigBit> clock state <SigBit> clock
state <SigSpec> sigA sigffAcemuxY sigB sigffBcemuxY sigC sigffCcemuxY sigD sigffDcemuxY sigM sigP state <SigSpec> sigA sigffAcemuxY sigB sigffBcemuxY sigC sigffCcemuxY sigD sigffDcemuxY sigM sigP
state <IdString> postAddAB postAddMuxAB state <IdString> postAddAB postAddMuxAB
state <bool> ffAcepol ffADcepol ffBcepol ffCcepol ffDcepol ffMcepol ffPcepol state <bool> ffA1cepol ffA2cepol ffADcepol ffB1cepol ffB2cepol ffCcepol ffDcepol ffMcepol ffPcepol
state <bool> ffArstpol ffADrstpol ffBrstpol ffCrstpol ffDrstpol ffMrstpol ffPrstpol state <bool> ffArstpol ffADrstpol ffBrstpol ffCrstpol ffDrstpol ffMrstpol ffPrstpol
state <Cell*> ffAD ffADcemux ffADrstmux ffA ffAcemux ffArstmux ffB ffBcemux ffBrstmux ffC ffCcemux ffCrstmux state <Cell*> ffAD ffADcemux ffADrstmux ffA1 ffA1cemux ffA1rstmux ffA2 ffA2cemux ffA2rstmux
state <Cell*> ffB1 ffB1cemux ffB1rstmux ffB2 ffB2cemux ffB2rstmux ffC ffCcemux ffCrstmux
state <Cell*> ffD ffDcemux ffDrstmux ffM ffMcemux ffMrstmux ffP ffPcemux ffPrstmux state <Cell*> ffD ffDcemux ffDrstmux ffM ffMcemux ffMrstmux ffP ffPcemux ffPrstmux
// subpattern // subpattern
@ -103,20 +104,20 @@ code sigA sigD
} }
endcode endcode
code argQ ffA ffAcemux ffArstmux ffAcepol ffArstpol sigA clock ffAD ffADcemux ffADrstmux ffADcepol ffADrstpol code argQ ffAD ffADcemux ffADrstmux ffADcepol ffADrstpol sigA clock ffA2 ffA2cemux ffA2rstmux ffA2cepol ffArstpol
// Only search for ffA if there was a pre-adder // Only search for ffA2 if there was a pre-adder
// (otherwise ffA would have been matched as ffAD) // (otherwise ffA2 would have been matched as ffA2)
if (preAdd) { if (preAdd) {
if (param(dsp, \AREG).as_int() == 0) { if (param(dsp, \AREG).as_int() == 0) {
argQ = sigA; argQ = sigA;
subpattern(in_dffe); subpattern(in_dffe);
if (dff) { if (dff) {
ffA = dff; ffA2 = dff;
clock = dffclock; clock = dffclock;
if (dffcemux) { if (dffcemux) {
ffAcemux = dffcemux; ffA2cemux = dffcemux;
ffArstmux = dffrstmux; ffA2rstmux = dffrstmux;
ffAcepol = dffcepol; ffA2cepol = dffcepol;
ffArstpol = dffrstpol; ffArstpol = dffrstpol;
} }
sigA = dffD; sigA = dffD;
@ -126,26 +127,26 @@ code argQ ffA ffAcemux ffArstmux ffAcepol ffArstpol sigA clock ffAD ffADcemux ff
// And if there wasn't a pre-adder, // And if there wasn't a pre-adder,
// move AD register to A // move AD register to A
else if (ffAD) { else if (ffAD) {
log_assert(!ffA && !ffAcemux && !ffArstmux); log_assert(!ffA2 && !ffA2cemux && !ffA2rstmux);
std::swap(ffA, ffAD); std::swap(ffA2, ffAD);
std::swap(ffAcemux, ffADcemux); std::swap(ffA2cemux, ffADcemux);
std::swap(ffArstmux, ffADrstmux); std::swap(ffA2rstmux, ffADrstmux);
ffAcepol = ffADcepol; ffA2cepol = ffADcepol;
ffArstpol = ffADrstpol; ffArstpol = ffADrstpol;
} }
endcode endcode
code argQ ffB ffBcemux ffBrstmux ffBcepol ffBrstpol sigB clock code argQ ffB2 ffB2cemux ffB2rstmux ffB2cepol ffBrstpol sigB clock
if (param(dsp, \BREG).as_int() == 0) { if (param(dsp, \BREG).as_int() == 0) {
argQ = sigB; argQ = sigB;
subpattern(in_dffe); subpattern(in_dffe);
if (dff) { if (dff) {
ffB = dff; ffB2 = dff;
clock = dffclock; clock = dffclock;
if (dffcemux) { if (dffcemux) {
ffBcemux = dffcemux; ffB2cemux = dffcemux;
ffBrstmux = dffrstmux; ffB2rstmux = dffrstmux;
ffBcepol = dffcepol; ffB2cepol = dffcepol;
ffBrstpol = dffrstpol; ffBrstpol = dffrstpol;
} }
sigB = dffD; sigB = dffD;