コード例 #1
0
ファイル: simReg.py プロジェクト: bojankumari/vetri
def regWrite(reg, value):
    f = simLib.fregstim()
    f.write("# WRITE\n")
    f.write("W " + "%08x\n" % CMD_WRITE)
    f.write("%08x, " % reg)  # // Address
    f.write("%08x, " % value)  # // Data
    f.write("f, -.\n")
コード例 #2
0
ファイル: simReg.py プロジェクト: boffinnm/test
def regWrite(reg, value):
    f = simLib.fregstim()
    f.write("# WRITE\n")
    f.write("W " + "%08x\n"%CMD_WRITE)
    f.write("%08x, "%reg) # // Address
    f.write("%08x, "%value) # // Data 
    f.write("f, -.\n")
コード例 #3
0
ファイル: simReg.py プロジェクト: mtpsa/P4-NetFPGA-MTPSA
def regDelay(nanoSeconds):
    simLib.fregstim().write("# DELAY \n")
    simLib.fregstim().write("D " + "%0d\n" % nanoSeconds)
    simLib.fregstim().write("# DELAY (MSB) " + "%08x, " %
                            (MSB_MASK & nanoSeconds) + str(nanoSeconds) +
                            " ns\n")
    simLib.fregstim().write("# DELAY (LSB) " + "%08x, " %
                            (LSB_MASK & nanoSeconds) + str(nanoSeconds) +
                            " ns\n")
コード例 #4
0
ファイル: simReg.py プロジェクト: mtpsa/P4-NetFPGA-MTPSA
def regreadstim(reg):
    f = simLib.fregstim()
    simLib.fregstim().write("# READ\n")
    f.write("R " + "%08x\n" % CMD_READ)  # // READ
    f.write("-, -, -, " + "%08x" % reg + ".\n")
コード例 #5
0
ファイル: simReg.py プロジェクト: sutianyu/NetFPGA-SUME-alpha
def regreadstim(reg):
    f = simLib.fregstim()
    simLib.fregstim().write("# READ\n")
    f.write("R " + "%08x\n"%CMD_READ) # // READ
    f.write("-, -, -, " + "%08x"%reg + ".\n")
コード例 #6
0
ファイル: simReg.py プロジェクト: sutianyu/NetFPGA-SUME-alpha
def regDelay(nanoSeconds):
    simLib.fregstim().write("# DELAY \n")
    simLib.fregstim().write("D " + "%0d\n"%nanoSeconds)
    simLib.fregstim().write("# DELAY (MSB) " + "%08x, "%(MSB_MASK & nanoSeconds) + str(nanoSeconds) + " ns\n")
    simLib.fregstim().write("# DELAY (LSB) " + "%08x, "%(LSB_MASK & nanoSeconds) + str(nanoSeconds) + " ns\n")
コード例 #7
0
def barrier():
    for i in range(NUM_PORTS):  # 0,1,2,3
        simLib.fPort(i + 1).write("# BARRIER\n")
        simLib.fPort(i + 1).write("B " + "%d\n" % CMD_BARRIER)
        simLib.fPort(i + 1).write("# EXPECTED\n")
        simLib.fPort(i + 1).write("N " + "%d\n" % (numExpectedPktsPHY[i]))
        simLib.fPort(i + 1).write("# SENT\n")
        simLib.fPort(i + 1).write("S " + "%d\n\n" % (numSendPktsPHY[i]))
    simLib.fDMA().write("# BARRIER\n")
    simLib.fDMA().write("B " + "%d\n" % CMD_BARRIER)
    simLib.fDMA().write("# EXPECTED\n")
    simLib.fDMA().write("N " + "%d\n" % (numExpectedPktsDMA[0]))
    simLib.fDMA().write("# SENT\n")
    simLib.fDMA().write("S " + "%d\n\n" % (numSendPktsDMA[0]))
    simLib.fregstim().write("# BARRIER\n")
    simLib.fregstim().write("B " + "%d\n" % CMD_BARRIER_REG)
    for i in range(NUM_PORTS):
        simLib.fregstim().write("# Interface " + "%d\n" % (i))
        simLib.fregstim().write("N " + "%d\n" % (numExpectedPktsPHY[i]))
        simLib.fregstim().write("S " + "%d\n" % (numSendPktsPHY[i]))
    simLib.fregstim().write("# DMA\n")
    simLib.fregstim().write("N " + "%d\n" % (numExpectedPktsDMA[i]))
    simLib.fregstim().write("S " + "%d\n" % (numSendPktsDMA[i]))

    resetBarrier()
コード例 #8
0
ファイル: simPkt.py プロジェクト: CharlieBashford/P33
def barrier():
    for i in range(NUM_PORTS): # 0,1,2,3
	simLib.fPort(i + 1).write("# BARRIER\n")
	simLib.fPort(i + 1).write("B " + "%d\n"%CMD_BARRIER)   
	simLib.fPort(i + 1).write("# EXPECTED\n") 
	simLib.fPort(i + 1).write("N " + "%d\n"%(numExpectedPktsPHY[i]))
	simLib.fPort(i + 1).write("# SENT\n") 
	simLib.fPort(i + 1).write("S " + "%d\n\n"%(numSendPktsPHY[i]))
    simLib.fDMA().write("# BARRIER\n")
    simLib.fDMA().write("B " + "%d\n"%CMD_BARRIER)   
    simLib.fDMA().write("# EXPECTED\n") 
    simLib.fDMA().write("N " + "%d\n"%(numExpectedPktsDMA[0]))
    simLib.fDMA().write("# SENT\n") 
    simLib.fDMA().write("S " + "%d\n\n"%(numSendPktsDMA[0]))
    simLib.fregstim().write("# BARRIER\n")
    simLib.fregstim().write("B " + "%d\n"%CMD_BARRIER_REG)
    for i in range(NUM_PORTS):
	#if numSendPktsPHY[i] == 0:
	#    simLib.fregstim().write("")
	#else: 
	#if numExpectedPktsPHY[i] == numSendPktsPHY[i]:
	#    simLib.fregstim().write("N " + "%d\n"%(numSendPktsPHY[i]))
	#    simLib.fregstim().write("N " + "%d\n"%(numExpectedPktsPHY[i]))
	#else:
	simLib.fregstim().write("# Interface " + "%d\n"%(i)) 
	#simLib.fregstim().write("S " + "%d\n"%(numSendPktsPHY[i]))
        simLib.fregstim().write("N " + "%d\n"%(numExpectedPktsPHY[i]))
	simLib.fregstim().write("S " + "%d\n"%(numSendPktsPHY[i]))
    #if numSendPktsDMA[i] == 0:
#	simLib.fregstim().write("")
#    else:
    simLib.fregstim().write("# DMA\n")
    #simLib.fregstim().write("S " + "%d\n"%(numSendPktsDMA[i]))
    simLib.fregstim().write("N " + "%d\n"%(numExpectedPktsDMA[i])) 
    simLib.fregstim().write("S " + "%d\n"%(numSendPktsDMA[i]))
    #simLib.fregexpect().write("# BARRIER\n")
    #simLib.fregexpect().write("B " + "%d\n"%CMD_BARRIER_REG)
       
    resetBarrier()