diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index 31b9a43..76e8a6d 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -266,7 +266,7 @@ namespace tmpl { A_2C2N_RB_X4 out1_t_buf_func[N]; sigbuf out1_en_buf_t(.in=_en, .out=_en1_X_t, .supply=supply); sigbuf out1_en_buf_f(.in=_en, .out=_en1_X_f, .supply=supply); - INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B); + INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vdd = supply.vdd, .vss = supply.vss); sigbuf out1_a_B_buf_f(.in=_out1_a_B,.out=_out1_a_BX_t, .supply=supply); sigbuf out1_a_B_buf_t(.in=_out1_a_B,.out=_out1_a_BX_f, .supply=supply); (i:N: @@ -296,7 +296,7 @@ namespace tmpl { A_2C2N_RB_X4 out2_t_buf_func[N]; sigbuf out2_en_buf_t(.in=_en, .out=_en2_X_t, .supply=supply); sigbuf out2_en_buf_f(.in=_en, .out=_en2_X_f, .supply=supply); - INV_X1 out2_a_inv(.a=out2.a,.y=_out2_a_B); + INV_X1 out2_a_inv(.a=out2.a,.y=_out2_a_B, .vdd = supply.vdd, .vss = supply.vss); sigbuf out2_a_B_buf_f(.in=_out2_a_B,.out=_out2_a_BX_t); sigbuf out2_a_B_buf_t(.in=_out2_a_B,.out=_out2_a_BX_f); (i:N: @@ -312,10 +312,10 @@ namespace tmpl { out2_t_buf_func[i].vdd=supply.vdd; out2_f_buf_func[i].vss=supply.vss; out2_t_buf_func[i].vss=supply.vss; - out2_t_buf_func[i].pr_B = _reset_BXX[i+N-1]; - out2_t_buf_func[i].sr_B = _reset_BXX[i+N-1]; - out2_f_buf_func[i].pr_B = _reset_BXX[i+N-1]; - out2_f_buf_func[i].sr_B = _reset_BXX[i+N-1]; + out2_t_buf_func[i].pr_B = _reset_BXX[i+N]; + out2_t_buf_func[i].sr_B = _reset_BXX[i+N]; + out2_f_buf_func[i].pr_B = _reset_BXX[i+N]; + out2_f_buf_func[i].sr_B = _reset_BXX[i+N]; out2_f_buf_func[i].n2=_c_t_buf[i]; out2_t_buf_func[i].n2=_c_t_buf[i]; ) @@ -390,10 +390,10 @@ namespace tmpl { out2_t_buf_func[i].vdd=supply.vdd; out2_f_buf_func[i].vss=supply.vss; out2_t_buf_func[i].vss=supply.vss; - out2_t_buf_func[i].pr_B = _reset_BXX[i+N-1]; - out2_t_buf_func[i].sr_B = _reset_BXX[i+N-1]; - out2_f_buf_func[i].pr_B = _reset_BXX[i+N-1]; - out2_f_buf_func[i].sr_B = _reset_BXX[i+N-1]; + out2_t_buf_func[i].pr_B = _reset_BXX[i+N]; + out2_t_buf_func[i].sr_B = _reset_BXX[i+N]; + out2_f_buf_func[i].pr_B = _reset_BXX[i+N]; + out2_f_buf_func[i].sr_B = _reset_BXX[i+N]; ) } @@ -893,5 +893,20 @@ defproc slice_data(avMx1of2 in; avMx1of2 out; demux_bit demux(.in = in, .out1 = out1, .out2 = out2, .reset_B = reset_B, .out1=out1, .out2=out2); } +/** +* Create M sigbufs to buffer an M bool array to N strength. +* Done lazily. +**/ +export template +defproc sigbuf_boolarray(bool? in[M]; bool! out[M]; power supply) { + sigbuf sb[M]; + (i:M: + sb[i].in = in[i]; + sb[i].out[0] = out[i]; + sb[i].supply = supply; + ) + +} + }}