예제 #1
0
def test_signed_cosim(cosim_cls):
    seq = [(0x1, 0x7), (-0x2, 0x7), (0x1, -0x8), (-0x2, -0x8)]

    verif(drv(t=Tuple[Int[2], Int[4]], seq=seq),
          f=mul(sim_cls=cosim_cls),
          ref=mul(name='ref_model'))

    sim()
예제 #2
0
def test_unsigned_overflow_cosim(cosim_cls):
    seq = [(0x1, 0xf), (0x2, 0xe), (0x3, 0xd)]

    verif(drv(t=Tuple[Uint[2], Uint[4]], seq=seq),
          f=mul(sim_cls=cosim_cls),
          ref=mul(name='ref_model'))

    sim()
예제 #3
0
def test_unsigned_synth_vivado():
    mul(Intf(Tuple[Uint[10], Uint[4]]))
예제 #4
0
 def dut(row):
     return row, row | queuemap(f=mul(Int[8](2)))
예제 #5
0
 def dut(row):
     row = row | mul(2)
     return row | mul(2)
예제 #6
0
from pygears.lib import drv, check, mul, fmap
from pygears.typing import Uint, Tuple

drv(t=Tuple[Uint[16], Uint[16]], seq=[(0, 0), (1, 10), (2, 20)]) \
    | fmap(f=(mul(2), mul(2))) \
    | check(ref=[(0, 0), (2, 20), (4, 40)])
예제 #7
0
from pygears.lib import drv, check, mul, fmap
from pygears.typing import Queue, Uint

drv(t=Queue[Uint[16]], seq=[[0, 1, 2, 3, 4]]) \
    | fmap(f=mul(2)) \
    | check(ref=[[0, 2, 4, 6, 8]])