Repository navigation
interconnect/stream: Switch Converter to LiteXModule - #2757
rohanmathew05 wants to merge 1 commit into
Conversation
|
Thanks @rohanmathew05, this looks good. I'll just wait a bit before merging to see if we should make the error more explicit and avoid this silent potential issue in the future. |
|
Thanks @rohanmathew05 for the analysis and the fix. Closing this one in favor of #2763, which fixes the root cause in the gatherers instead of working around it here: AutoCSR/AutoDoc/CSRBankArray now skip class references (so the |
|
Yes, I agree. Fixing it in the gatherers makes more sense. I'll keep that in mind for the future. Thanks! |
Resolves the FIXME: now that the gatherers skip class references, the self.cls attribute no longer needs an autocsr/autodoc exclude. Add a test gathering CSRs/Docs of a parent holding a Converter (scenario from enjoy-digital#2757). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Resolves the
# FIXME: Switch to LiteXModule.onstream.Converter.Problem with a one-word switch
Changing only
Module->LiteXModulemakesConverterinheritAutoCSR/AutoDoc.Converter.clsstores the converter class itself (e.g._DownConverter), not aninstance. When a parent module collects its CSRs (e.g.
VideoFrameBuffer, which holdsself.conv = stream.Converter(...)), the gatherer findsget_csrson that class andcalls it without an instance:
So any SoC with a video framebuffer would fail to build.
Fix
Exclude
clsfrom collection withautocsr_exclude = {"cls"}andautodoc_exclude = {"cls"}(AutoCSR and AutoDoc each have their own exclude set).Tests
New
test_converter_in_autocsr_parent(a parent module with a CSR and a Converter):Module->LiteXModuleonly: fails with the TypeError abovetest_stream,test_stream_pipeline,test_byte_enable,test_video,test_video_terminal: OK.Elaborated with
--no-compileand compared the generated Verilog with master:Logic identical; only the hierarchy-tree comment order differs, which also
varies between two runs of master.
Elaboration only, no hardware.
Written with help from Claude Code (AI agent), reviewed and supervised by me.