コード例 #1
0
ファイル: hello.py プロジェクト: PDFxy/my_pyvpi
def test():
    """
    c = a+b;
    """
    handle_a = pyvpi.handleByName("top.a")
    val_a = pyvpi.Value(cons.vpiIntVal)
    val_a.value = 5
    pyvpi.putValue(handle_a, val_a)
    time = pyvpi.Time()

    pyvpi.getTime(time)
    print('py: hello world at %d'%time.time)
コード例 #2
0
def test():
    """
    c = a+b;
    """
    time = pyvpi.Time()
    pyvpi.getTime(time)
    pyvpi.printf('py: hello world at %d\n' % time.time)

    handle_a = pyvpi.handleByName("top.a")
    val_a = pyvpi.Value(cons.vpiIntVal)

    pyvpi.getValue(handle_a, val_a)
    print(val_a.format)
    try:
        val_a.value += 1
        pyvpi.putValue(handle_a, val_a)
        print('py:      a = %d' % val_a.value)
    except:
        #
        pass
コード例 #3
0
ファイル: 3.py プロジェクト: antiface/pyvpi
#! python
import pyvpi
import pyvpi_cons as cons
def getAllHandles(handle,type) :
    ans = []
    iter = pyvpi.iterate(type,handle)
    while True :
        h = pyvpi.scan(iter)
        if not h :
            break
        ans.append(h)
    return ans
    
mod = pyvpi.handleByName("test")

pyvpi.printf("All regs are blew here :\n")    
for reg in getAllHandles(mod,cons.vpiReg) :
    pyvpi.printf("%s\n" % (pyvpi.getStr(cons.vpiName,reg)))
pyvpi.printf("All nets are blew here :\n")    
for net in getAllHandles(mod,cons.vpiNet) :
    pyvpi.printf("%s\n" % (pyvpi.getStr(cons.vpiFullName,net)))

time = pyvpi.Time()
pyvpi.getTime(time)
pyvpi.printf("%s\n" %(time.low))
コード例 #4
0
 def value(self):
     pyvpi.getTime(self._time)
     return self._time.real
コード例 #5
0
ファイル: 3.py プロジェクト: PDFxy/my_pyvpi
import pyvpi
import pyvpi_cons as cons
def getAllHandles(handle,type) :
    ans = []
    iter = pyvpi.iterate(type,handle)
    while True :
        h = pyvpi.scan(iter)
        if not h :
            break
        ans.append(h)
    return ans
    
mod = pyvpi.handleByName("top")

pyvpi.printf("All regs are blew here :\n")    
for reg in getAllHandles(mod,cons.vpiReg) :
    pyvpi.printf("%s\n" % (pyvpi.getStr(cons.vpiName,reg)))
pyvpi.printf("All nets are blew here :\n")    
for net in getAllHandles(mod,cons.vpiNet) :
    pyvpi.printf("%s\n" % (pyvpi.getStr(cons.vpiFullName,net)))

time = pyvpi.Time()
pyvpi.getTime(time)
pyvpi.printf("%s\n" %(time.low))