-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from ucb-bar/firesim-multiclock
[RFC] Initial multiclock support in token channels & synthesizable unit tests
- Loading branch information
Showing
11 changed files
with
884 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# VCS RTL Simulation Makefrag | ||
# | ||
# This makefrag stores common recipes for building RTL simulators with VCS | ||
# | ||
# Compulsory variables: | ||
# All those described Makefrag-verilator | ||
# vcs_wrapper_v: An additional verilog wrapper around the DUT not used in verilator | ||
# CLOCK_PERIOD: Self explanatory | ||
# TB := The top level module on which the stop and printf conditions are defined | ||
# | ||
|
||
VCS ?= vcs -full64 | ||
override VCS_FLAGS := -quiet -timescale=1ns/1ps +v2k +rad +vcs+initreg+random +vcs+lic+wait \ | ||
-notice -line +lint=all,noVCDE,noONGS,noUI -quiet -debug_pp +no_notifier -cpp $(CXX) \ | ||
-Mdir=$(GEN_DIR)/$(DESIGN)-debug.csrc \ | ||
+vc+list \ | ||
-CFLAGS "$(CXXFLAGS) $(CFLAGS) -DVCS -I$(VCS_HOME)/include" \ | ||
-LDFLAGS "$(LDFLAGS)" \ | ||
-sverilog \ | ||
+define+CLOCK_PERIOD=$(CLOCK_PERIOD) \ | ||
+define+RANDOMIZE_MEM_INIT \ | ||
+define+RANDOMIZE_REG_INIT \ | ||
+define+RANDOMIZE_GARBAGE_ASSIGN \ | ||
+define+RANDOMIZE_INVALID_ASSIGN \ | ||
+define+STOP_COND=!$(TB).reset \ | ||
+define+PRINTF_COND=!$(TB).reset \ | ||
$(VCS_FLAGS) | ||
|
||
vcs_v := $(emul_v) $(vcs_wrapper_v) | ||
|
||
$(OUT_DIR)/$(DESIGN): $(vcs_v) $(emul_cc) $(emul_h) | ||
mkdir -p $(OUT_DIR) | ||
rm -rf $(GEN_DIR)/$(DESIGN).csrc | ||
rm -rf $(OUT_DIR)/$(DESIGN).daidir | ||
$(VCS) $(VCS_FLAGS) \ | ||
-o $@ $(vcs_v) $(emul_cc) | ||
|
||
$(OUT_DIR)/$(DESIGN)-debug: $(vcs_v) $(emul_cc) $(emul_h) | ||
mkdir -p $(OUT_DIR) | ||
rm -rf $(GEN_DIR)/$(DESIGN)-debug.csrc | ||
rm -rf $(OUT_DIR)/$(DESIGN)-debug.daidir | ||
$(VCS) $(VCS_FLAGS) +define+DEBUG \ | ||
-o $@ $(vcs_v) $(emul_cc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Verilator RTL Simulation Makefrag | ||
# | ||
# This makefrag stores common recipes for building RTL simulators with Verilator | ||
# | ||
# Compulsory variables: | ||
# OUT_DIR: See Makefile | ||
# GEN_DIR: See Makefile | ||
# DESIGN: See Makefile | ||
# emul_cc: C++ sources | ||
# emul_h: C++ headers | ||
# emul_v: verilog sources and headers | ||
# | ||
# Verilator Only: | ||
# top_module: The top of the DUT | ||
|
||
VERILATOR ?= verilator --cc --exe | ||
override VERILATOR_FLAGS := --assert -Wno-STMTDLY -O3 \ | ||
-CFLAGS "$(CXXFLAGS) $(CFLAGS)" \ | ||
-LDFLAGS "$(LDFLAGS) " \ | ||
$(VERILATOR_FLAGS) | ||
|
||
$(OUT_DIR)/V$(DESIGN): $(emul_v) $(emul_cc) $(emul_h) | ||
mkdir -p $(OUT_DIR) | ||
rm -rf $(GEN_DIR)/V$(DESIGN).csrc | ||
$(VERILATOR) $(VERILATOR_FLAGS) --top-module $(top_module) -Mdir $(GEN_DIR)/V$(DESIGN).csrc \ | ||
-CFLAGS "-include $(GEN_DIR)/V$(DESIGN).csrc/V$(top_module).h" \ | ||
-o $@ $(emul_v) $(emul_cc) | ||
$(MAKE) -C $(GEN_DIR)/V$(DESIGN).csrc -f V$(top_module).mk | ||
|
||
$(OUT_DIR)/V$(DESIGN)-debug: $(emul_v) $(emul_cc) $(emul_h) | ||
mkdir -p $(OUT_DIR) | ||
rm -rf $(GEN_DIR)/V$(DESIGN)-debug.csrc | ||
$(VERILATOR) $(VERILATOR_FLAGS) --trace --top-module $(top_module) -Mdir $(GEN_DIR)/V$(DESIGN)-debug.csrc \ | ||
-CFLAGS "-include $(GEN_DIR)/V$(DESIGN)-debug.csrc/V$(top_module).h" \ | ||
-o $@ $(emul_v) $(emul_cc) | ||
$(MAKE) -C $(GEN_DIR)/V$(DESIGN)-debug.csrc -f V$(top_module).mk |
Oops, something went wrong.