From b813caf6fd08d294dc73bd98a39097aebaaff5d4 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Wed, 22 Apr 2020 19:58:24 -0700 Subject: [PATCH] get icenet and testchipip unit tests working --- .../src/main/scala/unittest/TestHarness.scala | 9 +++++++ .../main/scala/unittest/UnitTestSuite.scala | 8 +++++++ generators/icenet | 2 +- generators/testchipip | 2 +- sims/vcs/Makefile | 2 +- variables.mk | 24 +++++++++++++++++++ 6 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 generators/chipyard/src/main/scala/unittest/TestHarness.scala create mode 100644 generators/chipyard/src/main/scala/unittest/UnitTestSuite.scala diff --git a/generators/chipyard/src/main/scala/unittest/TestHarness.scala b/generators/chipyard/src/main/scala/unittest/TestHarness.scala new file mode 100644 index 00000000..8bb4bbd9 --- /dev/null +++ b/generators/chipyard/src/main/scala/unittest/TestHarness.scala @@ -0,0 +1,9 @@ +package chipyard.unittest + +import chisel3._ +import freechips.rocketchip.config.Parameters + +class TestHarness(implicit val p: Parameters) extends Module { + val io = IO(new Bundle { val success = Output(Bool()) }) + io.success := Module(new UnitTestSuite).io.finished +} diff --git a/generators/chipyard/src/main/scala/unittest/UnitTestSuite.scala b/generators/chipyard/src/main/scala/unittest/UnitTestSuite.scala new file mode 100644 index 00000000..40e991a2 --- /dev/null +++ b/generators/chipyard/src/main/scala/unittest/UnitTestSuite.scala @@ -0,0 +1,8 @@ +package chipyard.unittest + +import freechips.rocketchip.config.Parameters +import freechips.rocketchip.util.{ElaborationArtefacts, PlusArgArtefacts} + +class UnitTestSuite(implicit p: Parameters) extends freechips.rocketchip.unittest.UnitTestSuite { + ElaborationArtefacts.add("plusArgs", PlusArgArtefacts.serialize_cHeader) +} diff --git a/generators/icenet b/generators/icenet index 4522a397..705ca506 160000 --- a/generators/icenet +++ b/generators/icenet @@ -1 +1 @@ -Subproject commit 4522a3979be092c4221f186bdd93bf330fdca134 +Subproject commit 705ca50690383aa589dc560a5e7c152af04c46ad diff --git a/generators/testchipip b/generators/testchipip index b8d6f210..ba705408 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit b8d6f2101947e9f80f896dbaa5802946e2a3b9f0 +Subproject commit ba705408fa707d8e4e132fabd59dacb9eb12e985 diff --git a/sims/vcs/Makefile b/sims/vcs/Makefile index 659d1fc0..c00819c2 100644 --- a/sims/vcs/Makefile +++ b/sims/vcs/Makefile @@ -56,7 +56,7 @@ VCS_CC_OPTS = \ VCS_NONCC_OPTS = \ +lint=all,noVCDE,noONGS,noUI \ -error=PCWM-L \ - -timescale=1ns/10ps \ + -timescale=1ns/1ps \ -quiet \ -q \ +rad \ diff --git a/variables.mk b/variables.mk index 80e10a0c..ad981245 100644 --- a/variables.mk +++ b/variables.mk @@ -50,6 +50,30 @@ ifeq ($(SUB_PROJECT),hwacha) TB ?= TestDriver TOP ?= ExampleRocketSystem endif +# For TestChipIP developers +ifeq ($(SUB_PROJECT),testchipip) + SBT_PROJECT ?= chipyard + MODEL ?= TestHarness + VLOG_MODEL ?= TestHarness + MODEL_PACKAGE ?= chipyard.unittest + CONFIG ?= TestChipUnitTestConfig + CONFIG_PACKAGE ?= testchipip + GENERATOR_PACKAGE ?= chipyard + TB ?= TestDriver + TOP ?= UnitTestSuite +endif +# For IceNet developers +ifeq ($(SUB_PROJECT),icenet) + SBT_PROJECT ?= chipyard + MODEL ?= TestHarness + VLOG_MODEL ?= TestHarness + MODEL_PACKAGE ?= chipyard.unittest + CONFIG ?= IceNetUnitTestConfig + CONFIG_PACKAGE ?= icenet + GENERATOR_PACKAGE ?= chipyard + TB ?= TestDriver + TOP ?= UnitTestSuite +endif ######################################################################################### # path to rocket-chip and testchipip