started token buffer and token fifo. conmtinued arbiter tb
This commit is contained in:
@ -521,7 +521,7 @@ namespace tmpl {
|
||||
[keeper=0] _y2 | d => y2-
|
||||
}
|
||||
spec {
|
||||
mk_excllo(y1, y2)
|
||||
mk_excllo(_y1, _y2)
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
@ -350,4 +350,44 @@ namespace tmpl {
|
||||
ARBITER arbiter(.a = in1.r, .b = in2.r, .c = in2.a, .d = in1.a, .y1 = _y1_arb, .y2 = _y2_arb, .vdd = supply.vdd, .vss = supply.vss);
|
||||
|
||||
}
|
||||
export
|
||||
defproc buffer_t(a1of1 in; a1of1 out; bool? reset_B; power supply)
|
||||
{
|
||||
//control
|
||||
bool _en, _reset_BX;
|
||||
A_3C_RB_X4 inack_ctl(.c1=_en,.c2=in.r,.c3=out.r,.y=in.a,.pr_B=_reset_BX,.sr_B=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
|
||||
A_1C1P_X1 en_ctl(.c1=in.a,.p1=out.r,.y=_en,.vdd=supply.vdd,.vss=supply.vss);
|
||||
|
||||
//function
|
||||
bool _out_a_B;
|
||||
INV_X1 inv_outa(.a = out.a,.y=_out_a_B,.vdd = supply.vdd,.vss=supply.vss);
|
||||
A_2C1N_RB_X4 buf_func(.c1 = _en,.c2 = _out_a_B, .n1 = in.r,.y = out.r, .pr_B = _reset_BX, .sr_B = _reset_BX,.vdd = supply.vdd,.vss=supply.vss);
|
||||
|
||||
|
||||
//reset buffers
|
||||
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
|
||||
}
|
||||
export template<pint N>
|
||||
defproc fifo_t(a1of1 in; a1of1 out; bool? reset_B; power supply)
|
||||
{
|
||||
buffer_t fifo_element[N];
|
||||
bool _reset_BXX[N];
|
||||
fifo_element[0].in.r = in.r;
|
||||
fifo_element[0].in.a = in.a;
|
||||
fifo_element[0].supply = supply;
|
||||
fifo_element[0].reset_B = _reset_BXX[0];
|
||||
(i:1..N-1:
|
||||
fifo_element[i].in.r = fifo_element[i-1].out.r;
|
||||
fifo_element[i].in.a = fifo_element[i-1].out.a;
|
||||
fifo_element[i].supply = supply;
|
||||
fifo_element[i].reset_B = _reset_BXX[i];
|
||||
)
|
||||
fifo_element[N-1].out.r = out.r;
|
||||
fifo_element[N-1].out.a = out.a;
|
||||
|
||||
// reset buffers
|
||||
bool _reset_BX;
|
||||
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
|
||||
sigbuf<N> reset_bufarray(.in=_reset_BX, .out=_reset_BXX);
|
||||
}
|
||||
}}
|
||||
|
Reference in New Issue
Block a user