removed texel small, super old
This commit is contained in:
parent
7e2ae21098
commit
627caf1aed
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,123 +0,0 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* This file is part of ACT dataflow neuro library.
|
||||
* It's the testing facility for cell_lib_std.act
|
||||
*
|
||||
* Copyright (c) 2022 University of Groningen - Ole Richter
|
||||
* Copyright (c) 2022 University of Groningen - Hugh Greatorex
|
||||
* Copyright (c) 2022 University of Groningen - Michele Mastella
|
||||
* Copyright (c) 2022 University of Groningen - Madison Cotteret
|
||||
*
|
||||
* This source describes Open Hardware and is licensed under the CERN-OHL-W v2 or later
|
||||
*
|
||||
* You may redistribute and modify this documentation and make products
|
||||
* using it under the terms of the CERN-OHL-W v2 (https:/cern.ch/cern-ohl).
|
||||
* This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-W v2
|
||||
* for applicable conditions.
|
||||
*
|
||||
* Source location: https://git.web.rug.nl/bics/actlib_dataflow_neuro
|
||||
*
|
||||
* As per CERN-OHL-W v2 section 4.1, should You produce hardware based on
|
||||
* these sources, You must maintain the Source Location visible in its
|
||||
* documentation.
|
||||
*
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
import "../../dataflow_neuro/coders.act";
|
||||
import "../../dataflow_neuro/primitives.act";
|
||||
import "../../dataflow_neuro/chips.act";
|
||||
|
||||
import globals;
|
||||
import std::data;
|
||||
|
||||
open std::data;
|
||||
|
||||
|
||||
open tmpl::dataflow_neuro;
|
||||
|
||||
defproc chip_texel_test (bd<14> in; bd<14> out; Mx1of2<8> reg_data[16];
|
||||
bool? bd_dly_cfg[4], bd_dly_cfg2[2], loopback_en, _reset_B){
|
||||
|
||||
// prs {
|
||||
// Reset => _reset_B-
|
||||
// }
|
||||
power supply;
|
||||
supply.vdd = Vdd;
|
||||
supply.vss = GND;
|
||||
|
||||
pint N_IN = 14;
|
||||
|
||||
pint N_NRN_X = 2;
|
||||
pint N_NRN_Y = 4;
|
||||
// pint NC_NRN_X = std:ceil_log2(N_NRN_X);
|
||||
// pint NC_NRN_Y = std:ceil_log2(N_NRN_Y);
|
||||
pint NC_NRN_X = 1;
|
||||
pint NC_NRN_Y = 2;
|
||||
|
||||
pint N_SYN_X = 2;
|
||||
pint N_SYN_Y = 4;
|
||||
// pint NC_SYN_X = std:ceil_log2(N_SYN_X);
|
||||
// pint NC_SYN_Y = std:ceil_log2(N_SYN_Y);
|
||||
pint NC_SYN_X = 1;
|
||||
pint NC_SYN_Y = 2;
|
||||
|
||||
pint N_SYN_DLY_CFG = 4;
|
||||
pint N_BD_DLY_CFG = 4;
|
||||
pint N_BD_DLY_CFG2 = 2;
|
||||
|
||||
pint N_NRN_MON_X = N_NRN_X*2; // [mon,kill]*N
|
||||
pint N_NRN_MON_Y = N_NRN_Y; // [mon]*N
|
||||
// pint N_SYN_MON_X = 2;
|
||||
// pint N_SYN_MON_Y = 4;
|
||||
pint N_SYN_MON_X = N_SYN_X*4; // [mon, dev_mon, set, reset]*N
|
||||
pint N_SYN_MON_Y = N_SYN_Y; // [mon]*N
|
||||
|
||||
pint N_MON_AMZO_PER_SYN = 5;
|
||||
pint N_MON_AMZO_PER_NRN = 7;
|
||||
|
||||
pint N_FLAGS_PER_SYN = 5; // Must be at least 3 (since those ones have special safety)
|
||||
pint N_FLAGS_PER_NRN = 7; // And leq than the number of bits in a reg, since have presumed only needs one.
|
||||
|
||||
pint N_BUFFERS = 3;
|
||||
|
||||
pint N_LINE_PD_DLY = 3;
|
||||
|
||||
pint REG_NCA = 4;
|
||||
pint REG_M = 1<<REG_NCA;
|
||||
pint REG_NCW = 8;
|
||||
|
||||
chip_texel<N_IN,
|
||||
N_NRN_X, N_NRN_Y, N_SYN_X, N_SYN_Y,
|
||||
NC_NRN_X, NC_NRN_Y, NC_SYN_X, NC_SYN_Y,
|
||||
N_SYN_DLY_CFG,
|
||||
N_NRN_MON_X, N_NRN_MON_Y, N_SYN_MON_X, N_SYN_MON_Y,
|
||||
N_MON_AMZO_PER_SYN, N_MON_AMZO_PER_NRN,
|
||||
N_FLAGS_PER_SYN, N_FLAGS_PER_NRN,
|
||||
N_BUFFERS,
|
||||
N_LINE_PD_DLY,
|
||||
N_BD_DLY_CFG, N_BD_DLY_CFG2,
|
||||
REG_NCA, REG_NCW, REG_M> c(.in = in, .out = out, .reg_data = reg_data,
|
||||
.bd_dly_cfg = bd_dly_cfg, .bd_dly_cfg2 = bd_dly_cfg2, .loopback_en = loopback_en,
|
||||
.reset_B = _reset_B, .supply = supply);
|
||||
|
||||
// Spawn in some buffers as a conduit between neurons and synapses.
|
||||
pint N_SYNS = N_SYN_X * N_SYN_Y;
|
||||
BUF_X4 syn2nrns_r[N_SYNS];
|
||||
BUF_X4 syn2nrns_a[N_SYNS];
|
||||
(i:N_SYNS:
|
||||
syn2nrns_r[i].a = c.synapses[i].r;
|
||||
syn2nrns_r[i].y = c.neurons[i].r;
|
||||
|
||||
syn2nrns_a[i].a = c.neurons[i].a;
|
||||
syn2nrns_a[i].y = c.synapses[i].a;
|
||||
)
|
||||
// c.synapses = c.neurons; // Connect each synapse hs to a neuron hs
|
||||
|
||||
}
|
||||
|
||||
|
||||
// fifo_decoder_neurons_encoder_fifo e;
|
||||
chip_texel_test c;
|
@ -1,380 +0,0 @@
|
||||
watchall
|
||||
|
||||
|
||||
set c.bd_dly_cfg[0] 1
|
||||
set c.bd_dly_cfg[1] 1
|
||||
set c.bd_dly_cfg[2] 1
|
||||
set c.bd_dly_cfg[3] 1
|
||||
|
||||
set c.bd_dly_cfg2[0] 1
|
||||
set c.bd_dly_cfg2[1] 1
|
||||
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
set c.out.a 0
|
||||
# set c.loopback_en 1
|
||||
set c.loopback_en 0
|
||||
set Reset 1
|
||||
|
||||
cycle
|
||||
|
||||
mode run
|
||||
status X
|
||||
system "echo '[] Set reset 0'"
|
||||
status X
|
||||
set Reset 0
|
||||
cycle
|
||||
|
||||
# Reading address 0
|
||||
set-bd-data-valid "c.in" 14 8192
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
# Should first get loopback
|
||||
# Receiving output 0 from register 0
|
||||
# assert-bd-channel-valid "c.out" 14 8192
|
||||
# set c.out.a 1
|
||||
# cycle
|
||||
# assert-bd-channel-neutral "c.out" 14
|
||||
# set c.out.a 0
|
||||
# cycle
|
||||
|
||||
|
||||
# Expect register read packet to arrive
|
||||
# Receiving output 0 from register 0
|
||||
assert-bd-channel-valid "c.out" 14 0
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Disable loopback cus it's annoying
|
||||
set c.loopback_en 0
|
||||
cycle
|
||||
|
||||
# Writing 17 to address 1
|
||||
set-bd-data-valid "c.in" 14 12561
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Writing 255 to address 5
|
||||
set-bd-data-valid "c.in" 14 16373
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
# Reading address 1
|
||||
system "echo '[] Reading reg 1'"
|
||||
set-bd-data-valid "c.in" 14 8193
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Reading address 5
|
||||
system "echo '[] Reading reg 5'"
|
||||
set-bd-data-valid "c.in" 14 8197
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output 17 from register 1
|
||||
system "echo '[] Receiving 17'"
|
||||
assert-bd-channel-valid "c.out" 14 273
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
system "echo '[] Receiving 4085'"
|
||||
# Receiving output 255 from register 5
|
||||
assert-bd-channel-valid "c.out" 14 4085
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
|
||||
|
||||
# SEND PACKET TO CHANGE TO SYNAPSE HANDSHAKING
|
||||
# Writing 255 to address 0
|
||||
set-bd-data-valid "c.in" 14 16368
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# SPIKES
|
||||
|
||||
|
||||
|
||||
# Sending spike to synapse [0,1]
|
||||
system "echo '[] Spike'"
|
||||
set-bd-data-valid "c.in" 14 2
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,1]
|
||||
assert-bd-channel-valid "c.out" 14 2
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [1,3]
|
||||
system "echo '[] Spike'"
|
||||
set-bd-data-valid "c.in" 14 7
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [1,3]
|
||||
assert-bd-channel-valid "c.out" 14 7
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [1,2]
|
||||
system "echo '[] Spike'"
|
||||
set-bd-data-valid "c.in" 14 5
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [1,2]
|
||||
assert-bd-channel-valid "c.out" 14 5
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [1,3]
|
||||
system "echo '[] Spike'"
|
||||
set-bd-data-valid "c.in" 14 7
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [1,3]
|
||||
assert-bd-channel-valid "c.out" 14 7
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,2]
|
||||
set-bd-data-valid "c.in" 14 4
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,2]
|
||||
assert-bd-channel-valid "c.out" 14 4
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,3]
|
||||
set-bd-data-valid "c.in" 14 6
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,3]
|
||||
assert-bd-channel-valid "c.out" 14 6
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,1]
|
||||
set-bd-data-valid "c.in" 14 2
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,1]
|
||||
assert-bd-channel-valid "c.out" 14 2
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,0]
|
||||
set-bd-data-valid "c.in" 14 0
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,0]
|
||||
assert-bd-channel-valid "c.out" 14 0
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,0]
|
||||
set-bd-data-valid "c.in" 14 0
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,0]
|
||||
assert-bd-channel-valid "c.out" 14 0
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
||||
# Sending spike to synapse [0,3]
|
||||
set-bd-data-valid "c.in" 14 6
|
||||
cycle
|
||||
set c.in.r 1
|
||||
cycle
|
||||
assert c.in.a 1
|
||||
|
||||
|
||||
# Remove input
|
||||
set-bd-channel-neutral "c.in" 14
|
||||
cycle
|
||||
assert c.in.a 0
|
||||
|
||||
|
||||
# Receiving output spike [0,3]
|
||||
assert-bd-channel-valid "c.out" 14 6
|
||||
set c.out.a 1
|
||||
cycle
|
||||
assert-bd-channel-neutral "c.out" 14
|
||||
set c.out.a 0
|
||||
cycle
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user