| Age | Commit message (Collapse) | Author |
|
* Promote ChiselEnum user APIs from experimental (#2929)
They are commonly used and if we were ever to change them, we will need
to go through a deprecation process anyway.
Note that the EnumAnnotations remain in chisel3.experimental because,
like all Chisel annotation support, they are slated to be deprecated and
removed.
(cherry picked from commit 424e9446f1675fe0168e22bdfbbe85db997376e6)
# Conflicts:
# docs/src/cookbooks/verilog-vs-chisel.md
# docs/src/explanations/chisel-enum.md
* Maintain binary compatbility, use aliases in chisel3 package
* Deprecate the actual classes in chisel3.experimental
* Also fix backport conflicts
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
#2907) (#2928)
* Check for Vec subaccess in NamedComponent and throw a nicer error. (#2907)
This would previously end up throwing an exception later, when trying
to create a component name and realizing that it was invalid. Instead,
this detects Vec subaccesses early, and gives a more precise error and
suggestion.
(cherry picked from commit d8c30961c7b293ee19024a487698630367ee71c6)
# Conflicts:
# core/src/main/scala/chisel3/internal/Builder.scala
* Resolve backport conflicts
Co-authored-by: Mike Urbach <mikeurbach@gmail.com>
|
|
ChiselEnums check if they should create annotations every time an
instance of them is bound. Because so many annotations would be created,
they check to see if an equivalent annotation has already been added to
the annotations. Previously, this used a linear search of the
annotations, now it uses a HashSet.
(cherry picked from commit 96bde092e449281dc70ebdb05f21695468c3e5fa)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Implement compressed Namespace (#2856)
The namespace disambiguates requests for the same name with _<idx>.
Rather than storing every disambiguated name in the underlying HashMap,
it now only stores the base along with the "next available" index. This
makes the logic for checking if a name is already contained in the
namespace slightly more sophisticated because users can name things in a
way that will collide with disambiguated names from a common substring.
For example, in naming the sequence "foo", "foo", "foo_1", the 2nd "foo"
takes the name "foo_1" so the following "foo_1" gets disambiguated to
"foo_1_1". But since we compressed that original "foo_1" into the same
HashMap entry as just "foo", we have to do a form of "prefix checking"
whenever naming something that ends in "_<idx>".
In practice, the saved memory allocations more than make up for the more
complicated logic to disambiguate names because the common case is still
fast.
(cherry picked from commit 1654d87a02ca799bf12805a611a91e7524d49843)
# Conflicts:
# core/src/main/scala/chisel3/internal/Builder.scala
* Resolve backport conflicts
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Change RawModule._commands to a VectorBuilder (#2839)
* Change RawModule._commands to a VectorBuilder
Use the resulting Vector to build the underlying Component's commands
and then use those instead of copying the original ArrayBuffer when
iterating on commands. Previously, the Component was using a List to
hold the commands which is particularly memory inefficient, especially
for large modules.
* Optimize Converter's handling of Seq[Command]
It previously converted the Commands to a List (which, while not
captured in the type system, they were already a List) and then used
head and tail iteration. This is less efficient with the new underlying
Vector implementation.
(cherry picked from commit 48a1ef0a3872c6b68d46145764d977926923a270)
* Waive false binary compatibility failures
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
|
|
* Switch to using experimental trait for OpaqueTypes (#2783)
This makes it more clear that the feature is experimental. Users may
still override the opaqueType method for more dynamic control over when
instances of a given Record are OpaqueTypes or not, but they are
discouraged from doing so.
(cherry picked from commit 7525dc71ccc2050d8e4a68b38f3b76920ba693fc)
* Fix cloneType in RecordSpec
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Bugfix converter clearing flips (#2788)
* Bugfix: Output on Vec of bundle with mixed field orientations
* Bugfix OpaqueTypes clearing flips
(cherry picked from commit f05bff1a337589bafebd08783bb0f6a72092a95a)
# Conflicts:
# src/test/scala/chiselTests/Direction.scala
* Resolve backport conflicts
Co-authored-by: Adam Izraelevitz <adam.izraelevitz@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
|
|
MonoConnect.traceFlow now properly handles coerced directions.
Also minor improvement to getClassName especially useful in test case printf debugging.
(cherry picked from commit 3aba755bdcf996c0fbd846d13268fd6641b29e96)
Co-authored-by: Megan Wachs <megan@sifive.com>
|
|
(backport #2789) (#2790)
* Only set the chisel3 Builder prefix during the first invocation of suggestName
(cherry picked from commit b684506abab2f7b99d56181d548cb8119d317323)
# Conflicts:
# core/src/main/scala/chisel3/internal/Builder.scala
* Add simple test to show bug fix
(cherry picked from commit 255068b105de77a045a0016e3a157b52a81c86d6)
* Fix merge conflict
* Fix test to not use Hardware inside a bundle for prefixing
Co-authored-by: Jared Barocsi <jared.barocsi@sifive.com>
|
|
We need to ensure that contextual names stay contextual (ie. sensitive
to the module context which is important for naming ports).
(cherry picked from commit cee255216c4a1bb658a2d8ddc03d966ce7ffb877)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Bugfix - OpaqueSlot replace invalid localName (#2701)
(cherry picked from commit fb8ea2a2fac227f2570da992d7877de2eb1cf801)
* Fix cloneTypes (#2703)
Co-authored-by: Aditya Naik <91489422+adkian-sifive@users.noreply.github.com>
|
|
|
|
* Add OpaqueType support to Records (#2662)
OpaqueTypes are essentially type aliases that hide the underlying type.
They are implemented in Chisel as Records of a single, unnamed element
where the wrapping Record does not exist in the emitted FIRRTL.
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit df5afee2d41b5bcd82d4013b977965c0dfe046fd)
* Fix test compilation
* Fix OpaqueType tests in RecordSpec
Need to implement cloneType correctly and to warn instead of error when
accessing .toTarget of non-hardware types because that is a warning (not
error) in 3.5.
* Waive MiMa false positives
Co-authored-by: Aditya Naik <91489422+adkian-sifive@users.noreply.github.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* Add option to treat warnings as errors (#2676)
Add --warnings-as-errors option
(cherry picked from commit 498946663726955c380a1e420f5d7b9630000aad)
# Conflicts:
# core/src/main/scala/chisel3/experimental/hierarchy/Definition.scala
# core/src/main/scala/chisel3/internal/Builder.scala
# src/main/scala/chisel3/aop/injecting/InjectingAspect.scala
# src/main/scala/chisel3/stage/ChiselOptions.scala
# src/main/scala/chisel3/stage/package.scala
# src/main/scala/chisel3/stage/phases/Elaborate.scala
* Resolve backport conflicts
Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(cherry picked from commit ae76ff4cb303a6646e48dc044be47051b67e7cbb)
Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
|
|
(cherry picked from commit 1ad820f7f549eddcd7188b737f59a240e48a7f0a)
Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
|
|
* Replace some options with nullable vars (#2658)
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit ac460bfeb16c8e7d0dc00975bb03f73c0fea2103)
# Conflicts:
# core/src/main/scala/chisel3/internal/Builder.scala
* Fix backport conflicts (#2661)
Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
|
|
(cherry picked from commit 4b10cf7a276e90b280c1fd57070566acac3d80d3)
Co-authored-by: Girish Pai <girish.pai@sifive.com>
|
|
(cherry picked from commit 11e8cc60d6268301cff352b8a1d7c4d672b5be11)
Co-authored-by: Megan Wachs <megan@sifive.com>
|
|
Used for separate elaboration of Definition and Instance
(cherry picked from commit 48d57cc8db6f38fdf0e23b7dce36caa404c871b8)
Co-authored-by: Girish Pai <girish.pai@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>
|
|
* Factor buildName into reusable function
The new function is chisel3.internal.buildName.
(cherry picked from commit 370ca8ac68f6d888dd99e1b9e63f0371add398cf)
* Add --warn:reflective-naming
This new argument (and associated annotation) will turn on a warning
whenever reflective naming changes the name of a signal. This is
provided to help migrate from Chisel 3.5 to 3.6 since reflective naming
is removed in Chisel 3.6.
(cherry picked from commit 97afd9b9a1155fa7cd5cedf19f9e0c15fbe899ec)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
This includes (and is tested) for both the old .*Name APIs and
.toTarget
(cherry picked from commit 6e0d8d6b12e9d8f94c2cc43b92b2366ec70dfd50)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(cherry picked from commit 77a6c93592d5766d66f199720fc6d69478005091)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(backport #2512) (#2520)
* Support separately elaborating definition and instance in ChiselStage (#2512)
(cherry picked from commit a0aa4d1550e3fbde199a98529cffeb176fb4bed8)
# Conflicts:
# core/src/main/scala/chisel3/experimental/hierarchy/Definition.scala
# core/src/main/scala/chisel3/experimental/hierarchy/Instance.scala
# core/src/main/scala/chisel3/internal/Builder.scala
* fixing imports (#2522)
Co-authored-by: Deborah Soung <debs@sifive.com>
|
|
* Use a single field instead of two in HasId (4-bytes per HasId)
* Set the prefix to Nil after setting ref to free up memory
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 3aa179f0dc1a29403fd25be7d3dc08630976d018)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(backport #2476) (#2479)
* Capture 1:1 mappings of Aggregates inside of views
This is implemented by including any corresponding Aggregates from the
DataView.mapping in the AggregateViewBinding.childMap (which is now of
type Map[Data, Data]).
This enables dynamically indexing Vecs that are themselves elements of
larger Aggregates in views when the corresponding element of the view is
a Vec of the same type. It also increases the number of cases where a
single Target can represent part of a view.
(cherry picked from commit 1f6b1ca14ccf86918065073c3f6f3626dd83a68e)
* Add FlatIO API for creating ports from Bundles without a prefix
(cherry picked from commit 772a3a1fe3b9372b7c2d7cd2d424b2adcd633cdb)
* [docs] Add FlatIO to the general cookbook
(cherry picked from commit b4159641350f238f0f899b69954142ce8ee11544)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
* During sanitize, only filter the String if needed
* Do not recurse on name, saving an unnecessary call to sanitize
(cherry picked from commit 559b3df3e5bd6c73588638aa44a6df1244a11a53)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(cherry picked from commit 3940136bec72fc44e40d454f2c2dcc421fc92d82)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(cherry picked from commit 4da1e89f3a0b79adcb39ea5defb393ed6c00fa2f)
Co-authored-by: fzi-hielscher <47524191+fzi-hielscher@users.noreply.github.com>
|
|
This reduces memory use of every HasId by 64 bytes.
Every instance of HasId (including all Data) had 2 ListBuffer vals for
recording post-naming hooks, yet this feature is almost never used.
These are now vars of type List which allows the common case of Nil to
add no incremental memory use per instance of HasId.
(cherry picked from commit cf410180ac8de854d8d7ecf89f4813ac8541dcdb)
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
Chisel <> semantics differ somewhat from FIRRTL <= semantics,
so we only emit <= when it would be legal. Otherwise we continue
the old behavior of emitting a connection for every leaf-level
Element.
Co-authored-by: Deborah Soung <debs@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit 3553a1583403824718923a6cc530cec3b38f5704)
Co-authored-by: Jared Barocsi <82000041+jared-barocsi@users.noreply.github.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
(cherry picked from commit 2a985ac376698a2e6300fbee13001d82d3e13989)
Co-authored-by: Deborah Soung <debs@sifive.com>
|
|
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 015755749caa8a05f3809d446b023df80c7419d1)
Co-authored-by: Tynan McAuley <tynan@galois.com>
|
|
* Improve error reporting (#2376)
* Do not trim stack traces of exceptions with no stack trace
This prevents us from accidentally giving stack traces to exceptions
that don't have them and giving misleading messages telling users to use
--full-stacktrace when it won't actually do anything.
Also deprecate ChiselException.chiselStackTrace which is no longer being
used anywhere in this codebase.
* Add exception class for multiple-errors reported
New chisel3.internal.Errors replaces old anonymous class that would show
up as chisel3.internal.ErrorLog$$anon$1 in error messages.
* Add new option --throw-on-first-error
This tells Chisel not to aggregate recoverable errors but instead to
throw an exception on the first one. This gives a stack trace for users
who need it for debugging.
(cherry picked from commit ff2e9c92247b3848659fa09fdd53ddde2120036a)
* Waive MiMa false positives
The waived change is to a package private constructor.
Co-authored-by: Jack Koenig <koenig@sifive.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
|
|
Command:
sbt scalafmtAll
|
|
This reverts commit 21e324727e99f0bc124aaddea7fe294b4111c23a.
Note that I am keeping the change making Arg sealed.
|
|
Also clean up deprecation warnings for replacement APIs and add
clarifying ScalaDoc.
|
|
|
|
Co-authored-by: Megan Wachs <megan@sifive.com>
|
|
Provides a more intuitive implementation of toString for Data.
Utilizes the fact that the compiler plugin provides names earlier than
Chisel had in the past so we can accurately guess the name of
signals even in the currently elaborating module.
Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
|
|
As the chisel3 compiler plugin is now required, we can delete unused
code for reflective autoclonetype as well as the noPluginTests.
|
|
* Bugfix - definition name index skipping with D/I
* Add tests to DefinitionSpec
* Add failing test
* Fix failing test
* Update core/src/main/scala/chisel3/internal/Builder.scala
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
* whitespace
* revert package private val
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
Exposing more internals of D/I, which are required for supporting D/I with more powerful Chisel libraries:
- Exposing IsClone[_]
- Exposing InstantiableClone[_]
- Gated builders for Instance/Definition
- Unsealing Lookupable, with protected accessors for proto and cloned
|
|
* Add Hierarchy trait
* Add Hierarchy trait
* Add Hierarchy scaladoc
* Add license
* Add isA and tests
* Add back isA
* Add new Select APIs for hierarchy package
* Update scaladoc
* Write outlines for tests
* Add tests and fixes to new Select functions
* Make calculate via lazy val
* Apply suggestions from code review
Co-authored-by: Megan Wachs <megan@sifive.com>
* Apply suggestions from code review
Co-authored-by: Megan Wachs <megan@sifive.com>
* Clean up scaladoc
* Add shouldNot compile
* Apply suggestions from code review
Co-authored-by: Megan Wachs <megan@sifive.com>
* Bugfix all funcs should analyze root too
* Add mdoc, bugfix toDefinition
* Make func private, add scaladoc
* Update src/test/scala/chiselTests/experimental/hierarchy/InstanceSpec.scala
Co-authored-by: Jack Koenig <koenig@sifive.com>
* Made protected vals private
* Apply suggestions from code review
Co-authored-by: Jack Koenig <koenig@sifive.com>
* Address code review comments
* Added additional null check
Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
|
|
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
|
|
The removal of virtual method io accidentally made the naming of io in
compatibility mode Bundles sensitive to the prefix at the time of the
first access of the field. It also made .suggestName able to override
the name. This commit fixes that issue by forcing the name of the io
Data to be "io" no matter what.
|
|
functions (#2124)
* Migrate nullary funcs to parameterless versions
* Make deprecation message and dummy arguments clear and consistent
Co-authored-by: Megan Wachs <megan@sifive.com>
|
|
|
|
|