From 6dfc941993a92cea2d2dd94912ec40fc979b4b75 Mon Sep 17 00:00:00 2001 From: alexmadison Date: Thu, 31 Mar 2022 15:10:47 +0200 Subject: [PATCH] added Cel to buf out ack, so that ack can't be removed before the bufs output data is fully invalidated --- dataflow_neuro/coders.act | 40 +++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/dataflow_neuro/coders.act b/dataflow_neuro/coders.act index 7e3730f..14a6264 100644 --- a/dataflow_neuro/coders.act +++ b/dataflow_neuro/coders.act @@ -130,12 +130,24 @@ defproc decoder_2d_dly (avMx1of2 in; bool? outx[Nx], outy[Ny], export template defproc and_grid(bool! out[Nx*Ny]; bool? inx[Nx], iny[Ny]; power supply) { + // Buffer inputs + sigbuf xbuf[Nx]; + sigbuf ybuf[Ny]; + (i:Nx: + xbuf[i].in = inx[i]; + xbuf[i].supply = supply; + ) + (i:Ny: + ybuf[i].in = iny[i]; + ybuf[i].supply = supply; + ) + AND2_X1 ands[Nx*Ny]; (i:0..Nx*Ny-1:ands[i].vss = supply.vss; ands[i].vdd = supply.vdd;) (x:0..Nx-1: (y:0..Ny-1: - ands[x + y*Nx].a = inx[x]; - ands[x + y*Nx].b = iny[y]; + ands[x + y*Nx].a = xbuf[x].out[y]; + ands[x + y*Nx].b = ybuf[y].out[x]; ands[x + y*Nx].y = out[x + y*Nx]; ) ) @@ -164,6 +176,18 @@ defproc decoder_2d_hs (avMx1of2 in; a1of1 out[Nx*Ny]; bool? reset_B; po decoder_dualrail d_dr_y(.supply = supply); (i:0..NyC-1:d_dr_y.in.d[i] = addr_buf.out.d.d[i+NxC];) + // Buffer dualrail decoder outputs + // sigbuf d_dr_xX[Nx]; // x2 because X req lines go to twice the num of gates + // sigbuf d_dr_yX[Ny]; + // (i:Nx: + // d_dr_xX[i].in = d_dr_x.out[i]; + // d_dr_xX[i].supply = supply; + // ) + // (i:Ny: + // d_dr_yX[i].in = d_dr_y.out[i]; + // d_dr_yX[i].supply = supply; + // ) + // Validity vtree vtree_x (.supply = supply); vtree vtree_y (.supply = supply); @@ -171,7 +195,7 @@ defproc decoder_2d_hs (avMx1of2 in; a1of1 out[Nx*Ny]; bool? reset_B; po (i:0..NxC-1:vtree_x.in.d[i].f = addr_buf.out.d.d[i].f;) (i:0..NyC-1:vtree_y.in.d[i].t = addr_buf.out.d.d[i+NxC].t;) (i:0..NyC-1:vtree_y.in.d[i].f = addr_buf.out.d.d[i+NxC].f;) - A_2C_B_X1 C2el(.c1 = vtree_x.out, .c2 = vtree_y.out, .y = addr_buf.out.v, + A_2C_B_X1 valid_Cel(.c1 = vtree_x.out, .c2 = vtree_y.out, .y = addr_buf.out.v, .vdd = supply.vdd, .vss = supply.vss); @@ -214,7 +238,7 @@ defproc decoder_2d_hs (avMx1of2 in; a1of1 out[Nx*Ny]; bool? reset_B; po // ORtree from all output acks, back to the buffer ack. // This is instead of the ack that came from the delayed validity trees, // in decoder_2d_dly. - ortree _ortree(.out = addr_buf.out.a, .supply = supply); + ortree _ortree(.supply = supply); INV_X1 out_ack_invs[Nx]; (i:Nx: out_ack_invs[i].a = _out_acksB[i]; @@ -223,6 +247,14 @@ defproc decoder_2d_hs (avMx1of2 in; a1of1 out[Nx*Ny]; bool? reset_B; po _ortree.in[i] = out_ack_invs[i].y; ) + + // NEED TO ADD C EL + // SUCH THAT ACK IS LOWERED ONLY WHEN + // VAL IS LOWERED TOO + // i.e. buffer.out.a = Cel(ortree_ack, valid) + A_2C_B_X1 buf_ack_Cel(.c1 = _ortree.out, .c2 = valid_Cel.y, .y = addr_buf.out.a, + .vdd = supply.vdd, .vss = supply.vss); + }