Demux Simmed, fixed treegates

This commit is contained in:
2022-02-25 15:13:21 +01:00
parent 739aadbc4d
commit dbb7107da0
9 changed files with 1895 additions and 33 deletions

View File

@ -151,27 +151,25 @@ namespace tmpl {
}
export template<pint N>
defproc demux (avMx1of2<N> in; avMx1of2<N> out1; avMx1of2<N> out2; bool? reset_B, c_t, c_f; power supply) {
defproc demux (avMx1of2<N> in; avMx1of2<N> out1; avMx1of2<N> out2; bool? reset_B; avMx1of2<1> cond; power supply) {
//control
bool _en, _reset_BX,_reset_BXX[N], _out_v;
bool _en, _reset_BX,_reset_BXX[2*N], _out_v, _in_c_v_;
OR2_X1 out_or(.a=out1.v, .b=out2.v, .y=_out_v,.vdd=supply.vdd,.vss=supply.vss);
A_3C_RB_X4 inack_ctl(.c1=_en,.c2=_in_c_v_,.c3= _out_v,.y=in.a,.pr_B=_reset_BXX,.sr_B=_reset_BXX,.vdd=supply.vdd,.vss=supply.vss);
A_3C_RB_X4 inack_ctl(.c1=_en,.c2=_in_c_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<2*N> reset_bufarray(.in=_reset_BX, .out=_reset_BXX);
A_1C1P_X1 en_ctl(.c1=in.a,.p1=out.v,.y=_en,.vdd=supply.vdd,.vss=supply.vss);
//validity
bool _in_v, _c_f_buf, _c_t_buf, _c_v, _in_c_v_;
bool _in_v, _c_f_buf[N], _c_t_buf[N], _c_v;
sigbuf<N> c_buf_t(.in=c_t, .out=_c_t_buf);
sigbuf<N> c_buf_f(.in=c_f, .out=_c_f_buf);
sigbuf<N> c_buf_t(.in=cond.d.d[0].t, .out=_c_t_buf);
sigbuf<N> c_buf_f(.in=cond.d.d[0].f, .out=_c_f_buf);
OR2_X1 c_f_c_t_or(.a=c_t, .b=c_f, .y=_c_v,.vdd=supply.vdd,.vss=supply.vss);
OR2_X1 c_f_c_t_or(.a=cond.d.d[0].t, .b=cond.d.d[0].f, .y=_c_v,.vdd=supply.vdd,.vss=supply.vss);
ctree<N> vc(.in=in.d,.out=_in_v,.supply=supply);
A_2C_RB_X4 c_el(.c1=_c_v, .c2=_in_v, .y=_in_c_v_,.vdd=supply.vdd,.vss=supply.vss);
A_2C_B_X1 c_el(.c1=_c_v, .c2=_in_v, .y=_in_c_v_,.vdd=supply.vdd,.vss=supply.vss);
BUF_X4 in_v_buf(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss);
@ -202,9 +200,10 @@ namespace tmpl {
out1_t_buf_func[i].sr_B = _reset_BXX[i];
out1_f_buf_func[i].pr_B = _reset_BXX[i];
out1_f_buf_func[i].sr_B = _reset_BXX[i];
out1_f_buf_func[i].n2=_c_t_buf;
out1_t_buf_func[i].n2=_c_t_buf;
out1_f_buf_func[i].n2=_c_t_buf[i];
out1_t_buf_func[i].n2=_c_t_buf[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];
A_2C2N_RB_X4 out2_f_buf_func[N];
@ -231,12 +230,10 @@ namespace tmpl {
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_f_buf_func[i].n2=_c_f_buf;
out2_t_buf_func[i].n2=_c_f_buf;
out2_f_buf_func[i].n2=_c_f_buf[i];
out2_t_buf_func[i].n2=_c_f_buf[i];
)
}
export template<pint N>
defproc fork (avMx1of2<N> in; avMx1of2<N> out1; avMx1of2<N> out2 ; bool? reset_B; power supply) {
@ -313,6 +310,8 @@ namespace tmpl {
out2_f_buf_func[i].sr_B = _reset_BXX[i+N-1];
)
}
// export template<pint N>
// defproc merge (avMx1of2<N> in1; avMx1of2<N> in2; avMx1of2<N> out ; bool? reset_B; power supply) {

View File

@ -78,9 +78,15 @@ defproc ortree (bool? in[N]; bool! out; power supply)
(k:N:tmp[k] = in[k];)
/* array to hold the actual C-elments, either A2C or A3C */
OR2_X1 C2Els[lenTree2Count];
OR3_X1 C3Els[lenTree3Count];
[lenTree2Count > 0 ->
OR2_X1 C2Els[lenTree2Count];
]
[lenTree3Count > 0 ->
OR3_X1 C3Els[lenTree3Count];
]
(h:lenTree2Count:C2Els[h].vdd = supply.vdd;)
(h:lenTree3Count:C3Els[h].vdd = supply.vdd;)
@ -196,8 +202,14 @@ defproc ctree (std::data::Mx1of2?<N> in; bool! out; power supply)
//(k:N:tmp[k] = in[k];)
/* array to hold the actual C-elments, either A2C or A3C */
A_2C_B_X1 C2Els[lenTree2Count];
A_3C_B_X1 C3Els[lenTree3Count];
[lenTree2Count > 0 ->
A_2C_B_X1 C2Els[lenTree2Count];
]
[lenTree3Count > 0 ->
A_3C_B_X1 C3Els[lenTree3Count];
]
(h:lenTree2Count:C2Els[h].vdd = supply.vdd;)
(h:lenTree3Count:C3Els[h].vdd = supply.vdd;)