From 25a0100bb614f1dace54a5736b913a551f975bce Mon Sep 17 00:00:00 2001
From: Maciej Lipinski <maciej.lipinski@cern.ch>
Date: Fri, 24 Feb 2017 15:13:05 +0100
Subject: [PATCH] [tb/wrpc] added "null" test when test_num=0 (no test
 specified)

for some simulations, we just need link-up, so wrpc to initialize
and then loop endlessly, this should be the default behaviour
---
 wrc_main_sim.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/wrc_main_sim.c b/wrc_main_sim.c
index 4b15de82e..b574d346b 100644
--- a/wrc_main_sim.c
+++ b/wrc_main_sim.c
@@ -35,9 +35,11 @@
 
 #define TESTBENCH_MAGIC 0x4d433ebc
 #define TESTBENCH_VERSION 1
+#define TESTBENCH_RET_NO_TEST 0
 #define TESTBENCH_RET_OK 1
 #define TESTBENCH_RET_ERROR 2
 
+
 /*
  * This is a structure to pass information from the testbench to lm32's
  * software. hdl_testbench structure is meant to be set by testbench through
@@ -193,6 +195,11 @@ void main(void)
 			;
 	}
 	switch (hdl_testbench.test_num) {
+	case 0:
+		/* for simulations that just need link-up */
+		hdl_testbench.return_val = TESTBENCH_RET_NO_TEST;
+		while (1)
+			;
 	case 1:
 		wrpc_test_1();
 		break;
-- 
GitLab