chipsalliance / chipsalliance/chisel
CloneType Should Preserve Probe-ness
- Dominant language
- Scala
- Stars
- 4.8k
- Forks
- 658
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 14
Description
The following seems like incorrect behavior. If I `cloneType` a `Probe`, I get back the original, un-probed type. It should return the `Probe` type.
Consider:
```scala
//> using scala "2.13.11"
//> using repository sonatype-s01:snapshots
//> using lib "org.chipsalliance::chisel::6.0.0-M3+117-2372b1c4-SNAPSHOT"
//> using plugin "org.chipsalliance:::chisel-plugin::6.0.0-M3+117-2372b1c4-SNAPSHOT"
//> using options "-unchecked", "-deprecation", "-language:reflectiveCalls", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-Ywarn-unused", "-Ymacro-annotations"
import chisel3._
import chisel3.probe.Probe
import circt.stage.ChiselStage
class Foo extends RawModule {
val a = IO(Probe(Bool()))
val b = IO(a.cloneType)
}
object Main extends App {
println(
ChiselStage.emitCHIRRTL(
new Foo
)
)
}
```
This produces (`scala-cli Foo.scala`):
```
FIRRTL version 3.3.0
circuit Foo :
module Foo :
output a : Probe>
output b : UInt<1>
skip
```
I'd expect to get:
```
FIRRTL version 3.3.0
circuit Foo :
module Foo :
output a : Probe>
output b : Probe>
skip
```
Contributor guide
Assessment
This issue has not been assessed yet.