fixed test by using encoder_simple

This commit is contained in:
alexmadison 2023-11-21 13:28:38 +01:00
parent 1aeb37f976
commit c1e26267e2
2 changed files with 24 additions and 2 deletions

View File

@ -57,15 +57,17 @@ defproc fifo_decoder_neurons_encoder_fifo (avMx1of2<7> in; avMx1of2<7> out; bool
and_grid<Nx, Ny> _and_grid(.inx = decoder.outx, .iny = decoder.outy, .supply = supply); and_grid<Nx, Ny> _and_grid(.inx = decoder.outx, .iny = decoder.outy, .supply = supply);
// Pretend that each "synapse" immediately makes its one neuron "spike". // Pretend that each "synapse" immediately makes its one neuron "spike".
// that is, connect the output of each encoder target to the decoder input. // that is, connect the output of each encoder target to the decoder input.
nrn_hs_2D_array<Nx,Ny,10> neuron_grid(.reset_B = _reset_B, .supply = supply); nrn_hs_2d_array<Nx,Ny> neuron_grid(.reset_B = _reset_B, .supply = supply);
(i:Nx*Ny: (i:Nx*Ny:
// Connect the output bool to the input req of each neuron handshaker // Connect the output bool to the input req of each neuron handshaker
// Leave ack dangling. // Leave ack dangling.
neuron_grid.in[i].r = _and_grid.out[i]; neuron_grid.in[i].r = _and_grid.out[i];
) )
encoder2D<NxC,NyC,Nx,Ny,4> encoder(.inx = neuron_grid.outx, .iny = neuron_grid.outy, encoder2d_simple<NxC,NyC,Nx,Ny,4> encoder(.inx = neuron_grid.outx, .iny = neuron_grid.outy,
.to_pd_x = neuron_grid.to_pd_x, .to_pd_y = neuron_grid.to_pd_y,
.reset_B = _reset_B, .supply = supply); .reset_B = _reset_B, .supply = supply);
fifo<NxC + NyC,5> fifo_post(.in = encoder.out, .out = out, .reset_B = _reset_B, .supply = supply); fifo<NxC + NyC,5> fifo_post(.in = encoder.out, .out = out, .reset_B = _reset_B, .supply = supply);
} }

View File

@ -14,9 +14,29 @@ set e.dly_cfg[5] 1
cycle cycle
# assert e.decoder.outx[0] 0
# assert e.neuron_grid.outx[0].r 0
# assert e.encoder.pd_x[0].inv.y 1
# assert e.encoder.pd_x[0].pull_downR.n1 1
# assert e.encoder.pd_x[0].pull_downR.n2 1
# assert e.encoder.pd_x[0].pull_downR.y 0
# assert e.neuron_grid.neurons[0].pu_x.p1 1
# assert e.neuron_grid.neurons[0].pu_x.p2 1
# assert e.neuron_grid.neurons[0].pu_x.p3 1
# assert e.encoder.Xarb.in[0].a 0
mode run mode run
system "echo '[] Set reset 0'" system "echo '[] Set reset 0'"
system "echo '[] Asserting decoder req 0 0'"
status X status X
set Reset 0 set Reset 0
cycle cycle