chisel icon indicating copy to clipboard operation
chisel copied to clipboard

Make Probes an explicit Scala type for User Code [WIP]

Open mwachs5 opened this issue 2 years ago • 2 comments

Contributor Checklist

  • [ ] Did you add Scaladoc to every public function/method?
  • [ ] Did you add at least one test demonstrating the PR?
  • [ ] Did you delete any extraneous printlns/debugging code?
  • [ ] Did you specify the type of improvement?
  • [ ] Did you add appropriate documentation in docs/src?
  • [ ] Did you request a desired merge strategy?
  • [ ] Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Feature (or new API)
  • API modification

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).
  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

Reviewer Checklist (only modified by reviewer)

  • [ ] Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • [ ] Did you mark the proper milestone (Bug fix: 3.5.x, 3.6.x, or 5.x depending on impact, API modification or big change: 6.0)?
  • [ ] Did you review?
  • [ ] Did you check whether all relevant Contributor checkboxes have been checked?
  • [ ] Did you do one of the following when ready to merge:
    • [ ] Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • [ ] Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

mwachs5 avatar Dec 19 '23 19:12 mwachs5

Currently fails to compile:

error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsSpec.scala:332:17: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class Baz
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       define(a, ProbeValue(false.B))
[error]                 ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsTapSpec.scala:251:48: value x is not a member of chisel3.probe.RWProbe[this.MiniBundle]
[error]         probe.define(outElem, outRWBundleProbe.x)
[error]                                                ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsTapSpec.scala:281:44: chisel3.probe.RWProbe[chisel3.Vec[chisel3.Bool]] does not take parameters
[error]         probe.define(outElem, outRWVecProbe(1))
[error]                                            ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsTapSpec.scala:376:58: chisel3.probe.Probe[chisel3.Vec[Foo.this.InOutBundle]] does not take parameters
[error]       probe.define(outV_1_out_refsub, outProbeForChildVec(1).out)
[error]                                                          ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsTapSpec.scala:398:53: type mismatch;
[error]  found   : chisel3.probe.RWProbe[chisel3.Bool]
[error]  required: chisel3.Bool
[error]       @public val tapTarget: Bool = IO(probe.RWProbe(Bool()))
[error]                                                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/BoringUtilsTapSpec.scala:404:20: type mismatch;
[error]  found   : chisel3.Bool
[error]  required: chisel3.probe.ProbeLike[?]
[error]       probe.define(tapTarget, BoringUtils.rwTap(internalWire))
[error]                    ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:22:23: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]         val w_probe = RWProbeValue(w)
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:50:17: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from <$anon: chisel3.Module>
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]         val n = RWProbeValue(io.x)
[error]                 ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:87:23: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]           define(out, RWProbeValue(in))
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:112:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class Foo
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]           define(p, ProbeValue(x))
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:119:23: value b is not a member of chisel3.probe.Probe[this.FooBundle]
[error]         define(y, f.p.b)
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:142:36: chisel3.probe.Probe[chisel3.Vec[chisel3.UInt]] does not take parameters
[error]         define(outProbe, child.p(0)(1))
[error]                                    ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:232:26: type mismatch;
[error]  found   : chisel3.Vec[chisel3.Bool]
[error]  required: Seq[chisel3.probe.Probe[chisel3.Bool]]
[error]           io.out :<>= io.in
[error]                          ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:348:19: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]           val v = ProbeValue(w)
[error]                   ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:394:41: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from class Test
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w = WireInit(RWProbe(Bool()), RWProbeValue(init))
[error]                                         ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:443:21: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]         define(out, RWProbeValue(in))
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:456:23: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]           define(out, ProbeValue(in))
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:470:17: type mismatch;
[error]  found   : chisel3.probe.Probe[chisel3.Bool]
[error]  required: chisel3.probe.RWProbe[?]
[error]           force(out, in)
[error]                 ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:483:23: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]           define(out, RWProbeValue(true.B))
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:495:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from <$anon: chisel3.RawModule>
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]         define(out, ProbeValue(true.B))
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:610:26: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from class Top
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       define(b.refs.out, RWProbeValue(out))
[error]                          ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:611:26: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from class Top
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       define(b.refs.reg, RWProbeValue(r))
[error]                          ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/ProbeSpec.scala:666:21: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from class TestMod
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = RWProbeValue(w)
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/experimental/DataView.scala:823:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class MyModule
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = ProbeValue(w)
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/experimental/DataView.scala:835:21: macro method apply in object RWProbeValue cannot be accessed as a member of object chisel3.probe.RWProbeValue from class MyModule
[error] error after rewriting to chisel3.probe.RWProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = RWProbeValue(w)
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/experimental/DataView.scala:847:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class MyModule
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = ProbeValue(w)
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/experimental/DataView.scala:859:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class MyModule
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = ProbeValue(w)
[error]                     ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/interface/InterfaceSpec.scala:272:23: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class RefComponent
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]         val w_probe = ProbeValue(w)
[error]                       ^
[error] /scratch/megan/chisel/src/test/scala/chiselTests/interface/InterfaceSpec.scala:327:21: macro method apply in object ProbeValue cannot be accessed as a member of object chisel3.probe.ProbeValue from class RefComponent
[error] error after rewriting to chisel3.probe.ProbeValue.<apply: error>
[error] possible cause: maybe a wrong Dynamic method signature?
[error]       val w_probe = ProbeValue(w.b)
[error]                     ^
[error] 29 errors found
[error] (svsim / Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] (Test / compileIncremental) Compilation failed
[error] Total time: 15 s, completed Dec 19, 2023 11:44:05 AM

mwachs5 avatar Dec 19 '23 19:12 mwachs5

I'm a little scared about this idea landing in Chisel 6, since RC1 is out, this API is a big change... However I think we should eventually take this into consideration, but beside the Probe type(verification IO), we may additionally need to add Interface(hardware IO), Property(metadata IO).

sequencer avatar Dec 22 '23 09:12 sequencer