summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/VerificationSpec.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 10:39:52 -0800
committerJack Koenig2022-01-10 15:53:55 -0800
commit3131c0daad41dea78bede4517669e376c41a325a (patch)
tree55baed78a6a01f80ff3952a08233ca553a19964f /src/test/scala/chiselTests/VerificationSpec.scala
parentdd36f97a82746cec0b25b94651581fe799e24579 (diff)
Apply scalafmt
Command: sbt scalafmtAll
Diffstat (limited to 'src/test/scala/chiselTests/VerificationSpec.scala')
-rw-r--r--src/test/scala/chiselTests/VerificationSpec.scala35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/test/scala/chiselTests/VerificationSpec.scala b/src/test/scala/chiselTests/VerificationSpec.scala
index 2d7144df..95b0ffe6 100644
--- a/src/test/scala/chiselTests/VerificationSpec.scala
+++ b/src/test/scala/chiselTests/VerificationSpec.scala
@@ -11,13 +11,13 @@ import org.scalatest.matchers.should.Matchers
import java.io.File
class SimpleTest extends Module {
- val io = IO(new Bundle{
+ val io = IO(new Bundle {
val in = Input(UInt(8.W))
val out = Output(UInt(8.W))
})
io.out := io.in
cover(io.in === 3.U)
- when (io.in === 3.U) {
+ when(io.in === 3.U) {
assume(io.in =/= 2.U)
assert(io.out === io.in)
}
@@ -31,6 +31,7 @@ case class VerifAnnotation(target: ReferenceTarget) extends SingleTargetAnnotati
}
object VerifAnnotation {
+
/** Create annotation for a given verification component.
* @param c component to be annotated
*/
@@ -64,9 +65,10 @@ class VerificationSpec extends ChiselPropSpec with Matchers {
}
property("annotation of verification constructs should work") {
+
/** Circuit that contains and annotates verification nodes. */
class AnnotationTest extends Module {
- val io = IO(new Bundle{
+ val io = IO(new Bundle {
val in = Input(UInt(8.W))
val out = Output(UInt(8.W))
})
@@ -92,10 +94,10 @@ class VerificationSpec extends ChiselPropSpec with Matchers {
val annoLines = scala.io.Source.fromFile(annoFile).getLines.toList
// check for expected verification annotations
- exactly(3, annoLines) should include ("chiselTests.VerifAnnotation")
- exactly(1, annoLines) should include ("~AnnotationTest|AnnotationTest>asst")
- exactly(1, annoLines) should include ("~AnnotationTest|AnnotationTest>assm")
- exactly(1, annoLines) should include ("~AnnotationTest|AnnotationTest>cov")
+ exactly(3, annoLines) should include("chiselTests.VerifAnnotation")
+ exactly(1, annoLines) should include("~AnnotationTest|AnnotationTest>asst")
+ exactly(1, annoLines) should include("~AnnotationTest|AnnotationTest>assm")
+ exactly(1, annoLines) should include("~AnnotationTest|AnnotationTest>cov")
// read in FIRRTL file
val firFile = new File(testDir, "AnnotationTest.fir")
@@ -103,15 +105,16 @@ class VerificationSpec extends ChiselPropSpec with Matchers {
val firLines = scala.io.Source.fromFile(firFile).getLines.toList
// check that verification components have expected names
- exactly(1, firLines) should include ("cover(clock, _T, UInt<1>(\"h1\"), \"\") : cov")
- exactly(1, firLines) should include ("assume(clock, _T_3, UInt<1>(\"h1\"), \"\") : assm")
- exactly(1, firLines) should include ("assert(clock, _T_7, UInt<1>(\"h1\"), \"\") : asst")
+ exactly(1, firLines) should include("cover(clock, _T, UInt<1>(\"h1\"), \"\") : cov")
+ exactly(1, firLines) should include("assume(clock, _T_3, UInt<1>(\"h1\"), \"\") : assm")
+ exactly(1, firLines) should include("assert(clock, _T_7, UInt<1>(\"h1\"), \"\") : asst")
}
property("annotation of verification constructs with suggested name should work") {
+
/** Circuit that annotates a renamed verification nodes. */
class AnnotationRenameTest extends Module {
- val io = IO(new Bundle{
+ val io = IO(new Bundle {
val in = Input(UInt(8.W))
val out = Output(UInt(8.W))
})
@@ -137,9 +140,9 @@ class VerificationSpec extends ChiselPropSpec with Matchers {
val annoLines = scala.io.Source.fromFile(annoFile).getLines.toList
// check for expected verification annotations
- exactly(2, annoLines) should include ("chiselTests.VerifAnnotation")
- exactly(1, annoLines) should include ("~AnnotationRenameTest|AnnotationRenameTest>hello")
- exactly(1, annoLines) should include ("~AnnotationRenameTest|AnnotationRenameTest>howdy")
+ exactly(2, annoLines) should include("chiselTests.VerifAnnotation")
+ exactly(1, annoLines) should include("~AnnotationRenameTest|AnnotationRenameTest>hello")
+ exactly(1, annoLines) should include("~AnnotationRenameTest|AnnotationRenameTest>howdy")
// read in FIRRTL file
val firFile = new File(testDir, "AnnotationRenameTest.fir")
@@ -147,7 +150,7 @@ class VerificationSpec extends ChiselPropSpec with Matchers {
val firLines = scala.io.Source.fromFile(firFile).getLines.toList
// check that verification components have expected names
- exactly(1, firLines) should include ("assert(clock, _T, UInt<1>(\"h1\"), \"\") : hello")
- exactly(1, firLines) should include ("assume(clock, _T_4, UInt<1>(\"h1\"), \"\") : howdy")
+ exactly(1, firLines) should include("assert(clock, _T, UInt<1>(\"h1\"), \"\") : hello")
+ exactly(1, firLines) should include("assume(clock, _T_4, UInt<1>(\"h1\"), \"\") : howdy")
}
}