diff --git a/configs/common/Options.py b/configs/common/Options.py index 46bf4f3a99..f325e9be96 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -670,6 +670,13 @@ def addCommonOptions(parser): "that are present under any of the roots. If not given, dump all " "stats. ", ) + parser.add_argument( + "--override-vendor-string", + action="store", + type=str, + default=None, + help="Override vendor string returned by CPUID instruction in X86.", + ) def addSEOptions(parser): diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index a51fb33987..e558055f16 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -61,11 +61,11 @@ def getCPUClass(cpu_type): def setCPUClass(options): """Returns two cpu classes and the initial mode of operation. - Restoring from a checkpoint or fast forwarding through a benchmark - can be done using one type of cpu, and then the actual - simulation can be carried out using another type. This function - returns these two types of cpus and the initial mode of operation - depending on the options provided. + Restoring from a checkpoint or fast forwarding through a benchmark + can be done using one type of cpu, and then the actual + simulation can be carried out using another type. This function + returns these two types of cpus and the initial mode of operation + depending on the options provided. """ TmpClass, test_mem_mode = getCPUClass(options.cpu_type) @@ -300,9 +300,12 @@ def benchCheckpoints(options, maxtick, cptdir): def parseSimpointAnalysisFile(options, testsys): import re - simpoint_filename, weight_filename, interval_length, warmup_length = options.take_simpoint_checkpoints.split( - ",", 3 - ) + ( + simpoint_filename, + weight_filename, + interval_length, + warmup_length, + ) = options.take_simpoint_checkpoints.split(",", 3) print("simpoint analysis file:", simpoint_filename) print("simpoint weight file:", weight_filename) print("interval length:", interval_length) @@ -497,6 +500,13 @@ def run(options, root, testsys, cpu_class): for i in range(np): testsys.cpu[i].max_insts_any_thread = options.maxinsts + if options.override_vendor_string is not None: + for i in range(len(testsys.cpu)): + for j in range(len(testsys.cpu[i].isa)): + testsys.cpu[i].isa[ + j + ].vendor_string = options.override_vendor_string + if cpu_class: switch_cpus = [ cpu_class(switched_out=True, cpu_id=(i)) for i in range(np)