コード例 #1
0
ファイル: initializer.py プロジェクト: CaiJianLee/Xavier
def _create_uart_object():
    ret_value = True
    for bus_name, bus in Profile.get_buses().iteritems():
        try:
            if bus['bus'] == 'uart':
                device_path = bus['path']
                if utility.mount_on_fpga(device_path):
                    class_name = 'Axi4Uart'
                    createok = XObject.create_object(bus_name, class_name,
                                                     device_path)
                else:
                    class_name = 'UartBus'
                    createok = XObject.create_object(bus_name, class_name,
                                                     device_path)

                if createok:
                    logger.boot("create the %s uart object %s" %
                                (bus_name, class_name))
                else:
                    logger.boot(
                        "warning: can not find the %s uart class %s in this project code"
                        % (bus_name, class_name))
                    ret_value = False
        except Exception as e:
            logger.boot("error: create %s uart object fail:\n%s" %
                        (bus_name, traceback.format_exc()))
            ret_value = False
    return ret_value
コード例 #2
0
ファイル: initializer.py プロジェクト: CaiJianLee/Xavier
def _create_board_object():
    ret_value = True
    for board_name, board_profile in Profile.get_boards().iteritems():
        try:
            class_name = board_profile['partno'].replace('-', '')
            if XObject.create_object(board_name, class_name, board_profile):
                logger.boot('create the %s board object %s' %
                            (board_name, class_name))
            else:
                logger.boot(
                    'warning: can not find the %s board class %s in this project code'
                    % (board_name, class_name))
                ret_value = False
        except Exception as e:
            logger.boot("error: create %s board object fail:\n%s" %
                        (board_name, traceback.format_exc()))
            ret_value = False
    return ret_value
コード例 #3
0
ファイル: initializer.py プロジェクト: CaiJianLee/Xavier
def _create_chip_object():
    ret_value = True
    for chip_name, profile in Profile.get_chips().iteritems():
        try:
            partno = profile['partno']
            if XObject.create_object(chip_name, partno, profile):
                logger.boot('create the %s chip object %s' %
                            (chip_name, partno))
            else:
                logger.boot(
                    'warning: can not find the %s chip class %s in this project code'
                    % (chip_name, partno))
                ret_value = False
        except Exception as e:
            logger.boot('error: create %s chip object fail:\n%s' %
                        (chip_name, traceback.format_exc()))
            ret_value = False
    return ret_value