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

Subversion Repositories spdif_transmitter

[/] [spdif_transmitter/] [trunk/] [testbench/] [makefile] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 ultra_embe
#########################################################
2
# Vars
3
#########################################################
4
SYSTEMC_HOME  ?= /usr/local/systemc-2.3.1
5
 
6
TRACE         ?= 1
7
 
8
DUT_NAME       = spdif
9
RTL_DUT        = ../rtl/spdif.v
10
 
11
#########################################################
12
# Source
13
#########################################################
14
SRC          = $(wildcard *.cpp)
15
 
16
SRC_V        = tb_top.v
17
SRC_V       += $(RTL_DUT)
18
SRC_V       += ../rtl/spdif_core.v
19
 
20
OBJ          = $(patsubst %.cpp,%.o,$(SRC))
21
 
22
VPI_OBJ      = dut
23
 
24
#########################################################
25
# CFLAGS
26
#########################################################
27
INC_PATH  = -I.
28
INC_PATH += -I/usr/include/iverilog
29
INC_PATH += -I$(SYSTEMC_HOME)/include
30
 
31
VINC_PATH = -I. -I../rtl
32
VFLAGS    = -DTRACE=$(TRACE)
33
 
34
CFLAGS    = -c -fpic
35
 
36
LIB_OPT   = $(SYSTEMC_HOME)/lib-linux64/libsystemc.a
37
 
38
EXE       = output.out
39
 
40
#########################################################
41
# Rules
42
#########################################################
43
all: run
44
 
45
%.o : %.cpp
46
        gcc -c $(INC_PATH) $(CFLAGS) $< -o $@
47
 
48
$(VPI_OBJ).vpi: $(OBJ)
49
        g++ -shared -o $(VPI_OBJ).vpi -Wl,--whole-archive $(LIB_OPT) $(OBJ) -Wl,--no-whole-archive
50
 
51
$(EXE) : $(SRC_V)
52
        iverilog -o $(EXE) $(SRC_V) $(VINC_PATH) $(VFLAGS)
53
 
54
run: $(EXE) $(VPI_OBJ).vpi
55
        vvp -M. -m$(VPI_OBJ) $(EXE) -vcd
56
 
57
clean:
58
        rm -rf $(OBJ) dut.vpi *.vcd *.out

powered by: WebSVN 2.1.0

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