mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
support one-off test images in xtask
This commit is contained in:
parent
fb10311fbc
commit
3cd175fb49
3 changed files with 42 additions and 19 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -282,6 +282,7 @@ dependencies = [
|
||||||
"typenum",
|
"typenum",
|
||||||
"utralib",
|
"utralib",
|
||||||
"xous",
|
"xous",
|
||||||
|
"xous-names",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ ticktimer-server = { path = "../ticktimer-server" }
|
||||||
log-server = { path = "../log-server" }
|
log-server = { path = "../log-server" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
typenum = "1.12"
|
typenum = "1.12"
|
||||||
|
xous-names = { path = "../xous-names" }
|
||||||
|
|
||||||
[target.'cfg(not(any(windows,unix)))'.dependencies]
|
[target.'cfg(not(any(windows,unix)))'.dependencies]
|
||||||
utralib = { path = "../../utralib"}
|
utralib = { path = "../../utralib"}
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,44 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_main() -> Result<(), DynError> {
|
fn try_main() -> Result<(), DynError> {
|
||||||
|
let hw_pkgs = [
|
||||||
|
"gam",
|
||||||
|
"graphics-server",
|
||||||
|
"ticktimer-server",
|
||||||
|
"log-server",
|
||||||
|
"com",
|
||||||
|
"xous-names",
|
||||||
|
"keyboard",
|
||||||
|
"trng",
|
||||||
|
];
|
||||||
|
let fcc_pkgs = [
|
||||||
|
"shell",
|
||||||
|
"fcc-agent",
|
||||||
|
"graphics-server",
|
||||||
|
"ticktimer-server",
|
||||||
|
"log-server",
|
||||||
|
"com",
|
||||||
|
"xous-names",
|
||||||
|
"keyboard",
|
||||||
|
"trng",
|
||||||
|
];
|
||||||
|
let benchmark_pkgs = [
|
||||||
|
"benchmark",
|
||||||
|
"benchmark-target",
|
||||||
|
"graphics-server",
|
||||||
|
"ticktimer-server",
|
||||||
|
"log-server",
|
||||||
|
"xous-names",
|
||||||
|
"trng",
|
||||||
|
];
|
||||||
let task = env::args().nth(1);
|
let task = env::args().nth(1);
|
||||||
match task.as_deref() {
|
match task.as_deref() {
|
||||||
Some("renode-image") => renode_image(false)?,
|
Some("renode-image") => renode_image(false)?,
|
||||||
Some("renode-image-debug") => renode_image(true)?,
|
Some("renode-image-debug") => renode_image(true)?,
|
||||||
Some("run") => run(false)?,
|
Some("run") => run(false)?,
|
||||||
Some("hw-image") => build_hw_image(false, env::args().nth(2))?,
|
Some("hw-image") => build_hw_image(false, env::args().nth(2), &hw_pkgs)?,
|
||||||
|
Some("benchmark") => build_hw_image(false, env::args().nth(2), &benchmark_pkgs)?,
|
||||||
|
Some("fcc-agent") => build_hw_image(false, env::args().nth(2), &fcc_pkgs)?,
|
||||||
Some("debug") => run(true)?,
|
Some("debug") => run(true)?,
|
||||||
_ => print_help(),
|
_ => print_help(),
|
||||||
}
|
}
|
||||||
|
|
@ -56,11 +88,13 @@ renode-image-debug builds a test image for renode in debug mode
|
||||||
hw-image [soc.svd] builds an image for real hardware
|
hw-image [soc.svd] builds an image for real hardware
|
||||||
run runs a release build using a hosted environment
|
run runs a release build using a hosted environment
|
||||||
debug runs a debug build using a hosted environment
|
debug runs a debug build using a hosted environment
|
||||||
|
benchmark [soc.svd] builds a benchmarking image for real hardware
|
||||||
|
fcc-agent [soc.svd] builds a version suitable for FCC testing
|
||||||
"
|
"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_hw_image(debug: bool, svd: Option<String>) -> Result<(), DynError> {
|
fn build_hw_image(debug: bool, svd: Option<String>, packages: &[&str]) -> Result<(), DynError> {
|
||||||
let svd_file = match svd {
|
let svd_file = match svd {
|
||||||
Some(s) => s,
|
Some(s) => s,
|
||||||
None => return Err("svd file not specified".into()),
|
None => return Err("svd file not specified".into()),
|
||||||
|
|
@ -78,20 +112,7 @@ fn build_hw_image(debug: bool, svd: Option<String>) -> Result<(), DynError> {
|
||||||
|
|
||||||
let kernel = build_kernel(debug)?;
|
let kernel = build_kernel(debug)?;
|
||||||
let mut init = vec![];
|
let mut init = vec![];
|
||||||
for pkg in &[
|
for pkg in packages {
|
||||||
//"shell",
|
|
||||||
//"gam",
|
|
||||||
"benchmark",
|
|
||||||
"benchmark-target",
|
|
||||||
"graphics-server",
|
|
||||||
"ticktimer-server",
|
|
||||||
"log-server",
|
|
||||||
"com",
|
|
||||||
"xous-names",
|
|
||||||
"keyboard",
|
|
||||||
"trng",
|
|
||||||
] {
|
|
||||||
// "fcc-agent"
|
|
||||||
init.push(build(pkg, debug, Some(TARGET), None)?);
|
init.push(build(pkg, debug, Some(TARGET), None)?);
|
||||||
}
|
}
|
||||||
let loader = build("loader", debug, Some(TARGET), Some("loader".into()))?;
|
let loader = build("loader", debug, Some(TARGET), Some("loader".into()))?;
|
||||||
|
|
@ -185,10 +206,10 @@ fn renode_image(debug: bool) -> Result<(), DynError> {
|
||||||
fn run(debug: bool) -> Result<(), DynError> {
|
fn run(debug: bool) -> Result<(), DynError> {
|
||||||
let stream = if debug { "debug" } else { "release" };
|
let stream = if debug { "debug" } else { "release" };
|
||||||
let init = [
|
let init = [
|
||||||
//"shell",
|
"shell",
|
||||||
//"gam",
|
//"gam",
|
||||||
"benchmark",
|
//"benchmark",
|
||||||
"benchmark-target",
|
//"benchmark-target",
|
||||||
"log-server",
|
"log-server",
|
||||||
"graphics-server",
|
"graphics-server",
|
||||||
"ticktimer-server",
|
"ticktimer-server",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue