-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (48 loc) · 2.44 KB
/
Copy pathMakefile
File metadata and controls
57 lines (48 loc) · 2.44 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
#
# Copyright 2023 Ján Mach
#
# 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.
#
MODELSIM := /home/fliqqr/intelFPGA/20.1/modelsim_ase/linuxaloem/vsim
HARDISC_DIR := /run/media/fliqqr/HD/the-hardisc
HARDISC_SIM := $(HARDISC_DIR)/sim
RANDOM := $(shell bash -c 'echo $$RANDOM')
SV_SEED := ${RANDOM}
SEE_PROB := 1
SEE_GROUP := 16
LAT := 0
LOGGING := 0
HOW := gui
SIM_TIMEOUT := 900000000
TIME_STAMP :=`date +%H%M%S`
TEST_DIR := ${HARDISC_DIR}/example/hello_world
BINARY := ./target/shift-test.bin
BINARY_RELEASE := ./target/shift-test-release.bin
OBJCOPY := /opt/riscv/bin/riscv32-unknown-elf-objcopy
OBJDUMP := /opt/riscv/bin/riscv32-unknown-elf-objdump
all: build binary dump
build:
cargo build
# cargo build --release
emit-ir:
cargo rustc -- --emit=llvm-ir
binary:
${OBJCOPY} -O binary ./target/riscv32imac-unknown-none-elf/debug/shift-test ./target/shift-test.bin
${OBJCOPY} -O binary ./target/riscv32imac-unknown-none-elf/release/shift-test ./target/shift-test-release.bin
dump:
${OBJDUMP} -SCd ./target/riscv32imac-unknown-none-elf/debug/shift-test > ./target/shift-test.asm
${OBJDUMP} -SCd ./target/riscv32imac-unknown-none-elf/release/shift-test > ./target/shift-test-release.asm
sim:
${MODELSIM} -${HOW} ${HARDISC_SIM}/work.tb_mh_wrapper +TIMEOUT=${SIM_TIMEOUT} +BIN=${BINARY} +LOGGING=${LOGGING} +SEE_PROB=${SEE_PROB} +SEE_GROUP=${SEE_GROUP} +LAT=${LAT} -sv_seed ${SV_SEED} +LFILE=./logs/sim_${TIME_STAMP}.log -do "do ${HARDISC_DIR}/scripts/basic_waves_mh.do; run 100ms"
sim_release:
${MODELSIM} -${HOW} ${HARDISC_SIM}/work.tb_mh_wrapper +TIMEOUT=${SIM_TIMEOUT} +BIN=${BINARY_RELEASE} +LOGGING=${LOGGING} +SEE_PROB=${SEE_PROB} +SEE_GROUP=${SEE_GROUP} +LAT=${LAT} -sv_seed ${SV_SEED} +LFILE=./logs/sim_${TIME_STAMP}.log -do "do ${HARDISC_DIR}/scripts/basic_waves_mh.do; run 100ms"