Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change misleading comment about ModuleDoc. #668

Conversation

fidergo-stephane-gourichon
Copy link
Contributor

Not calling ModuleDoc.__init__(self) causes duid to be unset and exceptions like this (see gregdavill/valentyusb#1 ).

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'

Acknowledgement

Thanks for zyp on #litex for hints. As zyp wrote: "unless there is a better way to solve it".

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 <module>
    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 <lambda>
    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'
@mithro
Copy link
Collaborator

mithro commented Oct 6, 2020

@xobs could you take a look at this?

@enjoy-digital
Copy link
Owner

It seems the issue was in ValentyUSB that was inheriting from both AutoDoc and ModuleDoc. With litex-hub/valentyusb@f1b485c we are now able to build the documentation correctly: ./orangecrab.py --uart-name=usb_acm --doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants