diff --git a/dataflow_neuro/primitives.act b/dataflow_neuro/primitives.act index 9ab2d10..732c4ee 100644 --- a/dataflow_neuro/primitives.act +++ b/dataflow_neuro/primitives.act @@ -229,7 +229,9 @@ namespace tmpl { f_buf_func[i].sr_B = _reset_BXX[i]; ) } - + + // Note that in token false/0 is send on out1, true/1 is send on out2. + // test export template defproc demux (avMx1of2 in; avMx1of2 out1; avMx1of2 out2; bool? reset_B; avMx1of2<1> cond; power supply) { //control @@ -237,7 +239,8 @@ namespace tmpl { OR2_X1 out_or(.a=out1.v, .b=out2.v, .y=_out_v,.vdd=supply.vdd,.vss=supply.vss); A_3C_RB_X4 inack_ctl(.c1=_en,.c2=_in_c_v_,.c3=_out_v,.y=in.a,.pr_B=_reset_BX,.sr_B=_reset_BX,.vdd=supply.vdd,.vss=supply.vss); - cond.a = in.a; // THIS SHOULD BE IMPROVED UPON IN FUTURE VERSIONS + cond.a = in.a; // @TODO THIS SHOULD BE IMPROVED UPON IN FUTURE VERSIONS + // actually it might be fine cond.v = _in_c_v_; A_1C1P_X1 en_ctl(.c1=in.a,.p1=_out_v,.y=_en,.vdd=supply.vdd,.vss=supply.vss); BUF_X1 reset_buf(.a=reset_B, .y=_reset_BX,.vdd=supply.vdd,.vss=supply.vss); diff --git a/test/unit_tests/demux_7/test.prsim b/test/unit_tests/demux_7/test.prsim index b19ca92..5e85a55 100644 --- a/test/unit_tests/demux_7/test.prsim +++ b/test/unit_tests/demux_7/test.prsim @@ -23,8 +23,8 @@ cycle system "echo 'Output neutral checked'" -set my_demux.cond.d.d[0].t 1 -set my_demux.cond.d.d[0].f 0 +set my_demux.cond.d.d[0].t 0 +set my_demux.cond.d.d[0].f 1 set-qdi-channel-valid "my_demux.in" 7 127 cycle assert my_demux.in.v 1 @@ -32,6 +32,7 @@ assert my_demux.in.a 0 assert my_demux.cond.v 1 assert-qdi-channel-valid "my_demux.out1" 7 127 +assert-qdi-channel-neutral "my_demux.out2" 7 set my_demux.out1.v 1 cycle assert my_demux.in.a 1 @@ -64,8 +65,8 @@ set my_demux.out2.a 0 set my_demux.out2.v 0 cycle -set my_demux.cond.d.d[0].t 0 -set my_demux.cond.d.d[0].f 1 +set my_demux.cond.d.d[0].t 1 +set my_demux.cond.d.d[0].f 0 set-qdi-channel-valid "my_demux.in" 7 100 cycle assert my_demux.in.v 1