From 73acbcbc4fd24e7e4a9c1b9cf6863ffedffec86a Mon Sep 17 00:00:00 2001 From: alexmadison Date: Tue, 21 Nov 2023 10:14:54 +0100 Subject: [PATCH] fixed demux_td_sign test and unfucked the sign flipping which shoudl have broken the other version tbh --- dataflow_neuro/primitives.act | 12 ++++------ test/unit_tests/demux_td_2_SIGN/test.act | 4 ++-- test/unit_tests/demux_td_2_SIGN/test.prsim | 26 +++++++++++++--------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index f2938f7..c692ae3 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -390,10 +390,7 @@ namespace tmpl { // Demux export template - // WARNING WARNING WARNING - // With a False CONDITION_SIGN, this is wrong. - // the c.t/f just need to be swapped, not inverted!!! - // @TODO self explanatory + // @TODO docs // also note this is not used in the final texel chip defproc demux_td (avMx1of2 in; avMx1of2 out; a1of1 token; bool? reset_B; avMx1of2<1> cond; power supply) { //control @@ -421,10 +418,9 @@ namespace tmpl { BUF_X1 c_buf_tk(.a=cond.d.d[0].t, .y=_c_tk_buf, .vss = supply.vss, .vdd = supply.vdd); sigbuf c_buf_d(.in=cond.d.d[0].f, .out=_c_d_buf, .supply=supply); [] else -> - INV_X1 invout_t(.a = cond.d.d[0].t,.y=cond_inv_t,.vdd = supply.vdd,.vss=supply.vss); - INV_X1 invout_f(.a = cond.d.d[0].f,.y=cond_inv_f,.vdd = supply.vdd,.vss=supply.vss); - BUF_X1 c_buf_tk_inv(.a=cond_inv_t, .y=_c_tk_buf, .vss = supply.vss, .vdd = supply.vdd); - sigbuf c_buf_d_inv(.in=cond_inv_f, .out=_c_d_buf, .supply=supply); + + BUF_X1 c_buf_tk(.a=cond.d.d[0].f, .y=_c_tk_buf, .vss = supply.vss, .vdd = supply.vdd); + sigbuf c_buf_d(.in=cond.d.d[0].t, .out=_c_d_buf, .supply=supply); ] diff --git a/test/unit_tests/demux_td_2_SIGN/test.act b/test/unit_tests/demux_td_2_SIGN/test.act index ed29557..45b4858 100644 --- a/test/unit_tests/demux_td_2_SIGN/test.act +++ b/test/unit_tests/demux_td_2_SIGN/test.act @@ -32,9 +32,9 @@ import globals; open tmpl::dataflow_neuro; -defproc demux_2 (avMx1of2<2> in; avMx1of2<2> out1; a1of1 token; avMx1of2<1> cond){ +defproc demux_2 (avMx1of2<2> in; avMx1of2<2> out; a1of1 token; avMx1of2<1> cond){ - demux_td<2, true> my_demux(.in=in, .out1=out1,.token = token, .cond = cond); + demux_td<2, true> my_demux(.in=in, .out=out,.token = token, .cond = cond); //Low active Reset bool _reset_B; prs { diff --git a/test/unit_tests/demux_td_2_SIGN/test.prsim b/test/unit_tests/demux_td_2_SIGN/test.prsim index 2b7a233..dac167f 100644 --- a/test/unit_tests/demux_td_2_SIGN/test.prsim +++ b/test/unit_tests/demux_td_2_SIGN/test.prsim @@ -1,7 +1,7 @@ watchall set-qdi-channel-neutral "my_demux.in" 2 -set my_demux.out1.a 0 -set my_demux.out1.v 0 +set my_demux.out.a 0 +set my_demux.out.v 0 set my_demux.token.a 0 set my_demux.token.r 0 set my_demux.cond.d.d[0].t 0 @@ -15,7 +15,7 @@ system "echo 'System reset completed'" status X mode run -assert-qdi-channel-neutral "my_demux.out1" 2 +assert-qdi-channel-neutral "my_demux.out" 2 assert-qdi-channel-neutral "my_demux.in" 2 cycle @@ -28,21 +28,26 @@ cycle assert my_demux.in.v 1 assert my_demux.in.a 0 -assert-qdi-channel-valid "my_demux.out1" 2 3 +assert-qdi-channel-valid "my_demux.out" 2 3 assert my_demux.token.a 0 -set my_demux.out1.v 1 +assert my_demux.token.r 0 +set my_demux.out.v 1 cycle assert my_demux.in.a 1 set-qdi-channel-neutral "my_demux.in" 2 cycle -set my_demux.out1.a 1 - +set my_demux.out.a 1 +cycle +assert-qdi-channel-neutral "my_demux.out" 2 +set my_demux.out.a 0 +set my_demux.out.v 0 +cycle system "echo 'First Cond Checked'" -set my_demux.out1.a 0 -set my_demux.out1.v 0 +set my_demux.out.a 0 +set my_demux.out.v 0 set my_demux.token.a 0 set my_demux.token.r 0 set my_demux.cond.d.d[0].t 0 @@ -58,9 +63,9 @@ cycle assert my_demux.in.v 1 assert my_demux.in.a 1 assert my_demux.token.r 1 +assert-qdi-channel-neutral "my_demux.out" 2 set my_demux.token.a 1 -set my_demux.out1.a 1 cycle assert my_demux.token.r 0 @@ -75,6 +80,7 @@ set my_demux.cond.d.d[0].t 0 set my_demux.cond.d.d[0].f 0 cycle +assert my_demux.cond.v 0 assert my_demux.in.a 0