-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathrun_cube.ps1
More file actions
36 lines (34 loc) · 1.45 KB
/
run_cube.ps1
File metadata and controls
36 lines (34 loc) · 1.45 KB
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
# common functions
. "$PSScriptRoot\funcs.ps1"
# process args defaults
main 4 4 @args
if ($showhelp -eq $TRUE) {
Write-Output "[-n cnt] number of nodes"
Write-Output "[-b base] base offset"
Write-Output "[-s script_name] script mode"
Write-Output "[-e] emulator mode"
Write-Output "[-f] foreground mode"
Write-Output "[-h] help"
} else {
for ($cpu_z = $ncpu - 1; $cpu_z -ge 0; $cpu_z--) {
for ($cpu_y = $ncpu - 1; $cpu_y -ge 0; $cpu_y--) {
for ($cpu_x = $ncpu - 1; $cpu_x -ge 0; $cpu_x--) {
$cpu = $cpu_z * $ncpu * $ncpu + $cpu_y * $ncpu + $cpu_x
$links = ""
for ($lcpu_z = $cpu_z - 1; $lcpu_z -le $cpu_z + 1; $lcpu_z++) {
$wp = wrap $lcpu_z $ncpu
$links += add_link $cpu ($wp * $ncpu * $ncpu + $cpu_y * $ncpu + $cpu_x) $links
}
for ($lcpu_y = $cpu_y - 1; $lcpu_y -le $cpu_y + 1; $lcpu_y++) {
$wp = wrap $lcpu_y $ncpu
$links += add_link $cpu ($cpu_z * $ncpu * $ncpu + $wp * $ncpu + $cpu_x) $links
}
for ($lcpu_x = $cpu_x - 1; $lcpu_x -le $cpu_x + 1; $lcpu_x++) {
$wp = wrap $lcpu_x $ncpu
$links += add_link $cpu ($cpu_z * $ncpu * $ncpu + $cpu_y * $ncpu + $wp) $links
}
boot_cpu_gui $front $cpu $links
}
}
}
}