def test_socket_rand_cons(): skip_ifndef('SIM_SOCKET_TEST', 'RANDOM_TEST') cons = [] cons.append( randomize(T_DIN, 'din', eot_cons=['data_size == 50', 'trans_lvl1[0] == 4'])) verif(drv(t=T_DIN, seq=rand_seq('din', 30)), f=qcnt(sim_cls=partial(SimSocket, run=True)), ref=qcnt(name='ref_model')) sim(extens=[partial(SVRandSocket, cons=cons)])
def test_directed_cosim(cosim_cls, lvl, din_delay, dout_delay): seq = DIR_SEQ dut = get_dut(dout_delay) verif(drv(t=T_DIN, seq=seq) | delay_rng(din_delay, din_delay), f=dut(sim_cls=cosim_cls, lvl=lvl), ref=qcnt(name='ref_model', lvl=lvl), delays=[delay_rng(dout_delay, dout_delay)]) sim()
def test_random_cosim(cosim_cls, din_delay, dout_delay): skip_ifndef('RANDOM_TEST') seq = RANDOM_SEQ dut = get_dut(dout_delay) verif(drv(t=T_DIN, seq=seq) | delay_rng(din_delay, din_delay), f=dut(sim_cls=cosim_cls), ref=qcnt(name='ref_model'), delays=[delay_rng(dout_delay, dout_delay)]) sim()
def get_dut(dout_delay): @gear def decoupled(din, *, lvl=0, init=1, w_out=16): return din \ | qcnt(running=True, lvl=lvl, init=init, w_out=w_out) \ | decouple if dout_delay == 0: return decoupled return qcnt(running=True)
def decoupled(din, *, lvl=0, init=1, w_out=16): return din \ | qcnt(running=True, lvl=lvl, init=init, w_out=w_out) \ | decouple
def test_synth_yosys(): qcnt(Intf(Queue[Uint[8], 3]))
def test_synth_vivado(): qcnt(Intf(Queue[Uint[8], 3]))
def test_lvl_2(): qcnt(Intf(Queue[Uint[8], 3]), lvl=2)
def test_lvl_1(): qcnt(Intf(Queue[Uint[8], 3]))