diff --git a/configs/example/lupv/run_lupv.py b/configs/example/lupv/run_lupv.py index 721adcd9af..93eaa866be 100644 --- a/configs/example/lupv/run_lupv.py +++ b/configs/example/lupv/run_lupv.py @@ -64,6 +64,13 @@ parser.add_argument( parser.add_argument( "num_cpus", type=int, help="The number of CPU in the system" ) +parser.add_argument( + "--max-ticks", + type=int, + required=False, + default=m5.MaxTick, + help="The maximum number of ticks to simulate. Used for testing.", +) args = parser.parse_args() @@ -105,7 +112,7 @@ root = Root(full_system=True, system=board) m5.instantiate() print("Beginning simulation!") -exit_event = m5.simulate() +exit_event = m5.simulate(args.max_ticks) print( "Exiting @ tick {} because {}.".format(m5.curTick(), exit_event.getCause()) diff --git a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py index 8b0c48b24a..2aca184321 100644 --- a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py +++ b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py @@ -174,3 +174,20 @@ gem5_verify_config( valid_hosts=constants.supported_hosts, length=constants.long_tag, ) + +gem5_verify_config( + name="test-lupv-example", + fixtures=(), + verifiers=(), + config=joinpath( + config.base_dir, + "configs", + "example", + "lupv", + "run_lupv.py", + ), + config_args=["timing", "1", "--max-ticks", "1000000000"], + valid_isas=(constants.riscv_tag,), + valid_hosts=constants.supported_hosts, + length=constants.long_tag, +)