예제 #1
0
def readIgloo(slot, address, num_bytes):
    b.write(0x00,[0x06])
    b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    b.write(0x09,[address])
    b.read(0x09, num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #2
0
def writeIgloo(rm,slot,address,messageList):
    t.openRM(b,rm)
    b.write(0x00,[0x06])
    b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
    b.write(0x09,[address] + messageList)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #3
0
def bridgeTests(slot, num_tests, verbosity=0):
    passed = 0
    failed = 0
    neither = 0
    print '## Number of Tests: '+str(num_tests)
    for test in xrange(num_tests):
        print '\n### Bridge Test: '+str(test)+' ###'
        print '\n### Test Name: '+str(bridgeDict[test]['name'])
        function = bridgeDict[test]['function']
        address = bridgeDict[test]['address']
        num_bytes = bridgeDict[test]['bits']/8
        message = t.readRegisterBridge(slot, address, num_bytes)
        print '\n*********** RAW MESSAGE :'+str(t.reverseBytes(message))+'\n'
        result = function(message)
        if result == 'PASS':
            passed += 1
        elif result == 'FAIL':
            failed += 1
        else:
            print 'Neither PASS Nor FAIL'
            neither += 1
        if verbosity:
            print 'Register Name: '+str(bridgeDict[test]['name'])
            print 'Register Value: '+str(message)
            print 'Test Result: '+str(result)

    test_list = [passed, failed, neither]
    return test_list
예제 #4
0
def bridgeTests(slot, num_tests, verbosity=0):
    passed = 0
    failed = 0
    neither = 0
    print '## Number of Tests: ' + str(num_tests)
    for test in xrange(num_tests):
        print '\n### Bridge Test: ' + str(test) + ' ###'
        print '\n### Test Name: ' + str(bridgeDict[test]['name'])
        function = bridgeDict[test]['function']
        address = bridgeDict[test]['address']
        num_bytes = bridgeDict[test]['bits'] / 8
        message = t.readRegisterBridge(slot, address, num_bytes)
        print '\n*********** RAW MESSAGE :' + str(
            t.reverseBytes(message)) + '\n'
        result = function(message)
        if result == 'PASS':
            passed += 1
        elif result == 'FAIL':
            failed += 1
        else:
            print 'Neither PASS Nor FAIL'
            neither += 1
        if verbosity:
            print 'Register Name: ' + str(bridgeDict[test]['name'])
            print 'Register Value: ' + str(message)
            print 'Test Result: ' + str(result)

    test_list = [passed, failed, neither]
    return test_list
예제 #5
0
def readBridge(slot, address, num_bytes):
    b.write(t.bridgeAddress(slot), [address])
    b.read(t.bridgeAddress(slot), num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)
예제 #6
0
def readBridge(slot, address, num_bytes):
    b.write(t.bridgeAddress(slot),[address])
    b.read(t.bridgeAddress(slot), num_bytes)
    message = b.sendBatch()[-1]
    return t.reverseBytes(message)