Skip to content

Commit

Permalink
treewide: Move build flow in situ for each simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
alex96295 committed Jan 24, 2024
1 parent 429560c commit 3b410c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion carfield.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ include $(CAR_ROOT)/bender-safed.mk
######################

CAR_NONFREE_REMOTE ?= [email protected]:carfield/carfield-nonfree.git
CAR_NONFREE_COMMIT ?= d861a3a
CAR_NONFREE_COMMIT ?= f403440

## @section Carfield platform nonfree components
## Clone the non-free verification IP for Carfield. Some components such as CI scripts and ASIC
Expand Down
17 changes: 1 addition & 16 deletions target/sim/sim.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ CAR_VSIM_ALL += $(CAR_VSIM_DIR)/compile.carfield_soc.tcl
.PHONY: car-vsim-sim-init
car-vsim-sim-init: $(CAR_VSIM_ALL)

## Compile Carfield HW using Questasim
car-vsim-sim-build: car-vsim-sim-init
cd $(CAR_VSIM_DIR); $(QUESTA) vsim -c -do "quit -code [source $(CAR_VSIM_DIR)/compile.carfield_soc.tcl]"

.PHONY: car-vsim-sim-clean
## Remove all Questasim simulation build artifacts
car-vsim-sim-clean:
cd $(CAR_VSIM_DIR); rm -rf *.ini trace* *.wlf $(CAR_VSIM_DIR)/transcript $(CAR_VSIM_DIR)/work

#######
# VCS #
#######
Expand All @@ -88,13 +79,7 @@ CAR_XCELIUM_ALL += $(CAR_XCELIUM_ALL)
# TODO

## @section Global targets
.PHONY: car-sim-init car-sim-build car-sim-clean
.PHONY: car-sim-init

## Generate all required VIPs and compilation scripts for all supported simulators
car-sim-init: car-vsim-sim-init

## Compile Carfield HW using all supported simulators
car-sim-build: car-vsim-sim-build

## Remove all simulation build artifacts from all supported simulators
car-sim-clean: car-vsim-sim-clean
13 changes: 13 additions & 0 deletions target/sim/vsim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
QUESTA ?= questa-2023.4
TBENCH ?= tb_carfield_soc

VSIM_ROOT_DIR = $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))

QUESTA_FLAGS := -permissive -suppress 3009 -suppress 8386 -error 7 +UVM_NO_RELNOTES
ifdef DEBUG
VSIM_FLAGS := $(QUESTA_FLAGS)
Expand All @@ -16,6 +18,17 @@ else
RUN_AND_EXIT := run -all; exit
endif

## Compile Carfield HW using Questasim. Run `make car-sim-init` from the root directory to prepare
## the simulation environment before running this command.
.PHONY: car-vsim-sim-build
car-vsim-sim-build: $(VSIM_ROOT_DIR)/compile.carfield_soc.tcl
$(QUESTA) vsim -c -do "quit -code [source $<]"

.PHONY: car-vsim-sim-clean
## Remove all Questasim simulation build artifacts
car-vsim-sim-clean:
rm -rf $(VSIM_ROOT_DIR)/*.ini $(VSIM_ROOT_DIR)/trace* $(VSIM_ROOT_DIR)/*.wlf $(VSIM_ROOT_DIR)/transcript $(VSIM_ROOT_DIR)/work

.PHONY: car-sim-vsim
## Run simulation of the carfield RTL.
## @param HYP_USER_PRELOAD=0 Whether to preload code in the HyperRAM model.
Expand Down

0 comments on commit 3b410c6

Please sign in to comment.