From 19565e73037d0e7718743203d206908ac6956c0c Mon Sep 17 00:00:00 2001 From: alexmadison Date: Mon, 11 Apr 2022 17:00:15 +0200 Subject: [PATCH] fixed doubling of sigs --- dataflow_neuro/interfaces.act | 17 ++--- dataflow_neuro/primitives.act | 121 +++++++++++++++------------------- 2 files changed, 61 insertions(+), 77 deletions(-) diff --git a/dataflow_neuro/interfaces.act b/dataflow_neuro/interfaces.act index ad97da9..b29b2eb 100644 --- a/dataflow_neuro/interfaces.act +++ b/dataflow_neuro/interfaces.act @@ -103,23 +103,21 @@ namespace tmpl { A_1C1P_X1 en_ctl(.c1=in.a,.p1=out.v,.y=_en,.vdd=supply.vdd,.vss=supply.vss); //function - bool _out_a_BX_t[N],_out_a_BX_f[N],_out_a_B,_en_X_t[N],_en_X_f[N]; + bool _out_a_B; A_2C2N_RB_X4 f_buf_func[N]; A_2C2N_RB_X4 t_buf_func[N]; - sigbuf en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); - sigbuf en_buf_f(.in=_en, .out=_en_X_f, .supply=supply); + sigbuf en_buf(.in=_en, .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, .supply=supply); - sigbuf out_a_B_buf_t(.in=_out_a_B,.out=_out_a_BX_f, .supply=supply); + sigbuf out_a_B_buf(.in=_out_a_B, .supply=supply); // check if you can also do single var to array connect a=b[N] // and remove them from the loop (i:N: f_buf_func[i].y=out.d.d[i].f; t_buf_func[i].y=out.d.d[i].t; - f_buf_func[i].c1=_en_X_f[i]; - t_buf_func[i].c1=_en_X_t[i]; - f_buf_func[i].c2=_out_a_BX_f[i]; - t_buf_func[i].c2=_out_a_BX_t[i]; + f_buf_func[i].c1=en_buf.out[i]; + t_buf_func[i].c1=en_buf.out[i+N]; + f_buf_func[i].c2=out_a_B_buf.out[i]; + t_buf_func[i].c2=out_a_B_buf.out[i+N]; f_buf_func[i].n1=_inB[i]; t_buf_func[i].n1=in.d[i]; f_buf_func[i].n2=_reqXX[i]; @@ -134,7 +132,6 @@ namespace tmpl { f_buf_func[i].sr_B = _reset_BXX[i]; ) - } diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index b4597a5..ab3c8b5 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -125,11 +125,10 @@ namespace tmpl { BUF_X4 in_v_buf(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss); //function - bool _out_a_BX[N*2],_out_a_B,_en_X_t[N],_en_X_f[N]; + bool _out_a_BX[N*2],_out_a_B; A_2C1N_RB_X4 f_buf_func[N]; A_2C1N_RB_X4 t_buf_func[N]; - sigbuf en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); - sigbuf en_buf_f(.in=_en, .out=_en_X_f, .supply=supply); + sigbuf en_buf(.in=_en, .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(.in=_out_a_B,.out=_out_a_BX, .supply = supply); // check if you can also do single var to array connect a=b[N] @@ -137,8 +136,8 @@ namespace tmpl { (i:N: f_buf_func[i].y=out.d.d[i].f; t_buf_func[i].y=out.d.d[i].t; - f_buf_func[i].c1=_en_X_f[i]; - t_buf_func[i].c1=_en_X_t[i]; + f_buf_func[i].c1=en_buf.out[i]; + t_buf_func[i].c1=en_buf.out[i+N]; f_buf_func[i].c2=_out_a_BX[i]; t_buf_func[i].c2=_out_a_BX[i+N]; f_buf_func[i].n1=in.d.d[i].f; @@ -195,33 +194,31 @@ namespace tmpl { sigbuf reset_bufarray(.in=_reset_BX, .out=_reset_BXX, .supply=supply); //validity - bool _in_v, _in_vX[N]; + bool _in_v; vtree vc(.in=in.d,.out=_in_v,.supply=supply); BUF_X4 in_v_buf4(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss); - sigbuf in_v_bufN(.in = in.v, .out = _in_vX, .supply = supply); + sigbuf in_v_bufN(.in = in.v, .supply = supply); //function - bool _out_a_BX_t[N],_out_a_BX_f[N],_out_a_B,_en_X_t[N],_en_X_f[N]; + bool _out_a_B; A_2C2N_RB_X4 f_buf_func[N]; A_2C2N_RB_X4 t_buf_func[N]; - sigbuf en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); - sigbuf en_buf_f(.in=_en, .out=_en_X_f, .supply=supply); + sigbuf en_buf(.in=_en, .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, .supply=supply); - sigbuf out_a_B_buf_t(.in=_out_a_B,.out=_out_a_BX_f, .supply=supply); + sigbuf out_a_B_buf(.in=_out_a_B, .supply=supply); // check if you can also do single var to array connect a=b[N] // and remove them from the loop (i:N: f_buf_func[i].y=out.d.d[i].f; t_buf_func[i].y=out.d.d[i].t; - f_buf_func[i].c1=_en_X_f[i]; - t_buf_func[i].c1=_en_X_t[i]; - f_buf_func[i].c2=_out_a_BX_f[i]; - t_buf_func[i].c2=_out_a_BX_t[i]; + f_buf_func[i].c1=en_buf.out[i]; + t_buf_func[i].c1=en_buf.out[i+N]; + f_buf_func[i].c2=out_a_B_buf.out[i]; + t_buf_func[i].c2=out_a_B_buf.out[i+N]; f_buf_func[i].n1=in.d.d[i].f; t_buf_func[i].n1=in.d.d[i].t; - f_buf_func[i].n2=_in_vX[i]; - t_buf_func[i].n2=_in_vX[i]; + f_buf_func[i].n2=in_v_bufN.out[i]; + t_buf_func[i].n2=in_v_bufN.out[i+N]; f_buf_func[i].vdd=supply.vdd; t_buf_func[i].vdd=supply.vdd; f_buf_func[i].vss=supply.vss; @@ -260,21 +257,19 @@ namespace tmpl { //function //func buffer out1 - bool _out1_a_BX_t[N],_out1_a_BX_f[N],_out1_a_B,_en1_X_t[N],_en1_X_f[N]; + bool _out1_a_B; A_2C2N_RB_X4 out1_f_buf_func[N]; 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); + sigbuf out1_en_buf(.in=_en, .supply=supply); 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); + sigbuf out1_a_B_buf(.in=_out1_a_B, .supply=supply); (i:N: out1_f_buf_func[i].y=out1.d.d[i].f; out1_t_buf_func[i].y=out1.d.d[i].t; - out1_f_buf_func[i].c1=_en1_X_f[i]; - out1_t_buf_func[i].c1=_en1_X_t[i]; - out1_f_buf_func[i].c2=_out1_a_BX_f[i]; - out1_t_buf_func[i].c2=_out1_a_BX_t[i]; + out1_f_buf_func[i].c1=out1_en_buf.out[i]; + out1_t_buf_func[i].c1=out1_en_buf.out[i+N]; + out1_f_buf_func[i].c2=out1_a_B_buf.out[i]; + out1_t_buf_func[i].c2=out1_a_B_buf.out[i+N]; out1_f_buf_func[i].n1=in.d.d[i].f; out1_t_buf_func[i].n1=in.d.d[i].t; out1_f_buf_func[i].vdd=supply.vdd; @@ -290,21 +285,19 @@ namespace tmpl { ) //func buffer out2 - bool _out2_a_BX_t[N],_out2_a_BX_f[N],_out2_a_B,_en2_X_t[N],_en2_X_f[N]; + bool _out2_a_B; A_2C2N_RB_X4 out2_f_buf_func[N]; 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); + sigbuf out2_en_buf(.in=_en, .supply=supply); 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); + sigbuf out2_a_B_buf(.in=_out2_a_B); (i:N: out2_f_buf_func[i].y=out2.d.d[i].f; out2_t_buf_func[i].y=out2.d.d[i].t; - out2_f_buf_func[i].c1=_en2_X_f[i]; - out2_t_buf_func[i].c1=_en2_X_t[i]; - out2_f_buf_func[i].c2=_out2_a_BX_f[i]; - out2_t_buf_func[i].c2=_out2_a_BX_t[i]; + out2_f_buf_func[i].c1=out2_en_buf.out[i]; + out2_t_buf_func[i].c1=out2_en_buf.out[i+N]; + out2_f_buf_func[i].c2=out2_a_B_buf.out[i]; + out2_t_buf_func[i].c2=out2_a_B_buf.out[i+N]; out2_f_buf_func[i].n1=in.d.d[i].f; out2_t_buf_func[i].n1=in.d.d[i].t; out2_f_buf_func[i].vdd=supply.vdd; @@ -341,21 +334,19 @@ namespace tmpl { //function //func buffer out1 - bool _out1_a_BX_t[N],_out1_a_BX_f[N],_out1_a_B,_en1_X_t[N],_en1_X_f[N]; + bool _out1_a_B; A_2C1N_RB_X4 out1_f_buf_func[N]; A_2C1N_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); + sigbuf out1_en_buf(.in=_en, .supply=supply); INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B); - sigbuf out1_a_B_buf_f(.in=_out1_a_B,.out=_out1_a_BX_t); - sigbuf out1_a_B_buf_t(.in=_out1_a_B,.out=_out1_a_BX_f); + sigbuf out1_a_B_buf(.in=_out1_a_B); (i:N: out1_f_buf_func[i].y=out1.d.d[i].f; out1_t_buf_func[i].y=out1.d.d[i].t; - out1_f_buf_func[i].c1=_en1_X_f[i]; - out1_t_buf_func[i].c1=_en1_X_t[i]; - out1_f_buf_func[i].c2=_out1_a_BX_f[i]; - out1_t_buf_func[i].c2=_out1_a_BX_t[i]; + out1_f_buf_func[i].c1=out1_en_buf.out[i]; + out1_t_buf_func[i].c1=out1_en_buf.out[i+N]; + out1_f_buf_func[i].c2=out1_a_B_buf.out[i]; + out1_t_buf_func[i].c2=out1_a_B_buf.out[i+N]; out1_f_buf_func[i].n1=in.d.d[i].f; out1_t_buf_func[i].n1=in.d.d[i].t; out1_f_buf_func[i].vdd=supply.vdd; @@ -368,31 +359,29 @@ namespace tmpl { out1_f_buf_func[i].sr_B = _reset_BXX[i]; ) //func buffer out2 - bool _out2_a_BX_t[N],_out2_a_BX_f[N],_out2_a_B,_en2_X_t[N],_en2_X_f[N]; + bool _out2_a_B; A_2C1N_RB_X4 out2_f_buf_func[N]; A_2C1N_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); + sigbuf out2_en_buf(.in=_en, .supply=supply); INV_X1 out2_a_inv(.a=out2.a,.y=_out2_a_B); - 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); + sigbuf out2_a_B_buf(.in=_out2_a_B); (i:N: out2_f_buf_func[i].y=out2.d.d[i].f; out2_t_buf_func[i].y=out2.d.d[i].t; - out2_f_buf_func[i].c1=_en2_X_f[i]; - out2_t_buf_func[i].c1=_en2_X_t[i]; - out2_f_buf_func[i].c2=_out2_a_BX_f[i]; - out2_t_buf_func[i].c2=_out2_a_BX_t[i]; + out2_f_buf_func[i].c1=out2_en_buf.out[i]; + out2_t_buf_func[i].c1=out2_en_buf.out[i+N]; + out2_f_buf_func[i].c2=out2_a_B_buf.out[i]; + out2_t_buf_func[i].c2=out2_a_B_buf.out[i+N]; out2_f_buf_func[i].n1=in.d.d[i].f; out2_t_buf_func[i].n1=in.d.d[i].t; out2_f_buf_func[i].vdd=supply.vdd; 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]; - 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_t_buf_func[i].pr_B = _reset_BXX[i]; + out2_t_buf_func[i].sr_B = _reset_BXX[i]; + out2_f_buf_func[i].pr_B = _reset_BXX[i]; + out2_f_buf_func[i].sr_B = _reset_BXX[i]; ) } @@ -438,21 +427,19 @@ namespace tmpl { //function //func buffer out1 - bool _out1_a_BX_t[N],_out1_a_BX_f[N],_out1_a_B,_en1_X_t[N],_en1_X_f[N]; + bool _out1_a_B; A_2C2N_RB_X4 out1_f_buf_func[N]; 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); + sigbuf out1_en_buf(.in=_en, .supply=supply); INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vss = supply.vss, .vdd = supply.vdd); - 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); + sigbuf out1_a_B_buf(.in=_out1_a_B, .supply=supply); (i:N: out1_f_buf_func[i].y=out1.d.d[i].f; out1_t_buf_func[i].y=out1.d.d[i].t; - out1_f_buf_func[i].c1=_en1_X_f[i]; - out1_t_buf_func[i].c1=_en1_X_t[i]; - out1_f_buf_func[i].c2=_out1_a_BX_f[i]; - out1_t_buf_func[i].c2=_out1_a_BX_t[i]; + out1_f_buf_func[i].c1=out1_en_buf.out[i]; + out1_t_buf_func[i].c1=out1_en_buf.out[i+N]; + out1_f_buf_func[i].c2=out1_a_B_buf.out[i]; + out1_t_buf_func[i].c2=out1_a_B_buf.out[i+N]; out1_f_buf_func[i].n1=in.d.d[i].f; out1_t_buf_func[i].n1=in.d.d[i].t; out1_f_buf_func[i].vdd=supply.vdd;