-
Notifications
You must be signed in to change notification settings - Fork 98
/
run_star.ps1
70 lines (60 loc) · 1.28 KB
/
run_star.ps1
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
66
67
68
69
70
$HCPU = "x86_64"
$HABI = "WIN64"
$HOS = "Windows"
$dir = Get-Location
. "$dir\funcs.ps1"
$use_em = $FALSE;
$ncpu = 64;
$bcpu = 0;
$showhelp = $FALSE;
$front = $FALSE;
for ($count = 0 ; $count -lt $args.count ; $count ++ ){
$marg = $args[$count]
if ( $marg -eq '-e'){
$use_em = $TRUE;
}
elseif ( $marg -eq '-n'){
$ncpu = $args[$count+1];
$count ++;
}
elseif ( $marg -eq '-b'){
$bcpu = $args[$count+1];
$count ++;
}
elseif ( $marg -eq '-f'){
$front = $TRUE;
}
else {
$showhelp = $TRUE;
}
}
if ( $use_em -eq $TRUE ){
$HCPU = "vp64";
$HABI = "VP64";
$HOS = "Windows";
}
if ( $bcpu -eq 0 ){
. "$dir\stop.ps1"
}
if ( $ncpu -gt 64){
$ncpu = 64;
}
if ( $showhelp -eq $TRUE ){
Write-Output "[-n cnt] number of nodes";
Write-Output "[-b base] base offset";
Write-Output "[-e] emulator mode";
Write-Output "[-h] help";
}
else {
$num_cpu = $ncpu;
$links_to_0=""
for ($cpu=$num_cpu-1; $cpu -gt 0; $cpu--){
$links=""
$c1 = $cpu
$c2 = 0
$links += add_link $c1 $c2 $links
$links_to_0+="$links"
boot_cpu_gui $cpu "$links"
}
boot_cpu_gui $front $cpu "$links_to_0"
}