fastmodel: Helper function to setup FastModels for simulation
authorChun-Chen TK Hsu <chunchenhsu@google.com>
Fri, 25 Oct 2019 08:59:27 +0000 (16:59 +0800)
committerChun-Chen TK Hsu <chunchenhsu@google.com>
Wed, 30 Oct 2019 08:14:49 +0000 (08:14 +0000)
This function sets up ARM license, simulation name, and minimum
synchronize latency in FastModels. This function should be called once
per simulation.

Change-Id: Ic3408955aaff9f8b4e2b72d2f2b0da97b41bfc3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22183
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/fastmodel/arm_fast_model.py

index d666b7febfaeb866361a3f53efcc6bf70a083e12..2c19fe5bc4acb158f44473550d6e18ea3a562dee 100644 (file)
@@ -128,3 +128,9 @@ def scx_get_min_sync_latency(arg=None):
         return _m5.arm_fast_model.scx_get_min_sync_latency(arg)
     else:
         return _m5.arm_fast_model.scx_get_min_sync_latency()
+
+# This should be called once per simulation
+def setup_simulation(sim_name, min_sync_latency=100.0 / 100000000):
+    set_armlmd_license_file()
+    scx_initialize(sim_name)
+    scx_set_min_sync_latency(min_sync_latency)