예제 #1
0
def barrier():
    for i in range(NUM_PORTS):
        simLib.fPort(i + 1).write("%08d"%CMD_BARRIER + " // BARRIER\n")
        simLib.fPort(i + 1).write("%08x"%(numExpectedPktsPHY[i]) +
                                    " // Number of Packets\n")

    simLib.fPCI().write("%08d"%CMD_PCI_BARRIER + " // BARRIER\n")
    for i in range(NUM_PORTS):
        simLib.fPCI().write("%08x"%(numExpectedPktsDMA[i]) +
                            " // Number of expected pkts received via DMA port " +
                            str(i + 1) + "\n")

    resetBarrier()
예제 #2
0
def barrier():
    for i in range(NUM_PORTS):
        simLib.fPort(i + 1).write("%08d"%CMD_BARRIER + " // BARRIER\n")
        simLib.fPort(i + 1).write("%08x"%(numExpectedPktsPHY[i]) +
                                    " // Number of Packets\n")

    simLib.fPCI().write("%08d"%CMD_PCI_BARRIER + " // BARRIER\n")
    for i in range(NUM_PORTS):
        simLib.fPCI().write("%08x"%(numExpectedPktsDMA[i]) +
                            " // Number of expected pkts received via DMA port " +
                            str(i + 1) + "\n")

    resetBarrier()
예제 #3
0
def regDMA(queue, length):
    f = simLib.fPCI()
    f.write("// DMA: QUEUE: " + hex(queue) + " LENGTH: " + hex(length) + "\n")
    f.write("00000003 // DMA\n")
    f.write("%08x" % queue + " // Queue (" + hex(queue) + ")\n")
    f.write("%08x" % length + " // Length (" + hex(length) + ")\n")
    f.write("00000000" + " // Mask (0x0)\n")
예제 #4
0
def regDMA(queue, length):
    f = simLib.fPCI()
    f.write("// DMA: QUEUE: "+hex(queue)+ " LENGTH: "+hex(length)+"\n")
    f.write("00000003 // DMA\n")
    f.write("%08x"%queue +" // Queue ("+hex(queue)+")\n")
    f.write("%08x"%length+" // Length ("+hex(length)+")\n")
    f.write("00000000"+" // Mask (0x0)\n")
예제 #5
0
파일: simReg.py 프로젝트: zwj102030/netfpga
def regWrite(reg, value):
    f = simLib.fPCI()
    f.write("// WRITE:  Address: " + hex(reg) + " Data: " + hex(value) + "\n")
    f.write("00000002" + " // WRITE\n")
    f.write("%08x" % reg + " // Address \n")
    f.write("%08x" % value + " // Data (" + hex(value) + ")\n")
    f.write("00000000" + " // Mask (0x0)\n")
예제 #6
0
def regWrite(reg, value):
    f = simLib.fPCI()
    f.write("// WRITE:  Address: "+hex(reg)+" Data: "+hex(value)+"\n")
    f.write("00000002"+" // WRITE\n")
    f.write("%08x"%reg + " // Address \n")
    f.write("%08x"%value+" // Data ("+hex(value)+")\n")
    f.write("00000000"+" // Mask (0x0)\n")
예제 #7
0
def regRead(reg, value):
    f = simLib.fPCI()
    f.write("// READ:  Address: "+hex(reg)+" Expected Data: "+hex(value)+"\n")
    f.write("00000001 // READ\n")
    f.write("%08x"%reg+" // Address ("+hex(reg)+")\n")
    f.write("%08x"%value+" // Data ("+hex(value)+")\n")
    f.write("FFFFFFFF"+" // Mask (0xFFFFFFFF)\n")
예제 #8
0
파일: simReg.py 프로젝트: zwj102030/netfpga
def regRead(reg, value):
    f = simLib.fPCI()
    f.write("// READ:  Address: " + hex(reg) + " Expected Data: " +
            hex(value) + "\n")
    f.write("00000001 // READ\n")
    f.write("%08x" % reg + " // Address (" + hex(reg) + ")\n")
    f.write("%08x" % value + " // Data (" + hex(value) + ")\n")
    f.write("FFFFFFFF" + " // Mask (0xFFFFFFFF)\n")
예제 #9
0
def delay(nanoSeconds):
    for i in range(NUM_PORTS):
        simLib.fPort(i+1).write("%08d"%CMD_DELAY + " // DELAY\n")
        simLib.fPort(i+1).write("%08x"%(MSB_MASK & nanoSeconds) +
                                " // Delay (MSB) " + str(nanoSeconds)+" ns\n")
        simLib.fPort(i+1).write("%08x"%(MSB_MASK & nanoSeconds) +
                                " // Delay (LSB) " + str(nanoSeconds)+" ns\n")

    simLib.fPCI().write("%08d"%CMD_PCI_DELAY+" // DELAY\n")
    simLib.fPCI().write("%08x"%(MSB_MASK & nanoSeconds) + " // Delay (MSB) " +
                        str(nanoSeconds) + " ns\n")
    simLib.fPCI().write("%08x"%(LSB_MASK & nanoSeconds) + " // Delay (LSB) " +
                        str(nanoSeconds) + " ns\n")
예제 #10
0
def delay(nanoSeconds):
    for i in range(NUM_PORTS):
        simLib.fPort(i+1).write("%08d"%CMD_DELAY + " // DELAY\n")
        simLib.fPort(i+1).write("%08x"%(MSB_MASK & nanoSeconds) +
                                " // Delay (MSB) " + str(nanoSeconds)+" ns\n")
        simLib.fPort(i+1).write("%08x"%(MSB_MASK & nanoSeconds) +
                                " // Delay (LSB) " + str(nanoSeconds)+" ns\n")

    simLib.fPCI().write("%08d"%CMD_PCI_DELAY+" // DELAY\n")
    simLib.fPCI().write("%08x"%(MSB_MASK & nanoSeconds) + " // Delay (MSB) " +
                        str(nanoSeconds) + " ns\n")
    simLib.fPCI().write("%08x"%(LSB_MASK & nanoSeconds) + " // Delay (LSB) " +
                        str(nanoSeconds) + " ns\n")
예제 #11
0
파일: simReg.py 프로젝트: zwj102030/netfpga
def regDelay(nanoSeconds):
    simLib.fPCI().write("00000005 // DELAY \n")
    simLib.fPCI().write("%08x" % (MSB_MASK & nanoSeconds) +
                        " // Delay (MSB) " + str(nanoSeconds) + " ns\n")
    simLib.fPCI().write("%08x" % (LSB_MASK & nanoSeconds) +
                        " // Delay (LSB) " + str(nanoSeconds) + " ns\n")
예제 #12
0
def regDelay(nanoSeconds):
    simLib.fPCI().write("00000005 // DELAY \n")
    simLib.fPCI().write("%08x"%(MSB_MASK & nanoSeconds) + " // Delay (MSB) "
                        + str(nanoSeconds) + " ns\n")
    simLib.fPCI().write("%08x"%(LSB_MASK & nanoSeconds) + " // Delay (LSB) "
                        + str(nanoSeconds) + " ns\n")