File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ package object Chisel { // scalastyle:ignore package.object.name
19
19
case object OUTPUT extends Direction
20
20
case object NODIR extends Direction
21
21
22
+ val Input = chisel3.core.Input
23
+ val Output = chisel3.core.Output
24
+
22
25
object Flipped {
23
26
def apply [T <: Data ](target : T ): T = chisel3.core.Flipped [T ](target)
24
27
}
Original file line number Diff line number Diff line change @@ -304,4 +304,18 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks
304
304
}
305
305
}
306
306
307
+ " Chisel3 IO constructs" should " be useable in Chisel2" in {
308
+ import Chisel ._
309
+ elaborate(new Module {
310
+ val io = IO (new Bundle {
311
+ val in = Input (Bool ())
312
+ val foo = Output (Bool ())
313
+ val bar = Flipped (Bool ())
314
+ })
315
+ Chisel .assert(io.in.dir == INPUT )
316
+ Chisel .assert(io.foo.dir == OUTPUT )
317
+ Chisel .assert(io.bar.dir == INPUT )
318
+ })
319
+ }
320
+
307
321
}
You can’t perform that action at this time.
0 commit comments