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:
@@ -172,13 +172,13 @@ class BaseCPU(ClockedObject):
|
||||
|
||||
def connectCachedPorts(self, in_ports):
|
||||
for p in self._cached_ports:
|
||||
exec("self.%s = in_ports" % p)
|
||||
exec(f"self.{p} = in_ports")
|
||||
|
||||
def connectUncachedPorts(self, in_ports, out_ports):
|
||||
for p in self._uncached_interrupt_response_ports:
|
||||
exec("self.%s = out_ports" % p)
|
||||
exec(f"self.{p} = out_ports")
|
||||
for p in self._uncached_interrupt_request_ports:
|
||||
exec("self.%s = in_ports" % p)
|
||||
exec(f"self.{p} = in_ports")
|
||||
|
||||
def connectAllPorts(self, cached_in, uncached_in, uncached_out):
|
||||
self.connectCachedPorts(cached_in)
|
||||
@@ -267,7 +267,7 @@ class BaseCPU(ClockedObject):
|
||||
# Generate cpu nodes
|
||||
for i in range(int(self.numThreads)):
|
||||
reg = (int(self.socket_id) << 8) + int(self.cpu_id) + i
|
||||
node = FdtNode("cpu@%x" % reg)
|
||||
node = FdtNode(f"cpu@{reg:x}")
|
||||
node.append(FdtPropertyStrings("device_type", "cpu"))
|
||||
node.appendCompatible(["gem5,arm-cpu"])
|
||||
node.append(FdtPropertyWords("reg", state.CPUAddrCells(reg)))
|
||||
|
||||
@@ -117,7 +117,7 @@ class BaseTrafficGen(ClockedObject):
|
||||
def connectCachedPorts(self, in_ports):
|
||||
if hasattr(self, "_cached_ports") and (len(self._cached_ports) > 0):
|
||||
for p in self._cached_ports:
|
||||
exec("self.%s = in_ports" % p)
|
||||
exec(f"self.{p} = in_ports")
|
||||
else:
|
||||
self.port = in_ports
|
||||
|
||||
|
||||
Reference in New Issue
Block a user