merge tested with concurrent inputs work
This commit is contained in:
@ -151,6 +151,27 @@ namespace tmpl {
|
||||
f_buf_func[i].sr_B = _reset_BXX[i];
|
||||
)
|
||||
}
|
||||
// A template creating a FIFO of M buffers with N bits each
|
||||
export template<pint N;pint M>
|
||||
defproc fifo(avMx1of2<N> in; avMx1of2<N> out; bool? reset_B; power supply)
|
||||
{
|
||||
buffer<N> fifo_element[M];
|
||||
bool _reset_BXX[M];
|
||||
fifo_element[0].in = in ;
|
||||
fifo_element[0].supply = supply;
|
||||
fifo_element[0].reset_B = _reset_BXX[0];
|
||||
(i:1..M-1:
|
||||
fifo_element[i].in = fifo_element[i-1].out;
|
||||
fifo_element[i].supply = supply;
|
||||
fifo_element[i].reset_B = _reset_BXX[i];
|
||||
)
|
||||
fifo_element[N-1].out = out;
|
||||
|
||||
// reset buffers
|
||||
bool _reset_BX;
|
||||
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
|
||||
sigbuf<M> reset_bufarray(.in=_reset_BX, .out=_reset_BXX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Buffer_S template.
|
||||
@ -562,6 +583,7 @@ namespace tmpl {
|
||||
//reset buffers
|
||||
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
|
||||
}
|
||||
// A template creating a FIFO of N buffers tokens
|
||||
export template<pint N>
|
||||
defproc fifo_t(a1of1 in; a1of1 out; bool? reset_B; power supply)
|
||||
{
|
||||
|
Reference in New Issue
Block a user