continued register_rw

This commit is contained in:
Michele
2022-03-15 08:16:59 +01:00
parent b8a74e1bb7
commit 04d12338b7
2 changed files with 31 additions and 12 deletions

View File

@ -55,9 +55,7 @@ defproc register_w (avMx1of2<1+lognw+wl> in; d1of<wl> data[1<<lognw]; power supp
bool _in_v_temp,_in_a_temp,_clock_temp,_clock,_clock_temp_inv;
pint nw = 1<<lognw;
//Validation of the input
Mx1of2<1+lognw+wl> _in_temp;
(i:1+lognw+wl:_in_temp.d[i] = in.d.d[i];)
vtree<1+lognw+wl> val_input(.in = _in_temp,.out = _in_v_temp, .supply = supply);
vtree<1+lognw+wl> val_input(.in = in.d,.out = _in_v_temp, .supply = supply);
sigbuf_1output<4> val_input_X(.in = _in_v_temp,.out = in.v,.supply = supply);
// Generation of the fake clock pulse (inverted because the ff clocks are low_active)
delayprog<N_dly_cfg> clk_dly(.in = _in_v_temp, .out = _clock_temp,.s = dly_cfg, .supply = supply);
@ -175,13 +173,16 @@ defproc register_rw (avMx1of2<1+lognw+wl> in; avMx1of2<lognw+wl> out; d1of<wl> d
)
AND2_X1 ack_read_and(.a = in.d.d[lognw+wl].t,.b = output_buf.in.a,.y = _in_a_read,.vdd = supply.vdd, .vss = supply.vss);
//Reset Buffers
bool _reset_BX,_reset_mem_BX,_reset_mem_BXX[nw*wl];
bool _reset_BX, _reset_BXX[nw],_reset_mem_BX,_reset_mem_BXX[nw*wl];
BUF_X1 reset_buf_BX(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss);
BUF_X1 reset_buf_BXX(.a=reset_mem_B, .y=_reset_mem_BX,.vdd=supply.vdd,.vss=supply.vss);
sigbuf<nw*wl> reset_bufarray(.in=_reset_mem_BX, .out=_reset_mem_BXX,.supply=supply);
sigbuf<nw*wl> reset_mem_bufarray(.in=_reset_mem_BX, .out=_reset_mem_BXX,.supply=supply);
sigbuf<nw> reset_bufarray(.in=_reset_BX, .out=_reset_BXX,.supply=supply);
//Creating the encoder
andtree<lognw> atree[nw];
AND2_X1 and_encoder[nw];
OR2_X1 or_encoder[nw];
INV_X1 inv_encoder[nw];
// Creating the different flip flop arrays
bool _out_encoder[nw];
DFFQ_R_X1 ff[nw*wl];
@ -201,11 +202,14 @@ defproc register_rw (avMx1of2<1+lognw+wl> in; avMx1of2<lognw+wl> out; d1of<wl> d
)
// WRITE: Activating the fake clock for the right word
atree[word_idx].out = _out_encoder[word_idx];
and_encoder[word_idx].a = _out_encoder[word_idx];
and_encoder[word_idx].b = _clock[word_idx];
and_encoder[word_idx].y = _clock_word_temp[word_idx];
and_encoder[word_idx].vdd = supply.vdd;
and_encoder[word_idx].vss = supply.vss;
inv_encoder[word_idx].a = _out_encoder[word_idx];
inv_encoder[word_idx].y = or_encoder[word_idx].a;
inv_encoder[word_idx].vdd = supply.vdd;
inv_encoder[word_idx].vss = supply.vss;
or_encoder[word_idx].b = _clock[word_idx];
or_encoder[word_idx].y = _clock_word_temp[word_idx];
or_encoder[word_idx].vdd = supply.vdd;
or_encoder[word_idx].vss = supply.vss;
clock_buffer[word_idx].in = _clock_word_temp[word_idx];
clock_buffer[word_idx].supply = supply;
// READ: Selecting the right word to read if read is high