From be4ed8afcffc6d0427e168370b1480334f6ad54c Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Thu, 13 Apr 2023 12:20:19 -0400 Subject: [PATCH] soc.py: fix compile errors --- firmware/soc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/soc.py b/firmware/soc.py index 1390f06..b6e52c5 100644 --- a/firmware/soc.py +++ b/firmware/soc.py @@ -64,7 +64,7 @@ class Base(Module, AutoCSR): `o_` prefix in the keyword arguments. """ - if header_name not in self.csrset: + if name not in self.csrdict.keys(): self.csrdict[name] = csrlen if num is not None: name = f"{name}_{num}" @@ -128,12 +128,12 @@ class Base(Module, AutoCSR): self.kwargs["i_adc_sdo"] = platform.request("adc_sdo") self.kwargs["o_adc_sck"] = platform.request("adc_sck") - with f as open("io_widths.h", mode='w'): + with open("io_widths.h", mode='w') as f: print('#pragma once', file=f) for key in self.csrdict: print(f'#define {key.upper()}_LEN {self.csrdict[key]}', file=f) - self.specials += Instance("base", **kwargs) + self.specials += Instance("base", **self.kwargs) # Clock and Reset Generator # I don't know how this works, I only know that it does.