From 0a17d89fe76c11efadc3d0f90dc1d93a690d861a Mon Sep 17 00:00:00 2001 From: chick Date: Tue, 17 Dec 2019 13:26:08 -0800 Subject: This adds a mechanism for the unittests to be run with the TreadleBackend This mechanism is not enabled and should not change the behavior of existing tests A following PR will deliver a switch that will allow changing the backend. The reasons for this PR - Treadle tests run much faster, enabling quicker debugging and CI cycles - This will help ensure fidelity of Treadle to the Verilator backend A few tests are marked as verilator only due to black box limitations Change treadle to a direct dependency I tried to make it a test only dependency but the TesterDriver sits in src/main requiring that regular compile have access to treadle Oops, made treadle the default A number of changes in response to @ducky64 review - made backend check clearer and add error handling for multiple backends specified - Fixed duplicate TargetDirAnnotation uses in Treadle backend - Cleaned up BlackBox test formatting - Undid unnecessary debugging changes from Counter - Undid .gitignore change, that should be on another PR A number of changes in response to @ducky64 review - Undid debugging changes made to BitWiseOps --- src/test/scala/examples/SimpleVendingMachine.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/scala/examples') diff --git a/src/test/scala/examples/SimpleVendingMachine.scala b/src/test/scala/examples/SimpleVendingMachine.scala index 2021ece8..49caa92c 100644 --- a/src/test/scala/examples/SimpleVendingMachine.scala +++ b/src/test/scala/examples/SimpleVendingMachine.scala @@ -3,7 +3,7 @@ package examples import chiselTests.ChiselFlatSpec -import chisel3.testers.BasicTester +import chisel3.testers.{BasicTester, TesterDriver} import chisel3._ import chisel3.util._ @@ -49,7 +49,7 @@ class FSMVendingMachine extends SimpleVendingMachine { } class VerilogVendingMachine extends BlackBox { - // Because this is a blackbox, we must explicity add clock and reset + // Because this is a blackbox, we must explicitly add clock and reset val io = IO(new SimpleVendingMachineIO { val clock = Input(Clock()) val reset = Input(Reset()) @@ -90,6 +90,6 @@ class SimpleVendingMachineSpec extends ChiselFlatSpec { } "An Verilog implementation of a vending machine" should "work" in { assertTesterPasses(new SimpleVendingMachineTester(new VerilogVendingMachineWrapper), - List("/chisel3/VerilogVendingMachine.v")) + List("/chisel3/VerilogVendingMachine.v"), annotations = TesterDriver.verilatorOnly) } } -- cgit v1.2.3