summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
diff options
context:
space:
mode:
authorRichard Lin2017-06-26 18:35:46 -0700
committerGitHub2017-06-26 18:35:46 -0700
commitaaee58d374dc3f3a088856da13a6a59ecffb2cac (patch)
tree790828de9a9fbb1dfd26635eebaf27668a4cc8df /src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
parent91850ec917a432e9e3db588e7711c8a82801eb49 (diff)
Directions internals mega-refactor (#617)
Part 1 of mega-change in #578 Major notes: - Input(...) and Output(...) now (effectively) recursively override their elements' directions - Nodes given userDirection (Input, Output, Flip - what the user assigned to _that_ node) and actualDirection (Input, Output, None, but also Bidirectional and BidirectionalFlip for mostly Aggregates), because of the above (since a higher-level Input(...) can override the locally specified user direction). - DataMirror (node reflection APIs) added to chisel3.experimental. This provides ways to query the user given direction of a node as well as the actual direction. - checkSynthesizable replaced with requireIsHardware and requireIsChiselType and made available in chisel3.experimental. Internal changes notes: - toType moved into Emitter, this makes the implementation cleaner especially considering that Vec types can't be flipped in FIRRTL. This also more clearly separates Chisel frontend from FIRRTL emission. - Direction separated from Bindings, both are now fields in Data, and all nodes are given hierarchical directions (Aggregates may be Bidirectional). The actualDirection at the Element (leaf) level should be the same as binding directions previously. - Bindings are hierarchical, children (of a, for example, Bundle) have a ChildBinding that points to their parent. This is different than the previous scheme where Bindings only applied at the Element (leaf) level. - Lots of small misc clean up. Future PRs will address other parts of #578, including stricter direction checks that aren't a side-effect of this internal refactor, stricter checks and splitting of binding operations (Wire vs. WireInit), and node operations not introduced here (getType and deprecation of chiselCloneType). Since those shouldn't mess with internals, those should be much smaller.
Diffstat (limited to 'src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala')
-rw-r--r--src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala b/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
index 2baa6e48..c0538123 100644
--- a/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
+++ b/src/test/scala/chiselTests/CompatibilityInteroperabilitySpec.scala
@@ -64,21 +64,21 @@ object Chisel3Components {
}
class Chisel3BundleModuleA extends Chisel3DriverModule(new Chisel3Bundle)
- class Chisel3BundleModuleB extends Chisel3PassthroughModule((new Chisel3Bundle).flip)
+ class Chisel3BundleModuleB extends Chisel3PassthroughModule(Flipped(new Chisel3Bundle))
class Chisel3RecordModuleA extends Chisel3DriverModule(new Chisel3Record)
- class Chisel3RecordModuleB extends Chisel3PassthroughModule((new Chisel3Record).flip)
+ class Chisel3RecordModuleB extends Chisel3PassthroughModule(Flipped(new Chisel3Record))
class Chisel3ModuleChiselBundleA extends Chisel3DriverModule(new ChiselBundle)
- class Chisel3ModuleChiselBundleB extends Chisel3PassthroughModule((new ChiselBundle).flip)
+ class Chisel3ModuleChiselBundleB extends Chisel3PassthroughModule(Flipped(new ChiselBundle))
class Chisel3ModuleChiselRecordA extends Chisel3DriverModule(new ChiselRecord)
- class Chisel3ModuleChiselRecordB extends Chisel3PassthroughModule((new ChiselRecord).flip)
+ class Chisel3ModuleChiselRecordB extends Chisel3PassthroughModule(Flipped(new ChiselRecord))
}
class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
"Modules defined in the Chisel._" should "successfully bulk connect in chisel3._" in {
- import chisel3._
- import chisel3.testers.BasicTester
+ import chisel3._
+ import chisel3.testers.BasicTester
import CompatibilityComponents._
assertTesterPasses(new BasicTester {
@@ -96,8 +96,8 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
}
"Moduless defined in the chisel3._" should "successfully bulk connect in Chisel._" in {
- import Chisel._
- import chisel3.testers.BasicTester
+ import Chisel._
+ import chisel3.testers.BasicTester
import Chisel3Components._
assertTesterPasses(new BasicTester {
@@ -116,8 +116,8 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
"Bundles defined in Chisel._" should "work in chisel3._ Modules" in {
- import chisel3._
- import chisel3.testers.BasicTester
+ import chisel3._
+ import chisel3.testers.BasicTester
import Chisel3Components._
assertTesterPasses(new BasicTester {
@@ -135,8 +135,8 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
}
"Bundles defined in chisel3._" should "work in Chisel._ Modules" in {
- import chisel3._
- import chisel3.testers.BasicTester
+ import chisel3._
+ import chisel3.testers.BasicTester
import CompatibilityComponents._
assertTesterPasses(new BasicTester {
@@ -156,8 +156,8 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
"Similar Bundles defined in the chisel3._ and Chisel._" should
"successfully bulk connect in chisel3._" in {
- import chisel3._
- import chisel3.testers.BasicTester
+ import chisel3._
+ import chisel3.testers.BasicTester
import Chisel3Components._
import CompatibilityComponents._
@@ -187,8 +187,8 @@ class CompatibiltyInteroperabilitySpec extends ChiselFlatSpec {
})
}
they should "successfully bulk connect in Chisel._" in {
- import Chisel._
- import chisel3.testers.BasicTester
+ import Chisel._
+ import chisel3.testers.BasicTester
import Chisel3Components._
import CompatibilityComponents._