當前位置: 首頁>>代碼示例>>Python>>正文


Python BusDriver.__init__方法代碼示例

本文整理匯總了Python中cocotb.drivers.BusDriver.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python BusDriver.__init__方法的具體用法?Python BusDriver.__init__怎麽用?Python BusDriver.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cocotb.drivers.BusDriver的用法示例。


在下文中一共展示了BusDriver.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:28,代碼來源:avalon.py

示例2: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
 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,代碼行數:9,代碼來源:test_drv.py

示例3: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:9,代碼來源:avalon.py

示例4: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
 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,代碼行數:9,代碼來源:ppfifo_bus.py

示例5: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:37,代碼來源:avalon.py

示例6: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:62,代碼來源:avalon.py

示例7: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:32,代碼來源:axi_master_if.py

示例8: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
 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,代碼行數:11,代碼來源:ft245_bus.py

示例9: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:14,代碼來源:python_ztex.py

示例10: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
 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,代碼行數:14,代碼來源:wishbone.py

示例11: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:15,代碼來源:SiLibUsbBusDriver.py

示例12: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:16,代碼來源:amba.py

示例13: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
 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,代碼行數:16,代碼來源:video_gen.py

示例14: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:16,代碼來源:amba.py

示例15: __init__

# 需要導入模塊: from cocotb.drivers import BusDriver [as 別名]
# 或者: from cocotb.drivers.BusDriver import __init__ [as 別名]
    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,代碼行數:16,代碼來源:sata_driver.py


注:本文中的cocotb.drivers.BusDriver.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。