blob: 37feef016400142e45ccefbb60af8468bcd66848 [file] [log] [blame]
dineshannayya62e46322022-02-15 14:19:56 +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
dineshannayya62e46322022-02-15 14:19:56 +053017
dineshannayyad8a093b2022-03-26 08:32:19 +053018# ---- Include Partitioned Makefiles ----
dineshannayya62e46322022-02-15 14:19:56 +053019
dineshannayyad8a093b2022-03-26 08:32:19 +053020CONFIG = caravel_user_project
21
22#######################################################################
23## Caravel Verilog for Integration Tests
24#######################################################################
dineshannayya62e46322022-02-15 14:19:56 +053025
dineshannayyad8a093b2022-03-26 08:32:19 +053026DESIGNS?=../../..
dineshannayya62e46322022-02-15 14:19:56 +053027
dineshannayyad8a093b2022-03-26 08:32:19 +053028export USER_PROJECT_VERILOG ?= $(DESIGNS)/verilog
29
dineshannayya62e46322022-02-15 14:19:56 +053030
31## Simulation mode: RTL/GL
32SIM?=RTL
33DUMP?=OFF
34
dineshannayyad8a093b2022-03-26 08:32:19 +053035### To Enable IVERILOG FST DUMP
36export IVERILOG_DUMPER = fst
37
38
dineshannayya62e46322022-02-15 14:19:56 +053039.SUFFIXES:
40
41PATTERN = user_basic
42
43all: ${PATTERN:=.vcd}
44
45hex: ${PATTERN:=.hex}
46
47vvp: ${PATTERN:=.vvp}
48
49%.vvp: %_tb.v
50ifeq ($(SIM),RTL)
51 ifeq ($(DUMP),OFF)
dineshannayyaa83f3032022-02-22 08:34:37 +053052 iverilog -g2012 -DFUNCTIONAL -DSIM -I $(PDK_PATH) \
dineshannayyad8a093b2022-03-26 08:32:19 +053053 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya62e46322022-02-15 14:19:56 +053054 $< -o $@
55 else
dineshannayyaa83f3032022-02-22 08:34:37 +053056 iverilog -g2012 -DWFDUMP -DFUNCTIONAL -DSIM -I $(PDK_PATH) \
dineshannayyad8a093b2022-03-26 08:32:19 +053057 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya62e46322022-02-15 14:19:56 +053058 $< -o $@
59 endif
60else
dineshannayyaa83f3032022-02-22 08:34:37 +053061 iverilog -g2012 -DFUNCTIONAL -DSIM -DGL -I $(PDK_PATH) \
dineshannayyad8a093b2022-03-26 08:32:19 +053062 -f$(USER_PROJECT_VERILOG)/includes/includes.rtl.$(CONFIG) \
dineshannayya62e46322022-02-15 14:19:56 +053063 $< -o $@
64endif
65
66%.vcd: %.vvp
67 vvp $<
68
dineshannayya62e46322022-02-15 14:19:56 +053069
70# ---- Clean ----
71
72clean:
73 rm -f *.elf *.hex *.bin *.vvp *.vcd *.log *.dump
74
75.PHONY: clean hex all