Skip to content

Commit be36ea8

Browse files
committed
chore: add own impl of am-kernel and simple test config
1 parent 4e7c7a4 commit be36ea8

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

rtl/scripts/setup.sh

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,27 @@ END="\033[0m"
1010
ROOT_PATH=$(dirname $(readlink -f "$0"))/../dependency
1111
AM_FOLDER_PATH=${ROOT_PATH}"/am"
1212
ABSTRACT_MACHINE_FOLDER_PATH=${AM_FOLDER_PATH}"/abstract-machine"
13+
SIMPLE_TESTS_FOLDER_PATH=${AM_FOLDER_PATH}"/simple-tests"
1314
RISCV_TESTS_FOLDER_PATH=${AM_FOLDER_PATH}"/riscv-tests"
1415
AM_KERNELS_FOLDER_PATH=${AM_FOLDER_PATH}"/am-kernels"
1516

1617
DIFFTEST_FOLDER_PATH=${ROOT_PATH}"/difftest"
1718
NEMU_FOLDER_PATH=${ROOT_PATH}"/NEMU"
1819
DRAMSIM3_FOLDER_PATH=${ROOT_PATH}"/DRAMsim3"
1920
YSYXSOC_PATH=${ROOT_PATH}"/ysyxSoC"
21+
YSYX_SOFTWARE_FILE_PATH=${ROOT_PATH}"/ysyx-software-file"
22+
23+
#NOTE: am-kernel, simple-test need to dowload from the 'ysyx-software-file' repo
24+
configYsyxSoftwareFile() {
25+
cd ${ROOT_PATH}
26+
if [[ -d ${YSYX_SOFTWARE_FILE_PATH} ]]; then
27+
echo -e "${RIGHT}ysyx-software-file exist!${END}"
28+
else
29+
echo -e "${INFO}[no download]: git clone...${END}"
30+
git clone https://github.com/maksyuki/ysyx-software-file.git
31+
fi
32+
}
2033

21-
#TODO: am-kernel, simple-test need to dowload from the 'ysyx_software_file' repo
2234
# download the am repo from the github
2335
###### abstract-machine ######
2436
configAbstractMachine() {
@@ -33,7 +45,7 @@ configAbstractMachine() {
3345
# git clone https://github.com/NJU-ProjectN/abstract-machine.git
3446
# fi
3547
else
36-
echo -e "${INFO}[no download]: git clone${END}"
48+
echo -e "${INFO}[no download]: git clone...${END}"
3749
git clone https://github.com/NJU-ProjectN/abstract-machine.git
3850
fi
3951

@@ -56,43 +68,46 @@ configAbstractMachine() {
5668
cd ${ROOT_PATH}
5769
}
5870

59-
###### riscv-tests ######
71+
###### simple-tests, riscv-tests ######
6072
configTestSuites() {
6173
mkdir -p ${AM_FOLDER_PATH}
6274
cd ${AM_FOLDER_PATH}
6375

6476
if [[ -d ${RISCV_TESTS_FOLDER_PATH} ]]; then
6577
echo -e "${RIGHT}riscv-tests exist!${END}"
6678
else
67-
echo -e "${INFO}[no download]: git clone${END}"
79+
echo -e "${INFO}[no download]: git clone...${END}"
6880
git clone https://github.com/NJU-ProjectN/riscv-tests.git
6981
fi
7082

71-
# cd ${ROOT_PATH}
83+
cd ${ROOT_PATH}
7284

73-
# mkdir -p ${AM_FOLDER_PATH}
74-
# cd ${AM_FOLDER_PATH}
85+
configYsyxSoftwareFile
86+
mkdir -p ${AM_FOLDER_PATH}
87+
cd ${AM_FOLDER_PATH}
7588

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
89+
if [[ -d ${SIMPLE_TESTS_FOLDER_PATH} ]]; then
90+
echo -e "${RIGHT}simple-tests exist!${END}"
91+
else
92+
echo -e "${INFO}[no exist] copy...${END}"
93+
cp -rf ${YSYX_SOFTWARE_FILE_PATH}/simple-tests ./
94+
fi
8295

83-
# cd ${ROOT_PATH}
96+
cd ${ROOT_PATH}
8497
}
8598

8699
###### am-kernels ######
87100
configAMKernels() {
101+
configYsyxSoftwareFile
102+
88103
mkdir -p ${AM_FOLDER_PATH}
89104
cd ${AM_FOLDER_PATH}
90105

91106
if [[ -d ${AM_KERNELS_FOLDER_PATH} ]]; then
92107
echo -e "${RIGHT}am-kernels exist!${END}"
93108
else
94-
echo -e "${INFO}[no download]: git clone${END}"
95-
git clone https://github.com/NJU-ProjectN/am-kernels.git
109+
echo -e "${INFO}[no exist]: copy...${END}"
110+
cp -rf ${YSYX_SOFTWARE_FILE_PATH}/am-kernels ./
96111
fi
97112

98113
cd ${ROOT_PATH}
@@ -107,7 +122,7 @@ configDiffTest() {
107122
if [[ -d ${DIFFTEST_FOLDER_PATH} ]]; then
108123
echo -e "${RIGHT}difftest exist!${END}"
109124
else
110-
echo -e "${INFO}[no download]: git clone${END}"
125+
echo -e "${INFO}[no download]: git clone...${END}"
111126
git clone https://gitee.com/oscpu/difftest.git
112127
fi
113128

@@ -125,7 +140,7 @@ configNemu() {
125140
if [[ -d ${NEMU_FOLDER_PATH} ]]; then
126141
echo -e "${RIGHT}NEMU exist!${END}"
127142
else
128-
echo -e "${INFO}[no download]: git clone${END}"
143+
echo -e "${INFO}[no download]: git clone...${END}"
129144
git clone https://gitee.com/oscpu/NEMU.git
130145
fi
131146

@@ -165,7 +180,7 @@ configDramSim3() {
165180
if [[ -d ${DRAMSIM3_FOLDER_PATH} ]]; then
166181
echo -e "${RIGHT}dramsim3 exist!${END}"
167182
else
168-
echo -e "${INFO}[no download]: git clone${END}"
183+
echo -e "${INFO}[no download]: git clone...${END}"
169184
git clone https://github.com/OpenXiangShan/DRAMsim3.git
170185
fi
171186

@@ -174,14 +189,14 @@ configDramSim3() {
174189
cd ${ROOT_PATH}
175190
}
176191

177-
###### ysyxSoC ######
178-
configysyxSoC() {
192+
###### YsyxSoC ######
193+
configYsyxSoC() {
179194
cd ${ROOT_PATH}
180195

181196
if [[ -d ${YSYXSOC_PATH} ]]; then
182197
echo -e "${RIGHT}ysyxSoC exist!${END}"
183198
else
184-
echo -e "${INFO}[no download]: git clone${END}"
199+
echo -e "${INFO}[no download]: git clone...${END}"
185200
git clone --depth 1 https://github.com/OSCPU/ysyxSoC.git
186201
fi
187202
}
@@ -212,7 +227,7 @@ configSpecRepo() {
212227
configDiffTest
213228
configNemu
214229
configDramSim3
215-
configysyxSoC
230+
configYsyxSoC
216231
elif [[ -n $1 && $1 == "nemu" ]]; then
217232
configNemu
218233
elif [[ -n $1 && $1 == "difftest" ]]; then
@@ -226,7 +241,7 @@ configSpecRepo() {
226241
elif [[ -n $1 && $1 == "am-kernels" ]]; then
227242
configAMKernels
228243
elif [[ -n $1 && $1 == "ysyx-soc" ]]; then
229-
configysyxSoC
244+
configYsyxSoC
230245
else
231246
echo -e "${ERROR}the params [$1] is not found.${END} opt value: [nemu, diffttest, dramsim3, am, testsuites, am-kernels, ysyx-soc]"
232247
fi
@@ -243,7 +258,7 @@ while getopts 'andimrkys:h' OPT; do
243258
m) configAbstractMachine;;
244259
r) configTestSuites;;
245260
k) configAMKernels;;
246-
y) configysyxSoC;;
261+
y) configYsyxSoC;;
247262
s) configSpecRepo $OPTARG;;
248263
h) helpInfo;;
249264
?)

0 commit comments

Comments
 (0)