Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Greatorex 2022-04-04 17:27:34 +02:00
commit 185a4b2d77
1 changed files with 37 additions and 0 deletions

View File

@ -849,15 +849,23 @@ defproc slice_data(avMx1of2<N> in; avMx1of2<std::min(N1,N)-std::max(N0,0)> out;
{
demux<N> demux(.reset_B = reset_B, .out1=out1, .out2=out2);
pint _N1, _N0;
export template<pint N; pint CONDITION_BIT>
defproc demux_bit (avMx1of2<N+1> in; avMx1of2<N> out1; avMx1of2<N> out2; bool? reset_B; power supply)
{
demux<N> demux(.reset_B = reset_B, .out1=out1, .out2=out2);
in.d.d[CONDITION_BIT].f = demux.cond.d.d[0].f;
in.d.d[CONDITION_BIT].t = demux.cond.d.d[0].t;
_N1 = std::min(N1,N);
_N0 = std::max(N0,0);
in.d.d[CONDITION_BIT].f = demux.cond.d.d[0].f;
in.d.d[CONDITION_BIT].t = demux.cond.d.d[0].t;
in.v = demux.in.v;
in.a = demux.in.a;
BUF_X1 ack_buf(.a = out.a, .y = in.a, .vss = supply.vss, .vdd = supply.vdd);
in.v = demux.in.v;
in.a = demux.in.a;
(i:0..CONDITION_BIT:
@ -898,4 +906,33 @@ defproc slice_data(avMx1of2<N> in; avMx1of2<std::min(N1,N)-std::max(N0,0)> out;
(i:0..CONDITION_BIT:
in.d.d[i].f = demux.in.d.d[i].f;
in.d.d[i].t = demux.in.d.d[i].t;)
(i:CONDITION_BIT..N-1:
in.d.d[i].f = demux.in.d.d[i].f;
in.d.d[i].t = demux.in.d.d[i].t;)
}
export template<pint N>
defproc demux_bit_msb (avMx1of2<N+1> in; avMx1of2<N> out1; avMx1of2<N> out2; bool? reset_B; power supply)
{
demux<N> demux(.reset_B = reset_B, .out1=out1, .out2=out2);
in.d.d[N+1].f = demux.cond.d.d[0].f;
in.d.d[N+1].t = demux.cond.d.d[0].t;
in.v = demux.in.v;
in.a = demux.in.a;
(i:0..N:
in.d.d[i].f = demux.in.d.d[i].f;
in.d.d[i].t = demux.in.d.d[i].t;)
}
}}