From 321f50d4d69e4fccf990d6a68e5d7b21d3bd5d49 Mon Sep 17 00:00:00 2001 From: Stephane Gourichon Date: Tue, 6 Oct 2020 14:24:23 +0200 Subject: [PATCH] Change misleading comment. Not calling `ModuleDoc.__init__(self)` causes `duid` to be unset and exceptions like this: Traceback (most recent call last): File "mydesign.py", line 299, in main() File "mydesign.py", line 292, in main generate_docs(soc, "build/"+target+"/documentation") File ".../litex/litex/litex/soc/doc/__init__.py", line 98, in generate_docs documented_region = DocumentedCSRRegion( File ".../litex/litex/litex/soc/doc/csr.py", line 80, in __init__ docs = module.get_module_documentation() File ".../litex/litex/litex/soc/integration/doc.py", line 141, in gatherer return sorted(r, key=lambda x: x.duid) File ".../litex/litex/litex/soc/integration/doc.py", line 141, in return sorted(r, key=lambda x: x.duid) File ".../litex/migen/migen/fhdl/module.py", line 136, in __getattr__ raise AttributeError("'"+self.__class__.__name__+"' object has no attribute '"+name+"'") AttributeError: 'CDCUsbPHY' object has no attribute 'duid' --- litex/soc/integration/doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/integration/doc.py b/litex/soc/integration/doc.py index 10e58e0cca..d9662aada5 100644 --- a/litex/soc/integration/doc.py +++ b/litex/soc/integration/doc.py @@ -24,7 +24,7 @@ class ModuleDoc(DUID): first section of your class' module documentation 2. Add a :obj:`ModuleDoc` object to your class and inherit from :obj:`AutoDoc`. - If you inherit from :obj:`ModuleDoc`, then there is no need to call ``__init__()`` + If you inherit from :obj:`ModuleDoc`, you still need to call ``ModuleDoc.__init__(self)``. Synopsis --------