Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some usages of suggestName runtime deprecated #2556

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b6addc7
suggestName: add some runtime deprecations
mwachs5 Jun 2, 2022
08543f3
no more _computedName
mwachs5 Jun 19, 2022
236a4fd
post merge cleanups
mwachs5 Jun 19, 2022
eaedd38
Deleted a bunch of chiselName and TransitName to get tests to pass be…
mwachs5 Jun 19, 2022
87f0e41
Add back the check for suggestName after module close
mwachs5 Jun 24, 2022
f0d2499
Add another case that we can name IOs
mwachs5 Jun 24, 2022
a175c1d
scalafmt
mwachs5 Jun 24, 2022
aceaae4
scalafmt
mwachs5 Jun 27, 2022
3918123
Add back the @chiselName
mwachs5 Jun 28, 2022
dbb9078
SuggestNameSpec: use something other than Queue to avoid issues with …
mwachs5 Jun 28, 2022
cd07ede
I don't need to suggestName on clock/reset do I?
mwachs5 Jun 28, 2022
a0d145d
Revert "I don't need to suggestName on clock/reset do I?"
mwachs5 Jun 28, 2022
a8b296f
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jun 30, 2022
412a8d1
Arbiter restore chiselName
mwachs5 Jul 1, 2022
bbc0d0a
restore nowarn annotation in Decoupled, that should be deleted in a s…
mwachs5 Jul 1, 2022
d7a1782
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jul 1, 2022
898ae25
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jul 1, 2022
5f25d90
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jul 1, 2022
5a11980
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jul 1, 2022
0075c25
Update src/test/scala/chiselTests/naming/SuggestNameSpec.scala
mwachs5 Jul 1, 2022
7b84a38
Merge remote-tracking branch 'origin/suggest-name-errors' into sugges…
mwachs5 Jul 1, 2022
db9152f
checkpoint: one test fails
mwachs5 Jul 1, 2022
7cf0c42
scalafmt
mwachs5 Jul 1, 2022
ce18389
fix numbering
mwachs5 Jul 1, 2022
7158448
scalafmt
mwachs5 Jul 1, 2022
e60b9bd
get the builder context check to work
mwachs5 Jul 1, 2022
9772b29
scalafmt
mwachs5 Jul 1, 2022
67ce7d8
avoid any allocations in seedOpt check
mwachs5 Jul 1, 2022
fa28909
Merge branch 'master' into suggest-name-errors
mwachs5 Jul 2, 2022
47d88ce
Update core/src/main/scala/chisel3/internal/Builder.scala
mwachs5 Jul 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add back the check for suggestName after module close
  • Loading branch information
mwachs5 committed Jun 28, 2022
commit 87f0e41f83c3870c004acc43084e1fb0f652b542
6 changes: 2 additions & 4 deletions core/src/main/scala/chisel3/internal/Builder.scala
Original file line number Diff line number Diff line change
@@ -159,13 +159,11 @@ private[chisel3] trait HasId extends InstanceId {
s"Calling suggestName ($seed, on something that cannot actually be named: ${this}) will become an error in Chisel 3.6"
mwachs5 marked this conversation as resolved.
Show resolved Hide resolved
)
}
/*
if (_computedName.isDefined) {
if (_parent.map(_.isClosed).getOrElse(false)) { // not sure what it means to have no parent
mwachs5 marked this conversation as resolved.
Show resolved Hide resolved
Builder.deprecated(
s"Calling suggestName ($seed, when the name was already computed as ${_computedName.get})) will become an error in Chisel 3.6"
s"Calling suggestName ($seed, on ${this}, when the containing module (${_parent.get.name}) completed elaboration already will become an error in Chisel 3.6"
mwachs5 marked this conversation as resolved.
Show resolved Hide resolved
)
}
*/
_suggestNameInternal(seed)
}

21 changes: 2 additions & 19 deletions src/test/scala/chiselTests/naming/SuggestNameSpec.scala
Original file line number Diff line number Diff line change
@@ -52,8 +52,6 @@ class SuggestNameSpec extends ChiselPropSpec with Utils {
caught.getMessage should include("suggestName (somethingElse) should only be called from a Builder context")
}

/*
// TODO: I removed the _computedName code that would check for this... how to determine if we are after module close?
property("2. Calling suggestName after module close should be a runtime deprecation") {
class Child extends Module {
val wire = {
@@ -67,26 +65,11 @@ class SuggestNameSpec extends ChiselPropSpec with Utils {
}
val (log, _) = grabLog(ChiselStage.emitVerilog(new Test()))
log should include(
"Calling suggestName (somethingElse, when the name was already computed "
)
}

property("3. Calling suggestName after toString should be a runtime deprecation") {
class Test extends Module {
val wire = {
val x = WireInit(0.U(3.W))
val y = x.toString
x.suggestName("somethingElse")
}
}
val (log, _) = grabLog(ChiselStage.emitVerilog(new Test()))
log should include(
"Calling suggestName (somethingElse, when the name was already computed "
"Calling suggestName (somethingElse, on Child.wire: Wire[UInt<3>], when the containing module (Child) completed elaboration already"
)
}
*/

property("4. Calling suggestName with the same thing prefix would have given should be a runtime deprecation") {
property("3. Calling suggestName with the same thing prefix would have given should be a runtime deprecation") {
class Test extends Module {
val wire = {
val x = WireInit(0.U(3.W)).suggestName("wire")