Compare commits
No commits in common. "5e4e90596075b153b4272c5236ff08254ca8a75a" and "1a68a951e37084c852ef2d12e09552bbdd2e3c49" have entirely different histories.
5e4e905960
...
1a68a951e3
@ -460,7 +460,7 @@ namespace tmpl {
|
|||||||
|
|
||||||
// Valid trees
|
// Valid trees
|
||||||
vtree<NxC> vtree_x(.in = x_enc_out, .out = _in_x_v, .supply = supply);
|
vtree<NxC> vtree_x(.in = x_enc_out, .out = _in_x_v, .supply = supply);
|
||||||
vtree<NyC> vtree_y(.in = y_enc_out, .out = _in_y_v, .supply = supply);
|
vtree<NxC> vtree_y(.in = y_enc_out, .out = _in_y_v, .supply = supply);
|
||||||
|
|
||||||
// Buffer func thing
|
// Buffer func thing
|
||||||
Mx1of2<NxC + NyC> into_buffer;
|
Mx1of2<NxC + NyC> into_buffer;
|
||||||
@ -480,7 +480,7 @@ namespace tmpl {
|
|||||||
* Then performs a 2d handshake out outy then outx.
|
* Then performs a 2d handshake out outy then outx.
|
||||||
*/
|
*/
|
||||||
export
|
export
|
||||||
defproc nrn_hs_2D(a1of1 in; a1of1 outx; a1of1 outy; power supply; bool reset_B) {
|
defproc neuron_hs_2D(a1of1 in; a1of1 outx; a1of1 outy; power supply; bool reset_B) {
|
||||||
bool _reset_BX;
|
bool _reset_BX;
|
||||||
BUF_X2 reset_buf(.a = reset_B, .y = _reset_BX, .vdd = supply.vdd, .vss = supply.vss);
|
BUF_X2 reset_buf(.a = reset_B, .y = _reset_BX, .vdd = supply.vdd, .vss = supply.vss);
|
||||||
|
|
||||||
@ -553,54 +553,18 @@ namespace tmpl {
|
|||||||
rsb[j].supply = supply;
|
rsb[j].supply = supply;
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add buffers on output req lines
|
|
||||||
a1of1 _outx[Nx], _outy[Ny];
|
|
||||||
BUF_X4 out_req_buf_x[Nx];
|
|
||||||
(i:Nx:
|
|
||||||
out_req_buf_x[i].vss = supply.vss;
|
|
||||||
out_req_buf_x[i].vdd = supply.vdd;
|
|
||||||
out_req_buf_x[i].a = _outx[i].r;
|
|
||||||
out_req_buf_x[i].y = outx[i].r;
|
|
||||||
)
|
|
||||||
BUF_X4 out_req_buf_y[Ny];
|
|
||||||
(i:Ny:
|
|
||||||
out_req_buf_y[i].vss = supply.vss;
|
|
||||||
out_req_buf_y[i].vdd = supply.vdd;
|
|
||||||
out_req_buf_y[i].a = _outy[i].r;
|
|
||||||
out_req_buf_y[i].y = outy[i].r;
|
|
||||||
)
|
|
||||||
// Add buffers on output ack lines
|
|
||||||
// Note that this should be generalised.
|
|
||||||
// And probably won't even be done by ACT/innovus anwyay
|
|
||||||
// TODO: do it properly with sigbufs?
|
|
||||||
BUF_X4 out_ack_buf_x[Nx];
|
|
||||||
(i:Nx:
|
|
||||||
out_ack_buf_x[i].vss = supply.vss;
|
|
||||||
out_ack_buf_x[i].vdd = supply.vdd;
|
|
||||||
out_ack_buf_x[i].a = outx[i].a;
|
|
||||||
out_ack_buf_x[i].y = _outx[i].a;
|
|
||||||
)
|
|
||||||
BUF_X4 out_ack_buf_y[Ny];
|
|
||||||
(i:Ny:
|
|
||||||
out_ack_buf_y[i].vss = supply.vss;
|
|
||||||
out_ack_buf_y[i].vdd = supply.vdd;
|
|
||||||
out_ack_buf_y[i].a = outy[i].a;
|
|
||||||
out_ack_buf_y[i].y = _outy[i].a;
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create handshake grid
|
// Create handshake grid
|
||||||
pint index;
|
pint index;
|
||||||
nrn_hs_2D neurons[Nx*Ny];
|
neuron_hs_2D neurons[Nx*Ny];
|
||||||
(i:0..Nx-1:
|
(i:0..Nx-1:
|
||||||
(j:0..Ny-1:
|
(j:0..Ny-1:
|
||||||
index = i + j*Nx;
|
index = i + j*Nx;
|
||||||
neurons[index].supply = supply;
|
neurons[index].supply = supply;
|
||||||
neurons[index].reset_B = rsb[j].out[i];
|
neurons[index].reset_B = rsb[j].out[i];
|
||||||
neurons[index].in = in[index];
|
neurons[index].in = in[index];
|
||||||
neurons[index].outx = _outx[i];
|
neurons[index].outx = outx[i];
|
||||||
neurons[index].outy = _outy[j];
|
neurons[index].outy = outy[j];
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -615,13 +579,13 @@ namespace tmpl {
|
|||||||
sigbuf<Nx> rsb_pd_x(.in = reset_B, .supply = supply);
|
sigbuf<Nx> rsb_pd_x(.in = reset_B, .supply = supply);
|
||||||
(i:0..Nx-1:
|
(i:0..Nx-1:
|
||||||
[ N_dly = 0 ->
|
[ N_dly = 0 ->
|
||||||
pd_x[i].in = _outx[i].a;
|
pd_x[i].in = outx[i].a;
|
||||||
[] N_dly >= 1 ->
|
[] N_dly >= 1 ->
|
||||||
dly_x[i].supply = supply;
|
dly_x[i].supply = supply;
|
||||||
dly_x[i].in = _outx[i].a;
|
dly_x[i].in = outx[i].a;
|
||||||
pd_x[i].in = dly_x[i].out;
|
pd_x[i].in = dly_x[i].out;
|
||||||
]
|
]
|
||||||
pd_x[i].out = _outx[i].r;
|
pd_x[i].out = outx[i].r;
|
||||||
pd_x[i].reset_B = rsb_pd_x.out[i];
|
pd_x[i].reset_B = rsb_pd_x.out[i];
|
||||||
pd_x[i].supply = supply;
|
pd_x[i].supply = supply;
|
||||||
)
|
)
|
||||||
@ -631,13 +595,13 @@ namespace tmpl {
|
|||||||
sigbuf<Ny> rsb_pd_y(.in = reset_B, .supply = supply);
|
sigbuf<Ny> rsb_pd_y(.in = reset_B, .supply = supply);
|
||||||
(j:0..Ny-1:
|
(j:0..Ny-1:
|
||||||
[ N_dly = 0 ->
|
[ N_dly = 0 ->
|
||||||
pd_y[j].in = _outy[j].a;
|
pd_y[j].in = outy[j].a;
|
||||||
[] N_dly >= 1 ->
|
[] N_dly >= 1 ->
|
||||||
dly_y[j].supply = supply;
|
dly_y[j].supply = supply;
|
||||||
dly_y[j].in = _outy[j].a;
|
dly_y[j].in = outy[j].a;
|
||||||
pd_y[j].in = dly_y[j].out;
|
pd_y[j].in = dly_y[j].out;
|
||||||
]
|
]
|
||||||
pd_y[j].out = _outy[j].r;
|
pd_y[j].out = outy[j].r;
|
||||||
pd_y[j].reset_B = rsb_pd_y.out[j];
|
pd_y[j].reset_B = rsb_pd_y.out[j];
|
||||||
pd_y[j].supply = supply;
|
pd_y[j].supply = supply;
|
||||||
)
|
)
|
||||||
@ -647,14 +611,14 @@ namespace tmpl {
|
|||||||
(i:Nx:
|
(i:Nx:
|
||||||
keep_x[i].vdd = supply.vdd;
|
keep_x[i].vdd = supply.vdd;
|
||||||
keep_x[i].vss = supply.vss;
|
keep_x[i].vss = supply.vss;
|
||||||
keep_x[i].y = _outx[i].r;
|
keep_x[i].y = outx[i].r;
|
||||||
)
|
)
|
||||||
|
|
||||||
KEEP_X1 keep_y[Ny];
|
KEEP_X1 keep_y[Ny];
|
||||||
(j:Ny:
|
(j:Ny:
|
||||||
keep_y[j].vdd = supply.vdd;
|
keep_y[j].vdd = supply.vdd;
|
||||||
keep_y[j].vss = supply.vss;
|
keep_y[j].vss = supply.vss;
|
||||||
keep_y[j].y = _outy[j].r;
|
keep_y[j].y = outy[j].r;
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user