Skip to content

Document SpinalHDL facilities used across the org (NaxRiscv, VexiiRiscv, VexRiscv)#294

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/document-missing-functions
Draft

Document SpinalHDL facilities used across the org (NaxRiscv, VexiiRiscv, VexRiscv)#294
Copilot wants to merge 6 commits intomasterfrom
copilot/document-missing-functions

Conversation

Copy link

Copilot AI commented Feb 28, 2026

Documents SpinalHDL library facilities that are confirmed to be in active use in SpinalHDL organization repositories outside of SpinalHDL/SpinalHDL itself.

stream.rst — Functions table updated

  • pipelined (Stream method) — Added as a row in the existing stream.rst Functions table. Documents stream.pipelined(...), which returns a registered version of the stream to cut combinatorial paths for timing closure. Covers both call styles: pipelined(StreamPipe.FULL) using named StreamPipe constants (NONE, M2S, S2M, FULL, HALF), and pipelined(m2s, s2m, halfRate) using boolean flags. Used in NaxRiscv (NaxSoc.scala, SocDemo.scala) and VexiiRiscv (MicroSoc.scala, SocSim.scala) for timing closure in large designs.

bus_slave_factory.rst — 1 missing method added

  • setOnSet(that, address, bitOffset) — Set bits of that when the corresponding write bit is 1; used in VexRiscv (doc/gcdPeripheral/.../Apb3GCDCtrl.scala)
Original prompt

This section details on the original issue you should resolve

<issue_title>Undocumented function check</issue_title>
<issue_description>It seems there are some Classes, methods or functions provided by SpinalHDL/SpinalHDL are widely used in project under SpinalHDL orgnization, but these facilities are not documented in this project. Please help me check which parts are missing, and write the documents if possible.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ndle, and missing BusSlaveFactory methods

Co-authored-by: Readon <3614708+Readon@users.noreply.github.com>
Copilot AI changed the title [WIP] Document undocumented functions in SpinalHDL Document widely-used but undocumented SpinalHDL facilities Feb 28, 2026
@Readon
Copy link
Collaborator

Readon commented Feb 28, 2026

please tell us here, where did the added facilities is used? in which repos? and where? @copilot

Copy link
Author

Copilot AI commented Feb 28, 2026

please tell us here, where did the added facilities is used? in which repos? and where? @copilot

Here is the breakdown of where each documented facility is used:

StreamPipe — Used across multiple major repos in the org:

setOnSet — Found in the official VexRiscv peripheral tutorial example:

StreamAccessibleFifo, StreamShiftChain, clearOnSet/readAndClearOnSet/readAndSetOnSet, createReadMultiWord/createWriteMultiWord/createWriteAndReadMultiWord, readSyncMemWordAligned/readSyncMemMultiWord/writeMemWordAligned/writeMemMultiWord, PackedBundle/PackedWordBundle — These are defined and tested within SpinalHDL/SpinalHDL itself (in BusSlaveFactory.scala, Stream.scala, PackedBundle.scala, and their corresponding test files). They are public library APIs part of spinal.lib and spinal.lib.bus.misc that any SpinalHDL user can call, which is why they warrant documentation even before they appear widely in org downstream repos.

If you'd like some of these sections to be removed or deferred, happy to do that.

@Readon
Copy link
Collaborator

Readon commented Feb 28, 2026

@copilot Ok, we just need to document the facilities used in SpinalHDL organization exclude SpinalHDL/SpinalHDL repository.

…e StreamAccessibleFifo, StreamShiftChain, PackedBundle page, and undocumented BusSlaveFactory methods

Co-authored-by: Readon <3614708+Readon@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 28, 2026

@copilot Ok, we just need to document the facilities used in SpinalHDL organization exclude SpinalHDL/SpinalHDL repository.

Done in commit 70ddfb2. The PR now only documents facilities confirmed to be used in SpinalHDL org repos outside SpinalHDL/SpinalHDL:

Removed: StreamAccessibleFifo, StreamShiftChain, PackedBundle/PackedWordBundle page, and all other BusSlaveFactory methods (only used within SpinalHDL/SpinalHDL itself).

Copilot AI changed the title Document widely-used but undocumented SpinalHDL facilities Document SpinalHDL facilities used across the org (NaxRiscv, VexiiRiscv, VexRiscv) Feb 28, 2026
outputCount = 3
)

StreamPipe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this seems more a function called pipeline than a class. is StreamPipe just a enum?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. StreamPipe is a Scala trait — not an enum and not a class. Its companion object StreamPipe provides named singleton instances (NONE, M2S, S2M, FULL, HALF) that are each callable (they implement apply). The primary usage is passing them to stream.pipelined().

Updated in ceceab1 to correctly describe it as a trait with named callable singleton instances, and updated the table column header from "Value" to "Instance".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, how about document on pipelined method of Stream but StreamPipe? @copilot

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Restructured in 626fd52 — the section is now titled pipelined (the Stream method users actually call) with StreamPipe explained as the argument type. The section now shows both call styles: pipelined(StreamPipe.FULL) and pipelined(m2s = true, s2m = true), with a table mapping each boolean combination to its StreamPipe equivalent.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about merge pipelined into stream.rst#functions part? @copilot

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 96e48e7. The pipelined content is now part of the Functions table in stream.rst — both call styles (pipelined(pipe: StreamPipe) and pipelined(m2s, s2m, halfRate)) are listed as a single row alongside the other Stream methods. The standalone Utils section has been removed.

…es, not an enum or class

Co-authored-by: Readon <3614708+Readon@users.noreply.github.com>
…ll styles

Co-authored-by: Readon <3614708+Readon@users.noreply.github.com>
…tion

Co-authored-by: Readon <3614708+Readon@users.noreply.github.com>
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.

Undocumented function check

2 participants