Skip to content

Commit e446c4f

Browse files
committed
chore: modify dependencies lib path
1 parent be1069a commit e446c4f

File tree

2 files changed

+35
-45
lines changed

2 files changed

+35
-45
lines changed

rtl/Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
SHELL=/bin/bash
22

33
# be carefully, this path will be used in clean(rm -rf)!!!
4-
ROOT_PATH := $(shell pwd)/tc_l2
5-
BUILD_DIR := ${ROOT_PATH}/build
6-
MILL_OUT_DIR := ${ROOT_PATH}/../out
4+
# need to set the $(CHIP_TARGET) with tc_lx(2, 3, 4...)
5+
CHIP_TARGET := tc_l2
6+
ROOT_PATH := $(shell pwd)/dependency
7+
SOURCE_PATH := $(ROOT_PATH)/../$(CHIP_TARGET)
8+
BUILD_DIR := $(SOURCE_PATH)/build
9+
MILL_OUT_DIR := $(ROOT_PATH)/../out
710

811
AM_FOLDER_PATH := $(ROOT_PATH)/am
912
AM_KERNEL_PATH := $(AM_FOLDER_PATH)/am-kernels
@@ -22,7 +25,7 @@ DRAMSIM3_HOME := $(ROOT_PATH)/DRAMsim3
2225
YSYXSOC_HOME := $(ROOT_PATH)/ysyxSoC/ysyx
2326

2427
###### soc var ######
25-
SOC_CSRC_HOME += $(ROOT_PATH)/src/main/csrc
28+
SOC_CSRC_HOME += $(SOURCE_PATH)/src/main/csrc
2629
SOC_CSRC_LIB_HOME += $(ROOT_PATH)/ysyxSoC/ysyx/peripheral/spiFlash
2730
SOC_CXXFILES += $(shell find $(SOC_CSRC_HOME) -name "*.cpp")
2831
SOC_CXXFILES += $(shell find $(SOC_CSRC_LIB_HOME) -name "*.cpp")
@@ -81,18 +84,18 @@ install:
8184
./scripts/install.sh -g -c
8285

8386
setup:
84-
./scripts/setup.sh
87+
./scripts/setup.sh -a
8588

8689
###### chisel target ######
8790
millTest:
8891
mill -i __.test
8992

9093
chiselBuild:
9194
mkdir -p $(BUILD_DIR)
92-
mill -i tc_l2.runMain top.TopMain -td $(BUILD_DIR)
95+
mill -i $(CHIP_TARGET).runMain top.TopMain -td $(BUILD_DIR)
9396

9497
chiselHelp:
95-
mill -i tc_l2.runMain top.TopMain --help
98+
mill -i $(CHIP_TARGET).runMain top.TopMain --help
9699

97100
millCompile:
98101
mill -i __.compile
@@ -124,13 +127,13 @@ difftestBuild:
124127
@sed -i 's/io_memAXI_0_\([a-z]*\)_bits_data,/io_memAXI_0_\1_bits_data[3:0],/g' $(BUILD_DIR)/SimTop.v
125128
@sed -i 's/io_memAXI_0_w_bits_data =/io_memAXI_0_w_bits_data[0] =/g' $(BUILD_DIR)/SimTop.v
126129
@sed -i 's/ io_memAXI_0_r_bits_data;/ io_memAXI_0_r_bits_data[0];/g' $(BUILD_DIR)/SimTop.v
127-
$(MAKE) -C $(DIFFTEST_HOME) WITH_DRAMSIM3=1 EMU_TRACE=1
130+
$(MAKE) -C $(DIFFTEST_HOME) WITH_DRAMSIM3=1 EMU_TRACE=1 DESIGN_DIR=$(SOURCE_PATH)
128131

129132
changeTargetToSimTop:
130-
@sed -i 's/SoCEna\([ ]*\)=\([ ]*\)true/SoCEna\1=\2false/g' $(ROOT_PATH)/src/main/scala/common/InstConfig.scala
133+
@sed -i 's/SoCEna\([ ]*\)=\([ ]*\)true/SoCEna\1=\2false/g' $(SOURCE_PATH)/src/main/scala/common/InstConfig.scala
131134

132135
changeTargetToSoCTop:
133-
@sed -i 's/SoCEna\([ ]*\)=\([ ]*\)false/SoCEna\1=\2true/g' $(ROOT_PATH)/src/main/scala/common/InstConfig.scala
136+
@sed -i 's/SoCEna\([ ]*\)=\([ ]*\)false/SoCEna\1=\2true/g' $(SOURCE_PATH)/src/main/scala/common/InstConfig.scala
134137

135138
simBuild: changeTargetToSimTop chiselBuild difftestBuild
136139

rtl/scripts/setup.sh

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ NEMU_FOLDER_PATH=${ROOT_PATH}"/NEMU"
1818
DRAMSIM3_FOLDER_PATH=${ROOT_PATH}"/DRAMsim3"
1919
YSYXSOC_PATH=${ROOT_PATH}"/ysyxSoC"
2020

21+
#TODO: am-kernel, simple-test need to dowload from the 'ysyx_software_file' repo
2122
# download the am repo from the github
2223
###### abstract-machine ######
2324
configAbstractMachine() {
@@ -56,23 +57,30 @@ configAbstractMachine() {
5657
}
5758

5859
###### riscv-tests ######
59-
configRiscvTests() {
60+
configTestSuites() {
6061
mkdir -p ${AM_FOLDER_PATH}
6162
cd ${AM_FOLDER_PATH}
6263

6364
if [[ -d ${RISCV_TESTS_FOLDER_PATH} ]]; then
6465
echo -e "${RIGHT}riscv-tests exist!${END}"
65-
# if git fsck --full != 0; then
66-
# echo "[download error]: remove the dir and git clone"
67-
# rm -rf riscv-tests
68-
# git clone https://github.com/NJU-ProjectN/riscv-tests.git
69-
# fi
7066
else
7167
echo -e "${INFO}[no download]: git clone${END}"
7268
git clone https://github.com/NJU-ProjectN/riscv-tests.git
7369
fi
7470

75-
cd ${ROOT_PATH}
71+
# cd ${ROOT_PATH}
72+
73+
# mkdir -p ${AM_FOLDER_PATH}
74+
# cd ${AM_FOLDER_PATH}
75+
76+
# if [[ -d ${CPU_TESTS_FOLDER_PATH} ]]; then
77+
# echo -e "${RIGHT}simple-tests exist!${END}"
78+
# else
79+
# echo -e "${INFO}[no download]: git clone${END}"
80+
# git clone https://github.com/NJU-ProjectN
81+
# fi
82+
83+
# cd ${ROOT_PATH}
7684
}
7785

7886
###### am-kernels ######
@@ -82,11 +90,6 @@ configAMKernels() {
8290

8391
if [[ -d ${AM_KERNELS_FOLDER_PATH} ]]; then
8492
echo -e "${RIGHT}am-kernels exist!${END}"
85-
# if git fsck --full != 0; then
86-
# echo "[download error]: remove the dir and git clone"
87-
# rm -rf am-kernels
88-
# git clone https://github.com/NJU-ProjectN/am-kernels.git
89-
# fi
9093
else
9194
echo -e "${INFO}[no download]: git clone${END}"
9295
git clone https://github.com/NJU-ProjectN/am-kernels.git
@@ -103,11 +106,6 @@ configDiffTest() {
103106

104107
if [[ -d ${DIFFTEST_FOLDER_PATH} ]]; then
105108
echo -e "${RIGHT}difftest exist!${END}"
106-
# if git fsck --full != 0; then
107-
# echo "[download error]: remove the dir and git clone"
108-
# rm -rf am-kernels
109-
# git clone https://github.com/NJU-ProjectN/am-kernels.git
110-
# fi
111109
else
112110
echo -e "${INFO}[no download]: git clone${END}"
113111
git clone https://gitee.com/oscpu/difftest.git
@@ -126,11 +124,6 @@ configDiffTest() {
126124
configNemu() {
127125
if [[ -d ${NEMU_FOLDER_PATH} ]]; then
128126
echo -e "${RIGHT}NEMU exist!${END}"
129-
# if git fsck --full != 0; then
130-
# echo "[download error]: remove the dir and git clone"
131-
# rm -rf am-kernels
132-
# git clone https://github.com/NJU-ProjectN/am-kernels.git
133-
# fi
134127
else
135128
echo -e "${INFO}[no download]: git clone${END}"
136129
git clone https://gitee.com/oscpu/NEMU.git
@@ -171,11 +164,6 @@ configDramSim3() {
171164

172165
if [[ -d ${DRAMSIM3_FOLDER_PATH} ]]; then
173166
echo -e "${RIGHT}dramsim3 exist!${END}"
174-
# if git fsck --full != 0; then
175-
# echo "[download error]: remove the dir and git clone"
176-
# rm -rf am-kernels
177-
# git clone https://github.com/NJU-ProjectN/am-kernels.git
178-
# fi
179167
else
180168
echo -e "${INFO}[no download]: git clone${END}"
181169
git clone https://github.com/OpenXiangShan/DRAMsim3.git
@@ -207,19 +195,19 @@ helpInfo() {
207195
echo -e "${RIGHT} -d: download and config difftest${END}"
208196
echo -e "${RIGHT} -i: download and config dramsim3${END}"
209197
echo -e "${RIGHT} -m: download and config abstract-machine${END}"
210-
echo -e "${RIGHT} -r: download and config riscv-tests${END}"
198+
echo -e "${RIGHT} -r: download and config simple-tests, riscv-tests${END}"
211199
echo -e "${RIGHT} -k: download and config am-kernels${END}"
212200
echo -e "${RIGHT} -y: download and config ysyx-soc${END}"
213201
echo -e "${RIGHT} -s: download and config specific repo${END}"
214-
echo -e "sample: ./setup.sh -s [repo](default: nemu) ${INFO}[repo]: [nemu, diffttest, dramsim3, am, riscv-tests, am-kernels, ysyx-soc]${END}"
202+
echo -e "sample: ./setup.sh -s [repo](default: nemu) ${INFO}[repo]: [nemu, diffttest, dramsim3, am, testsuites, am-kernels, ysyx-soc]${END}"
215203
echo -e "${RIGHT} -h: help information${END}"
216204

217205
}
218206

219207
configSpecRepo() {
220208
if [[ -n $1 && $1 == "all" ]]; then
221209
configAbstractMachine
222-
configRiscvTests
210+
configTestSuites
223211
configAMKernels
224212
configDiffTest
225213
configNemu
@@ -233,18 +221,17 @@ configSpecRepo() {
233221
configDramSim3
234222
elif [[ -n $1 && $1 == "am" ]]; then
235223
configAbstractMachine
236-
elif [[ -n $1 && $1 == "riscv-tests" ]]; then
237-
configRiscvTests
224+
elif [[ -n $1 && $1 == "testsuites" ]]; then
225+
configTestSuites
238226
elif [[ -n $1 && $1 == "am-kernels" ]]; then
239227
configAMKernels
240228
elif [[ -n $1 && $1 == "ysyx-soc" ]]; then
241229
configysyxSoC
242230
else
243-
echo -e "${ERROR}the params [$1] is not found.${END} opt value: [nemu, diffttest, dramsim3, am, riscv-tests, am-kernels, ysyx-soc]"
231+
echo -e "${ERROR}the params [$1] is not found.${END} opt value: [nemu, diffttest, dramsim3, am, testsuites, am-kernels, ysyx-soc]"
244232
fi
245233
}
246234

247-
echo ${ROOT_PATH}
248235
mkdir -p ${ROOT_PATH}
249236
# Check parameters
250237
while getopts 'andimrkys:h' OPT; do
@@ -254,7 +241,7 @@ while getopts 'andimrkys:h' OPT; do
254241
d) configDiffTest;;
255242
i) configDramSim3;;
256243
m) configAbstractMachine;;
257-
r) configRiscvTests;;
244+
r) configTestSuites;;
258245
k) configAMKernels;;
259246
y) configysyxSoC;;
260247
s) configSpecRepo $OPTARG;;

0 commit comments

Comments
 (0)