From dde782d7c0cc148cc4eb497bfaad987f0d5412a9 Mon Sep 17 00:00:00 2001 From: alexmadison Date: Tue, 21 Jun 2022 13:39:34 +0200 Subject: [PATCH] updated 2d encoder simple to include delays after the arbiter --- dataflow_neuro/coders.act | 64 ++++++++++++++------------------------- 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/dataflow_neuro/coders.act b/dataflow_neuro/coders.act index 645d4fe..57a495e 100644 --- a/dataflow_neuro/coders.act +++ b/dataflow_neuro/coders.act @@ -917,60 +917,40 @@ defproc decoder_2d_hybrid (avMx1of2 in; bool! out_req_x[Nx], out_req_y[ dualrail_encoder Xenc(.supply = supply); dualrail_encoder Yenc(.supply = supply); - // Create slow-falling in acks - // (so that neurons have time to complete the internal handshakes) - OR2_X1 dly_ors_x[Nx]; - OR2_X1 dly_ors_y[Ny]; - BUF_X12 sb_inx_a[Nx]; - BUF_X12 sb_iny_a[Ny]; delay_chain dly_x[Nx]; delay_chain dly_y[Ny]; - (i:Nx: - dly_x[i].in = Xarb.in[i].a; - dly_ors_x[i].a = Xarb.in[i].a; - dly_ors_x[i].b = dly_x[i].out; - sb_inx_a[i].a = dly_ors_x[i].y; - sb_inx_a[i].y = inx[i].a; - // Power - dly_ors_x[i].vdd = supply.vdd; - dly_ors_x[i].vss = supply.vss; + BUF_X12 sb_inx_a[Nx]; + BUF_X12 sb_iny_a[Ny]; + + // Wire up inputs to encoders and arb + (i:Nx: + Xarb.in[i].r = inx[i].r; + + dly_x[i].in = Xarb.in[i].a; + dly_x[i].out = sb_inx_a[i].a; + sb_inx_a[i].y = inx[i].a; + // Xarb.in[i].a = inx[i].a; + Xenc.in[i] = inx[i].a; + dly_x[i].supply = supply; sb_inx_a[i].vdd = supply.vdd; sb_inx_a[i].vss = supply.vss; ) - (i:Ny: - dly_y[i].in = Yarb.in[i].a; - dly_ors_y[i].a = Yarb.in[i].a; - dly_ors_y[i].b = dly_y[i].out; - sb_iny_a[i].a = dly_ors_y[i].y; - sb_iny_a[i].y = iny[i].a; - - // Power - dly_ors_y[i].vdd = supply.vdd; - dly_ors_y[i].vss = supply.vss; - dly_y[i].supply = supply; - sb_iny_a[i].vdd = supply.vdd; - sb_iny_a[i].vss = supply.vss; - ) - - - // Wire up inputs to encoders and arb - (i:Nx: - Xarb.in[i].r = inx[i].r; - // Xarb.in[i].a = inx[i].a; - // Not sure here if the Xenc should be connected to the - // inx.a before or after the delay. - // But I think before is fine... - Xenc.in[i] = inx[i].a; - ) - // Wire up inputs to encoders and arb (i:Ny: Yarb.in[i].r = iny[i].r; + + dly_y[i].in = Yarb.in[i].a; + dly_y[i].out = sb_iny_a[i].a; + sb_iny_a[i].y = iny[i].a; // Yarb.in[i].a = iny[i].a; Yenc.in[i] = iny[i].a; + + dly_y[i].supply = supply; + sb_iny_a[i].vdd = supply.vdd; + sb_iny_a[i].vss = supply.vss; ) INV_X2 inv_buf(.a = buf.in.a, .vdd = supply.vdd, .vss = supply.vss); @@ -1004,7 +984,7 @@ defproc decoder_2d_hybrid (avMx1of2 in; bool! out_req_x[Nx], out_req_y[ // dly_x[i].in = to_pd_x[i].a; // pd_x[i].in = dly_x[i].out; pd_x[i].in = to_pd_x[i].a; - + pd_x[i].out = to_pd_x[i].r; pd_x[i].reset_B = rsb_pd_x.out[i]; pd_x[i].supply = supply;