-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
133 lines (106 loc) · 3.18 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
######################################
#
# RTS Makefile
#
######################################
# Copyright 2021, 2022, 2023 Galois, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
######################################
# General Config
######################################
# Which platform: Posix or RV32_bare_metal
PLATFORM ?= Posix
######################################
# Config for Posix only:
######################################
# Parallel: pthread-based implementation to simulate the concurrency SoC
# Sequential: a single-threaded implementation
EXECUTION ?= Parallel
# Should hardware be simulated?
# Use Verilator to simulate hardware implemented modules
HW ?= Simulated
# Should sensors be simulated?
SENSORS ?= NotSimulated
######################################
# Config for RV32_bare_metal only
######################################
# Virtual or LFE5UM5G_85F_EVN
DEV_BOARD ?= Virtual
######################################
#
# Posix definitions
#
######################################
$(info Choosing plaform $(PLATFORM))
ifeq ($(PLATFORM),Posix)
rts:
mkdir -p src/generated/SystemVerilog
mkdir -p src/generated/C
make -C src clean
SENSORS=$(SENSORS) SELF_TEST=Enabled make -C src rts
mv src/rts src/rts.self_test
make -C src clean
SENSORS=$(SENSORS) SELF_TEST=Disabled make -C src rts
mv src/rts src/rts.no_self_test
src_clean:
make -C src clean
else # Not PLATFORM=posix
######################################
#
# RV32_bare_metal definitions
#
######################################
ifeq ($(PLATFORM),RV32_bare_metal)
fw_only:
PROG=main make -C hardware/SoC/firmware
fw_clean:
PROG=main make -C hardware/SoC/firmware clean
src_clean:
PROG=main make -C hardware/SoC/ clean
$(info Choosing dev board $(DEV_BOARD))
ifeq ($(DEV_BOARD),Virtual)
rts:
PROG=main make -C hardware/SoC/ verilator
else # DEV_BOARD = LFE5UM5G_85F_EVN ?
ifeq ($(DEV_BOARD),LFE5UM5G_85F_EVN)
# Core freq with 12MHz clock in
# Since we have 5 CPU states, it should be 12MHZ/5 = 2400000
CORE_FREQ=2400000
rts:
CORE_FREQ=$(CORE_FREQ) PROG=main make -C hardware/SoC/ design.svf
else
$(info Unsupported dev board!)
endif
endif # DEV_BOARD = Virtual ?
else # Not PLATFORM=RV32_bare_metal
$(info Unsupported platform!)
endif # PLATFORM=RV32_bare_metal ?
endif # PLATFORM=posix ?
#
# Documentation
#
docs: README.pdf Assurance.pdf Toolchain.pdf
README.pdf: README.md
pandoc -o README.pdf README.md
Assurance.pdf: Assurance.md
pandoc -o Assurance.pdf Assurance.md
Toolchain.pdf: Toolchain.md
pandoc -o Toolchain.pdf Toolchain.md
clean: src_clean doc_clean
doc_clean:
rm -f README.pdf Assurance.pdf Toolchain.pdf
.PHONY: rts all clean src_clean fw_clean doc_clean docs
check:
make -C models
make -C saw