rename makefiles | move verilog rule to common.mk

This commit is contained in:
abejgonzalez
2019-03-08 16:47:27 -08:00
parent 82273107c1
commit 2c246af110
5 changed files with 14 additions and 61 deletions

View File

@@ -78,6 +78,12 @@ $(HARNESS_FILE): $(FIRRTL_FILE) $(ANNO_FILE) $(TAPEOUT_JAR)
$(SMEMS_FILE): $(SMEMS_CONF) $(MACROCOMPILER_JAR)
$(MACROCOMPILER) barstools.macros.MacroCompiler -n $(SMEMS_CONF) -v $(SMEMS_FILE) --mode synflops
#########################################################################################
# helper rule to just make verilog files
#########################################################################################
.PHONY: verilog
verilog: $(sim_vsrcs)
#########################################################################################
# run assembly/benchmarks rules
#########################################################################################

View File

@@ -11,7 +11,7 @@ sim_dir=$(abspath .)
#########################################################################################
# include shared variables
#########################################################################################
include $(base_dir)/Makefrag-Variables
include $(base_dir)/variables.mk
#########################################################################################
# name of simulator (used to generate *.f arguments file)
@@ -32,8 +32,8 @@ debug: $(sim_debug)
#########################################################################################
# import other necessary rules and variables
#########################################################################################
include $(base_dir)/Makefrag
include $(sim_dir)/Makefrag-Verilator
include $(base_dir)/common.mk
include $(sim_dir)/verilator.mk
#########################################################################################
# verilator build paths and file names

View File

@@ -1,47 +0,0 @@
#########################################################################################
# verilator installation makefrag
#########################################################################################
#########################################################################################
# verilator version, binary, and path
#########################################################################################
VERILATOR_VERSION=4.008
VERILATOR_SRCDIR=verilator/src/verilator-$(VERILATOR_VERSION)
INSTALLED_VERILATOR=$(abspath verilator/install/bin/verilator)
#########################################################################################
# build and install our own verilator to work around versioning issues
#########################################################################################
$(INSTALLED_VERILATOR): $(VERILATOR_SRCDIR)/bin/verilator
$(MAKE) -C $(VERILATOR_SRCDIR) installbin installdata
touch $@
$(VERILATOR_SRCDIR)/bin/verilator: $(VERILATOR_SRCDIR)/Makefile
$(MAKE) -C $(VERILATOR_SRCDIR) verilator_bin
touch $@
$(VERILATOR_SRCDIR)/Makefile: $(VERILATOR_SRCDIR)/configure
mkdir -p $(dir $@)
cd $(dir $@) && ./configure --prefix=$(abspath verilator/install)
$(VERILATOR_SRCDIR)/configure: verilator/verilator-$(VERILATOR_VERSION).tar.gz
rm -rf $(dir $@)
mkdir -p $(dir $@)
cat $^ | tar -xz --strip-components=1 -C $(dir $@)
touch $@
verilator/verilator-$(VERILATOR_VERSION).tar.gz:
mkdir -p $(dir $@)
wget http://www.veripool.org/ftp/verilator-$(VERILATOR_VERSION).tgz -O $@
#########################################################################################
# verilator binary and flags
#########################################################################################
VERILATOR := $(INSTALLED_VERILATOR) --cc --exe
CXXFLAGS := $(CXXFLAGS) -O1 -std=c++11 -I$(RISCV)/include -D__STDC_FORMAT_MACROS
VERILATOR_FLAGS := --top-module $(MODEL) \
+define+PRINTF_COND=\$$c\(\"verbose\",\"\&\&\"\,\"done_reset\"\) \
+define+STOP_COND=\$$c\(\"done_reset\"\) --assert \
--output-split 20000 \
-Wno-STMTDLY --x-assign unique \
-O3 -CFLAGS "$(CXXFLAGS) -DTEST_HARNESS=V$(MODEL) -DVERILATOR"

View File

@@ -11,7 +11,7 @@ sim_dir=$(abspath .)
#########################################################################################
# include shared variables
#########################################################################################
include $(base_dir)/Makefrag-Variables
include $(base_dir)/variables.mk
#########################################################################################
# name of simulator (used to generate *.f arguments file)
@@ -32,7 +32,7 @@ debug: $(sim_debug)
#########################################################################################
# import other necessary rules and variables
#########################################################################################
include $(base_dir)/Makefrag
include $(base_dir)/common.mk
#########################################################################################
# vcs binary and arguments
@@ -71,12 +71,6 @@ VCS_NONCC_OPTS = \
VCS_OPTS = -notice -line $(VCS_CC_OPTS) $(VCS_NONCC_OPTS)
#########################################################################################
# helper rule to just make verilog files
#########################################################################################
.PHONY: verilog
verilog: $(sim_vsrcs)
#########################################################################################
# vcs simulator rules
#########################################################################################

View File

@@ -6,11 +6,11 @@
# default variables to invoke the generator
# descriptions:
# PROJECT = the scala package to find the MODEL in
# MODEL = the top level module of the project
# MODEL = the top level module of the project (normally the harness)
# CONFIG = the configuration class to give the parameters for the project
# CFG_PROJECT = the scala package to find the CONFIG class
# TB = TODO
# TOP = TODO
# TB = wrapper over the TestHarness needed to simulate in VCS
# TOP = top level module of the project (normally the module instantiated by the harness)
#########################################################################################
PROJECT ?= example
MODEL ?= TestHarness