forked from stnolting/neorv32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo.py
executable file
·96 lines (81 loc) · 2.9 KB
/
do.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python3
# doit
from sys import executable, argv as sys_argv, exit as sys_exit
from os import environ
from pathlib import Path
from doit.action import CmdAction
from doit.cmd_base import ModuleTaskLoader
from doit.doit_cmd import DoitMain
DOIT_CONFIG = {"verbosity": 2, "action_string_formatting": "both"}
ROOT = Path(__file__).parent
def task_BuildAndInstallSoftwareFrameworkTests():
return {
"actions": [
# Check toolchain
"make -C sw/example/processor_check check",
# Generate executables for all example projects
"make -C sw/example clean_all exe",
# Compile and install bootloader
"make -C sw/bootloader clean_all info bootloader",
# Compile and install test application
# Redirect UART0 TX to text.io simulation output via <UART0_SIM_MODE> user flag
"echo 'Compiling and installing CPU (/Processor) test application'",
"make -C sw/example/processor_check clean_all USER_FLAGS+=-DRUN_CHECK USER_FLAGS+=-DUART0_SIM_MODE USER_FLAGS+=-DUART1_SIM_MODE MARCH=rv32imac info all",
],
"doc": "Build all sw/example/*; install bootloader and processor check",
}
def task_RunRISCVArchitectureTests():
return {
"actions": [CmdAction(
"./run_riscv_arch_test.sh {suite}",
cwd=ROOT / "sim"
)],
"doc": "Run RISC-V Architecture Tests",
"params": [
{
"name": "suite",
"short": "s",
"long": "suite",
"default": "M",
"choices": ((item, "") for item in [
"I",
"C",
"M",
"privilege",
"Zifencei",
"rv32e_C",
"rv32e_E",
"rv32e_M"
]),
"help": "Test suite to be executed",
}
],
}
def task_Documentation():
return {
"actions": ["make -C docs {posargs}"],
"doc": "Run a target in subdir 'doc'",
"uptodate": [False],
"pos_arg": "posargs",
}
def task_DeployToGitHubPages():
cwd = str(ROOT / "public")
return {
"actions": [
CmdAction(cmd, cwd=cwd)
for cmd in [
"git init",
"cp ../.git/config ./.git/config",
"touch .nojekyll",
"git add .",
'git config --local user.email "push@gha"',
'git config --local user.name "GHA"',
"git commit -am '{posargs}'",
"git push -u origin +HEAD:gh-pages",
]
],
"doc": "Create a clean branch in subdir 'public' and push to branch 'gh-pages'",
"pos_arg": "posargs",
}
if __name__ == '__main__':
sys_exit(DoitMain(ModuleTaskLoader(globals())).run(sys_argv[1:]))