-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrunsimu.sh
executable file
·66 lines (62 loc) · 1.82 KB
/
runsimu.sh
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
57
58
59
60
61
62
63
64
65
#!/bin/tcsh
## virtual env
#singularity run cocotb_v1.3 ./.run_sim.sh $@
#docker run --rm -it -v $PWD:/home/workspace cocotb:v1 ./.run_sim.sh $@
set SIM=ghdl
#grm
if (-d "/export") then #check if on CMC machine
printf "Exécution sur une machine du grm\n"
if (! -d ".env_cocotb") then
printf "cocotb virtualenv directory does not exist\n"
if (`where virtualenv` == "") then
printf "virtualenv command doesn't not exist\n"
printf "Install it using \n"
printf "\t pip3 install --user virtualenv \n"
printf "and add it to your path : \n"
printf "\t echo 'setenv PATH \044PATH\:/users/$USER/.local/bin/' >> ~/.cshrc \n"
printf "reload your env : source ~/.cshrc\n "
exit -1
else
printf "creating directory for virtualenv .env_cocotb\n"
mkdir .env_cocotb
printf "creating virtualenv in .env_cocotb\n"
stpython37
virtualenv .env_cocotb
printf "installing dependencies in virtual env \n"
source ./.env_cocotb/bin/activate.csh
# install dependencies
pip install cocotb
deactivate # leave virtual env to keep script stable
endif
endif
stmodelt
stpython37
source ./.env_cocotb/bin/activate.csh
else if (-d "/CMC") then # local CMC folder
printf "setting up CMC tools \n"
source /CMC/scripts/mentor.modelsim.10.7c.csh
endif
if (`where ghdl` != "") then
printf "ghdl trouvé\n"
set SIM=ghdl
else if (`where vsim` != "") then
printf "on utilise vsim\n"
set SIM=modelsim
else
printf "aucun simulateur trouvé\n"
exit -1
endif
#we pass specific arguments
#if ($argv == "") then
# set argv="empty"
# set argsToPass = ""
#else
set argsToPass = "$*"
#endif
#foreach name ( $argv )
# if ("$name" !~ "SIM="*) then
# set argsToPass = "$argsToPass SIM=$SIM"
# endif
#end
echo $argsToPass
./.run_sim.sh "$argsToPass"