Skip to content

Commit

Permalink
More sanitization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adkian-sifive authored and jackkoenig committed Jan 8, 2024
1 parent 3b189b7 commit f8cffe7
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ class InstanceSpec extends ChiselFunSpec with Utils {
val (chirrtl, _) = getFirrtlAndAnnos(new Top)
chirrtl.serialize should include("inst potato of AddOne")
}
it("11.2 suggestName with sanitization") {
it("11.3 suggestName with sanitization") {
class Top extends Module {
val definition = Definition(new AddOne)
val inst0 = Instance(definition)
Expand All @@ -1241,4 +1241,13 @@ class InstanceSpec extends ChiselFunSpec with Utils {
chirrtl.serialize should include("inst potato of AddOne")
chirrtl.serialize should include("inst potato_1 of AddOne")
}
it("11.4 suggestName with multi-def collision sanitization") {
class Top extends Module {
val inst0 = Module(new AddOne()).suggestName("potato")
val inst1 = Instance(Definition(new AddOne)).suggestName("potato")
}
val (chirrtl, _) = getFirrtlAndAnnos(new Top)
chirrtl.serialize should include("inst potato of AddOne")
chirrtl.serialize should include("inst potato_1 of AddOne_1")
}
}

0 comments on commit f8cffe7

Please sign in to comment.