-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (38 loc) · 1.37 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
# Copyright (C) 2019 SCARV project <[email protected]>
#
# Use of this source code is restricted per the MIT license, a copy of which
# can be found at https://opensource.org/licenses/MIT (or should be included
# as LICENSE.txt within the associated archive or repository).
BUILD_DIR = ${REPO_HOME}/build
BOARD_DIR = ${REPO_HOME}/board
SRC_DIR = ${REPO_HOME}/src
RTL_DIR = ${REPO_HOME}/rtl
MEM_SIZE = 32768
STACK_SIZE = 4096
RTL = $(wildcard ${RTL_DIR}/*.v)
TESTCASE ?= wide_data
include ${REPO_HOME}/src/$(TESTCASE)/Makefile.in
include ${REPO_HOME}/board/icefun/Makefile.in
include ${REPO_HOME}/board/arty/Makefile.in
include ${REPO_HOME}/board/sakura-x/Makefile.in
## ------------------------------
## linting: verilator
lint:
verilator -I$(RTL_DIR) -Wall --lint-only --top-module soc $(RTL_DIR)/soc.v
icefun: $(BUILD_DIR)/icefun.bin
arty: $(BUILD_DIR)/arty.bit
sakura-x: $(sakura-x-bitstream)
simulate: $(BUILD_DIR)/software.mem
@iverilog -g2012 -D$(TESTCASE) $(ACT) -I $(RTL_DIR) $(RTL) && ./a.out && rm a.out
iver = $(BUILD_DIR)/isim
simlog = $(BUILD_DIR)/simlog
simvcd = $(BUILD_DIR)/simvcd.vcd
simulate-hwdebug: $(BUILD_DIR)/software.mem
@touch $(BUILD_DIR)/software.mem
@iverilog -g2012 -D$(TESTCASE) $(ACT) -I$(RTL_DIR) -o $(iver) -s tb_top $(RTL)
@vvp -l $(simlog) $(iver) +WAVES=$(simvcd)
## ------
## el fin
clean:
@cd $(BUILD_DIR) && rm -f *.*
.PHONY: clean simulate