From a599fbea18cf72204ede688d6301ffa515362a38 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 18 Dec 2006 20:33:10 +0000 Subject: [PATCH] Have tests pick up standard .mk so PERL is set based on configure git-svn-id: file://localhost/svn/verilator/trunk/verilator@845 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- bin/verilator | 4 ++++ test_c/Makefile | 11 +++++++---- test_regress/Makefile | 8 +++++--- test_regress/t/t_math_imm.v | 2 +- test_sc/Makefile | 11 +++++++---- test_sp/Makefile | 11 +++++++---- test_vcs/Makefile | 6 +++++- test_verilated/Makefile | 6 +++++- 8 files changed, 41 insertions(+), 18 deletions(-) diff --git a/bin/verilator b/bin/verilator index 9143e381e..f3e0f92ca 100755 --- a/bin/verilator +++ b/bin/verilator @@ -879,6 +879,10 @@ disadvantage of this approach is that include/verilatedos.h must self-detect the requirements of the target system, rather then using configure. +The target system may also require edits to the Makefiles, the simple +Makefiles produced by Verilator presume the target system is the same type +as the build system. + =head1 VERILOG 2001 SUPPORT Verilator supports the more common Verilog 2001 language features. This diff --git a/test_c/Makefile b/test_c/Makefile index ee76758b0..60b23180c 100644 --- a/test_c/Makefile +++ b/test_c/Makefile @@ -12,20 +12,23 @@ # #****************************************************************************/ +default: test_default + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT -PERL = perl +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk DEBUG_ON = --debug --trace-dups #DEBUG = $(DEBUG_ON) VALGRIND_ON = $(DEBUG_ON) --gdb "valgrind -v --leak-check=yes" ###################################################################### -default: prep compile run -debug: prep_dbg compile run -valgrind: prep_vg compile run +test_default: prep compile run +test_debug: prep_dbg compile run +test_valgrind: prep_vg compile run VERILATOR_FLAGS = --cc -f $(VERILATOR_ROOT)/test_v/input.vc top.v #Note turning on traces requires SystemPerl to be installed diff --git a/test_regress/Makefile b/test_regress/Makefile index 0a6c42c2f..b3e4417af 100644 --- a/test_regress/Makefile +++ b/test_regress/Makefile @@ -12,15 +12,17 @@ # #****************************************************************************/ +default: test + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT -PERL = perl + +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk ###################################################################### -default: test - ifneq ($(VCS_HOME),) PRODUCTS += --vcs endif diff --git a/test_regress/t/t_math_imm.v b/test_regress/t/t_math_imm.v index 5c9cdabc3..e1a073ba7 100644 --- a/test_regress/t/t_math_imm.v +++ b/test_regress/t/t_math_imm.v @@ -85,7 +85,7 @@ module example (/*AUTOARG*/ input [5:0] LowMaskSel_Bot, HighMaskSel_Bot; output [63:0] LogicImm; - output [63:0] LowLogicImm, HighLogicImm; //FIX + output [63:0] LowLogicImm, HighLogicImm; wire [63:0] LowLogicImm, HighLogicImm; diff --git a/test_sc/Makefile b/test_sc/Makefile index dd20a9463..d16cd4b87 100644 --- a/test_sc/Makefile +++ b/test_sc/Makefile @@ -12,18 +12,21 @@ # #****************************************************************************/ +default: test_default + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT -PERL = perl +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk DEBUG_ON = --debug ###################################################################### -default: precopy prep preproc compile run -debug: precopy prep_dbg preproc compile run -nopublic: precopy prep_dbg_np preproc compile run +test_default: precopy prep preproc compile run +test_debug: precopy prep_dbg preproc compile run +test_nopublic: precopy prep_dbg_np preproc compile run V_FLAGS = -f $(VERILATOR_ROOT)/test_v/input.vc VERILATOR_FLAGS = --sc $(V_FLAGS) top.v diff --git a/test_sp/Makefile b/test_sp/Makefile index 9ce265e1d..3ec081ea9 100644 --- a/test_sp/Makefile +++ b/test_sp/Makefile @@ -12,18 +12,21 @@ # #****************************************************************************/ +default: test_default + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT -PERL = perl +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk DEBUG_ON = --debug --trace-dups --output-split 100 ###################################################################### -default: prep preproc compile run coverage -debug: prep_dbg preproc compile_dbg run coverage -nopublic: prep_dbg_np preproc compile_dbg run coverage +test_default: prep preproc compile run coverage +test_debug: prep_dbg preproc compile_dbg run coverage +test_nopublic: prep_dbg_np preproc compile_dbg run coverage V_FLAGS = -f $(VERILATOR_ROOT)/test_v/input.vc VERILATOR_FLAGS = --public --sp --coverage --stats --trace $(V_FLAGS) top.v diff --git a/test_vcs/Makefile b/test_vcs/Makefile index 80ea32c0b..e7088690c 100644 --- a/test_vcs/Makefile +++ b/test_vcs/Makefile @@ -12,16 +12,20 @@ # #****************************************************************************/ +default: test + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk + ###################################################################### V_FILES := $(wildcard *.v ../test_v/*.v) ###################################################################### -default: test ifneq ($(VCS_HOME),) test:: vcs diff --git a/test_verilated/Makefile b/test_verilated/Makefile index 4b32a767b..a53798b19 100644 --- a/test_verilated/Makefile +++ b/test_verilated/Makefile @@ -12,10 +12,14 @@ # #****************************************************************************/ +default: test + # This must point to the root of the VERILATOR kit VERILATOR_ROOT := $(shell pwd)/.. export VERILATOR_ROOT -PERL = perl + +# Pick up PERL and other variable settings +include $(VERILATOR_ROOT)/include/verilated.mk VERILATOR_SW += ifeq ($(VERILATOR_NO_DEBUG),)