summaryrefslogtreecommitdiff
path: root/src/test/scala
diff options
context:
space:
mode:
authorchick2016-02-24 23:05:11 -0800
committerchick2016-02-24 23:05:11 -0800
commit3c0a67889280803c22fff441462d06bb5081a558 (patch)
tree6871a959477f9a88d5aae08e8bb1e94e7d84149d /src/test/scala
parent5d278605f2f398b17e7059a70ccd7420aa555cf8 (diff)
Remove the assignment statements in EnqIO and DeqIO Bundle constructors.
Make the corresponding test run faster by giving it a Counter.
Diffstat (limited to 'src/test/scala')
-rw-r--r--src/test/scala/chiselTests/VectorPacketIO.scala17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/VectorPacketIO.scala b/src/test/scala/chiselTests/VectorPacketIO.scala
index 8f68532e..5fff6236 100644
--- a/src/test/scala/chiselTests/VectorPacketIO.scala
+++ b/src/test/scala/chiselTests/VectorPacketIO.scala
@@ -6,14 +6,13 @@ import Chisel._
import Chisel.testers.BasicTester
/**
- * This test illustrates the creation of a firrtl file
+ * This test used to fail when assignment statements were
+ * contained in DeqIO and EnqIO constructors.
+ * The symptom is creation of a firrtl file
* with missing declarations, the problem is exposed by
* the creation of the val outs in VectorPacketIO
- * NOTE: The problem does not exists if the initialization
- * code is removed from DeqIO and EnqIO
- * see: Decoupled.scala lines 29 and 38
- * valid := Bool(false) and ready := Bool(false)
- * statements inside a bundle
+ * NOTE: The problem does not exist now because the initialization
+ * code has been removed from DeqIO and EnqIO
*/
class Packet extends Bundle {
val header = UInt(width = 1)
@@ -40,6 +39,12 @@ class BrokenVectorPacketModule extends Module {
class VectorPacketIOUnitTester extends BasicTester {
val device_under_test = Module(new BrokenVectorPacketModule)
+
+ // This counter just makes the test end quicker
+ val c = Counter(1)
+ when(c.inc()) {
+ stop()
+ }
}
class VectorPacketIOUnitTesterSpec extends ChiselFlatSpec {