-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
185 lines (147 loc) · 6.69 KB
/
Copy pathMakefile
File metadata and controls
185 lines (147 loc) · 6.69 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#**********************************************************************#
# AsteRISC #
#**********************************************************************#
#
# Copyright (C) 2022 Jonathan Saussereau
#
# This file is part of AsteRISC.
# AsteRISC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# AsteRISC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with AsteRISC. If not, see <https://www.gnu.org/licenses/>.
#
########################################################
# Paths
########################################################
DHRYSTONE_WORK = work/simulations
########################################################
# Files
########################################################
VENV_ACTIVATE_SCRIPT = activate.sh
DHRYSTONE_SETTINGS = odatix_userconfig/simulations/_run_dhrystone_settings.yml
USER_PROGRAM_SETTINGS = odatix_userconfig/simulations/_run_user_program_settings.yml
########################################################
# Commands
########################################################
VENV_ACTIVATE = source $(VENV_ACTIVATE_SCRIPT)
########################################################
# Text formatting
########################################################
_BOLD =\033[1m
_END =\033[0m
_RED =\033[31m
_BLUE =\033[34m
_CYAN =\033[36m
_YELLOW =\033[33m
_GREEN =\033[32m
_WHITE =\033[37m
_GREY =\033[90m
_BLACK =\033[30m
########################################################
# General rules
########################################################
.PHONY: help
help: motd
@printf "SIMULATION\n"
@printf "\t$(_BOLD)make sim$(_END): run simulations\n"
@printf "\t$(_BOLD)make benchmarks$(_END): run benchmark simulations\n"
@printf "SYNTHESIS\n"
@printf "\t$(_BOLD)make vivado$(_END): run synthesis + place&route in Vivado\n"
@printf "\t$(_BOLD)make dc$(_END): run synthesis + place&route in Design Compiler\n"
@printf "DATA EXPORT\n"
@printf "\t$(_BOLD)make results$(_END): export synthesis results\n"
@printf "\t$(_BOLD)make results_vivado$(_END): export Vivado synthesis results\n"
@printf "\t$(_BOLD)make results_dc$(_END): export Design Compiler synthesis results\n"
@printf "DATA EXPLORATION\n"
@printf "\t$(_BOLD)make explore$(_END): explore results in a web app (localhost only)\n"
@printf "\t$(_BOLD)make explore_network$(_END): explore results in a web app (network-accessible)\n"
@printf "OTHERS\n"
@printf "\t$(_BOLD)make help$(_END): display a list of useful commands\n"
.PHONY: motd
motd:
@printf "$(_BLUE)$(_WHITE)5555555$(_YELLOW)555555555555$(_WHITE)$(_BLUE) $(_YELLOW) _____ _______ ______ _____ _____ _____ _____ \n"
@printf "$(_BLUE)$(_WHITE)555555555$(_YELLOW)5555555555$(_WHITE)$(_BLUE) $(_YELLOW) /\ / ____|__ __| ____| __ \|_ _|/ ____|/ ____|\n"
@printf "$(_BLUE)5555555$(_WHITE)555$(_YELLOW)555555555$(_WHITE)$(_BLUE) $(_YELLOW) / \ | (___ | | | |__ | |__) | | | | (___ | | \n"
@printf "$(_BLUE)5555555$(_WHITE)555$(_YELLOW)55555555$(_WHITE)5$(_BLUE) $(_YELLOW) / /\ \ \___ \ | | | __| | _ / | | \___ \| | \n"
@printf "$(_BLUE)555555$(_WHITE)555$(_YELLOW)55555555$(_WHITE)55$(_BLUE) $(_YELLOW) / ____ \ ____) | | | | |____| | \ \ _| |_ ____) | |____ \n"
@printf "$(_BLUE)5$(_WHITE)5555555$(_YELLOW)55555555$(_WHITE)555$(_BLUE) $(_YELLOW) /_/ \_\_____/ |_| |______|_| \_\_____|_____/ \_____|\n"
@printf "$(_BLUE)55$(_WHITE)5555$(_YELLOW)55555555$(_WHITE)5555$(_BLUE)5\n"
@printf "$(_BLUE)5555$(_WHITE)5555$(_YELLOW)55555$(_WHITE)5555$(_BLUE)55 $(_BOLD)A Flexible RISC-V Processor Core$(_END)\n"
@printf "$(_BLUE)55555$(_WHITE)5555$(_YELLOW)55$(_WHITE)5555$(_BLUE)5555 $(_BOLD)For Design Space Exploration$(_END)\n"
@printf "$(_BLUE)5555555$(_WHITE)5555$(_YELLOW)$(_WHITE)555$(_BLUE)55555\n$(_END)"
@printf "\n"
.PHONY: clean
clean:
@$/bin/bash -c '$(VENV_ACTIVATE); odatix clean --nobanner'
########################################################
# Simulation
########################################################
.PHONY: sim
sim: motd
@/bin/bash -c '$(VENV_ACTIVATE); odatix sim -i $(USER_PROGRAM_SETTINGS) --nobanner'
.PHONY: benchmarks
benchmarks: motd benchmarks_only results_benchmarks
.PHONY: benchmarks_only
benchmarks_only:
@/bin/bash -c '$(VENV_ACTIVATE); odatix sim -i $(DHRYSTONE_SETTINGS) --nobanner'
.PHONY: results_benchmarks
results_benchmarks:
@/bin/bash -c '$(VENV_ACTIVATE); odatix res_benchmark --work $(DHRYSTONE_WORK) --nobanner'
########################################################
# Vivado
########################################################
.PHONY: vivado
vivado: motd run_vivado clean_vivado
.PHONY: run_vivado
run_vivado:
@/bin/bash -c '$(VENV_ACTIVATE); odatix fmax --tool vivado --nobanner'
.PHONY: results_vivado
results_vivado:
@/bin/bash -c '$(VENV_ACTIVATE); odatix res_synth --tool vivado --nobanner'
.PHONY: clean_vivado
clean_vivado:
@/bin/bash -c '$(VENV_ACTIVATE); odatix clean --quiet --nobanner'
########################################################
# Design Compiler
########################################################
.PHONY: dc
dc: motd
@/bin/bash -c '$(VENV_ACTIVATE); odatix fmax --tool design_compiler --nobanner'
.PHONY: results_dc
results_dc:
@/bin/bash -c '$(VENV_ACTIVATE); odatix res_synth --tool design_compiler --nobanner'
.PHONY: clean_dc
clean_dc:
@/bin/bash -c '$(VENV_ACTIVATE); odatix clean --quiet --nobanner'
########################################################
# Firmware
########################################################
.PHONY: firmware
firmware:
@+$(MAKE) -C AsteRISC-firmware/firmware --no-print-directory
.PHONY: new
new:
@+$(MAKE) -C AsteRISC-firmware/firmware $@ --no-print-directory
.PHONY: delete
delete:
@+$(MAKE) -C AsteRISC-firmware/firmware $@ --no-print-directory
.PHONY: del
del: delete
########################################################
# Generic
########################################################
# export results
.PHONY: results
results: results_benchmarks results_vivado
# explore results
.PHONY: explore
explore:
@/bin/bash -c '$(VENV_ACTIVATE); odatix-explorer'