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


Python drivers.BusDriver类代码示例

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


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

示例1: __init__

    def __init__(self, entity, name, clock, **kwargs):
        BusDriver.__init__(self, entity, name, clock, **kwargs)
        self._can_read = False
        self._can_write = False

        # Drive some sensible defaults (setimmediatevalue to avoid x asserts)
        if hasattr(self.bus, "read"):
            self.bus.read.setimmediatevalue(0)
            self._can_read = True

        if hasattr(self.bus, "write"):
            self.bus.write.setimmediatevalue(0)
            v = self.bus.writedata.value
            v.binstr = "x" * len(self.bus.writedata)
            self.bus.writedata <= v
            self._can_write = True

        if hasattr(self.bus, "byteenable"):
            self.bus.byteenable.setimmediatevalue(0)

        if hasattr(self.bus, "cs"):
            self.bus.cs.setimmediatevalue(0)

        v = self.bus.address.value
        v.binstr = "x" * len(self.bus.address)
        self.bus.address.setimmediatevalue(v)
开发者ID:TC01,项目名称:cocotb,代码行数:26,代码来源:avalon.py

示例2: __init__

 def __init__(self, entity, name, clock):
     BusDriver.__init__(self, entity, name, clock)
     self.bus.A.setimmediatevalue(5)
     self.bus.B.setimmediatevalue(5)
     self.log.debug("Test DrvM created")
     self.busy_event = Event("%s_busy" % name)
     self.busy = False
开发者ID:kirknodeng,项目名称:cocotb,代码行数:7,代码来源:test_drv.py

示例3: __init__

    def __init__(self, entity, name, clock):
        BusDriver.__init__(self, entity, name, clock)

        # Drive some sensible defaults (setimmediatevalue to avoid x asserts)
        self.bus.read.setimmediatevalue(0)
        self.bus.write.setimmediatevalue(0)
        self.bus.address.setimmediatevalue(0)
开发者ID:darylz,项目名称:cocotb,代码行数:7,代码来源:avalon.py

示例4: __init__

 def __init__(self, entity, name, clock, debug = False):
     BusDriver.__init__(self, entity, name, clock)
     if debug:
         self.log.setLevel(logging.DEBUG)
     self.bus.act    <=  0
     self.bus.stb    <=  0
     self.data       =  Array('B')
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:7,代码来源:ppfifo_bus.py

示例5: __init__

    def __init__(self, entity, name, clock, readlatency_min=1,
                 readlatency_max=1, memory=None):
        BusDriver.__init__(self, entity, name, clock)

        self._readable = False
        self._writeable = False

        if hasattr(self.bus, "readdata"):
            self._width = len(self.bus.readdata)
            self._readable = True

        if hasattr(self.bus, "writedata"):
            self._width = len(self.bus.writedata)
            self._writeable = True

        if not self._readable and not self._writeable:
            raise TestError("Attempt to instantiate useless memory")

        # Allow dual port RAMs by referencing the same dictionary
        if memory is None:
            self._mem = {}
        else:
            self._mem = memory

        self._val = BinaryValue(bits=self._width, bigEndian=False)
        self._readlatency_min = readlatency_min
        self._readlatency_max = readlatency_max
        self._responses = []
        self._coro = cocotb.fork(self._respond())

        if hasattr(self.bus, "readdatavalid"):
            self.bus.readdatavalid.setimmediatevalue(0)

        if hasattr(self.bus, "waitrequest"):
            self.bus.waitrequest.setimmediatevalue(0)
开发者ID:nickg,项目名称:cocotb,代码行数:35,代码来源:avalon.py

示例6: __init__

    def __init__(self, entity, name, clock, readlatency_min=1,
                 readlatency_max=1, memory=None, avl_properties={}):
        BusDriver.__init__(self, entity, name, clock)

        if avl_properties != {}:
            for key, value in self._avalon_properties.items():
                self._avalon_properties[key] = avl_properties.get(key, value)

        if self._avalon_properties["burstCountUnits"] != "symbols":
            self.log.error("Only symbols burstCountUnits is supported")

        if self._avalon_properties["addressUnits"] != "symbols":
            self.log.error("Only symbols addressUnits is supported")

        self._burstread = False
        self._burstwrite = False
        self._readable = False
        self._writeable = False
        self._width = None

        if hasattr(self.bus, "readdata"):
            self._width = len(self.bus.readdata)
            self._readable = True

        if hasattr(self.bus, "writedata"):
            width = len(self.bus.writedata)
            if (self._width is not None) and self._width != width:
                self.log.error("readdata and writedata bus" +
                               " are not the same size")
            self._width = width
            self._writeable = True

        if hasattr(self.bus, "burstcount"):
            if hasattr(self.bus, "readdatavalid"):
                self._burstread = True
            self._burstwrite = True

        if not self._readable and not self._writeable:
            raise TestError("Attempt to instantiate useless memory")

        # Allow dual port RAMs by referencing the same dictionary
        if memory is None:
            self._mem = {}
        else:
            self._mem = memory

        self._val = BinaryValue(bits=self._width, bigEndian=False)
        self._readlatency_min = readlatency_min
        self._readlatency_max = readlatency_max
        self._responses = []
        self._coro = cocotb.fork(self._respond())

        if hasattr(self.bus, "readdatavalid"):
            self.bus.readdatavalid.setimmediatevalue(0)

        if hasattr(self.bus, "waitrequest"):
            self.bus.waitrequest.setimmediatevalue(0)

        if hasattr(self.bus, "readdatavalid"):
            self.bus.readdatavalid.setimmediatevalue(0)
开发者ID:ambikeshwar1991,项目名称:cocotb,代码行数:60,代码来源:avalon.py

示例7: __init__

    def __init__(self,
                 entity,
                 name,
                 clock,
                 wr_fifo_name = "WR",
                 wr_fifo_clk = None,
                 wr_fifo_clk_period = 10,
                 rd_fifo_name = "RD",
                 rd_fifo_clk = None,
                 rd_fifo_clk_period = 10):
        BusDriver.__init__(self, entity, name, clock)
        if wr_fifo_clk is None:
            wr_fifo_clk = entity.WR_CLK
        if rd_fifo_clk is None:
            rd_fifo_clk = entity.RD_CLK

        self.bus.EN.setimmediatevalue(0)
        self.bus.ADR.setimmediatevalue(0)
        self.bus.ADR_FIXED.setimmediatevalue(0)
        self.bus.ADR_WRAP.setimmediatevalue(0)
        self.bus.WR_RD.setimmediatevalue(0)
        self.bus.COUNT.setimmediatevalue(0)

        # Mutex for each channel that we master to prevent contention
        self.command_busy = Lock("%s_wabusy" % name)
        cocotb.fork(Clock(wr_fifo_clk, wr_fifo_clk_period).start())
        cocotb.fork(Clock(rd_fifo_clk, rd_fifo_clk_period).start())

        self.write_fifo = PPFIFOWritePath(entity, wr_fifo_name, wr_fifo_clk)
        self.read_fifo = PPFIFOReadPath(entity, rd_fifo_name, rd_fifo_clk)
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:30,代码来源:axi_master_if.py

示例8: __init__

 def __init__(self, entity, name, clock, buffer_size = BUFFER_SIZE, debug = False):
     BusDriver.__init__(self, entity, name, clock)
     if debug:
         self.log.setLevel(logging.DEBUG)
     self.buffer_size = buffer_size
     self.bus.data.binstr = 'ZZZZZZZZ'
     self.bus.txe_n  <=  1
     self.bus.rde_n  <=  1
     self.data = Array('B')
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:9,代码来源:ft245_bus.py

示例9: __init__

    def __init__(self, entity, name, clock):
        BusDriver.__init__(self, entity, name, clock)
        
        word   = BinaryValue(bits=32)
        single = BinaryValue(bits=1)

        word.binstr   = ("x" * 32)
        single.binstr = ("x")

        self.bus.load_i <= single
        self.bus.rst_i <= single
        self.bus.dat_i <= word
开发者ID:JarrettR,项目名称:FPGA-Cryptoparty,代码行数:12,代码来源:python_ztex.py

示例10: __init__

 def __init__(self, entity, name, clock):
     BusDriver.__init__(self, entity, name, clock)
     # Drive some sensible defaults (setimmediatevalue to avoid x asserts)
     self.bus.cyc.setimmediatevalue(0)
     self.bus.stb.setimmediatevalue(0)            
     self.bus.we.setimmediatevalue(0)
     self.bus.adr.setimmediatevalue(0)
     self.bus.datwr.setimmediatevalue(0)
     
     v = self.bus.sel.value
     v.binstr = "1" * len(self.bus.sel)
     self.bus.sel <= v
开发者ID:mkreider,项目名称:cocotb2,代码行数:12,代码来源:wishbone.py

示例11: __init__

    def __init__(self, entity):
        BusDriver.__init__(self, entity, "", entity.FCLK_IN)

        # Create an appropriately sized high-impedence value
        self._high_impedence = BinaryValue(bits=len(self.bus.BUS_DATA))
        self._high_impedence.binstr = "Z" * len(self.bus.BUS_DATA)

        # Create an appropriately sized high-impedence value
        self._x = BinaryValue(bits=16)
        self._x.binstr = "x" * 16

        # Kick off a clock generator
        cocotb.fork(Clock(self.clock, 20833).start())
开发者ID:MarcoVogt,项目名称:basil,代码行数:13,代码来源:SiLibUsbBusDriver.py

示例12: __init__

    def __init__(self, entity, name, clock, width=32):
        BusDriver.__init__(self, entity, name, clock)
        #Drive default values onto bus
        self.width = width
        self.strobe_width = width / 8
        self.bus.TVALID.setimmediatevalue(0)
        self.bus.TLAST.setimmediatevalue(0)
        self.bus.TDATA.setimmediatevalue(0)
        self.bus.TKEEP.setimmediatevalue(0)
        self.bus.TID.setimmediatevalue(0)
        self.bus.TDEST.setimmediatevalue(0)
        self.bus.TUSER.setimmediatevalue(0)

        self.write_data_busy = Lock("%s_wbusy" % name)
开发者ID:zpan007,项目名称:cocotb,代码行数:14,代码来源:amba.py

示例13: __init__

 def __init__(self, entity, name, clock, width = 100, height = 100, y_fp = 10, y_bp = 10, x_fp = 10, x_bp = 10):
     BusDriver.__init__(self, entity, name, clock)
     self.width = width
     self.height = height
     self.y_fp = y_fp
     self.y_bp = y_bp
     self.x_fp = x_fp
     self.x_bp = x_bp
     self.bus.SOF_STB.setimmediatevalue(0)
     self.bus.HSYNC.setimmediatevalue(0)
     self.bus.RED.setimmediatevalue(0)
     self.bus.BLUE.setimmediatevalue(0)
     self.bus.GREEN.setimmediatevalue(0)
     self.busy = Lock("%s_busy" % name)
开发者ID:CospanDesign,项目名称:nysa-verilog,代码行数:14,代码来源:video_gen.py

示例14: __init__

    def __init__(self, entity, name, clock):
        BusDriver.__init__(self, entity, name, clock)

        # Drive some sensible defaults (setimmediatevalue to avoid x asserts)
        self.bus.AWVALID.setimmediatevalue(0)
        self.bus.WVALID.setimmediatevalue(0)
        self.bus.ARVALID.setimmediatevalue(0)
        self.bus.BREADY.setimmediatevalue(1)
        self.bus.RREADY.setimmediatevalue(1)

        # Mutex for each channel that we master to prevent contention
        self.write_address_busy = Lock("%s_wabusy" % name)
        self.read_address_busy = Lock("%s_rabusy" % name)
        self.write_data_busy = Lock("%s_wbusy" % name)
开发者ID:enchanter,项目名称:cocotb,代码行数:14,代码来源:amba.py

示例15: __init__

    def __init__(self, entity, name, clock, gen):
        ''' The clock shall be serial '''
        BusDriver.__init__(self, entity, name, clock)

        # outcoming elecidle flag
        self.txelecidle = 1
        # queue of *parallel* values to send
        self.sq = []
        # stream trace of received parallel values
        self.rq = []
        # sata generation (~ clock frequency)
        self.gen = gen

        self.driveBit(0)
开发者ID:beforewind,项目名称:x393_sata,代码行数:14,代码来源:sata_driver.py


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