mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-20 14:15:49 +00:00
WIP
This commit is contained in:
parent
c3ffbf6fae
commit
d22805bd47
65 changed files with 739 additions and 718 deletions
|
|
@ -182,7 +182,7 @@ match add
|
|||
if mul->type != \SB_MAC16 || (param(mul, \TOPOUTPUT_SELECT).as_int() == 3 && param(mul, \BOTOUTPUT_SELECT).as_int() == 3)
|
||||
|
||||
select add->type.in($add)
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
select nusers(port(add, AB)) == 2
|
||||
|
||||
index <SigBit> port(add, AB)[0] === sigH[0]
|
||||
|
|
@ -214,7 +214,7 @@ endcode
|
|||
|
||||
match mux
|
||||
select mux->type == $mux
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
select nusers(port(mux, AB)) == 2
|
||||
index <SigSpec> port(mux, AB) === sigO
|
||||
set muxAB AB
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ match postAdd
|
|||
select GetSize(port(postAdd, \Y)) <= 48
|
||||
|
||||
// AB is the port that connects MUL to ADD
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
select nusers(port(postAdd, AB)) == 2
|
||||
|
||||
// has one input coming from multiplier
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ endcode
|
|||
|
||||
match add
|
||||
select add->type.in($add, $sub)
|
||||
choice <IdString> AB {\A, \B}
|
||||
define <IdString> BA (AB == \A ? \B : \A)
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
define <TwineRef> BA (AB == \A ? \B : \A)
|
||||
// One input to the adder is fed by the multiplier
|
||||
index <SigSpec> port(add, AB) === port(mul, \Y)
|
||||
// Save the other input port, it needs to be fed by the flip-flop
|
||||
|
|
@ -56,8 +56,8 @@ endmatch
|
|||
match mux
|
||||
if mux_in_pattern
|
||||
select mux->type.in($mux)
|
||||
choice <IdString> AB {\A, \B}
|
||||
define <IdString> BA (AB == \A ? \B : \A)
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
define <TwineRef> BA (AB == \A ? \B : \A)
|
||||
index <SigSpec> port(mux, AB) === port(mul, \Y)
|
||||
index <SigSpec> port(mux, BA) === port(add, \Y)
|
||||
filter nusers(port(mux, \Y)) == (output_registered ? 2 : 3)
|
||||
|
|
|
|||
|
|
@ -136,10 +136,10 @@ match preAdd
|
|||
// Output has to be 25 bits or less
|
||||
select GetSize(port(preAdd, \Y)) <= 25
|
||||
select nusers(port(preAdd, \Y)) == 2
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
// A port has to be 30 bits or less
|
||||
select GetSize(port(preAdd, AB)) <= 30
|
||||
define <IdString> BA (AB == \A ? \B : \A)
|
||||
define <TwineRef> BA (AB == \A ? \B : \A)
|
||||
// D port has to be 25 bits or less
|
||||
select GetSize(port(preAdd, BA)) <= 25
|
||||
index <SigSpec> port(preAdd, \Y) === sigA
|
||||
|
|
@ -316,7 +316,7 @@ match postAdd
|
|||
|
||||
select postAdd->type.in($add)
|
||||
select GetSize(port(postAdd, \Y)) <= 48
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
select nusers(port(postAdd, AB)) == 2
|
||||
|
||||
index <SigBit> port(postAdd, AB)[0] === sigP[0]
|
||||
|
|
@ -369,7 +369,7 @@ match postAddMux
|
|||
if ffP
|
||||
select postAddMux->type.in($mux)
|
||||
select nusers(port(postAddMux, \Y)) == 2
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
index <SigSpec> port(postAddMux, AB) === sigP
|
||||
index <SigSpec> port(postAddMux, \Y) === sigC
|
||||
set postAddMuxAB AB
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ match postAdd
|
|||
|
||||
select postAdd->type.in($add)
|
||||
select GetSize(port(postAdd, \Y)) <= 48
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
select nusers(port(postAdd, AB)) == 2
|
||||
|
||||
index <SigBit> port(postAdd, AB)[0] === sigP[0]
|
||||
|
|
@ -295,7 +295,7 @@ match postAddMux
|
|||
if ffP
|
||||
select postAddMux->type.in($mux)
|
||||
select nusers(port(postAddMux, \Y)) == 2
|
||||
choice <IdString> AB {\A, \B}
|
||||
choice <TwineRef> AB {\A, \B}
|
||||
index <SigSpec> port(postAddMux, AB) === sigP
|
||||
index <SigSpec> port(postAddMux, \Y) === sigC
|
||||
set postAddMuxAB AB
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@ finally
|
|||
add_siguser(cascade, dsp);
|
||||
|
||||
if (dsp->type.in(\DSP48E1))
|
||||
dsp->setParam(\ACASCREG, AREG);
|
||||
dsp_pcin->setParam(\A_INPUT, Const("CASCADE"));
|
||||
setparam(dsp, \ACASCREG, AREG);
|
||||
setparam(dsp_pcin, \A_INPUT, Const("CASCADE"));
|
||||
|
||||
log_debug("ACOUT -> ACIN cascade for %s -> %s\n", dsp, dsp_pcin);
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ finally
|
|||
add_siguser(cascade, dsp);
|
||||
|
||||
if (dsp->type.in(\DSP48E1)) {
|
||||
dsp->setParam(\BCASCREG, BREG);
|
||||
setparam(dsp, \BCASCREG, BREG);
|
||||
// According to UG389 p13 [https://www.xilinx.com/support/documentation/user_guides/ug389.pdf]
|
||||
// "The attribute is only used by place and route tools and
|
||||
// is not necessary for the users to set for synthesis. The
|
||||
|
|
@ -158,7 +158,7 @@ finally
|
|||
// BCOUT of another DSP48A1 slice, then the tools automatically
|
||||
// set the attribute to 'CASCADE', otherwise it is set to
|
||||
// 'DIRECT'".
|
||||
dsp_pcin->setParam(\B_INPUT, Const("CASCADE"));
|
||||
setparam(dsp_pcin, \B_INPUT, Const("CASCADE"));
|
||||
}
|
||||
|
||||
log_debug("BCOUT -> BCIN cascade for %s -> %s\n", dsp, dsp_pcin);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue