OpenCores
URL https://opencores.org/ocsvn/test_project/test_project/trunk

Subversion Repositories test_project

[/] [test_project/] [trunk/] [sim/] [bin/] [Makefile] - Blame information for rev 52

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 julius
######################################################################
2
####                                                              ####
3
####  ORPSoCv2 Testbenches Makefile                               ####
4
####                                                              ####
5
####  Description                                                 ####
6
####  ORPSoCv2 Testbenches Makefile, containing rules for         ####
7
####  configuring and running different tests on the current      ####
8
####  ORPSoC design.                                              ####
9
####                                                              ####
10
####  To Do:                                                      ####
11
####   - Verilator tests                                          ####
12
####                                                              ####
13
####  Author(s):                                                  ####
14
####      - jb, jb@orsoc.se                                       ####
15
####                                                              ####
16
####                                                              ####
17
######################################################################
18
####                                                              ####
19
#### Copyright (C) 2009 Authors and OPENCORES.ORG                 ####
20
####                                                              ####
21
#### This source file may be used and distributed without         ####
22
#### restriction provided that this copyright statement is not    ####
23
#### removed from the file and that any derivative work contains  ####
24
#### the original copyright notice and the associated disclaimer. ####
25
####                                                              ####
26
#### This source file is free software; you can redistribute it   ####
27
#### and/or modify it under the terms of the GNU Lesser General   ####
28
#### Public License as published by the Free Software Foundation; ####
29
#### either version 2.1 of the License, or (at your option) any   ####
30
#### later version.                                               ####
31
####                                                              ####
32
#### This source is distributed in the hope that it will be       ####
33
#### useful, but WITHOUT ANY WARRANTY; without even the implied   ####
34
#### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ####
35
#### PURPOSE.  See the GNU Lesser General Public License for more ####
36
#### details.                                                     ####
37
####                                                              ####
38
#### You should have received a copy of the GNU Lesser General    ####
39
#### Public License along with this source; if not, download it   ####
40
#### from http://www.opencores.org/lgpl.shtml                     ####
41
####                                                              ####
42
######################################################################
43 22 julius
 
44 39 julius
# Use: Type "make rtl-tests" to run all of the tests on the RTL model
45
# run in the Icarus Verilog simulator.
46
 
47
# The results and output of the simulation are in the results path,
48
# in parallel to the simulation run and bin paths. This directory is
49
# not checked into the repository, but is created when simulations are
50
# run.
51
 
52
# To run an individual test, specify it in the variable TESTS when
53
# calling make, like "make rtl-tests TESTS="mmu-nocache mul-idcd-O2".
54
 
55
# VCD (value change dumps, usable in a waveform viewer, such as gtkwave
56
# to inspect the internals of the system graphically) files can be
57
# generated by calling the make with VCD=1, like "make rtl-tests VCD=1"
58
# and a vcd file will be created in the simulation results directory,
59
# and named according to the test run which generated it.
60
 
61
# The rtl simulations can also be run with Cadences NCSim by using
62
# rtl-nc-tests in the place of rtl-tests.
63
 
64
# It is possible to speed up the simulation slightly by disabling
65
# log output of the processor's state to files by defining
66
# NO_SIM_LOGGING, eg. make rtl-tests TESTS=except-icdc NO_SIM_LOGGING=1
67
 
68
 
69
# Name of the directory we're currently in
70 22 julius
CUR_DIR=$(shell pwd)
71 39 julius
 
72
# The root path of the whole project
73 22 julius
PROJECT_ROOT=$(CUR_DIR)/../..
74
 
75 39 julius
# Tests is only defined if it wasn't already defined when make was called
76
# This is the default list of every test that is currently possible
77 33 julius
TESTS ?= basic-nocache cbasic-nocache-O2 dhry-nocache-O2 except-nocache mmu-nocache mul-nocache-O2 syscall-nocache tick-nocache uart-nocache basic-icdc cbasic-icdc-O2 dhry-icdc-O2 except-icdc mmu-icdc mul-icdc-O2 syscall-icdc tick-icdc uart-icdc
78 22 julius
 
79 39 julius
# Paths to other important parts of this test suite
80 22 julius
SIM_DIR=$(PROJECT_ROOT)/sim
81
SIM_RUN_DIR=$(SIM_DIR)/run
82
SIM_BIN_DIR=$(SIM_DIR)/bin
83
SIM_RESULTS_DIR=$(SIM_DIR)/results
84 44 julius
SIM_VLT_DIR=$(SIM_DIR)/vlt
85 22 julius
BENCH_DIR=$(PROJECT_ROOT)/bench
86
BACKEND_DIR=$(PROJECT_ROOT)/backend
87
BENCH_VERILOG_DIR=$(BENCH_DIR)/verilog
88 44 julius
BENCH_SYSC_DIR=$(BENCH_DIR)/sysc
89 47 julius
BENCH_SYSC_SRC_DIR=$(BENCH_SYSC_DIR)/src
90
BENCH_SYSC_INCLUDE_DIR=$(BENCH_SYSC_DIR)/include
91 22 julius
RTL_VERILOG_DIR=$(PROJECT_ROOT)/rtl/verilog
92
SW_DIR=$(PROJECT_ROOT)/sw
93
 
94
ICARUS=iverilog
95
ICARUS_VVP=vvp
96
ICARUS_COMMAND_FILE=icarus.scr
97 41 julius
VLT_COMMAND_FILE=verilator.scr
98 32 julius
SIM_SUCCESS_MESSAGE=deaddead
99 22 julius
 
100 45 julius
# If USE_SDRAM is defined we'll add it to the simulator's defines on the
101
# command line becuase it's used by many different modules and it's easier
102
# to do it this way than make them all include a file.
103
ifdef USE_SDRAM
104
RTL_SIM_FLAGS += "-D USE_SDRAM=$(USE_SDRAM)"
105
endif
106
SIM_FLASH_MEM_FILE="flash.in"
107
FLASH_MEM_FILE_SUFFIX="-twobyte-sizefirst.hex"
108
SIM_SRAM_MEM_FILE="sram.vmem"
109
 
110 52 julius
TESTS_PASSED=0
111
TESTS_PERFORMED=0;
112
 
113
################################################################################
114
# Event-driven simulator build rules (Icarus, NCSim)
115
################################################################################
116
 
117 22 julius
.PHONY: prepare_rtl
118
prepare_rtl:
119 26 julius
        @cd $(RTL_VERILOG_DIR)/components/wb_sdram_ctrl && perl fizzim.pl -encoding onehot -terse < wb_sdram_ctrl_fsm.fzm > wb_sdram_ctrl_fsm.v
120 43 julius
        @cd $(RTL_VERILOG_DIR) && sed '/defparam/!s/\([a-zA-Z0-9_]\)\.//g' intercon.vm > intercon.v
121 22 julius
 
122 52 julius
 
123
ifdef UART_PRINTF
124
TEST_SW_MAKE_OPTS=UART_PRINTF=1
125
endif
126
 
127 26 julius
.PHONY: prepare_sw
128
prepare_sw:
129 52 julius
        @$(MAKE) -C $(SW_DIR)/support all $(TEST_SW_MAKE_OPTS)
130
        @$(MAKE) -C $(SW_DIR)/utils all
131 26 julius
 
132 52 julius
 
133 39 julius
# Rough guide to how these tests work:
134
# First, the couple of custom, required, software tools under sw/utils are
135
# compiled, and then the software library files.
136
# Next the few verilog files that need preperation are taken care of.
137
# The test begins by starting a loop in bash using on the strings defined in
138
# TESTS. Each one corresponds to a certain module of software for the OpenRISC
139
# that is included in this test suite. Under the sw/ path is a set of paths,
140 45 julius
# and all except the support/ and utils/ paths contain code which is run to
141
# test the OR1k used in this test suite. For each of these software modules,
142
# it is possible that different tests are done using the same module. These
143
# tests can vary by either using different levels of optimisation during
144
# compilation, and/or by having the OR1k's caches enabled or disabled.
145 39 julius
# Each test has a unique name, and under the $(SIM_RESULTS_DIR), which is
146
# usually just ../results, log files, and optionally VCD files, are created for
147
# inspection later and are named according to the test. Inspect the file
148 45 julius
# bench/verilog/or1200_monitor.v to find out in detail what each log consists
149
# of.
150 39 julius
# For each test, a few things occur. First the software that will run inside
151 45 julius
# the simulated OR1k system is compiled, converted to a format which can be
152
# read
153 39 julius
# into the flash memory model via $readmemh() and linked to the sim/run
154 45 julius
# directory as $(SIM_FLASH_MEM_FILE), which currently is flash.in. Next a
155
# compilation script for icarus is generated, containing a list of all the
156
# RTL files and include directories. Next, an include file for the verilog
157
# testbench is generated, containing a string of the name of the current
158
# test, path to the results directory (for VCD generation) and any other
159
# things which might vary from test to test. This is not done by +define
160
# lines in the icarus script because of string handling incosistencies
161
# between different simulators and shells.
162
# Once all the files are generated, icarus is called to compile the rtl
163
# design, and then run it. Each of the tested software modules have code which
164
# will trigger the simulation to be stopped by use of the l.nop instruction
165
# with an immediate value of 1. When the simulation finishes, the simulation
166
# executable exits and the log of the simulation is inspected for the expected
167
# output. Currently, the string "deaddead" indicates that the software
168
# completed successfully. This is counted as the ORPSoC "passing" the test. In
169
# fact, whether the system did the right thing or not requires more
170
# inspection, but roughly this is a good indicator that nothing major went
171
# wrong.
172 39 julius
# Once the current test is finished, the next begins with the compilation of its
173
# software and linking of the resulting hex file to the run path, etc.
174 45 julius
# Main RAM setup - (RTL simulation with Icarus/NCSim only!):
175
# Define USE_SDRAM to enable the external SDRAM, otherwise the simulation
176
# defaults to an internal SRAM. Eg. $ make rtl-tests USE_SDRAM=1 VCD=1
177
# Verilator defaults to internal memories
178 39 julius
rtl-tests: prepare_sw prepare_rtl
179 22 julius
        @if [ ! -d $(SIM_RESULTS_DIR) ]; then mkdir -p $(SIM_RESULTS_DIR); fi
180 33 julius
        @echo
181
        @echo "Beginning loop that will complete the following tests: $(TESTS)"
182
        @echo
183 31 julius
        @for TEST in $(TESTS); do \
184 33 julius
                echo "################################################################################"; \
185
                echo; \
186
                echo "\t#### Current test: $$TEST ####"; echo; \
187 32 julius
                echo "\t#### Compiling software ####"; echo; \
188 22 julius
                CURRENT_TEST_SW_DIR=$(SW_DIR)/`echo $$TEST | cut -d "-" -f 1`; \
189 52 julius
                $(MAKE) -C $$CURRENT_TEST_SW_DIR $$TEST $(TEST_SW_MAKE_OPTS); \
190 45 julius
                rm -f $(SIM_RUN_DIR)/$(SIM_FLASH_MEM_FILE); \
191
                rm -f $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
192
                ln -s $$CURRENT_TEST_SW_DIR/$$TEST$(FLASH_MEM_FILE_SUFFIX) $(SIM_RUN_DIR)/$(SIM_FLASH_MEM_FILE); \
193
                ln -s $$CURRENT_TEST_SW_DIR/$$TEST.vmem $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
194 22 julius
                sed < $(SIM_BIN_DIR)/$(ICARUS_COMMAND_FILE) > $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated \
195
                        -e s!\$$BENCH_DIR!$(BENCH_VERILOG_DIR)!              \
196
                        -e s!\$$RTL_DIR!$(RTL_VERILOG_DIR)!                  \
197
                        -e s!\$$BACKEND_DIR!$(BACKEND_DIR)!                  \
198
                        -e \\!^//.*\$$!d -e \\!^\$$!d ; \
199 34 julius
                echo "+define+TEST_DEFINE_FILE=\"test_define.v\"" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
200 26 julius
                if [ ! -z $$VCD ]; \
201
                        then echo "+define+VCD" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
202
                fi; \
203 34 julius
                echo "\`define TEST_NAME_STRING \"$$TEST\"" > $(SIM_RUN_DIR)/test_define.v; \
204
                echo "\`define TEST_RESULTS_DIR \"$(SIM_RESULTS_DIR)/\" " >> $(SIM_RUN_DIR)/test_define.v; \
205 39 julius
                if [ -z $$NO_SIM_LOGGING ]; then \
206
                        echo "\`define OR1200_DISPLAY_ARCH_STATE" >> $(SIM_RUN_DIR)/test_define.v; \
207
                fi; \
208 22 julius
                echo ; \
209 32 julius
                echo "\t#### Compiling RTL ####"; \
210 22 julius
                rm -f $(SIM_RUN_DIR)/a.out; \
211 43 julius
                $(ICARUS) -sorpsoc_testbench -c $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated $(RTL_SIM_FLAGS); \
212 22 julius
                echo; \
213 32 julius
                echo "\t#### Beginning simulation ####"; \
214 33 julius
                time -p $(ICARUS_VVP) -l $(SIM_RESULTS_DIR)/$$TEST-vvp-out.log a.out ; \
215 36 julius
                if [ $$? -gt 0 ]; then exit $$?; fi; \
216
                TEST_RESULT=`cat $(SIM_RESULTS_DIR)/$$TEST-general.log | grep report | grep $(SIM_SUCCESS_MESSAGE) -c`; \
217 33 julius
                echo; echo "\t####"; \
218 34 julius
                if [ $$TEST_RESULT -gt 0 ]; then \
219 52 julius
                        echo "\t#### Test $$TEST PASSED ####";TESTS_PASSED=`expr $$TESTS_PASSED + 1`;\
220 32 julius
                else    echo "\t#### Test $$TEST FAILED ####";\
221
                fi; \
222 33 julius
                echo "\t####"; echo; \
223 52 julius
                TESTS_PERFORMED=`expr $$TESTS_PERFORMED + 1`;\
224
        done; \
225
        echo "Test results: "$$TESTS_PASSED" out of "$$TESTS_PERFORMED" tests passed"; echo
226 33 julius
 
227
 
228 52 julius
 
229 39 julius
# Use NCSIM instead of icarus
230
rtl-nc-tests: prepare_sw prepare_rtl
231 35 julius
        @if [ ! -d $(SIM_RESULTS_DIR) ]; then mkdir -p $(SIM_RESULTS_DIR); fi
232
        @echo
233
        @echo "Beginning loop that will complete the following tests: $(TESTS)"
234
        @echo
235
        @for TEST in $(TESTS); do \
236
                echo "################################################################################"; \
237
                echo; \
238
                echo "\t#### Current test: $$TEST ####"; echo; \
239
                echo "\t#### Compiling software ####"; echo; \
240
                CURRENT_TEST_SW_DIR=$(SW_DIR)/`echo $$TEST | cut -d "-" -f 1`; \
241
                $(MAKE) -C $$CURRENT_TEST_SW_DIR $$TEST; \
242 45 julius
                rm -f $(SIM_RUN_DIR)/$(SIM_FLASH_MEM_FILE); \
243
                rm -f $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
244
                ln -s $$CURRENT_TEST_SW_DIR/$$TEST_twobyte_sizefirst.hex $(SIM_RUN_DIR)/$(SIM_FLASH_MEM_FILE); \
245
                ln -s $$CURRENT_TEST_SW_DIR/$$TEST_fourbyte.hex $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
246 35 julius
                sed < $(SIM_BIN_DIR)/$(ICARUS_COMMAND_FILE) > $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated \
247
                        -e s!\$$BENCH_DIR!$(BENCH_VERILOG_DIR)!              \
248
                        -e s!\$$RTL_DIR!$(RTL_VERILOG_DIR)!                  \
249
                        -e s!\$$BACKEND_DIR!$(BACKEND_DIR)!                  \
250
                        -e \\!^//.*\$$!d -e \\!^\$$!d ; \
251
                echo "+define+TEST_DEFINE_FILE=\"test_define.v\"" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
252
                if [ ! -z $$VCD ]; \
253
                        then echo "+define+VCD" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
254
                        echo "+access+r" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
255
                fi; \
256 45 julius
                if [ ! -z $$USE_SDRAM ]; then \
257
                        echo "\`define USE_SDRAM" >> $(SIM_RUN_DIR)/test_define.v; \
258
                fi; \
259 36 julius
                echo "+nocopyright" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
260
                echo "+nowarn+MACRDF" >> $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated; \
261 35 julius
                echo "\`define TEST_NAME_STRING \"$$TEST\"" > $(SIM_RUN_DIR)/test_define.v; \
262
                echo "\`define TEST_RESULTS_DIR \"$(SIM_RESULTS_DIR)/\" " >> $(SIM_RUN_DIR)/test_define.v; \
263 39 julius
                if [ -z $$NO_SIM_LOGGING ]; then \
264
                        echo "\`define OR1200_DISPLAY_ARCH_STATE" >> $(SIM_RUN_DIR)/test_define.v; \
265
                fi; \
266 35 julius
                echo ; \
267
                echo "\t#### Beginning simulation ####"; \
268 36 julius
                time -p ncverilog -f $(SIM_RUN_DIR)/$(ICARUS_COMMAND_FILE).generated -Q -l $(SIM_RESULTS_DIR)/$$TEST-ius-out.log $(RTL_SIM_FLAGS); \
269
                if [ $$? -gt 0 ]; then exit $$?; fi; \
270
                TEST_RESULT=`cat $(SIM_RESULTS_DIR)/$$TEST-general.log | grep report | grep $(SIM_SUCCESS_MESSAGE) -c`; \
271 35 julius
                echo; echo "\t####"; \
272
                if [ $$TEST_RESULT -gt 0 ]; then \
273
                        echo "\t#### Test $$TEST PASSED ####";\
274
                else    echo "\t#### Test $$TEST FAILED ####";\
275
                fi; \
276
                echo "\t####"; echo; \
277
        done
278 33 julius
 
279
 
280 41 julius
 
281 52 julius
################################################################################
282
# Verilator model build rules
283
################################################################################
284 48 julius
 
285 52 julius
 
286
 
287
 
288
# List of System C models - use this list to link the sources into the Verilator
289 50 julius
# build directory
290 48 julius
SYSC_MODELS=OrpsocAccess TraceSC
291
 
292 52 julius
# Only need the trace target if we are tracing
293
ifneq (,$(findstring -trace, $(VLT_FLAGS)))
294
VLT_TRACEOBJ = SpTraceVcdC
295
endif
296
 
297 50 julius
# This is the list of extra models we'll issue make commands for
298
# Included is the SystemPerl trace model
299 52 julius
SYSC_MODELS_BUILD=$(SYSC_MODELS) $(VLT_TRACEOBJ)
300 50 julius
 
301 52 julius
prepare_vlt: prepare_rtl vlt_model_links $(SIM_VLT_DIR)/Vorpsoc_top
302
 
303
$(SIM_VLT_DIR)/Vorpsoc_top: $(SIM_VLT_DIR)/libVorpsoc_top.a $(SIM_VLT_DIR)/OrpsocMain.o
304
# Final linking of the simulation executable. Order of libraries here is important!
305
        @echo; echo "\tGenerating simulation executable"; echo
306
        cd $(SIM_VLT_DIR) && g++ -I$(BENCH_SYSC_INCLUDE_DIR) -I$(SIM_VLT_DIR) -I$(VERILATOR_ROOT)/include -I$(SYSTEMC)/include -o Vorpsoc_top -L. -L$(BENCH_SYSC_SRC_DIR) -L$(SYSTEMC)/lib-linux64 OrpsocMain.o -lVorpsoc_top -lmodules -lsystemc
307
 
308
$(SIM_VLT_DIR)/OrpsocMain.o:
309
# Now compile the top level systemC "testbench" module
310
        @echo; echo "\tCompiling top level SystemC testbench"; echo
311 48 julius
        cd $(SIM_VLT_DIR) && g++ -I$(BENCH_SYSC_INCLUDE_DIR) -I$(SIM_VLT_DIR) -I$(VERILATOR_ROOT)/include -I$(SYSTEMC)/include -c $(BENCH_SYSC_SRC_DIR)/OrpsocMain.cpp
312 52 julius
 
313
$(SIM_VLT_DIR)/libVorpsoc_top.a: $(SIM_VLT_DIR)/Vorpsoc_top__ALL.a vlt_modules_compile $(SIM_VLT_DIR)/verilated.o
314 48 julius
# Now archive all of the libraries from verilator witht he other modules we might have
315 52 julius
        @echo; echo "\tArchiving libraries into libVorpsoc_top.a"; echo
316
        @cd $(SIM_VLT_DIR) && \
317 48 julius
        cp Vorpsoc_top__ALL.a libVorpsoc_top.a && \
318
        ar rcs libVorpsoc_top.a verilated.o; \
319 50 julius
        for SYSCMODEL in $(SYSC_MODELS_BUILD); do \
320 48 julius
                ar rcs libVorpsoc_top.a $$SYSCMODEL.o; \
321
        done
322 41 julius
 
323 52 julius
$(SIM_VLT_DIR)/verilated.o:
324
        @echo; echo "\tCompiling verilated.o"; echo
325
        @cd $(SIM_VLT_DIR) && \
326
        $(MAKE) -f Vorpsoc_top.mk verilated.o
327 41 julius
 
328 52 julius
.PHONY: vlt_modules_compile
329
vlt_modules_compile:
330
# Compile the module files
331
        @echo; echo "\tCompiling SystemC models"
332
        @cd $(SIM_VLT_DIR) && \
333
        for SYSCMODEL in $(SYSC_MODELS_BUILD); do \
334
                echo;echo "\t$$SYSCMODEL"; echo; \
335
                $(MAKE) -f Vorpsoc_top.mk $$SYSCMODEL.o; \
336
        done
337
 
338
$(SIM_VLT_DIR)/Vorpsoc_top__ALL.a: $(SIM_VLT_DIR)/Vorpsoc_top.mk
339
        @echo; echo "\tCompiling main design"; echo
340
        @cd $(SIM_VLT_DIR) && \
341
        $(MAKE) -f Vorpsoc_top.mk Vorpsoc_top__ALL.a
342
 
343
$(SIM_VLT_DIR)/Vorpsoc_top.mk: $(SIM_VLT_DIR)/$(VLT_COMMAND_FILE).generated $(SIM_VLT_DIR)/libmodules.a
344
# Now call verilator to generate the .mk files
345
        @echo; echo "\tCalling verilator"; echo
346
        cd $(SIM_VLT_DIR) && \
347
        verilator -language 1364-2001 -Wno-lint --top-module orpsoc_top -Mdir . -sc $(VLT_FLAGS) -I$(BENCH_SYSC_INCLUDE_DIR) -I$(BENCH_SYSC_SRC_DIR) -f $(VLT_COMMAND_FILE).generated
348
 
349 47 julius
# SystemC modules library
350
$(SIM_VLT_DIR)/libmodules.a:
351 52 julius
        @echo; echo "\tCompiling SystemC modules"; echo
352
        @$(MAKE) -C $(BENCH_SYSC_SRC_DIR) -f $(BENCH_SYSC_SRC_DIR)/Modules.make
353 47 julius
 
354 52 julius
 
355
# Verilator command script
356
# Generate the compile script to give Verilator
357
$(SIM_VLT_DIR)/$(VLT_COMMAND_FILE).generated:
358
        @echo; echo "\tGenerating verilator compile script"; echo
359
        @sed < $(SIM_BIN_DIR)/$(VLT_COMMAND_FILE) > $(SIM_VLT_DIR)/$(VLT_COMMAND_FILE).generated \
360
                -e s!\$$BENCH_DIR!$(BENCH_VERILOG_DIR)!              \
361
                -e s!\$$RTL_DIR!$(RTL_VERILOG_DIR)!                  \
362
                -e s!\$$BACKEND_DIR!$(BACKEND_DIR)!                  \
363
                -e \\!^//.*\$$!d -e \\!^\$$!d;
364
 
365
.PHONY: vlt_model_links
366
vlt_model_links:
367
# Link all the required system C model files into the verilator work dir
368
        @echo; echo "\tLinking SystemC model source to verilator build path"; echo
369
        @if [ ! -d $(SIM_VLT_DIR) ]; then mkdir $(SIM_VLT_DIR); fi
370
        @cd $(SIM_VLT_DIR) && \
371
        for SYSCMODEL in $(SYSC_MODELS); do \
372
                if [ ! -e $$SYSCMODEL.cpp ]; then \
373
                        ln -s $(BENCH_SYSC_SRC_DIR)/$$SYSCMODEL.cpp .; \
374
                        ln -s $(BENCH_SYSC_INCLUDE_DIR)/$$SYSCMODEL.h .; \
375
                fi; \
376
        done
377
 
378
################################################################################
379
# Cleaning rules
380
################################################################################
381
 
382 22 julius
clean-sw:
383
        @for TEST in $(TESTS); do \
384
                echo "Current test: $$TEST"; \
385
                CURRENT_TEST_SW_DIR=$(SW_DIR)/`echo $$TEST | cut -d "-" -f 1`; \
386
                echo "Current test sw directory: " $$CURRENT_TEST_SW_DIR; \
387
                $(MAKE) -C $$CURRENT_TEST_SW_DIR clean; \
388
        done
389 31 julius
        $(MAKE) -C $(SW_DIR)/support clean
390
        $(MAKE) -C $(SW_DIR)/utils clean
391
 
392
clean-sim:
393 52 julius
        rm -rf $(SIM_RESULTS_DIR) $(SIM_RUN_DIR)/*.* $(SIM_VLT_DIR)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.