Added sigbuf_1output for signals that cannot have array outputs

This commit is contained in:
Michele 2022-03-03 19:23:13 +01:00
parent a4889ae844
commit 15d3fd1b9b
2 changed files with 30 additions and 4 deletions

View File

@ -246,9 +246,9 @@ namespace tmpl {
arbtree<N> Xarb(.in = _x_temp,.out = _out_arb_X,.supply = supply);
arbtree<M> Yarb(.in = _y_temp,.out = _out_arb_Y,.supply = supply);
// Sigbufs for strong ackowledge signals (note that the sigbuf needs to be changed)
sigbuf<ACK_STRENGTH> x_ack_arb[N];
sigbuf<ACK_STRENGTH> y_ack_arb[M];
// Sigbufs for strong ackowledge signals
sigbuf_1output<ACK_STRENGTH> x_ack_arb[N];
sigbuf_1output<ACK_STRENGTH> y_ack_arb[M];
(i:N:
x_ack_arb[i].in = _x_temp[i].a;
x_ack_arb[i].out[0] = x[i].a;
@ -349,7 +349,7 @@ namespace tmpl {
)
bool _addr_v
vtree addr_validity(.in = addr,.out = _addr_v);
sigbuf<4> addr_validity_x(.in = _addr_v,.out = addr.v);
sigbuf_1output<4> addr_validity_x(.in = _addr_v,.out = addr.v);
addr_validity.supply = supply;
addr_validity_x.supply = supply;

View File

@ -439,6 +439,32 @@ defproc sigbuf (bool? in; bool! out[N]; power supply)
(i:1..N-1:out[i]=out[0];)
}
//Sigbuf in which there is only 1 output. Made for outputs that cannot have multiple wires.
export template<pint N>
defproc sigbuf_1output (bool? in; bool! out; power supply)
{
{ N >= 0 : "sigbuf: parameter error" };
{ N <= 43 : "sigbuf: parameter error, N too big" };
/* -- just use in sized driver here -- */
[ N <= 4 ->
BUF_X1 buf1 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 5 & N <= 7 ->
BUF_X2 buf2 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 8 & N <= 10 ->
BUF_X3 buf3 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 11 & N <= 14 ->
BUF_X4 buf4 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 15 & N <= 18 ->
BUF_X6 buf6 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 19 & N <= 29 ->
BUF_X8 buf8 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
[] N >= 30 & N <= 42 ->
BUF_X12 buf12 (.a = in, .y = out, .vdd = supply.vdd, .vss = supply.vss);
]
}
}}