misc: Use python f-strings for string formatting

This patch has been generated by applying flynt to the
gem5 repo (ext has been excluded)

JIRA: https://gem5.atlassian.net/browse/GEM5-831

Change-Id: I0935db6223d5426b99515959bde78e374cbadb04
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68957
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Giacomo Travaglini
2023-03-15 13:34:46 +00:00
parent 07fca546e6
commit e73655d038
242 changed files with 814 additions and 1002 deletions

View File

@@ -280,6 +280,6 @@ def create_system(
elif options.topology in ["Crossbar", "Pt2Pt"]:
topology = create_topology(network_cntrls, options)
else:
m5.fatal("%s not supported!" % options.topology)
m5.fatal(f"{options.topology} not supported!")
return (cpu_sequencers, mem_cntrls, topology)

View File

@@ -428,7 +428,7 @@ class CPUSequencerWrapper:
cpu.icache_port = self.inst_seq.in_ports
for p in cpu._cached_ports:
if str(p) != "icache_port":
exec("cpu.%s = self.data_seq.in_ports" % p)
exec(f"cpu.{p} = self.data_seq.in_ports")
cpu.connectUncachedPorts(
self.data_seq.in_ports, self.data_seq.interrupt_out_port
)

View File

@@ -120,8 +120,8 @@ def define_options(parser):
)
protocol = buildEnv["PROTOCOL"]
exec("from . import %s" % protocol)
eval("%s.define_options(parser)" % protocol)
exec(f"from . import {protocol}")
eval(f"{protocol}.define_options(parser)")
Network.define_options(parser)
@@ -207,8 +207,8 @@ def create_topology(controllers, options):
found in configs/topologies/BaseTopology.py
This is a wrapper for the legacy topologies.
"""
exec("import topologies.%s as Topo" % options.topology)
topology = eval("Topo.%s(controllers)" % options.topology)
exec(f"import topologies.{options.topology} as Topo")
topology = eval(f"Topo.{options.topology}(controllers)")
return topology
@@ -242,7 +242,7 @@ def create_system(
cpus = system.cpu
protocol = buildEnv["PROTOCOL"]
exec("from . import %s" % protocol)
exec(f"from . import {protocol}")
try:
(cpu_sequencers, dir_cntrls, topology) = eval(
"%s.create_system(options, full_system, system, dma_ports,\
@@ -250,7 +250,7 @@ def create_system(
% protocol
)
except:
print("Error: could not create sytem for ruby protocol %s" % protocol)
print(f"Error: could not create sytem for ruby protocol {protocol}")
raise
# Create the network topology