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


Python Status.set_level方法代码示例

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


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

示例1: install_board

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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,代码行数:9,代码来源:local_install.py

示例2: uninstall_board

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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,代码行数:9,代码来源:local_install.py

示例3: setUp

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
    def setUp(self):
        s = Status()
        s.set_level("fatal")

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

示例4: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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,代码行数:60,代码来源:test_sdio_slave.py

示例5: setUp

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
 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,代码行数:13,代码来源:test_nysa.py

示例6: setUp

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
 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,代码行数:15,代码来源:test_nysa_sdb_manager.py

示例7: test_full_dionysus_read

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
    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,代码行数:20,代码来源:test_som_rom_parser.py

示例8: setUp

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
    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,代码行数:22,代码来源:test_nysa_driver.py

示例9: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
class Test (unittest.TestCase):

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

        self.configure_device(uart.UART)

    def configure_device(self, driver):
        self.s.Debug("type of driver: %s" % str(driver))
        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.d = None
            return
        n = plat[2]
        self.n = n
        urn = n.find_device(driver)[0]
        self.d = driver(n, urn)
        self.s.Important("Using Platform: %s" % plat[0])
        self.s.Important("Instantiated a driver Device: %s" % urn)

    def test_uart(self):
        """Unit test for UART
        """
        if self.d is None:
            return
        if self.n.get_board_name() == "sim":
            self.s.Warning("Unable to run UART test with simulator")
            return

        self.d.set_control(0)
        self.s.Debug ("Testing UART config")
        baudrate = self.d.get_baudrate()
        self.s.Debug ("Initial baudrate = %d" % baudrate)
        self.s.Debug ("Setting baudrate to 115200")
        self.d.set_baudrate(115200)
        '''
        self.d.set_baudrate(57600)
        if self.d.get_baudrate() > (57600 - (57600 * .01)) and self.d.get_baudrate() < (57600 + (57600 * .01)) :
            self.s.Debug ("Baudrate is within 1% of target")
        else:
            self.s.Debug ("Baudrate is not correct!")

        self.s.Debug ("Reverting back to initial baudrate")
        self.d.set_baudrate(baudrate)

        self.s.Debug ("\tXXX: Cannot test hardware flow control!")
        '''
        self.s.Debug ("\tControl: 0x%08X" % self.d.get_control())

        self.s.Debug ("Writing a string")
        self.d.write_string("STEAM ROXORS THE BIG ONE!1!!\r\n")


        self.s.Debug ("disable all interrupts")
        self.d.disable_interrupts()
        self.s.Debug ("Testing receive interrupt")
        self.d.enable_read_interrupt()
        self.s.Debug ("\tControl: 0x%08X" % self.d.get_control())

        self.s.Debug ("Read: %s " % self.d.read_string(-1))
        self.d.get_status()

#.........这里部分代码省略.........
开发者ID:CospanDesign,项目名称:nysa,代码行数:103,代码来源:test_uart.py

示例10: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
class Test (unittest.TestCase):

    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

    def read_image_callback(self):
        self.received_callback = True
        self.s.Debug("Image callback")

    def test_camera(self):
        if self.camera is None:
            self.s.Fatal("Cannot Run Test when no device is found!")
            return
        #Setup the camera
        self.camera.unregister_interrupt_callback(None)
        self.s.Debug("Image Height: %d" % self.camera.get_height())
        self.s.Debug("Image Width : %d" % self.camera.get_width())

        self.s.Debug("Initialize the camera")
        self.camera.set_control(0x00)
        self.camera.reset_camera()
        self.camera.set_rgb_mode()
        self.camera.reset_counts()
        time.sleep(0.1)
        row_count = self.camera.read_row_count()
        pixel_count = self.camera.read_pixel_count()
        height = row_count
        width = pixel_count / 2
        self.s.Debug("Height: %d" % height)
        self.s.Debug("Width : %d" % width)

        self.camera.enable_camera(True)
        time.sleep(0.1)
        #self.s.Important("Wait for a callback from the camera...")
        self.camera.start_async_reader(self.read_image_callback)
        #self.s.Important("Sleep for a moment...")
        time.sleep(0.4)
        '''
        data = self.camera.read_raw_image()
        print "Length of data: %d" % len(data)
        shape = (self.camera.get_width(), self.camera.get_height())
        img = Image.frombuffer('RGB', shape, data)
        img.save("/home/cospan/foo.png")
        '''
        if self.received_callback:
            data = self.camera.dma_reader.async_read()
            #Expand Image
            rgb_image = Array('B')
            for i in range(0, height * width * 2, 2):
                #top = data[i]
                #bot = data[i + 1]
#.........这里部分代码省略.........
开发者ID:CospanDesign,项目名称:nysa,代码行数:103,代码来源:test_camera.py

示例11: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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:
            #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)
                        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)
                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)

    def test_device(self):
        #print "Is enabled: %s" % self.driver.is_enabled()
        self.driver.enable(False)
        #self.driver.set_trigger         (0x00000020)
        #self.driver.set_trigger_mask    (0x00000020)
        #self.driver.set_trigger_edge    (0xFFFFFFFF)

        #self.driver.set_trigger         (0x00200000)
        #self.driver.set_trigger_mask    (0x01E00000)
        #self.driver.set_trigger_edge    (0xFFFFFFFF)
 
        #self.driver.set_trigger_after   (0x00000100)
        #self.driver.set_trigger_after   (0x00000000)
        self.driver.enable(True)
        self.driver.force_trigger()
        while not self.driver.is_finished():
            print "Waiting..."
            time.sleep(0.5)
            
        print "Is Finished: %s" % self.driver.is_finished()
        data = self.driver.read_data()
        clock_rate = self.driver.get_clock_rate()
        buf = create_vcd_buffer(data, count = 32, clock_count = clock_rate, add_clock = True)
        f = open('f.vcd', 'wb')
        f.write(buf)
        f.close()
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:85,代码来源:force_trigger.py

示例12: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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:
            #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.sd = None
            return
        n = plat[2]
        self.n = n
        sdio_urn = n.find_device(DRIVER)[0]
        self.sd = DRIVER(n, sdio_urn)
        sdio_urn = n.find_device(SDIODeviceDriver)[0]
        self.sdio = SDIODeviceDriver(n, sdio_urn)
        self.s.set_level("verbose")

        self.s.Info("Using Platform: %s" % plat[0])

    def test_sd_host_sdio(self):
        #self.s.Info("Host Control:\t\t0x%08X" % self.sd.get_control())
        self.sd.display_control()
        self.s.Info("Device Control:\t\t0x%08X" % self.sdio.get_control())
        self.s.Info("Delay: 0x%02X" % self.sd.get_input_delay())
        sd_host_input_delay_value = 63
        self.s.Info("Set host input delay to %d ( 0x%02X )" % (sd_host_input_delay_value, sd_host_input_delay_value))
        self.sd.set_input_delay(sd_host_input_delay_value)
        self.s.Info("Delay: 0x%02X" % self.sd.get_input_delay())

        self.sdio.enable_sdio_device(False)
        self.sdio.reset_core()

        sdio_input_delay_value = 0
        self.s.Info("Delay: 0x%02X" % self.sdio.get_input_delay())
        self.s.Info("Set Input delay to %d ( 0x%02X )" % (sdio_input_delay_value, sdio_input_delay_value))
        self.sdio.set_input_delay(sdio_input_delay_value)
        self.s.Info("Delay: 0x%02X" % self.sdio.get_input_delay())

        self.sdio.enable_sdio_device(True)
        #self.s.Info("Host Status:\t\t0x%08X" % self.sd.get_status())
        self.sd.display_status()
        self.s.Info("Device Control:\t\t0x%08X" % self.sdio.get_control())
        self.s.Info("Device Status:\t\t0x%08X" % self.sdio.get_status())
        self.s.Info("Host Attempting to set voltage range")
        self.sd.set_voltage_range(2.0, 3.6)
        self.s.Info("Host Enable SD Host")
        self.sd.enable_sd_host(True)

        self.s.Verbose("Setting Phy Select... should be no response")
        self.sdio.display_control()
        self.sdio.display_status()
        self.sd.cmd_phy_sel()
        self.sd.display_crcs()
        self.sdio.display_crcs()

        self.s.Verbose("Phy State should be 0x00")
        self.s.Info("SD Command:\t\t0x%08X" % self.sdio.get_sd_cmd())
        self.s.Info("Host Control:\t\t0x%08X" % self.sd.get_control())

        try:
            self.s.Verbose("Send Command 5")
            self.sd.cmd_io_send_op_cond(enable_1p8v = True)
            #self.sd.display_crcs()
            #self.sdio.display_crcs()
#.........这里部分代码省略.........
开发者ID:CospanDesign,项目名称:nysa,代码行数:103,代码来源:test_full_sdio.py

示例13: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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:
            #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.driver = None
            return
        n = plat[2]
        self.n = n
        sdio_urn = n.find_device(DRIVER)[0]
        self.driver = 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_device(self):

        TX_DIFF_CTRL = 0x09
        TX_PRE_EMPTH = 0x00
        RX_EQUALIZER = 0x3


        self.s.Info("Attempting to set voltage range")
        self.s.Info("Enable PCIE")
        self.driver.enable(False)
        self.driver.enable_pcie_read_block(True)
        self.driver.enable_external_reset(True)
        #self.driver.enable_manual_reset(True)
        #self.driver.enable_manual_reset(False)

        self.s.Info("Is external reset enabled: %s" % str(self.driver.is_external_reset_enabled()))
        self.s.Info("Driver Control: 0x%08X" % self.driver.get_control())
        self.driver.set_tx_diff_swing(TX_DIFF_CTRL)
        self.driver.set_rx_equalizer(RX_EQUALIZER)
        self.s.Important("Tx Diff Swing: %d" % self.driver.get_tx_diff_swing())
        self.s.Important("RX Equalizer: %d" % self.driver.get_rx_equalizer())
        time.sleep(0.5)
        self.driver.enable(True)
        time.sleep(0.5)
        self.s.Info("Driver Control: 0x%08X" % self.driver.get_control())

        self.s.Verbose("Is GTP PLL Locked: %s" % self.driver.is_gtp_pll_locked())
        self.s.Verbose("Is GTP Reset Done: %s" % self.driver.is_gtp_reset_done())
        self.s.Verbose("Is GTP RX Electrical Idle: %s" % self.driver.is_gtp_rx_elec_idle())
        self.s.Verbose("Is PLL Locked: %s" % self.driver.is_pll_locked())
        self.s.Verbose("Is Host Holding Reset: %s" % self.driver.is_host_set_reset())

        if self.driver.is_pcie_reset():
            self.s.Error("PCIE_A1 Core is in reset!")

        if self.driver.is_linkup():
            self.s.Important("PCIE Linked up!")
        else:
            self.s.Error("PCIE Core is not linked up!")

        self.s.Important("LTSSM State: %s" % self.driver.get_ltssm_state())

        if self.driver.is_correctable_error():
            self.s.Error("Correctable Error Detected")

        if self.driver.is_fatal_error():
#.........这里部分代码省略.........
开发者ID:duvitech,项目名称:nysa-artemis-usb2-platform,代码行数:103,代码来源:test_real.py

示例14: NysaSim

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
class NysaSim (FauxNysa):

    @cocotb.coroutine
    def interrupt_interface(self):
        while(1):
            yield RisingEdge(self.dut.device_interrupt)
            #print "got interrupt... looking for callback"
            for key in self.callbacks:
                if self.callbacks[key] is not None:
                    #print "Found callback for: %s" % str(key)
                    for c in self.callbacks[key]:
                        c()

    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())

    @cocotb.coroutine
    def wait_clocks(self, num_clks):
        for i in range(num_clks):
            yield RisingEdge(self.dut.clk)

    def read_sdb(self):
        """read_sdb

        Read the contents of the DRT

        Args:
          Nothing

        Returns (Array of bytes):
          the raw DRT data, this can be ignored for normal operation

        Raises:
          Nothing
        """
        self.s.Verbose("entered")
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        return self.nsm.read_sdb(self)

    def read(self, address, length = 1, disable_auto_inc = False):
        if (address * 4) + (length * 4) <= len(self.rom):
            length *= 4
            address *= 4

            ra = Array('B')
            for count in range (0, length, 4):
                ra.extend(self.rom[address + count :address + count + 4])
            #print "ra: %s" % str(ra)
            return ra

        mem_device = False
        if self.mem_addr is None:
            self.mem_addr = self.nsm.get_address_of_memory_bus()

        if address >= self.mem_addr:
            address = address - self.mem_addr
            mem_device = True

        self._read(address, length, mem_device, disable_auto_inc)
        return self.response

    @cocotb.function
    def _read(self, address, length = 1, mem_device = False, disable_auto_inc = False):
        yield(self.comm_lock.acquire())

        #print "_Read Acquire Lock"
        data_index = 0
        self.dut.in_ready       <= 0
        self.dut.out_ready      <= 0

        self.response = Array('B')
        yield( self.wait_clocks(10))

        command = 0x00000002
#.........这里部分代码省略.........
开发者ID:CospanDesign,项目名称:nysa,代码行数:103,代码来源:sim_host.py

示例15: Test

# 需要导入模块: from nysa.common.status import Status [as 别名]
# 或者: from nysa.common.status.Status import set_level [as 别名]
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:
            #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.sd = None
            return
        n = plat[2]
        self.n = n
        sdio_urn = n.find_device(DRIVER)[0]
        self.sd = 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_sd_host(self):
        self.s.Info("Control: 0x%08X" % self.sd.get_control())
        self.s.Info("Status: 0x%08X" % self.sd.get_status())
        self.s.Info("Attempting to set voltage range")
        self.sd.set_voltage_range(2.0, 3.6)
        self.s.Info("Enable SD Host")
        self.sd.enable_sd_host(True)
        #self.s.Info("Control: 0x%08X" % self.sd.get_control())
        #self.sd.cmd_phy_sel()
        self.s.Info("Control: 0x%08X" % self.sd.get_control())
        self.sd.cmd_io_send_op_cond(enable_1p8v = True)
        self.s.Info("Control: 0x%08X" % self.sd.get_control())
        self.s.Info("Status: 0x%08X" % self.sd.get_status())
开发者ID:CospanDesign,项目名称:nysa,代码行数:69,代码来源:test_sd_host.py


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