chipsalliance / chipsalliance/chisel

CloneType Should Preserve Probe-ness

Open
#3,647 7 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.