# Amazon FPGA Hardware Development Kit # # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.amazon.com/asl/ # # or in the "license" file accompanying this file. This file is distributed on # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or # implied. See the License for the specific language governing permissions and # limitations under the License. ################################################################## ## Makefile For Questa compiles and simulations ## Step to run : ## 1. make create_libs QUESTA=1 -> To generate xilinx compile ## libraries. This is a one time step ## 2. make all QUESTA=1 -> Runs the test ################################################################## LIBLISTS = $(COMMON_LIBLISTS) LIBLISTS_ARGS = $(shell echo " $(strip $(LIBLISTS))" | sed 's|\ | -L |g') compile: $(COMPLIB_DIR) mkdir -p $(SIM_DIR) cd ${SIM_DIR} && ln -s -f ../questa_complib/modelsim.ini cd $(SIM_DIR) && vlog $(C_FILES) -ccflags "-I$(C_SDK_USR_INC_DIR)" -ccflags "-I$(C_SDK_USR_UTILS_DIR)" -ccflags "-I$(C_COMMON_DIR)/include" -ccflags "-I$(C_COMMON_DIR)/src" -ccflags "-DSV_TEST" -ccflags "-DSCOPE" -ccflags "-DQUESTA_SIM" -ccflags "-DINT_MAIN" -ccflags "-I$(C_INC_DIR)" cd $(SIM_DIR) && vlog -mfcu -sv -64 -timescale 1ps/1ps -93 -L $(COMPLIB_DIR)/unisims_ver -L $(COMPLIB_DIR)/unimacro_ver -L $(COMPLIB_DIR)/secureip -f $(SCRIPTS_DIR)/top.$(SIMULATOR).f run: ifeq ($(TEST),test_null) cd $(SIM_DIR) && vsim -c -voptargs="+acc" -64 -t ps -sv_seed random $(LIBLISTS_ARGS) -l $(C_TEST).log -do "run -all; quit -f" tb glbl $(TEST) else cd $(SIM_DIR) && vsim -c -voptargs="+acc" -64 -t ps -sv_seed random $(LIBLISTS_ARGS) -l $(TEST).log -do "run -all; quit -f" tb glbl $(TEST) endif $(COMPLIB_DIR): cd $(SIM_ROOT)/.. && echo "compile_simlib -language all -dir $(COMPLIB_DIR) -simulator $(SIMULATOR) -no_systemc_compile -library all -family all" > create_libs.tcl cd $(SIM_ROOT)/.. && vivado -mode batch -source create_libs.tcl cd $(SIM_ROOT)/.. && rm -rf create_libs.tcl