added decoder dualrail refresh

This commit is contained in:
alexmadison 2022-04-13 17:35:41 +02:00
parent 4cca8c14fe
commit bf4af13e04
6 changed files with 28645 additions and 6082 deletions

View File

@ -86,6 +86,63 @@ defproc decoder_dualrail (Mx1of2<Nc> in; bool? out[N]; power supply) {
)
}
/**
* Dualrail decoder, but the signals to the decoders are refreshed every 48 gates.
* final_refresh is signal at the end of the refresh line.
* Is needed for doing validity checking etc, since it is the laggiest signal.
*/
export template<pint Nc, N>
defproc decoder_dualrail_refresh (Mx1of2<Nc> in; bool? out[N]; Mx1of2<Nc> final_refresh; power supply) {
// signal buffers
pint index;
pint NUM_REFRESH = N/(48*2); // x2 bc only half the output bits look for it.
BUF_X12 in_tX[Nc*(NUM_REFRESH+1)];
BUF_X12 in_fX[Nc*(NUM_REFRESH+1)];
(i:Nc:
// Connect start
in_tX[i].a = in.d[i].t;
in_fX[i].a = in.d[i].f;
// Connect mid bois
(j:NUM_REFRESH:
index = i + (1+j)*Nc;
in_tX[index].a = in_tX[index-Nc].y;
)
// Connect end
in_tX[i+NUM_REFRESH*Nc].y = final_refresh.d[i].t;
in_fX[i+NUM_REFRESH*Nc].y = final_refresh.d[i].f;
)
(i:Nc*(NUM_REFRESH+1):
in_tX[i].vdd = supply.vdd;
in_tX[i].vss = supply.vss;
in_fX[i].vdd = supply.vdd;
in_fX[i].vss = supply.vss;
)
// AND trees
pint bitval;
andtree<Nc> atree[N];
(k:0..N-1:atree[k].supply = supply;)
(i:0..N-1:
(j:0..Nc-1:
bitval = (i & ( 1 << j )) >> j; // Get binary digit of integer i, column j
[bitval = 1 ->
atree[i].in[j] = in_tX[j+(i/96)*Nc].y;
// atree[i].in[j] = addr_buf.out.d.d[j].t;
[]bitval = 0 ->
atree[i].in[j] = in_fX[j+(i/96)*Nc].y;
// atree[i].in[j] = addr_buf.out.d.d[j].f;
[]bitval >= 2 -> {false : "fuck"};
]
atree[i].out = out[i];
)
)
}
/**
* Dualrail decoder with buffered outputs.
* Be careful of out[] indexing.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -42,8 +42,12 @@ open tmpl::dataflow_neuro;
pint N_IN = 32;
pint N_NRN_X = 15;
pint N_NRN_Y = 6;
// pint N_NRN_X = 15;
// pint N_NRN_Y = 6;
// pint NC_NRN_X = 4;
// pint NC_NRN_Y = 3;
pint N_NRN_X = 16;
pint N_NRN_Y = 8;
pint NC_NRN_X = 4;
pint NC_NRN_Y = 3;
@ -51,8 +55,8 @@ pint NC_NRN_Y = 3;
// pint N_SYN_Y = 348;
// pint NC_SYN_X = 6;
// pint NC_SYN_Y = 9;
pint N_SYN_X = 15;
pint N_SYN_Y = 6;
pint N_SYN_X = 16;
pint N_SYN_Y = 8;
pint NC_SYN_X = 4;
pint NC_SYN_Y = 3;
@ -86,10 +90,10 @@ defproc chip_texel_dualcore (bd<N_IN> in, out;
Mx1of2<REG_NCW> c1_reg_data[REG_M];
// a1of1 c1_synapses[N_SYN_X * N_SYN_Y];
// a1of1 c1_neurons[N_NRN_X * N_NRN_Y];
bool! c1_syn_r[N_SYN_X * N_SYN_Y];
bool? c1_syn_a[N_SYN_X * N_SYN_Y];
bool? c1_nrn_r[N_NRN_X * N_NRN_Y];
bool! c1_nrn_a[N_NRN_X * N_NRN_Y];
bool c1_syn_r[N_SYN_X * N_SYN_Y];
bool c1_syn_a[N_SYN_X * N_SYN_Y];
bool c1_nrn_r[N_NRN_X * N_NRN_Y];
bool c1_nrn_a[N_NRN_X * N_NRN_Y];
bool! c1_nrn_mon_x[N_NRN_MON_X], c1_nrn_mon_y[N_NRN_MON_Y];
bool! c1_syn_mon_x[N_SYN_MON_X], c1_syn_mon_y[N_SYN_MON_Y];
@ -100,10 +104,10 @@ defproc chip_texel_dualcore (bd<N_IN> in, out;
Mx1of2<REG_NCW> c2_reg_data[REG_M];
// a1of1 c2_synapses[N_SYN_X * N_SYN_Y];
// a1of1 c2_neurons[N_NRN_X * N_NRN_Y];
bool! c2_syn_r[N_SYN_X * N_SYN_Y];
bool? c2_syn_a[N_SYN_X * N_SYN_Y];
bool? c2_nrn_r[N_NRN_X * N_NRN_Y];
bool! c2_nrn_a[N_NRN_X * N_NRN_Y];
bool c2_syn_r[N_SYN_X * N_SYN_Y];
bool c2_syn_a[N_SYN_X * N_SYN_Y];
bool c2_nrn_r[N_NRN_X * N_NRN_Y];
bool c2_nrn_a[N_NRN_X * N_NRN_Y];
bool! c2_nrn_mon_x[N_NRN_MON_X], c2_nrn_mon_y[N_NRN_MON_Y];
bool! c2_syn_mon_x[N_SYN_MON_X], c2_syn_mon_y[N_SYN_MON_Y];
@ -155,7 +159,22 @@ defproc chip_texel_dualcore (bd<N_IN> in, out;
.c1_reg_data = c1_reg_data, .c1_synapses = c1_synapses, .c1_neurons = c1_neurons, .c1_nrn_mon_x = c1_nrn_mon_x, .c1_nrn_mon_y = c1_nrn_mon_y, .c1_syn_mon_x = c1_syn_mon_x, .c1_syn_mon_y = c1_syn_mon_y, .c1_syn_mon_AMZI = c1_syn_mon_AMZI, .c1_nrn_mon_AMZI = c1_nrn_mon_AMZI, .c1_syn_mon_AMZO = c1_syn_mon_AMZO, .c1_nrn_mon_AMZO = c1_nrn_mon_AMZO, .c1_syn_flags_EFO = c1_syn_flags_EFO, .c1_nrn_flags_EFO = c1_nrn_flags_EFO, .c2_reg_data = c2_reg_data, .c2_synapses = c2_synapses, .c2_neurons = c2_neurons, .c2_nrn_mon_x = c2_nrn_mon_x, .c2_nrn_mon_y = c2_nrn_mon_y, .c2_syn_mon_x = c2_syn_mon_x, .c2_syn_mon_y = c2_syn_mon_y, .c2_syn_mon_AMZI = c2_syn_mon_AMZI, .c2_nrn_mon_AMZI = c2_nrn_mon_AMZI, .c2_syn_mon_AMZO = c2_syn_mon_AMZO, .c2_nrn_mon_AMZO = c2_nrn_mon_AMZO, .c2_syn_flags_EFO = c2_syn_flags_EFO, .c2_nrn_flags_EFO = c2_nrn_flags_EFO, .bd_dly_cfg = bd_dly_cfg, .bd_dly_cfg2 = bd_dly_cfg2,
.loopback_en = loopback_en, .supply = supply, .reset_B = _reset_B);
pint N_SYNS = N_SYN_X * N_SYN_Y;
BUF_X4 syn2nrns_r[N_SYNS*2];
BUF_X4 syn2nrns_a[N_SYNS*2];
(i:N_SYNS:
syn2nrns_r[i].a = c1_synapses[i].r;
syn2nrns_r[i].y = c1_neurons[i].r;
syn2nrns_a[i].a = c1_neurons[i].a;
syn2nrns_a[i].y = c1_synapses[i].a;
syn2nrns_r[i+N_SYNS].a = c2_synapses[i].r;
syn2nrns_r[i+N_SYNS].y = c2_neurons[i].r;
syn2nrns_a[i+N_SYNS].a = c2_neurons[i].a;
syn2nrns_a[i+N_SYNS].y = c2_synapses[i].a;
)
}

File diff suppressed because it is too large Load Diff