Async buffer test fully working

This commit is contained in:
2022-02-22 18:04:21 +01:00
parent 7e86815e28
commit 53d11963fb
10 changed files with 1758 additions and 39 deletions

View File

@ -287,7 +287,32 @@ namespace tmpl {
p_n_mode <- 1;
y {-1}}
}
export defcell A_2C1N_RB_X1(bool ! y; bool? c1, c2, n1, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
export defcell A_2C1N_RB_X4(bool ! y; bool? c1, c2, n1, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_2C_X1 (bool ! y; bool? c1, c2; bool? vdd, vss)
{
prs{

View File

@ -106,42 +106,44 @@ namespace tmpl {
export template<pint N>
defproc buffer (avMx1of2<N> in; avMx1of2<N> out; bool? reset_B; power supply) {
//control
bool _en,_en_X, _reset_BX,_reset_BXX[N];
A_3C_RB_X4 inack_ctl(.c1=_en_X,.c2=in.v,.c3=out.v,.y=in.a,.pr_B=reset_B,.sr_B=reset_B,.vdd=supply.vdd,.vss=supply.vss);
bool _en, _reset_BX,_reset_BXX[N];
A_3C_RB_X4 inack_ctl(.c1=_en,.c2=in.v,.c3=out.v,.y=in.a,.pr_B=reset_B,.sr_B=reset_B,.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);
sigbuf<N*2> en_buf(.in=_en, .out=_en_X, .supply=supply);
sigbuf<N> reset_bufarray(.in=reset_BX, .out=_reset_BXX);
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX);
sigbuf<N> reset_bufarray(.in=_reset_BX, .out=_reset_BXX);
BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
//validity
bool _in_v;
ctree<N> vc(.in=in.d,.y=_in_v,.vdd=supply.vdd,.vss=supply.vss);
sigbuf<12> in_v_buf(.in=_in_v, .out=in.v,.vdd=supply.vdd,.vss=supply.vss);
ctree<N> vc(.in=in.d,.out=_in_v,.supply=supply);
BUF_X4 in_v_buf(.a=_in_v, .y=in.v,.vdd=supply.vdd,.vss=supply.vss);
//function
bool _out_a_BX, _out_a_B;
A_2C1N_RB_X4 f_buf_func[N](.pr_B = reset_BXX,.sr_B = reset_BXX);
bool _out_a_BX_t[N],_out_a_BX_f[N],_out_a_B,_en_X_t[N],_en_X_f[N];
A_2C1N_RB_X4 f_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> en_buf_f(.in=_en, .out=_en_X_f, .supply=supply);
INV_X1 out_a_inv(.a=out.a,.y=_out_a_B);
sigbuf<N*2> out_a_B_buf(.a=_out_a_B,.y=_out_a_BX);
sigbuf<N> out_a_B_buf_f(.in=_out_a_B,.out=_out_a_BX_t);
sigbuf<N> out_a_B_buf_t(.in=_out_a_B,.out=_out_a_BX_f);
// 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;
t_buf_func[i].c1=_en_X;
f_buf_func[i].c2=_out_a_BX;
t_buf_func[i].c2=_out_a_BX;
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].n1=in.d.d[i].f;
t_buf_func[i].n1=in.d.d[i].t;
f_buf_func[i].pr_B=reset_B;
t_buf_func[i].pr_B=reset_B;
f_buf_func[i].sr_B=reset_B;
t_buf_func[i].sr_B=reset_B;
f_buf_func[i].vdd=supply.vdd;
t_buf_func[i].vdd=supply.vdd;
f_buf_func[i].vss=supply.vss;
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];
)
}
}

View File

@ -23,7 +23,8 @@
**************************************************************************/
import "../../dataflow_neuro/cell_lib_async.act";
import "../../dataflow_neuro/cell_lib_std.act";
import std::channel;
open std::channel;
namespace tmpl {
namespace dataflow_neuro {
@ -144,7 +145,7 @@ defproc ortree (bool? in[N]; bool! out; power supply)
* C-elements
*/
export template<pint N>
defproc ctree (bool? in[N]; bool! out; power supply)
defproc ctree (std::data::Mx1of2?<N> in; bool! out; power supply)
{
bool tout;
@ -180,7 +181,19 @@ defproc ctree (bool? in[N]; bool! out; power supply)
/* array that holds ALL the nodes in the completion tree */
bool tmp[end+1];
(k:N:tmp[k] = in[k];)
// OR layer for making OR between true and false of in (they are then sent to Ctree)
OR2_X1 OR2_tf[N];
(l:N:
OR2_tf[l].a = in.d[l].t;
OR2_tf[l].b = in.d[l].f;
OR2_tf[l].y = tmp[l];
// OR2_tf[i].a = supply.vdd;
// OR2_tf[i].b = supply.vdd;
// OR2_tf[i].y = supply.vdd;
OR2_tf[l].vdd = supply.vdd;
OR2_tf[l].vss = supply.vss;
)
//(k:N:tmp[k] = in[k];)
/* array to hold the actual C-elments, either A2C or A3C */
A_2C_B_X1 C2Els[lenTree2Count];
@ -269,7 +282,7 @@ defproc sigbuf (bool? in; bool! out[N]; power supply)
[] N >= 30 & N <= 42 ->
BUF_X12 buf12 (.a = in, .y = out[0], .vdd = supply.vdd, .vss = supply.vss);
]
(i:1..N:y[i]=y[0];)
(i:1..N-1:out[i]=out[0];)
}
}}