blob: a25bc69ddccc0e17201704bfa073ebed9f72295b [file] [log] [blame]
dineshannayya00438892022-03-12 22:36:37 +05301# SPDX-FileCopyrightText: 2020 Efabless Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# SPDX-License-Identifier: Apache-2.0
16
dineshannayya00438892022-03-12 22:36:37 +053017
dineshannayyad8a093b2022-03-26 08:32:19 +053018# ---- Include Partitioned Makefiles ----
dineshannayya00438892022-03-12 22:36:37 +053019
dineshannayyad8a093b2022-03-26 08:32:19 +053020CONFIG = caravel_user_project
21
22#######################################################################
23## Caravel Verilog for Integration Tests
24#######################################################################
dineshannayya00438892022-03-12 22:36:37 +053025
dineshannayyad8a093b2022-03-26 08:32:19 +053026DESIGNS?=../../..
27
28export USER_PROJECT_VERILOG ?= $(DESIGNS)/verilog
dineshannayya00438892022-03-12 22:36:37 +053029## YIFIVE FIRMWARE
dineshannayyad8a093b2022-03-26 08:32:19 +053030YIFIVE_FIRMWARE_PATH = $(USER_PROJECT_VERILOG)/dv/firmware
dineshannayya00438892022-03-12 22:36:37 +053031GCC64_PREFIX?=riscv64-unknown-elf
32
dineshannayya00438892022-03-12 22:36:37 +053033
34## Simulation mode: RTL/GL
35SIM?=RTL
36DUMP?=OFF
37RISC_CORE?=0
38
dineshannayyad8a093b2022-03-26 08:32:19 +053039### To Enable IVERILOG FST DUMP
40export IVERILOG_DUMPER = fst
41
42
dineshannayya00438892022-03-12 22:36:37 +053043.SUFFIXES:
44
45PATTERN = user_usb
46
47all: ${PATTERN:=.vcd}
48
49
50vvp: ${PATTERN:=.vvp}
51
52%.vvp: %_tb.v
53ifeq ($(SIM),RTL)
54 ifeq ($(DUMP),OFF)
dineshannayyad8a093b2022-03-26 08:32:19 +053055 iverilog -g2012 -DFUNCTIONAL -DSIM -I $(PDK_PATH) \
56 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya00438892022-03-12 22:36:37 +053057 $< -o $@
58 else
dineshannayyad8a093b2022-03-26 08:32:19 +053059 iverilog -g2012 -DWFDUMP -DFUNCTIONAL -DSIM -I $(PDK_PATH) \
60 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya00438892022-03-12 22:36:37 +053061 $< -o $@
62 endif
63else
dineshannayyad8a093b2022-03-26 08:32:19 +053064 iverilog -g2012 -DFUNCTIONAL -DSIM -DGL -I $(PDK_PATH) \
65 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya00438892022-03-12 22:36:37 +053066 $< -o $@
67endif
68
69%.vcd: %.vvp
70 vvp $<
71
dineshannayya00438892022-03-12 22:36:37 +053072
73# ---- Clean ----
74
75clean:
76 rm -f *.vvp *.vcd *.log *.fst
77
78.PHONY: clean hex all