当前位置: 首页>>代码示例>>Python>>正文


Python status.Status类代码示例

本文整理汇总了Python中nysa.common.status.Status的典型用法代码示例。如果您正苦于以下问题:Python Status类的具体用法?Python Status怎么用?Python Status使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Status类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
        s = Status()
        s.set_level("fatal")

        print "Unit test!"
        pass
        '''
开发者ID:CospanDesign,项目名称:nysa,代码行数:7,代码来源:test_stepper.py

示例2: uninstall_board

def uninstall_board(name, debug):
    from nysa.ibuilder.lib import utils
    from nysa.common.status import Status
    status = Status()
    if debug:
        status.set_level("Verbose")
    utils.uninstall_local_board_package(name, status)
开发者ID:CospanDesign,项目名称:nysa-tx1-pcie-platform,代码行数:7,代码来源:local_install.py

示例3: install_board

def install_board(name, path, setup_platform, debug):
    from nysa.ibuilder.lib import utils
    from nysa.common.status import Status
    status = Status()
    if debug:
        status.set_level("Verbose")
    utils.install_local_board_package(name, path, setup_platform, status)
开发者ID:CospanDesign,项目名称:nysa-tx1-pcie-platform,代码行数:7,代码来源:local_install.py

示例4: Test

class Test (unittest.TestCase):

    def setUp(self):
        self.s = Status()
        plat = ["", None, None]
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()

        if "sim" in platform_names:
            platform_names.remove("sim")
            platform_names.append("sim")
        urn = None
        for platform_name in platform_names:
            if plat[1] is not None:
                break
            self.s.Debug("Platform: %s" % str(platform_name))
            platform_instance = platform_dict[platform_name](self.s)
            instances_dict = platform_instance.scan()
            for name in instances_dict:
                n = instances_dict[name]
                plat = ["", None, None]
                if n is not None:
                    self.s.Important("Found a nysa instance: %s" % name)
                    n.read_sdb()
                    if n.is_device_in_platform(DRIVER):
                        plat = [platform_name, name, n]
                        break
                    continue

        if plat[1] is None:
            self.sdio_drv = None
            return
        n = plat[2]
        self.n = n
        sdio_urn = n.find_device(DRIVER)[0]
        self.sdio = DRIVER(n, sdio_urn)
        self.s.set_level("verbose")
        self.s.Info("Using Platform: %s" % plat[0])
        self.s.Info("Instantiated a SDIO Device Device: %s" % sdio_urn)

    def test_sdio_device(self):
        self.s.Info("Control: 0x%08X" % self.sdio.get_control())
        self.s.Info("Enable Interrupt: %s" % self.sdio.is_interrupt_enable())
        self.sdio.enable_interrupt(True)
        self.s.Info("Enable Interrupt: %s" % self.sdio.is_interrupt_enable())
        self.s.Info("Control: 0x%08X" % self.sdio.get_control())
        self.sdio.enable_sdio_device(True)
        self.s.Info("Control: 0x%08X" % self.sdio.get_control())
        self.sdio.set_control(0x01)
        self.s.Info("Control: 0x%08X" % self.sdio.get_control())
        self.sdio.write_local_buffer(0, [0, 1, 2, 3, 4, 5, 6, 7, 8])
        data = self.sdio.read_local_buffer(0, 2)
        self.s.Info("Buffer Out: %s" % str(data))
        self.s.Info("Status: 0x%08X" % self.sdio.get_status())
        self.s.Info("Clock Count: 0x%08X" % self.sdio.get_clock_count())
        self.s.Info("SD Command: 0x%08X" % self.sdio.get_sd_cmd())
        self.s.Info("SD Command Arg: 0x%08X" % self.sdio.get_sd_cmd_arg())
开发者ID:CospanDesign,项目名称:nysa,代码行数:58,代码来源:test_sdio_slave.py

示例5: setUp

 def setUp(self):
     name = "sim"
     serial = "dionysus_uart_pmod"
     s = Status()
     s.set_level("fatal")
     try:
         self.n = find_board(name, serial, s)
     except PlatformScannerException as ex:
         print "Could not find platform :%s" % str(ex)
         sys.exit(1)
     self.n.read_sdb()
开发者ID:CospanDesign,项目名称:nysa,代码行数:11,代码来源:test_nysa.py

示例6: setUp

 def setUp(self):
     self.dbg = False
     name = "sim"
     serial = "dionysus_uart_pmod"
     s = Status()
     s.set_level(StatusLevel.FATAL)
     try:
         self.board = find_board(name, serial, s)
     except PlatformScannerException as ex:
         print "Could not find platform :%s" % str(ex)
         sys.exit(1)
     self.board.read_sdb()
     self.nsm = self.board.nsm
开发者ID:CospanDesign,项目名称:nysa,代码行数:13,代码来源:test_nysa_sdb_manager.py

示例7: __init__

    def __init__(self, dut, sim_config, period = CLK_PERIOD, user_paths = []):
        self.status = Status()
        self.status.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut                              = dut
        dev_dict                              = json.load(open(sim_config), object_pairs_hook = OrderedDict)
        super (NysaSim, self).__init__(dev_dict, self.status)

        self.timeout                          = 1000
        self.response                         = Array('B')

        self.dut.rst                          <= 0
        self.dut.ih_reset                     <= 0

        self.dut.in_ready                     <= 0
        self.dut.in_command                   <= 0
        self.dut.in_address                   <= 0
        self.dut.in_data                      <= 0
        self.dut.in_data_count                <= 0
        gd = GenSDB()
        self.callbacks = {}
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        cocotb.fork(Clock(dut.clk, period).start())
        cocotb.fork(self.interrupt_interface())
开发者ID:CospanDesign,项目名称:nysa,代码行数:26,代码来源:sim_host.py

示例8: setUp

    def setUp(self):
        self.s = Status()
        plat = ["", None, None]
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()

        if "sim" in platform_names:
            #If sim is in the platforms, move it to the end
            platform_names.remove("sim")
            platform_names.append("sim")
        urn = None
        for platform_name in platform_names:
            if plat[1] is not None:
                break

            self.s.Debug("Platform: %s" % str(platform_name))

            platform_instance = platform_dict[platform_name](self.s)
            #self.s.Verbose("Platform Instance: %s" % str(platform_instance))

            instances_dict = platform_instance.scan()

            for name in instances_dict:

                try:
                    #s.Verbose("Found Platform Item: %s" % str(platform_item))
                    n = instances_dict[name]
                    plat = ["", None, None]
                    
                    if n is not None:
                        self.s.Important("Found a nysa instance: %s" % name)
                        try:
                            n.read_sdb()
                        except IndexError:
                            self.s.Warning("%s is not responding..." % name)
                            continue
                        #import pdb; pdb.set_trace()
                        if n.is_device_in_platform(DRIVER):
                            plat = [platform_name, name, n]
                            break
                        continue
                    
                    #self.s.Verbose("\t%s" % psi)
                except NysaCommError:
                    continue

        if plat[1] is None:
            self.driver = None
            return
        n = plat[2]
        self.n = n
        pcie_urn = n.find_device(DRIVER)[0]
        self.driver = DRIVER(n, pcie_urn)
        self.s.set_level("verbose")

        self.s.Info("Using Platform: %s" % plat[0])
        self.s.Info("Instantiated a PCIE Device Device: %s" % pcie_urn)
开发者ID:CospanDesign,项目名称:nysa-tx1-pcie-platform,代码行数:58,代码来源:test_real.py

示例9: test_full_dionysus_read

    def test_full_dionysus_read(self):
        from nysa.host.platform_scanner import PlatformScanner
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()
        if "dionysus" not in platform_names:
            return

        s = Status()
        platform_instance = platform_dict["dionysus"](s)
        platforms = platform_instance.scan()
        if len(platforms) == 0:
            return
        dionysus = platforms[platforms.keys()[0]]
        #print "Found Dionysus"
        s.set_level("fatal")
        s.Verbose("Read SDB")
        dionysus.read_sdb()
开发者ID:CospanDesign,项目名称:nysa,代码行数:18,代码来源:test_som_rom_parser.py

示例10: setUp

    def setUp(self):
        self.s = Status()
        plat = ["", None, None]
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()

        if "sim" in platform_names:
            #If sim is in the platforms, move it to the end
            platform_names.remove("sim")
            platform_names.append("sim")
        urn = None
        for platform_name in platform_names:
            if plat[1] is not None:
                break

            self.s.Debug("Platform: %s" % str(platform_name))

            platform_instance = platform_dict[platform_name](self.s)
            #self.s.Verbose("Platform Instance: %s" % str(platform_instance))

            instances_dict = platform_instance.scan()

            for name in instances_dict:

                #s.Verbose("Found Platform Item: %s" % str(platform_item))
                n = instances_dict[name]
                plat = ["", None, None]

                if n is not None:
                    self.s.Important("Found a nysa instance: %s" % name)
                    n.read_sdb()
                    #import pdb; pdb.set_trace()
                    if n.is_device_in_platform(DRIVER):
                        plat = [platform_name, name, n]
                        break
                    continue

                #self.s.Verbose("\t%s" % psi)

        if plat[1] is None:
            self.sata_drv = None
            return
        n = plat[2]
        self.n = n
        sata_urn = n.find_device(DRIVER)[0]
        dma_urn = n.find_device(DMA)[0]
        self.memory_urn = self.n.find_device(Memory)[0]

        self.sata_drv = DRIVER(n, sata_urn)
        self.dma = DMA(n, dma_urn)
        self.s.set_level("verbose")

        self.s.Info("Using Platform: %s" % plat[0])
        self.s.Info("Instantiated a SATA Device: %s" % sata_urn)
        self.s.Info("Instantiated a DMA Device: %s" % dma_urn)
开发者ID:CospanDesign,项目名称:nysa,代码行数:56,代码来源:test_dma_sata.py

示例11: setUp

    def setUp(self):
        name = "sim"
        serial = "dionysus_dma_test"
        s = Status()
        s.set_level("fatal")
        try:
            self.n = find_board(name, serial, s)
        except PlatformScannerException as ex:
            print "Could not find platform :%s" % str(ex)
            sys.exit(1)
        self.n.read_sdb()
        urns = self.n.find_device(MockGPIODriver)
        #self.simple_dev = MockGPIODriver(self.n, urns[0], True)
        self.simple_dev = MockGPIODriver(self.n, urns[0], False)
        urns = self.n.find_device(MockDMAReaderDriver)
        self.dmar = MockDMAReaderDriver(self.n, urns[0], False)

        urns = self.n.find_device(MockDMAWriterDriver)
        self.dmaw = MockDMAWriterDriver(self.n, urns[0], False)
        s.set_level("error")
开发者ID:CospanDesign,项目名称:nysa,代码行数:20,代码来源:test_nysa_driver.py

示例12: setUp

    def setUp(self):
        self.s = Status()
        self.s.set_level("fatal")
        plat = ["", None, None]
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()

        if "sim" in platform_names:
            #If sim is in the platforms, move it to the end
            platform_names.remove("sim")
            platform_names.append("sim")
        urn = None
        for platform_name in platform_names:
            if plat[1] is not None:
                break

            self.s.Debug("Platform: %s" % str(platform_name))

            platform_instance = platform_dict[platform_name](self.s)
            #self.s.Verbose("Platform Instance: %s" % str(platform_instance))

            instances_dict = platform_instance.scan()

            for name in instances_dict:

                #s.Verbose("Found Platform Item: %s" % str(platform_item))
                n = instances_dict[name]
                plat = ["", None, None]

                if n is not None:
                    self.s.Important("Found a nysa instance: %s" % name)
                    n.read_sdb()
                    #import pdb; pdb.set_trace()
                    if n.is_device_in_platform(SFCamera):
                        plat = [platform_name, name, n]
                        break
                    continue

                #self.s.Verbose("\t%s" % psi)

        if plat[1] is None:
            self.camera = None
            return
        n = plat[2]
        urn = n.find_device(SFCamera)[0]
        self.s.set_level("verbose")
        self.s.Important("Using Platform: %s" % plat[0])
        self.s.Important("Instantiated a SFCamera Device: %s" % urn)
        self.camera = SFCamera(n, urn)
        self.received_callback = False
开发者ID:CospanDesign,项目名称:nysa,代码行数:51,代码来源:test_camera.py

示例13: setUp

    def setUp(self):
        self.s = Status()
        plat = ["", None, None]
        pscanner = PlatformScanner()
        platform_dict = pscanner.get_platforms()
        platform_names = platform_dict.keys()

        if "sim" in platform_names:
            platform_names.remove("sim")
            platform_names.append("sim")
        urn = None
        for platform_name in platform_names:
            if plat[1] is not None:
                break
            self.s.Debug("Platform: %s" % str(platform_name))
            platform_instance = platform_dict[platform_name](self.s)
            instances_dict = platform_instance.scan()
            for name in instances_dict:
                n = instances_dict[name]
                plat = ["", None, None]
                if n is not None:
                    self.s.Important("Found a nysa instance: %s" % name)
                    n.read_sdb()
                    if n.is_device_in_platform(DRIVER):
                        plat = [platform_name, name, n]
                        break
                    continue

        if plat[1] is None:
            self.sdio_drv = None
            return
        n = plat[2]
        self.n = n
        sdio_urn = n.find_device(DRIVER)[0]
        self.sdio = DRIVER(n, sdio_urn)
        self.s.set_level("verbose")
        self.s.Info("Using Platform: %s" % plat[0])
        self.s.Info("Instantiated a SDIO Device Device: %s" % sdio_urn)
开发者ID:CospanDesign,项目名称:nysa,代码行数:38,代码来源:test_sdio_slave.py

示例14: __init__

    def __init__(self, dut, sim_config, period = CLK_PERIOD, user_paths = []):
        self.status = Status()
        self.status.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut                              = dut
        dev_dict                              = json.load(open(sim_config), object_pairs_hook = OrderedDict)
        super (NysaSim, self).__init__(dev_dict, self.status)

        self.timeout                          = 1000
        self.response                         = Array('B')

        self.dut.rst                          <= 0
        #self.ft245  =   FT245(dut, "ft245", dut.ft245_clk, buffer_size = 0x10)
        self.ft245  =   FT245(dut, "ft245", dut.ft245_clk, buffer_size = 0x11)
        #self.ft245  =   FT245(dut, "ft245", dut.ft245_clk, buffer_size = 0x200)
        gd = GenSDB()
        self.callbacks = {}
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        cocotb.fork(Clock(dut.clk, period).start())
        setup_ft245_clk(dut)
        cocotb.fork(self.interrupt_interface())
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:23,代码来源:sim_host.py

示例15: setUp

    def setUp(self):
        self.s = Status()
        self.s.set_level("debug")

        self.configure_device(uart.UART)
开发者ID:CospanDesign,项目名称:nysa,代码行数:5,代码来源:test_uart.py


注:本文中的nysa.common.status.Status类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。