Closed gregdavill closed 3 years ago
@kgugala - Who added this code and thus should look at this issue?
I did try to dig into the issue. But all I can see is that LiteSPISDRPHYCore
does inherit from ModuleDoc
which inherits from DUID
. So I'm not really sure why it's not getting a duid.
I don't really understand python inner workings enough to dig further.
If you add this it works:
diff --git a/litespi/phy/generic_sdr.py b/litespi/phy/generic_sdr.py
index a28d26f..ca714e8 100644
--- a/litespi/phy/generic_sdr.py
+++ b/litespi/phy/generic_sdr.py
@@ -60,6 +60,7 @@ class LiteSPISDRPHYCore(Module, AutoCSR, AutoDoc, ModuleDoc):
Register which holds a clock divisor value applied to clkgen.
"""
def __init__(self, pads, flash, device, clock_domain, default_divisor, cs_delay):
+ ModuleDoc.__init__(self)
self.source = source = stream.Endpoint(spi_phy2core_layout)
self.sink = sink = stream.Endpoint(spi_core2phy_layout)
self.cs = Signal()
But that's against the docs for ModuleDoc
which state
If you inherit from :obj:`ModuleDoc`, then there is no need to call ``__init__()``
It also seems like we're picking up some warnings, there is quite a few of these.
docs/spiflash_phy.rst:11: WARNING: duplicate label parameters, other instance in docs/spiflash_core.rst
docs/spiflash_phy.rst:34: WARNING: duplicate label attributes, other instance in docs/spiflash_core.rst
docs/spiflash_phy.rst:46: WARNING: duplicate label litespi phy instantiator, other instance in docs/spiflash_phy.rst
Probably LiteSPISDRPHYCore
should be somehow excluded from the parent one, otherwise litex generates docs both for the parent one and (twice) for the inner one. This would also solve the problem with this module.
Another question is why this hack is required (actually setting self.duid
is enough). Probably it's a bug in an unrelated part of litex, because other modules with a similar structure don't reveal any problems.
The issue is similar to https://github.com/enjoy-digital/litex/pull/668#issuecomment-752393559 and is fixed with https://github.com/litex-hub/litespi/commit/40ddf2c76cb0d24973b668e4deac7baf0847ead2.
BTW it's possible to test Doc generation with by adding --doc
to the build command:
python3 -m litex_boards.targets.1bitsquared_icebreaker --doc
Ahh great! Thanks!
Yes that's working much better now! The generated LiteSPI documentation isn't getting all the module docstrings, which is was before.
I'm updating some older icebreaker litex examples to use more upstream LiteX features. One of which is LiteSPI The SoC works, as expected, but it appears I'm no longer able to generate documentation...
I've been able to replicate this in the
litex_boards.1bitsquared_icebreaker
target.Then running creates the following error.