Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
150 changes: 150 additions & 0 deletions #Makefile#
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Copyright 2023 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# Andrea Belano <andrea.belano@studio.unibo.it>
#

mkfile_path := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
SW ?= $(mkfile_path)sw
BUILD_DIR ?= $(mkfile_path)work
QUESTA ?= #questa-2020.1
PYTHON ?= python
ISA ?= riscv
ARCH ?= rv
XLEN ?= 32
XTEN ?= imc

BENDER ?= $(mkfile_path)/bender
TEST ?= tb_datamover.c

TEST_SRCS := $(SW)/$(TEST)

compile_script ?= $(mkfile_path)scripts/compile.tcl
compile_script_synth ?= $(mkfile_path)scripts/synth_compile.tcl
compile_flag ?= -suppress 2583 -suppress 13314 -suppress 8386

sim_flags ?= -suppress 3009

bender_defs += -D COREV_ASSERT_OFF

sim_targs += -t rtl
sim_targs += -t test
bender_targs += -t cv32e40p_exclude_tracer
sim_targs += -t test

INI_PATH = $(mkfile_path)/modelsim.ini
WORK_PATH = $(BUILD_DIR)

tb := tb_datamover_top

gui ?= 0

PROB_STALL ?= 0.0
OUTPUT_SIZE ?= 2

# Include directories
INC += -I$(SW)
INC += -I$(SW)/inc
INC += -I$(SW)/utils

BOOTSCRIPT := $(SW)/kernel/crt0.S
LINKSCRIPT := $(SW)/kernel/link.ld

CC=$(ISA)$(XLEN)-unknown-elf-gcc
LD=$(CC)
OBJDUMP=$(ISA)$(XLEN)-unknown-elf-objdump
CC_OPTS=-march=$(ARCH)$(XLEN)$(XTEN) -mabi=ilp32 -D__$(ISA)__ -O2 -g -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wundef -fdata-sections -ffunction-sections -MMD -MP
LD_OPTS=-march=$(ARCH)$(XLEN)$(XTEN) -mabi=ilp32 -D__$(ISA)__ -MMD -MP -nostartfiles -nostdlib -Wl,--gc-sections

# Setup build object dirs
CRT=$(BUILD_DIR)/crt0.o
OBJ=$(BUILD_DIR)/verif.o
BIN=$(BUILD_DIR)/verif
DUMP=$(BUILD_DIR)/verif.dump

STIM_INSTR=$(mkfile_path)/stim_instr.txt
STIM_DATA=$(mkfile_path)/stim_data.txt

# Build implicit rules
$(STIM_INSTR) $(STIM_DATA): $(BIN)
objcopy --srec-len 1 --output-target=srec $(BIN) $(BIN).s19
scripts/parse_s19.pl $(BIN).s19 > $(BIN).txt
python scripts/s19tomem.py $(BIN).txt $(STIM_INSTR) $(STIM_DATA)

$(BIN): $(CRT) $(OBJ)
$(LD) $(LD_OPTS) -o $(BIN) $(CRT) $(OBJ) -T$(LINKSCRIPT)

$(CRT): $(BUILD_DIR)
$(CC) $(CC_OPTS) -c $(BOOTSCRIPT) -o $(CRT)

$(OBJ): $(TEST_SRCS)
$(CC) $(CC_OPTS) -c $(TEST_SRCS) $(FLAGS) $(INC) -o $(OBJ)

$(BUILD_DIR):
mkdir -p $(BUILD_DIR)

# Generate instructions and data stimuli
sw-build: $(STIM_INSTR) $(STIM_DATA) dis

sw-clean:
rm -f $(BUILD_DIR)/*.o

sw-all: sw-clean sw-build

dis:
$(OBJDUMP) -d $(BIN) > $(DUMP)

# Run the simulation
run:
ifeq ($(gui), 0)
$(QUESTA) vsim -c vopt_tb -do "run -a" \
-gPROB_STALL=$(PROB_STALL) \
-gOUTPUT_SIZE=$(OUTPUT_SIZE) \
$(sim_flags)
else
$(QUESTA) vsim vopt_tb \
-do "add log -r sim:/$(tb)/*" \
-gPROB_STALL=$(PROB_STALL) \
-gOUTPUT_SIZE=$(OUTPUT_SIZE) \
$(sim_flags)
endif

bender:
curl --proto '=https' \
--tlsv1.2 https://pulp-platform.github.io/bender/init -sSf | sh -s

update-ips:
$(BENDER) update
$(BENDER) script vsim \
--vlog-arg="$(compile_flag)" \
--vcom-arg="-pedanticerrors" \
$(bender_targs) $(bender_defs) \
$(sim_targs) $(sim_deps) \
> ${compile_script}

synth-ips:
$(BENDER) update
$(BENDER) script synopsys \
$(common_targs) $(common_defs) \
$(synth_targs) $(synth_defs) \
> ${compile_script_synth}

hw-opt:
$(QUESTA) vopt +acc=npr -o vopt_tb $(tb) -floatparameters+$(tb) -work $(BUILD_DIR)

hw-compile:
$(QUESTA) vsim -c +incdir+$(UVM_HOME) -do 'quit -code [source $(compile_script)]'

hw-lib:
@touch modelsim.ini
@mkdir -p $(BUILD_DIR)
@$(QUESTA) vlib $(BUILD_DIR)
@$(QUESTA) vmap work $(BUILD_DIR)
@chmod +w modelsim.ini

hw-clean:
rm -rf transcript
rm -rf modelsim.ini

hw-all: hw-clean hw-lib hw-compile hw-opt
Submodule cluster_interconnect-a17539e30e6dc0ae added at 1284de
1 change: 1 addition & 0 deletions .bender/git/checkouts/common_cells-6a333249e301ab43
Submodule common_cells-6a333249e301ab43 added at c27bce
1 change: 1 addition & 0 deletions .bender/git/checkouts/common_verification-d33f9e1d33e4db52
Submodule common_verification-d33f9e1d33e4db52 added at fa2630
1 change: 1 addition & 0 deletions .bender/git/checkouts/hci-f076afff0f6dbd15
Submodule hci-f076afff0f6dbd15 added at 066c7c
1 change: 1 addition & 0 deletions .bender/git/checkouts/hwpe-ctrl-6391b99ee5c90b6c
Submodule hwpe-ctrl-6391b99ee5c90b6c added at 292686
1 change: 1 addition & 0 deletions .bender/git/checkouts/hwpe-stream-11876d121d6ecdf0
Submodule hwpe-stream-11876d121d6ecdf0 added at 65c99a
1 change: 1 addition & 0 deletions .bender/git/checkouts/ibex-0d71cebc1d9540af
Submodule ibex-0d71cebc1d9540af added at b18f7e
Submodule l2_tcdm_hybrid_interco-e3a492f6795b8e6b added at fa55e7
1 change: 1 addition & 0 deletions .bender/git/checkouts/tech_cells_generic-712461a608e7f5e9
Submodule tech_cells_generic-712461a608e7f5e9 added at 7968dd
19 changes: 19 additions & 0 deletions .bender/git/db/cluster_interconnect-b387c598c6b7108b/FETCH_HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
89e1019d64a86425211be6200770576cbdf3e8b3 not-for-merge branch 'assertion-fix' of https://github.com/pulp-platform/cluster_interconnect
aaa8ef61969d0416c178038d8ae7ea91a0d767df not-for-merge branch 'atomics' of https://github.com/pulp-platform/cluster_interconnect
d01798091dab8ab5fdcd9b5dc6ee61b574a41cae not-for-merge branch 'atomics-v2' of https://github.com/pulp-platform/cluster_interconnect
49581f12e61941ca93e063ceb89514a2d932854a not-for-merge branch 'atomics_merge' of https://github.com/pulp-platform/cluster_interconnect
1f2bf749a8438528ee827ea81998862edcfe9d6e not-for-merge branch 'control-pulp' of https://github.com/pulp-platform/cluster_interconnect
4ff19495103c99d9dbc0c22497da1a117d01a7da not-for-merge branch 'jg_support' of https://github.com/pulp-platform/cluster_interconnect
2967d8d17be0a6139229ca8d3d4956e182aec3de not-for-merge branch 'master' of https://github.com/pulp-platform/cluster_interconnect
8c6c2273d60077002834d2cb5d8e44ee0de3e32c not-for-merge branch 'resp_wen' of https://github.com/pulp-platform/cluster_interconnect
fac1a54c31e0b61c48b9436dea09943db5b081be not-for-merge branch 'vega' of https://github.com/pulp-platform/cluster_interconnect
cac00c5810494693ff9cdf69a630191751956bcf not-for-merge tag 'pulp-v1.0' of https://github.com/pulp-platform/cluster_interconnect
fac1a54c31e0b61c48b9436dea09943db5b081be not-for-merge tag 'v1.0.1' of https://github.com/pulp-platform/cluster_interconnect
d088ef824b5314f74d9b85f138dabb4f2746d0a2 not-for-merge tag 'v1.0.2' of https://github.com/pulp-platform/cluster_interconnect
f0dc98b36884b20efc7e0b3476c96be48d4ea6d2 not-for-merge tag 'v1.0.3' of https://github.com/pulp-platform/cluster_interconnect
eeb8d0e97ff426865ce5baa2c4a9826ff2a5a998 not-for-merge tag 'v1.1' of https://github.com/pulp-platform/cluster_interconnect
eeb8d0e97ff426865ce5baa2c4a9826ff2a5a998 not-for-merge tag 'v1.1.0' of https://github.com/pulp-platform/cluster_interconnect
02a5eaef88170037b0b678cb169ab027540865a0 not-for-merge tag 'v1.1.1' of https://github.com/pulp-platform/cluster_interconnect
2dc55ed7f6dc03c405c256dd9107ae0159328708 not-for-merge tag 'v1.1.2' of https://github.com/pulp-platform/cluster_interconnect
15067138873959641e013b8fc55719e18b52a9af not-for-merge tag 'v1.2.0' of https://github.com/pulp-platform/cluster_interconnect
7d0a4f8acae71a583a6713cab5554e60b9bb8d27 not-for-merge tag 'v1.2.1' of https://github.com/pulp-platform/cluster_interconnect
1 change: 1 addition & 0 deletions .bender/git/db/cluster_interconnect-b387c598c6b7108b/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/master
7 changes: 7 additions & 0 deletions .bender/git/db/cluster_interconnect-b387c598c6b7108b/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
[remote "origin"]
url = https://github.com/pulp-platform/cluster_interconnect.git
fetch = +refs/heads/*:refs/remotes/origin/*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".

. git-sh-setup
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
:
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
Loading