fixed test
This commit is contained in:
parent
96042d3bea
commit
5eb77108ab
@ -33,14 +33,33 @@ open tmpl::dataflow_neuro;
|
||||
|
||||
defproc nrn_hs_2d_inst(a1of1 in; a1of1 outx, outy)
|
||||
{
|
||||
power supply;
|
||||
supply.vdd = Vdd;
|
||||
supply.vss = GND;
|
||||
|
||||
bool _reset_B;
|
||||
prs {
|
||||
Reset => _reset_B-
|
||||
}
|
||||
nrn_hs_2d b(.in = in, .outx = outx, .outy = outy);
|
||||
b.supply.vdd = Vdd;
|
||||
b.supply.vss = GND;
|
||||
b.reset_B = _reset_B;
|
||||
nrn_hs_2d b(.in = in, .outx = outx, .outy = outy,
|
||||
.supply = supply, .reset_B = _reset_B);
|
||||
|
||||
nrn_line_end_pull_down pd_x;
|
||||
pd_x.in = b.outx.a;
|
||||
pd_x.out = b.outx.r;
|
||||
pd_x.supply = supply;
|
||||
pd_x.reset_B = _reset_B;
|
||||
|
||||
nrn_line_end_pull_down pd_y;
|
||||
pd_y.in = b.outy.a;
|
||||
pd_y.out = b.outy.r;
|
||||
pd_y.supply = supply;
|
||||
pd_y.reset_B = _reset_B;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
nrn_hs_2d_inst b;
|
||||
|
@ -1,202 +1,76 @@
|
||||
watchall
|
||||
|
||||
set b.in[0].r 0
|
||||
set b.in[1].r 0
|
||||
set b.in[2].r 0
|
||||
set b.in[3].r 0
|
||||
set b.in[4].r 0
|
||||
set b.in[5].r 0
|
||||
set b.in[6].r 0
|
||||
set b.in[7].r 0
|
||||
set b.in[8].r 0
|
||||
set b.in[9].r 0
|
||||
set b.in[10].r 0
|
||||
set b.in[11].r 0
|
||||
set b.in[12].r 0
|
||||
set b.in[13].r 0
|
||||
set b.in[14].r 0
|
||||
set b.in.r 0
|
||||
|
||||
set b.outx[0].a 0
|
||||
set b.outx[1].a 0
|
||||
set b.outx[2].a 0
|
||||
|
||||
set b.outy[0].a 0
|
||||
set b.outy[1].a 0
|
||||
set b.outy[2].a 0
|
||||
set b.outy[3].a 0
|
||||
set b.outy[4].a 0
|
||||
|
||||
set b.outx[0].r 1
|
||||
set b.outx[1].r 1
|
||||
set b.outx[2].r 1
|
||||
|
||||
set b.outy[0].r 1
|
||||
set b.outy[1].r 1
|
||||
set b.outy[2].r 1
|
||||
set b.outy[3].r 1
|
||||
set b.outy[4].r 0
|
||||
|
||||
set b.b.neurons[0]._en 0
|
||||
set b.b.neurons[0]._req 1
|
||||
|
||||
# set Reset 0
|
||||
cycle
|
||||
set b.outx.a 0
|
||||
set b.outy.a 0
|
||||
|
||||
system "echo '[] set Reset 1'"
|
||||
set Reset 1
|
||||
cycle
|
||||
status X
|
||||
|
||||
|
||||
system "echo '[] set Reset 0'"
|
||||
set Reset 0
|
||||
mode run
|
||||
cycle
|
||||
status X
|
||||
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 0
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
|
||||
system "echo '[] Neurons 0,1,3 spike'"
|
||||
set b.in[0].r 1
|
||||
set b.in[1].r 1
|
||||
set b.in[3].r 1
|
||||
# spike
|
||||
set b.in.r 1
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
assert b.outx.r 0
|
||||
assert b.outy.r 1
|
||||
assert b.in.a 1
|
||||
|
||||
assert b.outy[0].r 1
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
assert b.in[0].a 1
|
||||
assert b.in[1].a 1
|
||||
assert b.in[3].a 1
|
||||
|
||||
system "echo '[] removing in reqs'"
|
||||
set b.in[0].r 0
|
||||
set b.in[1].r 0
|
||||
set b.in[3].r 0
|
||||
set b.in.r 0
|
||||
set b.outy.a 1
|
||||
cycle
|
||||
assert b.in[0].a 0
|
||||
assert b.in[1].a 0
|
||||
assert b.in[3].a 0
|
||||
assert b.outx.r 1
|
||||
assert b.in.a 0
|
||||
|
||||
|
||||
system "echo '[] y0 chosen, give ack'"
|
||||
set b.outy[0].a 1
|
||||
# send in another spike while its still dealing with previous
|
||||
set b.in.r 1
|
||||
cycle
|
||||
assert b.outx[0].r 1
|
||||
assert b.outx[1].r 1
|
||||
assert b.outx[2].r 0
|
||||
assert b.outx.r 1
|
||||
assert b.outy.r 0
|
||||
assert b.in.a 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] x0 chosen, give ack'"
|
||||
set b.outx[0].a 1
|
||||
set b.outx.a 1
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 1
|
||||
assert b.outx[2].r 0
|
||||
assert b.outx.r 0
|
||||
assert b.outy.r 0
|
||||
assert b.in.a 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] remove x ack'"
|
||||
set b.outx[0].a 0
|
||||
set b.outx.a 0
|
||||
set b.outy.a 0
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 1
|
||||
assert b.outx[2].r 0
|
||||
assert b.outy.r 1
|
||||
assert b.outx.r 0
|
||||
assert b.in.a 1
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] x1 remaining, give ack'"
|
||||
set b.outx[1].a 1
|
||||
set b.in.r 0
|
||||
set b.outy.a 1
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
assert b.outx.r 1
|
||||
assert b.outy.r 0
|
||||
assert b.in.a 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] remove acks'"
|
||||
set b.outx[1].a 0
|
||||
set b.outy[0].a 0
|
||||
set b.outx.a 1
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
assert b.outx.r 0
|
||||
assert b.outy.r 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 1
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] y1 remaining, give ack'"
|
||||
set b.outy[1].a 1
|
||||
set b.outx.a 0
|
||||
set b.outy.a 0
|
||||
cycle
|
||||
assert b.outx[0].r 1
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 0
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
system "echo '[] x0 req, give ack'"
|
||||
set b.outx[0].a 1
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 0
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
assert b.outx.r 0
|
||||
assert b.outy.r 0
|
||||
assert b.in.a 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
system "echo '[] remove acks'"
|
||||
set b.outx[0].a 0
|
||||
set b.outy[1].a 0
|
||||
cycle
|
||||
assert b.outx[0].r 0
|
||||
assert b.outx[1].r 0
|
||||
assert b.outx[2].r 0
|
||||
|
||||
assert b.outy[0].r 0
|
||||
assert b.outy[1].r 0
|
||||
assert b.outy[2].r 0
|
||||
assert b.outy[3].r 0
|
||||
assert b.outy[4].r 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user