diff options
| author | Jim Lawson | 2015-05-11 13:02:03 -0700 |
|---|---|---|
| committer | Jim Lawson | 2015-07-24 15:50:53 -0700 |
| commit | 2ae50411cbc5e2cd5fdc9ca4069b9c5f64919bc4 (patch) | |
| tree | a656e44d86a68a7c53b159fe6c74d328a126126d /src/test/scala/ChiselTests/Decoder.scala | |
| parent | b208bfb5691c7b5921dd47d0b599726872acd1cd (diff) | |
Incorporate chisel3-tests; update Makefile.
Diffstat (limited to 'src/test/scala/ChiselTests/Decoder.scala')
| -rw-r--r-- | src/test/scala/ChiselTests/Decoder.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/scala/ChiselTests/Decoder.scala b/src/test/scala/ChiselTests/Decoder.scala new file mode 100644 index 00000000..c9b9f418 --- /dev/null +++ b/src/test/scala/ChiselTests/Decoder.scala @@ -0,0 +1,20 @@ +package ChiselTests +import Chisel._ + +object Insts { + def ADD = MInt("b0000000??????????000?????0110011") +} + +class Decoder extends Module { + val io = new Bundle { + val inst = UInt(INPUT, 32) + val isAdd = Bool(OUTPUT) + } + io.isAdd := (Insts.ADD === io.inst) +} + +class DecoderTester(c: Decoder) extends Tester(c) { + poke(c.io.inst, 0x1348533) + step(1) + expect(c.io.isAdd, int(true)) +} |
