fixed doubling of sigs

This commit is contained in:
alexmadison 2022-04-11 17:00:15 +02:00
parent 81032c1296
commit 19565e7303
2 changed files with 61 additions and 77 deletions

View File

@ -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); A_1C1P_X1 en_ctl(.c1=in.a,.p1=out.v,.y=_en,.vdd=supply.vdd,.vss=supply.vss);
//function //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 f_buf_func[N];
A_2C2N_RB_X4 t_buf_func[N]; A_2C2N_RB_X4 t_buf_func[N];
sigbuf<N> en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); sigbuf<N*2> en_buf(.in=_en, .supply=supply);
sigbuf<N> 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); INV_X1 out_a_inv(.a=out.a,.y=_out_a_B, .vss = supply.vss, .vdd = supply.vdd);
sigbuf<N> out_a_B_buf_f(.in=_out_a_B,.out=_out_a_BX_t, .supply=supply); sigbuf<N*2> out_a_B_buf(.in=_out_a_B, .supply=supply);
sigbuf<N> 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] // check if you can also do single var to array connect a=b[N]
// and remove them from the loop // and remove them from the loop
(i:N: (i:N:
f_buf_func[i].y=out.d.d[i].f; f_buf_func[i].y=out.d.d[i].f;
t_buf_func[i].y=out.d.d[i].t; t_buf_func[i].y=out.d.d[i].t;
f_buf_func[i].c1=_en_X_f[i]; f_buf_func[i].c1=en_buf.out[i];
t_buf_func[i].c1=_en_X_t[i]; t_buf_func[i].c1=en_buf.out[i+N];
f_buf_func[i].c2=_out_a_BX_f[i]; f_buf_func[i].c2=out_a_B_buf.out[i];
t_buf_func[i].c2=_out_a_BX_t[i]; t_buf_func[i].c2=out_a_B_buf.out[i+N];
f_buf_func[i].n1=_inB[i]; f_buf_func[i].n1=_inB[i];
t_buf_func[i].n1=in.d[i]; t_buf_func[i].n1=in.d[i];
f_buf_func[i].n2=_reqXX[i]; f_buf_func[i].n2=_reqXX[i];
@ -134,7 +132,6 @@ namespace tmpl {
f_buf_func[i].sr_B = _reset_BXX[i]; f_buf_func[i].sr_B = _reset_BXX[i];
) )
} }

View File

@ -125,11 +125,10 @@ namespace tmpl {
BUF_X4 in_v_buf(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss); BUF_X4 in_v_buf(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss);
//function //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 f_buf_func[N];
A_2C1N_RB_X4 t_buf_func[N]; A_2C1N_RB_X4 t_buf_func[N];
sigbuf<N> en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); sigbuf<N*2> en_buf(.in=_en, .supply=supply);
sigbuf<N> 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); INV_X1 out_a_inv(.a=out.a,.y=_out_a_B, .vss = supply.vss, .vdd = supply.vdd);
sigbuf<N*2> out_a_B_buf(.in=_out_a_B,.out=_out_a_BX, .supply = supply); sigbuf<N*2> 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] // check if you can also do single var to array connect a=b[N]
@ -137,8 +136,8 @@ namespace tmpl {
(i:N: (i:N:
f_buf_func[i].y=out.d.d[i].f; f_buf_func[i].y=out.d.d[i].f;
t_buf_func[i].y=out.d.d[i].t; t_buf_func[i].y=out.d.d[i].t;
f_buf_func[i].c1=_en_X_f[i]; f_buf_func[i].c1=en_buf.out[i];
t_buf_func[i].c1=_en_X_t[i]; t_buf_func[i].c1=en_buf.out[i+N];
f_buf_func[i].c2=_out_a_BX[i]; f_buf_func[i].c2=_out_a_BX[i];
t_buf_func[i].c2=_out_a_BX[i+N]; t_buf_func[i].c2=_out_a_BX[i+N];
f_buf_func[i].n1=in.d.d[i].f; f_buf_func[i].n1=in.d.d[i].f;
@ -195,33 +194,31 @@ namespace tmpl {
sigbuf<N> reset_bufarray(.in=_reset_BX, .out=_reset_BXX, .supply=supply); sigbuf<N> reset_bufarray(.in=_reset_BX, .out=_reset_BXX, .supply=supply);
//validity //validity
bool _in_v, _in_vX[N]; bool _in_v;
vtree<N> vc(.in=in.d,.out=_in_v,.supply=supply); vtree<N> 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); BUF_X4 in_v_buf4(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss);
sigbuf<N> in_v_bufN(.in = in.v, .out = _in_vX, .supply = supply); sigbuf<N*2> in_v_bufN(.in = in.v, .supply = supply);
//function //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 f_buf_func[N];
A_2C2N_RB_X4 t_buf_func[N]; A_2C2N_RB_X4 t_buf_func[N];
sigbuf<N> en_buf_t(.in=_en, .out=_en_X_t, .supply=supply); sigbuf<N*2> en_buf(.in=_en, .supply=supply);
sigbuf<N> 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); INV_X1 out_a_inv(.a=out.a,.y=_out_a_B, .vss = supply.vss, .vdd = supply.vdd);
sigbuf<N> out_a_B_buf_f(.in=_out_a_B,.out=_out_a_BX_t, .supply=supply); sigbuf<N*2> out_a_B_buf(.in=_out_a_B, .supply=supply);
sigbuf<N> 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] // check if you can also do single var to array connect a=b[N]
// and remove them from the loop // and remove them from the loop
(i:N: (i:N:
f_buf_func[i].y=out.d.d[i].f; f_buf_func[i].y=out.d.d[i].f;
t_buf_func[i].y=out.d.d[i].t; t_buf_func[i].y=out.d.d[i].t;
f_buf_func[i].c1=_en_X_f[i]; f_buf_func[i].c1=en_buf.out[i];
t_buf_func[i].c1=_en_X_t[i]; t_buf_func[i].c1=en_buf.out[i+N];
f_buf_func[i].c2=_out_a_BX_f[i]; f_buf_func[i].c2=out_a_B_buf.out[i];
t_buf_func[i].c2=_out_a_BX_t[i]; t_buf_func[i].c2=out_a_B_buf.out[i+N];
f_buf_func[i].n1=in.d.d[i].f; f_buf_func[i].n1=in.d.d[i].f;
t_buf_func[i].n1=in.d.d[i].t; t_buf_func[i].n1=in.d.d[i].t;
f_buf_func[i].n2=_in_vX[i]; f_buf_func[i].n2=in_v_bufN.out[i];
t_buf_func[i].n2=_in_vX[i]; t_buf_func[i].n2=in_v_bufN.out[i+N];
f_buf_func[i].vdd=supply.vdd; f_buf_func[i].vdd=supply.vdd;
t_buf_func[i].vdd=supply.vdd; t_buf_func[i].vdd=supply.vdd;
f_buf_func[i].vss=supply.vss; f_buf_func[i].vss=supply.vss;
@ -260,21 +257,19 @@ namespace tmpl {
//function //function
//func buffer out1 //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_f_buf_func[N];
A_2C2N_RB_X4 out1_t_buf_func[N]; A_2C2N_RB_X4 out1_t_buf_func[N];
sigbuf<N> out1_en_buf_t(.in=_en, .out=_en1_X_t, .supply=supply); sigbuf<N*2> out1_en_buf(.in=_en, .supply=supply);
sigbuf<N> out1_en_buf_f(.in=_en, .out=_en1_X_f, .supply=supply);
INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vdd = supply.vdd, .vss = supply.vss); INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vdd = supply.vdd, .vss = supply.vss);
sigbuf<N> out1_a_B_buf_f(.in=_out1_a_B,.out=_out1_a_BX_t, .supply=supply); sigbuf<N*2> out1_a_B_buf(.in=_out1_a_B, .supply=supply);
sigbuf<N> out1_a_B_buf_t(.in=_out1_a_B,.out=_out1_a_BX_f, .supply=supply);
(i:N: (i:N:
out1_f_buf_func[i].y=out1.d.d[i].f; out1_f_buf_func[i].y=out1.d.d[i].f;
out1_t_buf_func[i].y=out1.d.d[i].t; out1_t_buf_func[i].y=out1.d.d[i].t;
out1_f_buf_func[i].c1=_en1_X_f[i]; out1_f_buf_func[i].c1=out1_en_buf.out[i];
out1_t_buf_func[i].c1=_en1_X_t[i]; out1_t_buf_func[i].c1=out1_en_buf.out[i+N];
out1_f_buf_func[i].c2=_out1_a_BX_f[i]; out1_f_buf_func[i].c2=out1_a_B_buf.out[i];
out1_t_buf_func[i].c2=_out1_a_BX_t[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_f_buf_func[i].n1=in.d.d[i].f;
out1_t_buf_func[i].n1=in.d.d[i].t; out1_t_buf_func[i].n1=in.d.d[i].t;
out1_f_buf_func[i].vdd=supply.vdd; out1_f_buf_func[i].vdd=supply.vdd;
@ -290,21 +285,19 @@ namespace tmpl {
) )
//func buffer out2 //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_f_buf_func[N];
A_2C2N_RB_X4 out2_t_buf_func[N]; A_2C2N_RB_X4 out2_t_buf_func[N];
sigbuf<N> out2_en_buf_t(.in=_en, .out=_en2_X_t, .supply=supply); sigbuf<N*2> out2_en_buf(.in=_en, .supply=supply);
sigbuf<N> out2_en_buf_f(.in=_en, .out=_en2_X_f, .supply=supply);
INV_X1 out2_a_inv(.a=out2.a,.y=_out2_a_B, .vdd = supply.vdd, .vss = supply.vss); INV_X1 out2_a_inv(.a=out2.a,.y=_out2_a_B, .vdd = supply.vdd, .vss = supply.vss);
sigbuf<N> out2_a_B_buf_f(.in=_out2_a_B,.out=_out2_a_BX_t); sigbuf<N*2> out2_a_B_buf(.in=_out2_a_B);
sigbuf<N> out2_a_B_buf_t(.in=_out2_a_B,.out=_out2_a_BX_f);
(i:N: (i:N:
out2_f_buf_func[i].y=out2.d.d[i].f; out2_f_buf_func[i].y=out2.d.d[i].f;
out2_t_buf_func[i].y=out2.d.d[i].t; out2_t_buf_func[i].y=out2.d.d[i].t;
out2_f_buf_func[i].c1=_en2_X_f[i]; out2_f_buf_func[i].c1=out2_en_buf.out[i];
out2_t_buf_func[i].c1=_en2_X_t[i]; out2_t_buf_func[i].c1=out2_en_buf.out[i+N];
out2_f_buf_func[i].c2=_out2_a_BX_f[i]; out2_f_buf_func[i].c2=out2_a_B_buf.out[i];
out2_t_buf_func[i].c2=_out2_a_BX_t[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_f_buf_func[i].n1=in.d.d[i].f;
out2_t_buf_func[i].n1=in.d.d[i].t; out2_t_buf_func[i].n1=in.d.d[i].t;
out2_f_buf_func[i].vdd=supply.vdd; out2_f_buf_func[i].vdd=supply.vdd;
@ -341,21 +334,19 @@ namespace tmpl {
//function //function
//func buffer out1 //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_f_buf_func[N];
A_2C1N_RB_X4 out1_t_buf_func[N]; A_2C1N_RB_X4 out1_t_buf_func[N];
sigbuf<N> out1_en_buf_t(.in=_en, .out=_en1_X_t, .supply=supply); sigbuf<N*2> out1_en_buf(.in=_en, .supply=supply);
sigbuf<N> 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);
sigbuf<N> out1_a_B_buf_f(.in=_out1_a_B,.out=_out1_a_BX_t); sigbuf<N*2> out1_a_B_buf(.in=_out1_a_B);
sigbuf<N> out1_a_B_buf_t(.in=_out1_a_B,.out=_out1_a_BX_f);
(i:N: (i:N:
out1_f_buf_func[i].y=out1.d.d[i].f; out1_f_buf_func[i].y=out1.d.d[i].f;
out1_t_buf_func[i].y=out1.d.d[i].t; out1_t_buf_func[i].y=out1.d.d[i].t;
out1_f_buf_func[i].c1=_en1_X_f[i]; out1_f_buf_func[i].c1=out1_en_buf.out[i];
out1_t_buf_func[i].c1=_en1_X_t[i]; out1_t_buf_func[i].c1=out1_en_buf.out[i+N];
out1_f_buf_func[i].c2=_out1_a_BX_f[i]; out1_f_buf_func[i].c2=out1_a_B_buf.out[i];
out1_t_buf_func[i].c2=_out1_a_BX_t[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_f_buf_func[i].n1=in.d.d[i].f;
out1_t_buf_func[i].n1=in.d.d[i].t; out1_t_buf_func[i].n1=in.d.d[i].t;
out1_f_buf_func[i].vdd=supply.vdd; out1_f_buf_func[i].vdd=supply.vdd;
@ -368,31 +359,29 @@ namespace tmpl {
out1_f_buf_func[i].sr_B = _reset_BXX[i]; out1_f_buf_func[i].sr_B = _reset_BXX[i];
) )
//func buffer out2 //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_f_buf_func[N];
A_2C1N_RB_X4 out2_t_buf_func[N]; A_2C1N_RB_X4 out2_t_buf_func[N];
sigbuf<N> out2_en_buf_t(.in=_en, .out=_en2_X_t, .supply=supply); sigbuf<N*2> out2_en_buf(.in=_en, .supply=supply);
sigbuf<N> 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);
sigbuf<N> out2_a_B_buf_f(.in=_out2_a_B,.out=_out2_a_BX_t); sigbuf<N*2> out2_a_B_buf(.in=_out2_a_B);
sigbuf<N> out2_a_B_buf_t(.in=_out2_a_B,.out=_out2_a_BX_f);
(i:N: (i:N:
out2_f_buf_func[i].y=out2.d.d[i].f; out2_f_buf_func[i].y=out2.d.d[i].f;
out2_t_buf_func[i].y=out2.d.d[i].t; out2_t_buf_func[i].y=out2.d.d[i].t;
out2_f_buf_func[i].c1=_en2_X_f[i]; out2_f_buf_func[i].c1=out2_en_buf.out[i];
out2_t_buf_func[i].c1=_en2_X_t[i]; out2_t_buf_func[i].c1=out2_en_buf.out[i+N];
out2_f_buf_func[i].c2=_out2_a_BX_f[i]; out2_f_buf_func[i].c2=out2_a_B_buf.out[i];
out2_t_buf_func[i].c2=_out2_a_BX_t[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_f_buf_func[i].n1=in.d.d[i].f;
out2_t_buf_func[i].n1=in.d.d[i].t; out2_t_buf_func[i].n1=in.d.d[i].t;
out2_f_buf_func[i].vdd=supply.vdd; out2_f_buf_func[i].vdd=supply.vdd;
out2_t_buf_func[i].vdd=supply.vdd; out2_t_buf_func[i].vdd=supply.vdd;
out2_f_buf_func[i].vss=supply.vss; out2_f_buf_func[i].vss=supply.vss;
out2_t_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].pr_B = _reset_BXX[i];
out2_t_buf_func[i].sr_B = _reset_BXX[i+N]; out2_t_buf_func[i].sr_B = _reset_BXX[i];
out2_f_buf_func[i].pr_B = _reset_BXX[i+N]; out2_f_buf_func[i].pr_B = _reset_BXX[i];
out2_f_buf_func[i].sr_B = _reset_BXX[i+N]; out2_f_buf_func[i].sr_B = _reset_BXX[i];
) )
} }
@ -438,21 +427,19 @@ namespace tmpl {
//function //function
//func buffer out1 //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_f_buf_func[N];
A_2C2N_RB_X4 out1_t_buf_func[N]; A_2C2N_RB_X4 out1_t_buf_func[N];
sigbuf<N> out1_en_buf_t(.in=_en, .out=_en1_X_t, .supply=supply); sigbuf<N*2> out1_en_buf(.in=_en, .supply=supply);
sigbuf<N> out1_en_buf_f(.in=_en, .out=_en1_X_f, .supply=supply);
INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vss = supply.vss, .vdd = supply.vdd); INV_X1 out1_a_inv(.a=out1.a,.y=_out1_a_B, .vss = supply.vss, .vdd = supply.vdd);
sigbuf<N> out1_a_B_buf_f(.in=_out1_a_B,.out=_out1_a_BX_t, .supply=supply); sigbuf<N*2> out1_a_B_buf(.in=_out1_a_B, .supply=supply);
sigbuf<N> out1_a_B_buf_t(.in=_out1_a_B,.out=_out1_a_BX_f, .supply=supply);
(i:N: (i:N:
out1_f_buf_func[i].y=out1.d.d[i].f; out1_f_buf_func[i].y=out1.d.d[i].f;
out1_t_buf_func[i].y=out1.d.d[i].t; out1_t_buf_func[i].y=out1.d.d[i].t;
out1_f_buf_func[i].c1=_en1_X_f[i]; out1_f_buf_func[i].c1=out1_en_buf.out[i];
out1_t_buf_func[i].c1=_en1_X_t[i]; out1_t_buf_func[i].c1=out1_en_buf.out[i+N];
out1_f_buf_func[i].c2=_out1_a_BX_f[i]; out1_f_buf_func[i].c2=out1_a_B_buf.out[i];
out1_t_buf_func[i].c2=_out1_a_BX_t[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_f_buf_func[i].n1=in.d.d[i].f;
out1_t_buf_func[i].n1=in.d.d[i].t; out1_t_buf_func[i].n1=in.d.d[i].t;
out1_f_buf_func[i].vdd=supply.vdd; out1_f_buf_func[i].vdd=supply.vdd;