misc: Run pre-commit run --all-files

This is reflect the updates made to black when running `pre-commit
autoupdate`.

Change-Id: Ifb7fea117f354c7f02f26926a5afdf7d67bc5919
This commit is contained in:
Bobby R. Bruce
2023-10-09 12:40:48 -07:00
parent 317d2fb5b8
commit ddf6cb88e4
183 changed files with 120 additions and 175 deletions

View File

@@ -36,7 +36,6 @@ from m5.objects import *
def TLB_constructor(options, level, gpu_ctrl=None, full_system=False):
if full_system:
constructor_call = (
"VegaGPUTLB(\
@@ -71,7 +70,6 @@ def TLB_constructor(options, level, gpu_ctrl=None, full_system=False):
def Coalescer_constructor(options, level, full_system):
if full_system:
constructor_call = (
"VegaTLBCoalescer(probesPerCycle = \

View File

@@ -29,7 +29,6 @@
def tlb_options(parser):
# ===================================================================
# TLB Configuration
# ===================================================================

View File

@@ -430,7 +430,6 @@ def add_options(parser):
# configure HMC host controller
def config_hmc_host_ctrl(opt, system):
# create HMC host controller
system.hmc_host = SubSystem()
@@ -533,7 +532,6 @@ def config_hmc_host_ctrl(opt, system):
# Create an HMC device
def config_hmc_dev(opt, system, hmc_host):
# create HMC device
system.hmc_dev = SubSystem()

View File

@@ -164,7 +164,7 @@ class EnumList(ObjectList):
def _add_objects(self):
"""Add all enum values to the ObjectList"""
self._sub_classes = {}
for (key, value) in list(self.base_cls.__members__.items()):
for key, value in list(self.base_cls.__members__.items()):
# All Enums have a value Num_NAME at the end which we
# do not want to include
if not key.startswith("Num_"):

View File

@@ -771,7 +771,6 @@ def run(options, root, testsys, cpu_class):
if (
options.take_checkpoints or options.take_simpoint_checkpoints
) and options.checkpoint_restore:
if m5.options.outdir:
cptdir = m5.options.outdir
else:

View File

@@ -44,6 +44,7 @@ at: http://www.arm.com/ResearchEnablement/SystemModeling
from m5.objects import *
# Simple function to allow a string of [01x_] to be converted into a
# mask and value for use with MinorFUTiming
def make_implicant(implicant_string):

View File

@@ -36,6 +36,7 @@
from m5.objects import *
from .O3_ARM_v7a import O3_ARM_v7a_3
# O3_ARM_v7a_3 adapted to generate elastic traces
class O3_ARM_v7a_3_Etrace(O3_ARM_v7a_3):
# Make the number of entries in the ROB, LQ and SQ very

View File

@@ -26,6 +26,7 @@
from m5.objects import *
# Simple ALU Instructions have a latency of 1
class O3_ARM_v7a_Simple_Int(FUDesc):
opList = [OpDesc(opClass="IntAlu", opLat=1)]

View File

@@ -31,6 +31,7 @@ from m5.objects import *
# ex5 LITTLE core (based on the ARM Cortex-A7)
# -----------------------------------------------------------------------
# Simple ALU Instructions have a latency of 3
class ex5_LITTLE_Simple_Int(MinorDefaultIntFU):
opList = [OpDesc(opClass="IntAlu", opLat=4)]

View File

@@ -31,6 +31,7 @@ from m5.objects import *
# ex5 big core (based on the ARM Cortex-A15)
# -----------------------------------------------------------------------
# Simple ALU Instructions have a latency of 1
class ex5_big_Simple_Int(FUDesc):
opList = [OpDesc(opClass="IntAlu", opLat=1)]

View File

@@ -164,7 +164,7 @@ def build_test_system(np):
# assuming that there is just one such port.
test_sys.iobus.mem_side_ports = test_sys.ruby._io_port.in_ports
for (i, cpu) in enumerate(test_sys.cpu):
for i, cpu in enumerate(test_sys.cpu):
#
# Tie the cpu ports to the correct ruby system ports
#

2
configs/dist/sw.py vendored
View File

@@ -62,7 +62,7 @@ def build_switch(args):
for i in range(args.dist_size)
]
for (i, link) in enumerate(switch.portlink):
for i, link in enumerate(switch.portlink):
link.int0 = switch.interface[i]
return switch

View File

@@ -150,6 +150,7 @@ cfg_file = open(cfg_file_name, "w")
burst_size = 64
system.cache_line_size = burst_size
# lazy version to check if an integer is a power of two
def is_pow2(num):
return num != 0 and ((num & (num - 1)) == 0)
@@ -177,6 +178,7 @@ iterations = 2
# do not pile up in the system, adjust if needed
itt = 150 * 1000
# for every data point, we create a trace containing a random address
# sequence, so that we can play back the same sequence for warming and
# the actual measurement
@@ -276,6 +278,7 @@ system.tgen.port = system.monitor.cpu_side_port
# basic to explore some of the options
from common.Caches import *
# a starting point for an L3 cache
class L3Cache(Cache):
assoc = 16

View File

@@ -673,6 +673,7 @@ gpu_driver.device = gpu_cmd_proc
shader.dispatcher = dispatcher
shader.gpu_cmd_proc = gpu_cmd_proc
# Create and assign the workload Check for rel_path in elements of
# base_list using test, returning the first full path that satisfies test
def find_path(base_list, rel_path, test):
@@ -756,7 +757,7 @@ if fast_forward:
]
# Other CPU strings cause bad addresses in ROCm. Revert back to M5 Simulator.
for (i, cpu) in enumerate(cpu_list):
for i, cpu in enumerate(cpu_list):
for j in range(len(cpu)):
cpu.isa[j].vendor_string = "M5 Simulator"

View File

@@ -117,6 +117,7 @@ board.set_workload(
)
)
# This generator will dump the stats and exit the simulation loop when the
# simulation region reaches its end. In the case there is a warmup interval,
# the simulation stats are reset after the warmup is complete.

View File

@@ -211,6 +211,7 @@ board.set_kernel_disk_workload(
readfile_contents=command,
)
# The first exit_event ends with a `workbegin` cause. This means that the
# system started successfully and the execution on the program started.
def handle_workbegin():
@@ -236,6 +237,7 @@ def handle_workbegin():
# The next exit_event is to simulate the ROI. It should be exited with a cause
# marked by `workend`.
# We exepect that ROI ends with `workend` or `simulate() limit reached`.
def handle_workend():
print("Dump stats at the end of the ROI!")

View File

@@ -192,6 +192,7 @@ board.set_kernel_disk_workload(
readfile_contents=command,
)
# functions to handle different exit events during the simuation
def handle_workbegin():
print("Done booting Linux")

View File

@@ -46,7 +46,6 @@ class DisjointSimple(SimpleNetwork):
self.ruby_system = ruby_system
def connectCPU(self, opts, controllers):
# Setup parameters for makeTopology call for CPU network
topo_module = import_module(f"topologies.{opts.cpu_topology}")
topo_class = getattr(topo_module, opts.cpu_topology)
@@ -56,7 +55,6 @@ class DisjointSimple(SimpleNetwork):
self.initSimple(opts, self.int_links, self.ext_links)
def connectGPU(self, opts, controllers):
# Setup parameters for makeTopology call for GPU network
topo_module = import_module(f"topologies.{opts.gpu_topology}")
topo_class = getattr(topo_module, opts.gpu_topology)
@@ -66,7 +64,6 @@ class DisjointSimple(SimpleNetwork):
self.initSimple(opts, self.int_links, self.ext_links)
def initSimple(self, opts, int_links, ext_links):
# Attach links to network
self.int_links = int_links
self.ext_links = ext_links
@@ -82,7 +79,6 @@ class DisjointGarnet(GarnetNetwork):
self.ruby_system = ruby_system
def connectCPU(self, opts, controllers):
# Setup parameters for makeTopology call for CPU network
topo_module = import_module(f"topologies.{opts.cpu_topology}")
topo_class = getattr(topo_module, opts.cpu_topology)
@@ -94,7 +90,6 @@ class DisjointGarnet(GarnetNetwork):
Network.init_network(opts, self, GarnetNetworkInterface)
def connectGPU(self, opts, controllers):
# Setup parameters for makeTopology call
topo_module = import_module(f"topologies.{opts.gpu_topology}")
topo_class = getattr(topo_module, opts.gpu_topology)

View File

@@ -38,7 +38,6 @@ from ruby import Ruby
class DummySystem:
def __init__(self, mem_ranges):
self.mem_ctrls = []
self.mem_ranges = mem_ranges
@@ -51,7 +50,6 @@ class Disjoint_VIPER(RubySystem):
super(Disjoint_VIPER, self).__init__()
def create(self, options, system, piobus, dma_devices):
# Disjoint network topology
if "garnet" in options.network:
self.network_cpu = DisjointGarnet(self)

View File

@@ -267,7 +267,7 @@ def makeGpuFSSystem(args):
# and FMA.
avx_cpu_features = [0x00020F51, 0x00000805, 0xEFDBFBFF, 0x1C983209]
for (i, cpu) in enumerate(system.cpu):
for i, cpu in enumerate(system.cpu):
# Break once we reach the shader "CPU"
if i == args.num_cpus:
break

View File

@@ -260,6 +260,7 @@ system.memchecker = MemChecker()
# For each level, track the next subsys index to use
next_subsys_index = [0] * (len(cachespec) + 1)
# Recursive function to create a sub-tree of the cache and tester
# hierarchy
def make_cache_level(ncaches, prototypes, level, next_cache):

View File

@@ -145,6 +145,7 @@ parser.add_argument(
args = parser.parse_args()
# Get the total number of testers
def numtesters(cachespec, testerspec):
# Determine the tester multiplier for each level as the
@@ -278,6 +279,7 @@ system.clk_domain = SrcClockDomain(
# For each level, track the next subsys index to use
next_subsys_index = [0] * (len(cachespec) + 1)
# Recursive function to create a sub-tree of the cache and tester
# hierarchy
def make_cache_level(ncaches, prototypes, level, next_cache):

View File

@@ -35,6 +35,7 @@
from ruby import CHI_config
# CustomMesh parameters for a 2x4 mesh. Routers will have the following layout:
#
# 0 --- 1 --- 2 --- 3

View File

@@ -366,7 +366,6 @@ class ConfigManager(object):
if port_has_correct_index(from_port) and port_has_correct_index(
to_port
):
connections_to_make.append((from_port, to_port))
increment_port_index(from_port)

View File

@@ -110,7 +110,6 @@ class MyCacheSystem(RubySystem):
class L1Cache(L1Cache_Controller):
_version = 0
@classmethod
@@ -174,7 +173,6 @@ class L1Cache(L1Cache_Controller):
class DirController(Directory_Controller):
_version = 0
@classmethod

View File

@@ -108,7 +108,6 @@ class MyCacheSystem(RubySystem):
class L1Cache(L1Cache_Controller):
_version = 0
@classmethod
@@ -163,7 +162,6 @@ class L1Cache(L1Cache_Controller):
class DirController(Directory_Controller):
_version = 0
@classmethod

View File

@@ -121,7 +121,6 @@ def define_options(parser):
def create_network(options, ruby):
# Allow legacy users to use garnet through garnet2.0 option
# until next gem5 release.
if options.network == "garnet2.0":
@@ -162,7 +161,6 @@ def create_network(options, ruby):
def init_network(options, network, InterfaceClass):
if options.network == "garnet":
network.num_rows = options.mesh_rows
network.vcs_per_vnet = options.vcs_per_vnet

View File

@@ -38,6 +38,7 @@ addToPath("../")
from topologies.Cluster import Cluster
#
# Note: the L1 Cache latency is only used by the sequencer on fast path hits
#
@@ -115,7 +116,6 @@ def construct(options, system, ruby_system):
cpuCluster = None
cpuCluster = Cluster(name="CPU Cluster", extBW=8, intBW=8) # 16 GB/s
for i in range((options.num_cpus + 1) // 2):
cp_cntrl = CPCntrl()
cp_cntrl.create(options, ruby_system, system)

View File

@@ -65,7 +65,6 @@ def read_config_file(file):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "CHI":
m5.panic("This script requires the CHI build")

View File

@@ -524,7 +524,6 @@ def define_options(parser):
def construct_dirs(options, system, ruby_system, network):
dir_cntrl_nodes = []
# For an odd number of CPUs, still create the right number of controllers
@@ -592,7 +591,6 @@ def construct_dirs(options, system, ruby_system, network):
def construct_gpudirs(options, system, ruby_system, network):
dir_cntrl_nodes = []
mem_ctrls = []
@@ -681,12 +679,10 @@ def construct_gpudirs(options, system, ruby_system, network):
def construct_corepairs(options, system, ruby_system, network):
cpu_sequencers = []
cp_cntrl_nodes = []
for i in range((options.num_cpus + 1) // 2):
cp_cntrl = CPCntrl()
cp_cntrl.create(options, ruby_system, system)
@@ -721,7 +717,6 @@ def construct_corepairs(options, system, ruby_system, network):
def construct_tcps(options, system, ruby_system, network):
tcp_sequencers = []
tcp_cntrl_nodes = []
@@ -729,7 +724,6 @@ def construct_tcps(options, system, ruby_system, network):
TCC_bits = int(math.log(options.num_tccs, 2))
for i in range(options.num_compute_units):
tcp_cntrl = TCPCntrl(
TCC_select_num_bits=TCC_bits, issue_latency=1, number_of_TBEs=2560
)
@@ -769,7 +763,6 @@ def construct_tcps(options, system, ruby_system, network):
def construct_sqcs(options, system, ruby_system, network):
sqc_sequencers = []
sqc_cntrl_nodes = []
@@ -777,7 +770,6 @@ def construct_sqcs(options, system, ruby_system, network):
TCC_bits = int(math.log(options.num_tccs, 2))
for i in range(options.num_sqc):
sqc_cntrl = SQCCntrl(TCC_select_num_bits=TCC_bits)
sqc_cntrl.create(options, ruby_system, system)
@@ -804,7 +796,6 @@ def construct_sqcs(options, system, ruby_system, network):
def construct_scalars(options, system, ruby_system, network):
scalar_sequencers = []
scalar_cntrl_nodes = []
@@ -837,7 +828,6 @@ def construct_scalars(options, system, ruby_system, network):
def construct_cmdprocs(options, system, ruby_system, network):
cmdproc_sequencers = []
cmdproc_cntrl_nodes = []
@@ -845,7 +835,6 @@ def construct_cmdprocs(options, system, ruby_system, network):
TCC_bits = int(math.log(options.num_tccs, 2))
for i in range(options.num_cp):
tcp_ID = options.num_compute_units + i
sqc_ID = options.num_sqc + i
@@ -898,11 +887,9 @@ def construct_cmdprocs(options, system, ruby_system, network):
def construct_tccs(options, system, ruby_system, network):
tcc_cntrl_nodes = []
for i in range(options.num_tccs):
tcc_cntrl = TCCCntrl(l2_response_latency=options.TCC_latency)
tcc_cntrl.create(options, ruby_system, system)
tcc_cntrl.l2_request_latency = options.gpu_to_dir_latency

View File

@@ -31,6 +31,7 @@ from m5.defines import buildEnv
from m5.util import addToPath
from .Ruby import create_topology, create_directories
#
# Declare caches used by the protocol
#

View File

@@ -35,6 +35,7 @@ from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
from common import FileSystemConfig
#
# Declare caches used by the protocol
#
@@ -77,7 +78,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MESI_Three_Level":
fatal(
"This script requires the MESI_Three_Level protocol to be\

View File

@@ -35,6 +35,7 @@ from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
from common import FileSystemConfig
#
# Declare caches used by the protocol
#
@@ -77,7 +78,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MESI_Three_Level_HTM":
fatal(
"This script requires the MESI_Three_Level protocol to be\

View File

@@ -32,6 +32,7 @@ from m5.defines import buildEnv
from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
#
# Declare caches used by the protocol
#
@@ -50,7 +51,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MESI_Two_Level":
fatal("This script requires the MESI_Two_Level protocol to be built.")

View File

@@ -32,6 +32,7 @@ from m5.defines import buildEnv
from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
#
# Declare caches used by the protocol
#
@@ -46,7 +47,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MI_example":
panic("This script requires the MI_example protocol to be built.")

View File

@@ -327,7 +327,6 @@ def create_system(
# For an odd number of CPUs, still create the right number of controllers
cpuCluster = Cluster(extBW=512, intBW=512) # 1 TB/s
for i in range((options.num_cpus + 1) // 2):
cp_cntrl = CPCntrl()
cp_cntrl.create(options, ruby_system, system)

View File

@@ -44,6 +44,7 @@ from m5.defines import buildEnv
from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
#
# Declare caches used by the protocol
#
@@ -64,7 +65,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MOESI_CMP_directory":
panic(
"This script requires the MOESI_CMP_directory protocol to be built."

View File

@@ -32,6 +32,7 @@ from m5.defines import buildEnv
from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
#
# Declare caches used by the protocol
#
@@ -71,7 +72,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MOESI_CMP_token":
panic("This script requires the MOESI_CMP_token protocol to be built.")

View File

@@ -33,6 +33,7 @@ from .Ruby import create_topology, create_directories
from .Ruby import send_evicts
from common import FileSystemConfig
#
# Declare caches used by the protocol
#
@@ -70,7 +71,6 @@ def define_options(parser):
def create_system(
options, full_system, system, dma_ports, bootmem, ruby_system, cpus
):
if buildEnv["PROTOCOL"] != "MOESI_hammer":
panic("This script requires the MOESI_hammer protocol to be built.")

View File

@@ -221,7 +221,6 @@ def create_system(
bootmem=None,
cpus=None,
):
system.ruby = RubySystem()
ruby = system.ruby

View File

@@ -64,6 +64,7 @@ parser.add_argument("-b", "--benchmark", help="Splash 2 benchmark to run")
args = parser.parse_args()
# --------------------
# Define Splash2 Benchmarks
# ====================

View File

@@ -66,6 +66,7 @@ if not args.numcpus:
print("Specify the number of cpus with -n")
sys.exit(1)
# --------------------
# Define Splash2 Benchmarks
# ====================

View File

@@ -34,7 +34,6 @@ class Crossbar(SimpleTopology):
description = "Crossbar"
def makeTopology(self, options, network, IntLink, ExtLink, Router):
# default values for link latency and router latency.
# Can be over-ridden on a per link/router basis
link_latency = options.link_latency # used by simple and garnet

View File

@@ -67,7 +67,6 @@ class CustomMesh(SimpleTopology):
cross_links,
cross_link_latency,
):
# East->West, West->East, North->South, South->North
# XY routing weights
link_weights = [1, 1, 2, 2]

View File

@@ -91,7 +91,7 @@ class MeshDirCorners_XY(SimpleTopology):
# Connect each cache controller to the appropriate router
ext_links = []
for (i, n) in enumerate(cache_nodes):
for i, n in enumerate(cache_nodes):
cntrl_level, router_id = divmod(i, num_routers)
assert cntrl_level < caches_per_router
ext_links.append(
@@ -161,7 +161,7 @@ class MeshDirCorners_XY(SimpleTopology):
link_count += 1
# Connect the dma nodes to router 0. These should only be DMA nodes.
for (i, node) in enumerate(dma_nodes):
for i, node in enumerate(dma_nodes):
assert node.type == "DMA_Controller"
ext_links.append(
ExtLink(

View File

@@ -87,7 +87,7 @@ class Mesh_XY(SimpleTopology):
# Connect each node to the appropriate router
ext_links = []
for (i, n) in enumerate(network_nodes):
for i, n in enumerate(network_nodes):
cntrl_level, router_id = divmod(i, num_routers)
assert cntrl_level < cntrls_per_router
ext_links.append(
@@ -102,7 +102,7 @@ class Mesh_XY(SimpleTopology):
# Connect the remainding nodes to router 0. These should only be
# DMA nodes.
for (i, node) in enumerate(remainder_nodes):
for i, node in enumerate(remainder_nodes):
assert node.type == "DMA_Controller"
assert i < remainder
ext_links.append(

View File

@@ -90,7 +90,7 @@ class Mesh_westfirst(SimpleTopology):
# Connect each node to the appropriate router
ext_links = []
for (i, n) in enumerate(network_nodes):
for i, n in enumerate(network_nodes):
cntrl_level, router_id = divmod(i, num_routers)
assert cntrl_level < cntrls_per_router
ext_links.append(
@@ -105,7 +105,7 @@ class Mesh_westfirst(SimpleTopology):
# Connect the remainding nodes to router 0. These should only be
# DMA nodes.
for (i, node) in enumerate(remainder_nodes):
for i, node in enumerate(remainder_nodes):
assert node.type == "DMA_Controller"
assert i < remainder
ext_links.append(