summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJim Lawson2016-10-06 11:15:08 -0700
committerJim Lawson2016-10-06 11:15:08 -0700
commitd9e46d06522102634b04a187d5e89fe84b94678a (patch)
tree3f44fc56acc334c1ffa7340583b29ad44ff8740b /src/main
parentf98171296f821034cf66ace070bcf179183e833d (diff)
parent7aea39d4deac62d5477904f4bf4381c3482c41d0 (diff)
Merge branch 'master' into buildinfo
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/chisel3/Driver.scala9
-rw-r--r--src/main/scala/chisel3/util/TransitName.scala16
2 files changed, 15 insertions, 10 deletions
diff --git a/src/main/scala/chisel3/Driver.scala b/src/main/scala/chisel3/Driver.scala
index e91b40b4..03f8547e 100644
--- a/src/main/scala/chisel3/Driver.scala
+++ b/src/main/scala/chisel3/Driver.scala
@@ -87,14 +87,17 @@ trait BackendCompilationUtilities {
def executeExpectingFailure(
prefix: String,
dir: File,
- assertionMsg: String = "Assertion failed"): Boolean = {
+ assertionMsg: String = ""): Boolean = {
var triggered = false
+ val assertionMessageSupplied = assertionMsg != ""
val e = Process(s"./V${prefix}", dir) !
ProcessLogger(line => {
- triggered = triggered || line.contains(assertionMsg)
+ triggered = triggered || (assertionMessageSupplied && line.contains(assertionMsg))
System.out.println(line) // scalastyle:ignore regex
})
- triggered
+ // Fail if a line contained an assertion or if we get a non-zero exit code
+ // or, we get a SIGABRT (assertion failure) and we didn't provide a specific assertion message
+ triggered || (e != 0 && (e != 134 || !assertionMessageSupplied))
}
def executeExpectingSuccess(prefix: String, dir: File): Boolean = {
diff --git a/src/main/scala/chisel3/util/TransitName.scala b/src/main/scala/chisel3/util/TransitName.scala
index ce6cb60f..a3220a13 100644
--- a/src/main/scala/chisel3/util/TransitName.scala
+++ b/src/main/scala/chisel3/util/TransitName.scala
@@ -5,14 +5,16 @@ package chisel3.util
import chisel3._
import internal.HasId
+/**
+ * The purpose of TransitName is to allow a library to 'move' a name
+ * call to a more appropriate place.
+ * For example, a library factory function may create a module and return
+ * the io. The only user-exposed field is that given IO, which can't use
+ * any name supplied by the user. This can add a hook so that the supplied
+ * name then names the Module.
+ * See Queue companion object for working example
+ */
object TransitName {
- // The purpose of this is to allow a library to 'move' a name call to a more
- // appropriate place.
- // For example, a library factory function may create a module and return
- // the io. The only user-exposed field is that given IO, which can't use
- // any name supplied by the user. This can add a hook so that the supplied
- // name then names the Module.
- // See Queue companion object for working example
def apply[T<:HasId](from: T, to: HasId): T = {
from.addPostnameHook((given_name: String) => {to.suggestName(given_name)})
from