def test_directed_two_inputs(cosim_cls): verif( drv(t=T_DIN_SEP, seq=[list(range(9)), list(range(5))]), drv(t=T_CFG, seq=[2, 3]), f=clip(sim_cls=cosim_cls), ref=clip(name='ref_model')) sim()
def test_random(cosim_cls): skip_ifndef('RANDOM_TEST') cfg_seq = [] din_seq = [] cfg_num = random.randint(2, 10) for _ in range(cfg_num): cfg_seq.append(random.randint(1, 10)) din_seq.append(list(range(random.randint(1, 10)))) verif( drv(t=T_DIN_SEP, seq=din_seq), drv(t=T_CFG, seq=cfg_seq), f=clip(sim_cls=cosim_cls), ref=clip(name='ref_model')) sim()
def test_random_constrained(): skip_ifndef('SIM_SOCKET_TEST', 'RANDOM_TEST') cnt = 5 # cons.append(randomize(T_CFG, 'cfg', cons=['cfg == 2'])) stim = [] stim.append(drv(t=T_DIN_SEP, seq=randomize(T_DIN_SEP, 'din', cnt=cnt))) stim.append( drv(t=T_CFG, seq=randomize(T_CFG, 'cfg', cons=['cfg < 20', 'cfg > 0'], cnt=cnt))) verif(*stim, f=clip, ref=clip(name='ref_model')) cosim('/clip', 'xsim', run=False) sim()
def test_synth_yosys(): clip(Intf(T_DIN))
def test_synth_vivado(): clip(Intf(T_DIN))
def test_formal(): clip(Intf(T_DIN))