summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Data.scala
diff options
context:
space:
mode:
authorJim Lawson2016-10-05 16:18:59 -0700
committerGitHub2016-10-05 16:18:59 -0700
commit0675d2443c07bbd43723bf57694b688d2df08498 (patch)
tree5566195d427b5d75031726002f6b96d5742e3c08 /chiselFrontend/src/main/scala/chisel3/core/Data.scala
parent7981c6d9e6d25fb27b25e1427794775c9f934a09 (diff)
parenta18002c879d14b6c51cd49311a3b2a99a6a204fc (diff)
Merge pull request #315 from ucb-bar/fix-rocket-chip
Give <> and := legacy behavior in compatibility mode
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Data.scala45
1 files changed, 27 insertions, 18 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
index 922b33a9..4167be98 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
@@ -135,27 +135,35 @@ abstract class Data extends HasId {
private[core] def badConnect(that: Data)(implicit sourceInfo: SourceInfo): Unit =
throwException(s"cannot connect ${this} and ${that}")
private[chisel3] def connect(that: Data)(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): Unit = {
- Binding.checkSynthesizable(this, s"'this' ($this)")
- Binding.checkSynthesizable(that, s"'that' ($that)")
- try {
- MonoConnect.connect(sourceInfo, connectCompileOptions, this, that, Builder.forcedModule)
- } catch {
- case MonoConnect.MonoConnectException(message) =>
- throwException(
- s"Connection between sink ($this) and source ($that) failed @$message"
- )
+ if (connectCompileOptions.checkSynthesizable) {
+ Binding.checkSynthesizable(this, s"'this' ($this)")
+ Binding.checkSynthesizable(that, s"'that' ($that)")
+ try {
+ MonoConnect.connect(sourceInfo, connectCompileOptions, this, that, Builder.forcedModule)
+ } catch {
+ case MonoConnect.MonoConnectException(message) =>
+ throwException(
+ s"Connection between sink ($this) and source ($that) failed @$message"
+ )
+ }
+ } else {
+ this legacyConnect that
}
}
private[chisel3] def bulkConnect(that: Data)(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): Unit = {
- Binding.checkSynthesizable(this, s"'this' ($this)")
- Binding.checkSynthesizable(that, s"'that' ($that)")
- try {
- BiConnect.connect(sourceInfo, connectCompileOptions, this, that, Builder.forcedModule)
- } catch {
- case BiConnect.BiConnectException(message) =>
- throwException(
- s"Connection between left ($this) and source ($that) failed @$message"
- )
+ if (connectCompileOptions.checkSynthesizable) {
+ Binding.checkSynthesizable(this, s"'this' ($this)")
+ Binding.checkSynthesizable(that, s"'that' ($that)")
+ try {
+ BiConnect.connect(sourceInfo, connectCompileOptions, this, that, Builder.forcedModule)
+ } catch {
+ case BiConnect.BiConnectException(message) =>
+ throwException(
+ s"Connection between left ($this) and source ($that) failed @$message"
+ )
+ }
+ } else {
+ this legacyConnect that
}
}
private[chisel3] def lref: Node = Node(this)
@@ -163,6 +171,7 @@ abstract class Data extends HasId {
private[core] def cloneTypeWidth(width: Width): this.type
private[chisel3] def toType: String
private[core] def width: Width
+ private[core] def legacyConnect(that: Data)(implicit sourceInfo: SourceInfo): Unit
def cloneType: this.type
def chiselCloneType: this.type = {