Пример #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
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
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
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")