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

Subversion Repositories spdif_transmitter

[/] [spdif_transmitter/] [trunk/] [testbench/] [makefile] - Rev 3

Compare with Previous | Blame | View Log

#########################################################
# Vars
#########################################################
SYSTEMC_HOME  ?= /usr/local/systemc-2.3.1

TRACE         ?= 1

DUT_NAME       = spdif
RTL_DUT        = ../rtl/spdif.v

#########################################################
# Source
#########################################################
SRC          = $(wildcard *.cpp)

SRC_V        = tb_top.v
SRC_V       += $(RTL_DUT)
SRC_V       += ../rtl/spdif_core.v

OBJ          = $(patsubst %.cpp,%.o,$(SRC)) 

VPI_OBJ      = dut

#########################################################
# CFLAGS
#########################################################
INC_PATH  = -I.
INC_PATH += -I/usr/include/iverilog
INC_PATH += -I$(SYSTEMC_HOME)/include

VINC_PATH = -I. -I../rtl
VFLAGS    = -DTRACE=$(TRACE)

CFLAGS    = -c -fpic

LIB_OPT   = $(SYSTEMC_HOME)/lib-linux64/libsystemc.a

EXE       = output.out

#########################################################
# Rules
#########################################################
all: run

%.o : %.cpp
        gcc -c $(INC_PATH) $(CFLAGS) $< -o $@

$(VPI_OBJ).vpi: $(OBJ) 
        g++ -shared -o $(VPI_OBJ).vpi -Wl,--whole-archive $(LIB_OPT) $(OBJ) -Wl,--no-whole-archive

$(EXE) : $(SRC_V)
        iverilog -o $(EXE) $(SRC_V) $(VINC_PATH) $(VFLAGS)

run: $(EXE) $(VPI_OBJ).vpi
        vvp -M. -m$(VPI_OBJ) $(EXE) -vcd

clean:
        rm -rf $(OBJ) dut.vpi *.vcd *.out

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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