Skip to content

Commit 0705fb0

Browse files
committed
feat(cocotbext): enable dtb without "resource" property in grpc.NfbServicer
1 parent 9ecd4f4 commit 0705fb0

File tree

1 file changed

+6
-2
lines changed
  • python/cocotbext/cocotbext/nfb/ext/grpc

1 file changed

+6
-2
lines changed

python/cocotbext/cocotbext/nfb/ext/grpc/nfb.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ def _comp_addr(self, path):
7171
while p:
7272
compatible = p.get_property("compatible")
7373
if compatible and compatible.value == "netcope,bus,mi":
74-
m = re.search(r'PCI(?P<pci>\d+),BAR(?P<bar>\d+)', p.get_property("resource").value)
75-
pci, _ = int(m.group('pci')), int(m.group('bar'))
74+
resource = p.get_property("resource")
75+
if resource is not None:
76+
m = re.search(r'PCI(?P<pci>\d+),BAR(?P<bar>\d+)', resource.value)
77+
pci, _ = int(m.group('pci')), int(m.group('bar'))
78+
else:
79+
pci, _ = 0, 0
7680
mi = self._dev.mi[pci]
7781
break
7882
p = p.parent

0 commit comments

Comments
 (0)