spikes out to sram working

This commit is contained in:
alexmadison 2022-05-10 14:53:26 +02:00
parent 7735cf8cba
commit 9ee41dc390
2 changed files with 630 additions and 3 deletions

View File

@ -743,11 +743,11 @@ defproc texel_dualcore_mapper (bd<N_IN> in, out;
fork<32> postcore_fork(.in = fifo_core2fork.out, .reset_B = _reset_BX, .supply = supply);
dropper_static<32, false> sram_dropper(.in = postcore_fork.out1, .cond = mapper_en, .supply = supply);
// Need to have it then drop the spike if its from a register.
demux_td<32, false> drop_if_reg(.in = sram_dropper.out, .reset_B = _reset_BX, .supply = supply); // if cond true, go out on data
demux_td<32, true> drop_if_reg(.in = sram_dropper.out, .reset_B = _reset_BX, .supply = supply); // if cond true, go out on data
drop_if_reg.cond.d.d[0] = sram_dropper.out.d.d[30];
drop_if_reg.token.r = drop_if_reg.token.a;
fifo<8,N_BUFFERS> fifo_out_sram_spk(.out = out_sram_spk, .reset_B = _reset_BX, .supply = supply);
slice_data<32,0,8> slice_to_sram(.in = drop_if_reg.out, .out = fifo_out_sram_spk.in, .supply = supply);
slice_data<32,0,8> slice_to_sram(.supply = supply);
// And move the msb (core bit) to just after the neuron address...
slice_to_sram.in.a = drop_if_reg.out.a;
slice_to_sram.in.v = drop_if_reg.out.v;
@ -755,6 +755,10 @@ defproc texel_dualcore_mapper (bd<N_IN> in, out;
slice_to_sram.in.d.d[7] = drop_if_reg.out.d.d[31];
(i:7..30: slice_to_sram.in.d.d[i+1] = drop_if_reg.out.d.d[i];)
fifo<8,N_BUFFERS> fifo_out_sram_spk(.in = slice_to_sram.out, .out = out_sram_spk,
.reset_B = _reset_BX, .supply = supply);
// merge from cores and sram read in
fifo<29, N_BUFFERS> fifo_in_sram_r(.in = in_sram_r, .reset_B = _reset_BX, .supply = supply);
fifo<32, N_BUFFERS> fifo_fork2mrg(.in = postcore_fork.out2, .reset_B = _reset_BX, .supply = supply);

View File

@ -7244,4 +7244,627 @@ cycle
assert-qdi-channel-neutral "c.out_sram_wr" 30
set c.out_sram_wr.a 0
set c.out_sram_wr.v 0
cycle
# Checking that neuron spikes end up goign to the sram
system "echo '[] Sending spike to core 0 synapse [5,293]'"
set-bd-data-valid "c.in" 32 4693
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [5,5]'"
assert-bd-channel-valid "c.out" 32 85
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 85
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [1,58]'"
set-bd-data-valid "c.in" 32 929
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [1,1]'"
assert-bd-channel-valid "c.out" 32 17
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 17
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [8,198]'"
set-bd-data-valid "c.in" 32 2147486824
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [8,3]'"
assert-bd-channel-valid "c.out" 32 2147483704
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 184
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [0,10]'"
set-bd-data-valid "c.in" 32 2147483808
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [0,0]'"
assert-bd-channel-valid "c.out" 32 2147483648
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 128
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [2,303]'"
set-bd-data-valid "c.in" 32 2147488498
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [2,5]'"
assert-bd-channel-valid "c.out" 32 2147483730
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 210
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [0,184]'"
set-bd-data-valid "c.in" 32 2944
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [0,3]'"
assert-bd-channel-valid "c.out" 32 48
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 48
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [4,44]'"
set-bd-data-valid "c.in" 32 2147484356
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [4,0]'"
assert-bd-channel-valid "c.out" 32 2147483652
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 132
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [1,190]'"
set-bd-data-valid "c.in" 32 2147486689
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [1,3]'"
assert-bd-channel-valid "c.out" 32 2147483697
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 177
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [8,68]'"
set-bd-data-valid "c.in" 32 2147484744
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [8,1]'"
assert-bd-channel-valid "c.out" 32 2147483672
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 152
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [13,3]'"
set-bd-data-valid "c.in" 32 61
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [13,0]'"
assert-bd-channel-valid "c.out" 32 13
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 13
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [8,307]'"
set-bd-data-valid "c.in" 32 2147488568
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [8,5]'"
assert-bd-channel-valid "c.out" 32 2147483736
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 216
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [10,240]'"
set-bd-data-valid "c.in" 32 2147487498
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [10,4]'"
assert-bd-channel-valid "c.out" 32 2147483722
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 202
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [2,143]'"
set-bd-data-valid "c.in" 32 2147485938
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [2,2]'"
assert-bd-channel-valid "c.out" 32 2147483682
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 162
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [2,62]'"
set-bd-data-valid "c.in" 32 2147484642
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [2,1]'"
assert-bd-channel-valid "c.out" 32 2147483666
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 146
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [14,173]'"
set-bd-data-valid "c.in" 32 2782
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [14,2]'"
assert-bd-channel-valid "c.out" 32 46
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 46
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [11,223]'"
set-bd-data-valid "c.in" 32 2147487227
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [11,3]'"
assert-bd-channel-valid "c.out" 32 2147483707
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 187
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [8,305]'"
set-bd-data-valid "c.in" 32 4888
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [8,5]'"
assert-bd-channel-valid "c.out" 32 88
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 88
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 1 synapse [0,104]'"
set-bd-data-valid "c.in" 32 2147485312
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [0,1]'"
assert-bd-channel-valid "c.out" 32 2147483664
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 144
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [10,78]'"
set-bd-data-valid "c.in" 32 1258
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [10,1]'"
assert-bd-channel-valid "c.out" 32 26
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 26
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle
system "echo '[] Sending spike to core 0 synapse [7,5]'"
set-bd-data-valid "c.in" 32 87
cycle
set c.in.r 1
cycle
assert c.in.a 1
system "echo '[] Removing input'"
set-bd-channel-neutral "c.in" 32
cycle
assert c.in.a 0
system "echo '[] Receiving output spike [7,0]'"
assert-bd-channel-valid "c.out" 32 7
set c.out.a 1
cycle
assert-bd-channel-neutral "c.out" 32
set c.out.a 0
cycle
system "echo '[] Checking spike received at SRAM'"
assert-qdi-channel-valid "c.out_sram_spk" 8 7
set c.out_sram_spk.a 1
set c.out_sram_spk.v 1
cycle
assert-qdi-channel-neutral "c.out_sram_spk" 8
set c.out_sram_spk.a 0
set c.out_sram_spk.v 0
cycle