Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14b80b3

Browse files
Merge #2520
2520: tools/board-runner: Improve documentation and OpenTitan support r=bradjc a=alistair23 ### Pull Request Overview Improvements to the OT board runner. ### Testing Strategy Using board runner to run Tock2.0 tests on OT. ### TODO or Help Wanted ### Documentation Updated - [X] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [X] Ran `make prepush`. Co-authored-by: Alistair Francis <[email protected]>
2 parents 200954b + 34302bd commit 14b80b3

File tree

2 files changed

+59
-29
lines changed

2 files changed

+59
-29
lines changed

tools/board-runner/README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
# Tock Board Runner
22

3-
This is a Rust program that uses rexpect to test Tock on different boards. The goal of this is to automated the testing, currently it still requires manual steps though.
3+
This is a Rust program that uses rexpect to test Tock on different boards.
4+
The goal of this is to automated the testing, currently it still requires
5+
manual steps though.
46

57
## Supported Boards
68

79
### OpenTitan
810

911
This can be used to perform Tock release testing on the OpenTitan board.
1012

11-
This assumes that the OpenTitan serial console is available on the machines first serial port (`/dev/ttyUSB0` for Unix systems). The tests can be run from the top level of the Tock direcotry with the following command
13+
This assumes that the OpenTitan serial console is available on the machines
14+
first serial port (`/dev/ttyUSB0` for Unix systems). The tests can be run from
15+
the top level of the Tock direcotry with the following command
1216

1317
```shell
14-
OPENTITAN_TREE=<opentitan_repo> LIBTOCK_C_TREE=<libtock_c_repo> TARGET=earlgrey-nexysvideo make board-release-test
18+
OPENTITAN_TREE=<opentitan_repo> LIBTOCK_C_TREE=<libtock_c_repo> TARGET=earlgrey_nexysvideo make board-release-test
1519
```
1620

17-
Where `opentitan_repo` and `libtock_c_repo` point to the top level directory of the corresponding repos. You will need to make sure that the OpenTitan spiflash command has been built in the OpenTitan repo and that the c apps have been built in the libtock-c repo.
21+
Where `opentitan_repo` and `libtock_c_repo` point to the top level directory
22+
of the corresponding repos. You will need to make sure that the OpenTitan
23+
spiflash command has been built in the OpenTitan repo and that the c apps have
24+
been built in the libtock-c repo.
1825

1926
### Redboard Artemis Nano
2027

21-
This can be used to perform Tock release testing on the Sparkfun Redboard Artemis Nano board.
28+
This can be used to perform Tock release testing on the Sparkfun Redboard
29+
Artemis Nano board.
2230

23-
This assumes that the ARtemis Nano serial console is available on the machines first serial port (`/dev/ttyUSB0` for Unix systems). The tests can be run from the top level of the Tock directory with the following command
31+
This assumes that the ARtemis Nano serial console is available on the machines
32+
first serial port (`/dev/ttyUSB0` for Unix systems). The tests can be run from
33+
the top level of the Tock directory with the following command
2434

2535
```shell
2636
LIBTOCK_C_TREE=<libtock_c_repo> TARGET=artemis_nano make board-release-test
2737
```
2838

29-
Where `libtock_c_repo` points to the top level directory of the corresponding libtock-c repo.
39+
Where `libtock_c_repo` points to the top level directory of the corresponding
40+
libtock-c repo.

tools/board-runner/src/earlgrey_nexysvideo.rs

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn earlgrey_nexysvideo_flash(
3434
// Flash the Tock kernel and app
3535
let mut build = Command::new("make")
3636
.arg("-C")
37-
.arg("../../boards/earlgrey_nexysvideo")
37+
.arg("../../boards/earlgrey-nexysvideo")
3838
.arg(format!(
3939
"OPENTITAN_TREE={}",
4040
env::var("OPENTITAN_TREE").unwrap()
@@ -49,9 +49,7 @@ fn earlgrey_nexysvideo_flash(
4949
// Make sure the image is flashed
5050
p.exp_string("Processing frame #13, expecting #13")?;
5151
p.exp_string("Processing frame #67, expecting #67")?;
52-
p.exp_string("Processing frame #155, expecting #155")?;
53-
p.exp_string("Processing frame #183, expecting #183")?;
54-
p.exp_string("Processing frame #200, expecting #200")?;
52+
p.exp_string("Processing frame #101, expecting #101")?;
5553

5654
p.exp_string("Boot ROM initialisation has completed, jump into flash")?;
5755

@@ -116,7 +114,7 @@ fn earlgrey_nexysvideo_c_hello_and_printf_long() -> Result<(), Error> {
116114
.arg(format!(
117115
"{}/{}",
118116
env::var("LIBTOCK_C_TREE").unwrap(),
119-
"examples/tests/printf_long/build/rv32imc/rv32imc.0x20031080.0x10008000.tbf"
117+
"examples/tests/printf_long/build/rv32imc/rv32imc.0x20032080.0x10008000.tbf"
120118
))
121119
.stdout(app)
122120
.spawn()
@@ -351,6 +349,7 @@ fn earlgrey_nexysvideo_mpu_walk_region() -> Result<(), Error> {
351349
p.exp_string("MPU Walk Regions")?;
352350
p.exp_string("Walking flash")?;
353351
p.exp_string("Will overrun")?;
352+
p.exp_string("0x2003ba00")?;
354353
p.exp_string("panicked at 'Process mpu_walk_region had a fault'")?;
355354

356355
Ok(())
@@ -377,53 +376,73 @@ pub fn all_earlgrey_nexysvideo_tests() {
377376
println!();
378377
println!("Running earlgrey_nexysvideo tests...");
379378
earlgrey_nexysvideo_c_hello()
380-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
379+
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo_c_hello job failed with {}", e));
381380
earlgrey_nexysvideo_blink()
382-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
383-
earlgrey_nexysvideo_c_hello_and_printf_long()
384-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
385-
earlgrey_nexysvideo_recv_short_and_recv_long()
386-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
387-
earlgrey_nexysvideo_blink_and_c_hello_and_buttons()
388-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
389-
earlgrey_nexysvideo_console_recv_short()
390-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
381+
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo_blink job failed with {}", e));
382+
earlgrey_nexysvideo_c_hello_and_printf_long().unwrap_or_else(|e| {
383+
panic!(
384+
"earlgrey_nexysvideo_c_hello_and_printf_long job failed with {}",
385+
e
386+
)
387+
});
388+
earlgrey_nexysvideo_recv_short_and_recv_long().unwrap_or_else(|e| {
389+
panic!(
390+
"earlgrey_nexysvideo_recv_short_and_recv_long job failed with {}",
391+
e
392+
)
393+
});
394+
earlgrey_nexysvideo_blink_and_c_hello_and_buttons().unwrap_or_else(|e| {
395+
panic!(
396+
"earlgrey_nexysvideo_blink_and_c_hello_and_buttons job failed with {}",
397+
e
398+
)
399+
});
400+
earlgrey_nexysvideo_console_recv_short().unwrap_or_else(|e| {
401+
panic!(
402+
"earlgrey_nexysvideo_console_recv_short job failed with {}",
403+
e
404+
)
405+
});
391406
earlgrey_nexysvideo_console_timeout()
392-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
407+
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo_console_timeout job failed with {}", e));
393408

394409
// Disabled by default.
395410
// Requires:
396411
// STACK_SIZE = 2048
397412
// APP_HEAP_SIZE = 4096
398413
// KERNEL_HEAP_SIZE = 2048
399-
// earlgrey_nexysvideo_malloc_test1().unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
414+
// earlgrey_nexysvideo_malloc_test1()
415+
// .unwrap_or_else(|e| panic!("earlgrey_nexysvideo_malloc_test1 job failed with {}", e));
400416

401417
// Disabled by default.
402418
// Requires:
403419
// STACK_SIZE = 2048
404420
// APP_HEAP_SIZE = 4096
405421
// KERNEL_HEAP_SIZE = 2048
406-
// earlgrey_nexysvideo_stack_size_test1().unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
422+
// earlgrey_nexysvideo_stack_size_test1()
423+
// .unwrap_or_else(|e| panic!("earlgrey_nexysvideo_stack_size_test1 job failed with {}", e));
407424

408425
// Disabled by default.
409426
// Requires:
410427
// STACK_SIZE = 2048
411428
// APP_HEAP_SIZE = 4096
412429
// KERNEL_HEAP_SIZE = 2048
413-
// earlgrey_nexysvideo_stack_size_test2().unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
430+
// earlgrey_nexysvideo_stack_size_test2()
431+
// .unwrap_or_else(|e| panic!("earlgrey_nexysvideo_stack_size_test2 job failed with {}", e));
414432

415433
earlgrey_nexysvideo_mpu_stack_growth()
416-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
434+
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo_mpu_stack_growth job failed with {}", e));
417435

418436
// Disabled by default.
419437
// Requires:
420438
// STACK_SIZE = 2048
421439
// APP_HEAP_SIZE = 4096
422440
// KERNEL_HEAP_SIZE = 2048
423-
// earlgrey_nexysvideo_mpu_walk_region().unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
441+
// earlgrey_nexysvideo_mpu_walk_region()
442+
// .unwrap_or_else(|e| panic!("earlgrey_nexysvideo_mpu_walk_region job failed with {}", e));
424443

425444
earlgrey_nexysvideo_multi_alarm_test()
426-
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo job failed with {}", e));
445+
.unwrap_or_else(|e| panic!("earlgrey_nexysvideo_multi_alarm_test job failed with {}", e));
427446

428447
println!("earlgrey_nexysvideo SUCCESS.");
429448
}

0 commit comments

Comments
 (0)