示例#1
0
文件: comm_usb.py 项目: zoobab/litex
 def __init__(self, vid=None, pid=None, max_retries=10, csr_csv=None, debug=False):
     CSRBuilder.__init__(self, comm=self, csr_csv=csr_csv)
     self.vid         = vid
     self.pid         = pid
     self.debug       = debug
     self.max_retries = max_retries
     self.max_recursion_count = 5
示例#2
0
    def __init__(self, bar, csr_csr=None, debug=False):
        CSRBuilder.__init__(self, comm=self, csr_csv=csr_csv)
        if "/sys/bus/pci/devices" not in bar:
            bar = f"/sys/bus/pci/devices/0000:{bar}/resource0"
        self.bar   = bar
        self.debug = debug

        self.enable()
示例#3
0
文件: comm_udp.py 项目: zoobab/litex
 def __init__(self,
              server="192.168.1.50",
              port=1234,
              csr_csv=None,
              debug=False):
     CSRBuilder.__init__(self, comm=self, csr_csv=csr_csv)
     self.server = server
     self.port = port
     self.debug = debug
 def __init__(self,
              host="localhost",
              port=1234,
              csr_csv="csr.csv",
              csr_data_width=None,
              debug=False):
     if csr_csv is not None:
         CSRBuilder.__init__(self, self, csr_csv, csr_data_width)
     else:
         assert csr_data_width is not None
     self.host = host
     self.port = port
     self.debug = debug
示例#5
0
 def __init__(self, host="localhost", port=1234, base_address=0, csr_csv=None, csr_data_width=None, debug=False):
     # If csr_csv set to None and local csr.csv file exists, use it.
     if csr_csv is None and os.path.exists("csr.csv"):
         csr_csv = "csr.csv"
     # If valid csr_csv file found, build the CSRs.
     if csr_csv is not None:
         CSRBuilder.__init__(self, self, csr_csv, csr_data_width)
     # Else if csr_data_width set to None, force to csr_data_width 32-bit.
     elif csr_data_width is None:
         csr_data_width = 32
     self.host         = host
     self.port         = port
     self.debug        = debug
     self.base_address = base_address if base_address is not None else 0
示例#6
0
文件: comm_uart.py 项目: zoobab/litex
 def __init__(self, port, baudrate=115200, csr_csv=None, debug=False):
     CSRBuilder.__init__(self, comm=self, csr_csv=csr_csv)
     self.port     = serial.serial_for_url(port, baudrate)
     self.baudrate = str(baudrate)
     self.debug    = debug