forked from chipsalliance/i3c-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mk
67 lines (55 loc) · 1.94 KB
/
common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# SPDX-License-Identifier: Apache-2.0
TOPLEVEL_LANG = verilog
SIM ?= verilator
WAVES ?= 1
# Paths
CURDIR = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
I3C_ROOT := $(abspath $(CURDIR)/../..)
CFGDIR :=
CONFIG :=
$(info From common.mk, CURDIR is $(CURDIR))
# Set pythonpath so that tests can access common modules
export PYTHONPATH := $(PYTHONPATH):$(CURDIR)/common
# Common sources
COMMON_SOURCES = \
$(CALIPTRA_ROOT)/src/caliptra_prim/rtl/caliptra_prim_assert.sv \
$(CALIPTRA_ROOT)/src/caliptra_prim/rtl/caliptra_prim_pkg.sv \
$(CALIPTRA_ROOT)/src/caliptra_prim_generic/rtl/caliptra_prim_generic_flop.sv \
$(CALIPTRA_ROOT)/src/caliptra_prim/rtl/caliptra_prim_flop.sv \
$(CALIPTRA_ROOT)/src/caliptra_prim/rtl/caliptra_prim_flop_2sync.sv
VERILOG_INCLUDE_DIRS= \
$(CALIPTRA_ROOT)/src/libs/rtl \
$(CALIPTRA_ROOT)/src/caliptra_prim/rtl \
$(I3C_ROOT)/src \
$(I3C_ROOT)/src/libs/axi
$(info VERILOG_SOURCES = $(VERILOG_SOURCES))
VERILOG_SOURCES := $(COMMON_SOURCES) $(VERILOG_SOURCES)
$(info VERILOG_SOURCES = $(VERILOG_SOURCES))
# Coverage reporting
COVERAGE_TYPE ?=
ifeq ("$(COVERAGE_TYPE)", "all")
VERILATOR_COVERAGE = --coverage
else ifeq ("$(COVERAGE_TYPE)", "branch")
VERILATOR_COVERAGE = --coverage-line
else ifeq ("$(COVERAGE_TYPE)", "toggle")
VERILATOR_COVERAGE = --coverage-toggle
else ifeq ("$(COVERAGE_TYPE)", "functional")
VERILATOR_COVERAGE = --coverage-user
else
VERILATOR_COVERAGE = ""
endif
# Enable processing of #delay statements
ifeq ($(SIM), verilator)
COMPILE_ARGS += --timing
COMPILE_ARGS += -Wall -Wno-fatal
EXTRA_ARGS += --trace --trace-structs
EXTRA_ARGS += $(VERILATOR_COVERAGE)
EXTRA_ARGS += -Wno-DECLFILENAME -Wno-TIMESCALEMOD
endif
COCOTB_HDL_TIMEUNIT = 1ns
COCOTB_HDL_TIMEPRECISION = 10ps
# Build directory
ifneq ($(COVERAGE_TYPE),)
SIM_BUILD := sim-build-$(COVERAGE_TYPE)
endif
include $(shell cocotb-config --makefiles)/Makefile.sim