diff --git a/dataflow_neuro/coders.act b/dataflow_neuro/coders.act index 7ce6b44..a2d93ca 100644 --- a/dataflow_neuro/coders.act +++ b/dataflow_neuro/coders.act @@ -604,23 +604,20 @@ namespace tmpl { ) ) - // Hacks to maybe construct some fifos, ignore. - [N_dly >= 1 -> - delay_fifo dly_x[Nx]; - delay_fifo dly_y[Ny]; - ] + // Create delay fifos to emulate the fact that the line pull downs + // are at the end of the line, and thus slow. + // Note that if N_dly = 0, delay fifo is just a pipe. + delay_fifo dly_x[Nx]; + delay_fifo dly_y[Ny]; // Create x line req pull downs line_end_pull_down pd_x[Nx]; sigbuf rsb_pd_x(.in = reset_B, .supply = supply); (i:0..Nx-1: - [ N_dly = 0 -> - pd_x[i].in = _outx[i].a; - [] N_dly >= 1 -> - dly_x[i].supply = supply; - dly_x[i].in = _outx[i].a; - pd_x[i].in = dly_x[i].out; - ] + dly_x[i].supply = supply; + dly_x[i].in = _outx[i].a; + pd_x[i].in = dly_x[i].out; + pd_x[i].out = _outx[i].r; pd_x[i].reset_B = rsb_pd_x.out[i]; pd_x[i].supply = supply; @@ -630,13 +627,10 @@ namespace tmpl { line_end_pull_down pd_y[Ny]; sigbuf rsb_pd_y(.in = reset_B, .supply = supply); (j:0..Ny-1: - [ N_dly = 0 -> - pd_y[j].in = _outy[j].a; - [] N_dly >= 1 -> - dly_y[j].supply = supply; - dly_y[j].in = _outy[j].a; - pd_y[j].in = dly_y[j].out; - ] + dly_y[j].supply = supply; + dly_y[j].in = _outy[j].a; + pd_y[j].in = dly_y[j].out; + pd_y[j].out = _outy[j].r; pd_y[j].reset_B = rsb_pd_y.out[j]; pd_y[j].supply = supply; diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index 0c09581..d75051a 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -690,8 +690,9 @@ namespace tmpl { // Is useful for testing purposes. // But should probably remove before running innovus etc. export template - defproc delay_fifo (bool! out; bool? in; power supply) { + defproc delay_fifo (bool out; bool in; power supply) { { N >= 0 : "What?" }; + [N >= 1 -> DLY4_X1 dly[N]; dly[0].vdd = supply.vdd; @@ -707,6 +708,10 @@ namespace tmpl { dly[N-1].vdd = supply.vdd; dly[N-1].vss = supply.vss; dly[N-1].y = out; + [] N = 1 -> + in = out; + ] + }