| Age | Commit message (Collapse) | Author |
|
* Add opt-in AutoCloneType for Records (#2781)
There is a new trait, chisel3.experimental.AutoCloneType that is mixed
in to Bundle and can optionally be mixed in to user-defined Records. The
compiler plugin prints a deprecation warning on any user-defined
implementation of cloneType, telling the user to mix in AutoCloneType
before upgrading to 3.6.
(cherry picked from commit a234fd48ac8f5942c38fef5797292014e407b586)
# Conflicts:
# core/src/main/scala/chisel3/Aggregate.scala
# plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala
* Resolve backport conflicts
* Do not make MixedVec extend AutoCloneType
It is a binary incompatible change that can wait for 3.6.
* Waive MiMa false positives
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(#2617)
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: Megan Wachs <megan@sifive.com>
(cherry picked from commit 3ab34cddd8b87c22d5fc31020f10ddb2f1990d51)
Co-authored-by: Jared Barocsi <82000041+jared-barocsi@users.noreply.github.com>
|
|
Previously, the plugin would crash with a useless internal error.
(cherry picked from commit 9fcfb252beb9f06d8d1409fe7db9c8b3b6b962ce)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Define leading '_' as API for creating temporaries
Chisel and FIRRTL have long used signals with names beginning with an
underscore as an API to specify that the name does not really matter.
Tools like Verilator follow a similar convention and exclude signals
with underscore names from waveform dumps by default. With the
introduction of compiler-plugin prefixing in Chisel 3.4, the convention
remained but was hard for users to use unless the unnnamed signal
existed outside of any prefix domain. Notably, unnamed signals are most
useful when creating wires inside of utility methods which almost always
results in the signal ending up with a prefix.
With this commit, Chisel explicitly recognizes signals whos val names
start with an underscore and preserve that underscore regardless of any
prefixing. Chisel will also ignore such underscores when generating
prefixes based on the temporary signal, preventing accidental double
underscores in the names of signals that are prefixed by the temporary.
(cherry picked from commit bd94366290886f3489d58f88b9768c7c11fa2cb6)
* Remove unused defaultPrefix argument from _computeName
(cherry picked from commit ec178aa20a830df2c8c756b9e569709a59073554)
# Conflicts:
# core/src/main/scala/chisel3/Module.scala
# core/src/main/scala/chisel3/experimental/hierarchy/ModuleClone.scala
* Resolve backport conflicts
* Waive false positive binary compatibility errors
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
Previously, verification statements (assert, assume, cover, and printf)
were only named via reflection.
(cherry picked from commit 7fa2691f670813eef4ec59fc27c4e4f625d598de)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
For traits or abstract classes that extend Bundle but have no concrete
methods, the plugin will print a benign warning that the user cannot
fix. It will no longer print that warning.
(cherry picked from commit ed4a98188ee1fe43efbd3a1ba43a657a128764d6)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Change type of Bundle._elementsImpl to Iterable
It was previously SeqMap (ListMap on Scala 2.12). This change gives us
more freedom to optimize the implementation without breaking binary
compatibility. It is scala.collection.Iterable because it is perfectly
fine to return mutable collections (like Arrays) since the only use is
to Iterate on them.
* Disallow users implementing Bundle._elementsImpl
Currently, it would result in a runtime linkage error. This turns it
into a compile-time error.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 1b05a14ad6d5784f3b91ab510dc1095423c23ea8)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
Adds generation of `Bundle.elements` method to the chores done by the compiler plugin
For each `Bundle` find the relevant visible Chisel field members and construct a
hard-coded list of the elements and their names implemented as `_elementsImpl`
For more details: See plugins/README.md
- Should be no change in API
- Handles inheritance and mixins
- Handles Seq[Data]
- Tests in BundleElementSpec
Co-authored-by: chick <chick.markley@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit 237200a420581519f29149cbae9b3e968c0d01fc)
Co-authored-by: Chick Markley <chick@qrhino.com>
|
|
Command:
sbt scalafmtAll
|
|
This enables skipping files in the compiler plugin, only needed for
unidoc generation.
|
|
It is always true. The scalacOption to enable it is still supported and
prints a warning that the option no longer does anything.
|
|
* Remove all manual cloneTypes and make it chisel runtime deprecated to add one
* runtime deprecate cloneType with runtime reflection
* [Backport this commit] Bundle: add check that override def cloneType still works (will be made an error later)
* Plugin: make it an error to override cloneType and add a test for that
* Docs: can't compile the cloneType anymore
* BundleSpec: comment out failing test I cannot get to fail or ignore
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
|
|
This introduces a new experimental API for module instantiation that disentagles
elaborating the definition (or implementation) from instantiation of
a given module. This solves Chisel's longstanding reliance on
"Deduplication" for generating Verilog with multiple instances of the
same module.
The new API resides in package chisel3.experimental.hierarchy. Please
see the hierarchy ScalaDoc, documentation, and tests for examples of
use.
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
|
|
|
|
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
* Refine autonaming to have more intuitive behavior
Last name in an Expression wins, while the first Statement to name wins.
This is done via checking the _id of HasIds during autonaming and only
applying a name if the HasId was created in the scope of autonaming.
There is no change to .autoSeed or .suggestName behavior.
Behavior of chisel3-plugins from before this change is maintained.
* Update docs with naming plugin changes
|
|
* Use Data refs for name prefixing with aggregate elements
Vecs set the refs of their elements upon construction of those elements.
In the past, Records haven't set their elements refs until module close,
but it can be done sooner. Doing it upon binding means that refs will at
least be available for Records used in hardware elements. Since only
bound Data can be connected to anyway, Aggregate elements being
connected to will always have a ref which we can then use for creating
naming prefixes.
* Add tighter correctness checks
* Handle more cases in connection prefixing
Add support for forcing setRef to override a previous setting. This
is only used by BlackBox ports which need to drop their io prefix.
Also add a Try() around Data.bindingToString which sometimes throws
exceptions when being used to .toString a Data in an error message.
* Strip trailing spaces in names in compiler plugin
|
|
Use caching to reduce number of expensive lookups
|
|
* Added documentation. Bugfix in plugin. Moved plugin APIs to separate package
* Revert reg naming behavior (omit underscore)
* Added documentation and a test
* Addressed reviewer feedback.
|
|
It must run after the typer, but doesn't need to "run right after". The
stricter dependency conflicted with the semanticdb-typer.
|
|
Added prefixing and a compiler plugin to improve naming. Only works for Scala 2.12 and above.
Co-authored-by: Jack Koenig <koenig@sifive.com>
|