From 70f1f96fda423a9890fc35c7b768fdb1715484cd Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 17 Mar 2015 16:04:07 +0100 Subject: [PATCH] litescope/drivers: do not build regs when addrmap is None --- misoclib/tools/litescope/host/driver/etherbone.py | 3 ++- misoclib/tools/litescope/host/driver/uart.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/misoclib/tools/litescope/host/driver/etherbone.py b/misoclib/tools/litescope/host/driver/etherbone.py index 0f3efd158..44959887f 100644 --- a/misoclib/tools/litescope/host/driver/etherbone.py +++ b/misoclib/tools/litescope/host/driver/etherbone.py @@ -11,7 +11,8 @@ class LiteScopeEtherboneDriver: self.tx_sock = None self.rx_sock = None - self.regs = build_map(addrmap, busword, self.read, self.write) + if addrmap is not None: + self.regs = build_map(addrmap, busword, self.read, self.write) def open(self): self.tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) diff --git a/misoclib/tools/litescope/host/driver/uart.py b/misoclib/tools/litescope/host/driver/uart.py index 4771c989b..da3cd3635 100644 --- a/misoclib/tools/litescope/host/driver/uart.py +++ b/misoclib/tools/litescope/host/driver/uart.py @@ -15,7 +15,8 @@ class LiteScopeUARTDriver: self.baudrate = str(baudrate) self.debug = debug self.uart = serial.Serial(port, baudrate, timeout=0.25) - self.regs = build_map(addrmap, busword, self.read, self.write) + if addrmap is not None: + self.regs = build_map(addrmap, busword, self.read, self.write) def open(self): self.uart.flushOutput()