-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefrag-vars
91 lines (78 loc) · 4.5 KB
/
Makefrag-vars
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
#########################################################################################
# makefile variables shared across multiple makefiles
#########################################################################################
#########################################################################################
# variables to invoke the generator
# descriptions:
# MODEL = the top level module of the project in Chisel
# PROJECT = the scala package to find the MODEL in
# CONFIG = the configuration class to give the parameters for the project
# CFG_PRJ = the scala package to find the CONFIG class
# GENERATOR = the Generator used to produce the verilog sources
# TB = wrapper over the TestHarness needed to simulate in a verilog simulator
# TOP = top level module of the project (normally the module instantiated by the harness)
#
#########################################################################################
#########################################################################################
# path to rocket-chip and sifive-blocks
#########################################################################################
ROCKETCHIP_DIR = $(base_dir)/rocket-chip
SIFIVEBLOCKS_DIR = $(base_dir)/sifive-blocks
FIRRTL_DIR = $(ROCKETCHIP_DIR)/firrtl
BOOTROM_DIR = $(base_dir)/bootrom
SDK_DIR = $(base_dir)/freedom-e-sdk
#########################################################################################
# names of various files needed to compile and run things
#########################################################################################
GENERATOR ?= freechips.rocketchip.system.Generator
PROJECT ?= sifive.freedom.e300artydevkit
CFG_PRJ ?= sifive.freedom.e300artydevkit
CONFIG ?= E300ArtyDevKitConfig
MODEL ?= E300ArtyDevKitPlatform
TOP ?= E300ArtyDevKitChip
TB ?= E300ArtyDevKitTB
FIRRTL_FILE ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).fir
ANNO_FILE ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).anno.json
MEM_CONF ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).conf
SRAM_FILE ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).behav.srams.v
VLOG_FILE ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).v
export DTS ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).dts
export DTB ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).dtb
export BOOTROM_CONF ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).rom.conf
export BOOTROM_VLOG ?= $(build_dir)/$(CFG_PRJ).$(CONFIG).rom.v
#########################################################################################
# java arguments used in sbt
#########################################################################################
JAVA ?= java
JAVA_HEAP_SIZE ?= 2G
JAVA_ARGS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss256M -XX:MaxPermSize=256M
PYTHON ?= python3
#########################################################################################
# default sbt launch command
#########################################################################################
SBT ?= $(JAVA) $(JAVA_ARGS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar
#########################################################################################
# Scripts
#########################################################################################
VLSI_MEM_GEN ?= $(ROCKETCHIP_DIR)/scripts/vlsi_mem_gen
VLSI_ROM_GEN ?= $(ROCKETCHIP_DIR)/scripts/vlsi_rom_gen
SOFTWARE_IMG_GEN ?= $(base_dir)/scripts/bin2hex.py
export VLSI_ROM_GEN
#########################################################################################
# RISC-V Toolchain
#########################################################################################
CROSS_COMPILE := riscv64-unknown-elf
export RISCV_GCC := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-gcc)
export RISCV_GXX := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-g++)
export RISCV_OBJDUMP := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-objdump)
export RISCV_OBJCOPY := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-objcopy)
export RISCV_GDB := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-gdb)
export RISCV_AR := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-ar)
export RISCV_SIZE := $(abspath $(RISCV)/bin/$(CROSS_COMPILE)-size)
export PATH := $(abspath $(RISCV)/bin):$(PATH)
#########################################################################################
# Misc.
#########################################################################################
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COMMA := ,