@@ -7,7 +7,7 @@ RIGHT="\033[0;32m"
77END=" \033[0m"
88
99
10- ROOT_PATH=$( dirname $( readlink -f " $0 " ) )
10+ ROOT_PATH=$( dirname $( readlink -f " $0 " ) ) /../dependency
1111AM_FOLDER_PATH=${ROOT_PATH} " /am"
1212ABSTRACT_MACHINE_FOLDER_PATH=${AM_FOLDER_PATH} " /abstract-machine"
1313RISCV_TESTS_FOLDER_PATH=${AM_FOLDER_PATH} " /riscv-tests"
@@ -18,6 +18,7 @@ NEMU_FOLDER_PATH=${ROOT_PATH}"/NEMU"
1818DRAMSIM3_FOLDER_PATH=${ROOT_PATH} " /DRAMsim3"
1919YSYXSOC_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 ######
2324configAbstractMachine () {
@@ -52,27 +53,34 @@ configAbstractMachine() {
5253 fi
5354 echo -e " ${RIGHT} AM_HOME: $AM_HOME ${END} "
5455
55- cd ${ROOT_PATH} # am -> tc-l2
56+ cd ${ROOT_PATH}
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} # am -> tc-l2
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,17 +90,12 @@ 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
9396 fi
9497
95- cd ${ROOT_PATH} # am -> tc-l2
98+ cd ${ROOT_PATH}
9699}
97100
98101# download the specific commit id difftest and NEMU
@@ -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() {
126124configNemu () {
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
219207configSpecRepo () {
220208 if [[ -n $1 && $1 == " all" ]]; then
221209 configAbstractMachine
222- configRiscvTests
210+ configTestSuites
223211 configAMKernels
224212 configDiffTest
225213 configNemu
@@ -233,17 +221,18 @@ 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
235+ mkdir -p ${ROOT_PATH}
247236# Check parameters
248237while getopts ' andimrkys:h' OPT; do
249238 case $OPT in
@@ -252,7 +241,7 @@ while getopts 'andimrkys:h' OPT; do
252241 d) configDiffTest;;
253242 i) configDramSim3;;
254243 m) configAbstractMachine;;
255- r) configRiscvTests ;;
244+ r) configTestSuites ;;
256245 k) configAMKernels;;
257246 y) configysyxSoC;;
258247 s) configSpecRepo $OPTARG ;;
0 commit comments