From 91f8f2b276bf0a4ef03963822dbcbadd6a657d2e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 2 Dec 2022 11:15:45 -0800 Subject: [PATCH] tests: Add missing `_pre_instantiate()` As of this change: https://gem5-review.googlesource.com/c/public/gem5/+/65051, the `_pre_instantiate` function must be called prior to `m5.instantiate` when using the stdlib without the Simulator module. The "test/gem5/replacement-policies/run_replacement_policy_test.py" lacked this and was causing errors when running replacement policy tests. In addition we also fix the incorrect type of size in`createArtifact'. This was causing problems with the Kokoro build system. The typing here was `int` but had a default value of `None`. The correct type is therefore `Optional[int]`. Change-Id: Ibaf63151196b15f68e643fa5c1b290439d6618c8 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66371 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce (cherry picked from commit a3fd9631cc209914fad2e2c1fb24006d6d5adc2d) Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66613 --- tests/gem5/replacement-policies/run_replacement_policy_test.py | 1 + util/gem5art/artifact/gem5art/artifact/artifact.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/gem5/replacement-policies/run_replacement_policy_test.py b/tests/gem5/replacement-policies/run_replacement_policy_test.py index 10061094b4..31076c6d99 100644 --- a/tests/gem5/replacement-policies/run_replacement_policy_test.py +++ b/tests/gem5/replacement-policies/run_replacement_policy_test.py @@ -85,6 +85,7 @@ motherboard = TestBoard( ) root = Root(full_system=False, system=motherboard) +motherboard._pre_instantiate() m5.instantiate() generator.start_traffic() diff --git a/util/gem5art/artifact/gem5art/artifact/artifact.py b/util/gem5art/artifact/gem5art/artifact/artifact.py index 91ffc64e50..46664e82fb 100644 --- a/util/gem5art/artifact/gem5art/artifact/artifact.py +++ b/util/gem5art/artifact/gem5art/artifact/artifact.py @@ -158,7 +158,7 @@ class Artifact: documentation: str, inputs: List["Artifact"] = [], architecture: str = "", - size: int = None, + size: Optional[int] = None, is_zipped: bool = False, md5sum: str = "", url: str = "",