예제 #1
0
파일: test_sdf.py 프로젝트: s-holst/kyupy
def test_gates(mydir):
    c = verilog.load(mydir / 'gates.v')
    df = sdf.load(mydir / 'gates.sdf')
    lt = df.annotation(c, dataset=1)
    nand_a = c.cells['nandgate'].ins[0]
    nand_b = c.cells['nandgate'].ins[1]
    and_a = c.cells['andgate'].ins[0]
    and_b = c.cells['andgate'].ins[1]

    assert lt[nand_a, 0, 0] == 0.103
    assert lt[nand_a, 0, 1] == 0.127

    assert lt[nand_b, 0, 0] == 0.086
    assert lt[nand_b, 0, 1] == 0.104

    assert lt[and_a, 0, 0] == 0.378
    assert lt[and_a, 0, 1] == 0.377

    assert lt[and_b, 0, 0] == 0.375
    assert lt[and_b, 0, 1] == 0.370
예제 #2
0
def test_b01(mydir):
    with open(mydir / 'b01.v', 'r') as f:
        modules = verilog.parse(f.read())
    assert modules is not None
    assert verilog.load(mydir / 'b01.v') is not None
예제 #3
0
def test_b14_cuda(mydir):
    c = verilog.load(mydir / 'b14.v.gz', branchforks=True)
    df = sdf.load(mydir / 'b14.sdf.gz')
    lt = df.annotation(c)
    wsim = WaveSimCuda(c, lt, 8)
    compare_to_logic_sim(wsim)