diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index 7a433a3..31b9a43 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -111,13 +111,13 @@ namespace tmpl { export template defproc buffer (avMx1of2 in; avMx1of2 out; bool? reset_B; power supply) { //control - bool _en, _reset_BX,_reset_BXX[N]; + bool _en, _reset_BX,_reset_BXX[N*2]; A_3C_RB_X4 inack_ctl(.c1=_en,.c2=in.v,.c3=out.v,.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.v,.y=_en,.vdd=supply.vdd,.vss=supply.vss); BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss); - sigbuf reset_bufarray(.in=_reset_BX, .out=_reset_BXX); + sigbuf reset_bufarray(.in=_reset_BX, .out=_reset_BXX); //validity bool _in_v; @@ -131,8 +131,8 @@ namespace tmpl { sigbuf en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); sigbuf en_buf_f(.in=_en, .out=_en_X_f, .supply=supply); INV_X1 out_a_inv(.a=out.a,.y=_out_a_B, .vss = supply.vss, .vdd = supply.vdd); - sigbuf out_a_B_buf_f(.in=_out_a_B,.out=_out_a_BX_t); - sigbuf out_a_B_buf_t(.in=_out_a_B,.out=_out_a_BX_f); + sigbuf out_a_B_buf_f(.in=_out_a_B,.out=_out_a_BX_t, .supply = supply); + sigbuf out_a_B_buf_t(.in=_out_a_B,.out=_out_a_BX_f, .supply = supply); // check if you can also do single var to array connect a=b[N] // and remove them from the loop (i:N: @@ -150,8 +150,8 @@ namespace tmpl { t_buf_func[i].vss=supply.vss; t_buf_func[i].pr_B = _reset_BXX[i]; t_buf_func[i].sr_B = _reset_BXX[i]; - f_buf_func[i].pr_B = _reset_BXX[i]; - f_buf_func[i].sr_B = _reset_BXX[i]; + f_buf_func[i].pr_B = _reset_BXX[i+N]; + f_buf_func[i].sr_B = _reset_BXX[i+N]; ) } // A template creating a FIFO of M buffers with N bits each