Skip to content

Commit

Permalink
misc: Run pre-commit run --all-files
Browse files Browse the repository at this point in the history
This ensures `isort` is applied to all files in the repo.

Change-Id: Ib7ced1c924ef1639542bf0d1a01c5737f6ba43e9
  • Loading branch information
BobbyRBruce committed Nov 30, 2023
1 parent 7d67109 commit d11c40d
Show file tree
Hide file tree
Showing 681 changed files with 3,589 additions and 2,347 deletions.
3 changes: 1 addition & 2 deletions build_tools/cxx_config_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand All @@ -59,8 +58,8 @@
module = importlib.import_module(args.modpath)
sim_object = getattr(module, sim_object_name)

from m5.params import isSimObjectClass
import m5.params
from m5.params import isSimObjectClass

code = code_formatter()

Expand Down
1 change: 0 additions & 1 deletion build_tools/cxx_config_hh.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand Down
1 change: 0 additions & 1 deletion build_tools/enum_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand Down
1 change: 0 additions & 1 deletion build_tools/enum_hh.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand Down
1 change: 0 additions & 1 deletion build_tools/sim_object_param_struct_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand Down
1 change: 0 additions & 1 deletion build_tools/sim_object_param_struct_hh.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import sys

import importer

from code_formatter import code_formatter

parser = argparse.ArgumentParser()
Expand Down
8 changes: 7 additions & 1 deletion configs/common/Benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from common.SysPaths import script, disk, binary
from os import environ as env

from common.SysPaths import (
binary,
disk,
script,
)

from m5.defines import buildEnv


Expand Down
7 changes: 4 additions & 3 deletions configs/common/CacheConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
# Configure the M5 cache hierarchy config in one place
#

from common import ObjectList
from common.Caches import *

import m5
from m5.objects import *

from gem5.isas import ISA
from gem5.runtime import get_runtime_isa

from common.Caches import *
from common import ObjectList


def _get_hwp(hwp_option):
if hwp_option == None:
Expand Down
1 change: 1 addition & 0 deletions configs/common/Caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

from m5.defines import buildEnv
from m5.objects import *

from gem5.isas import ISA
from gem5.runtime import get_runtime_isa

Expand Down
2 changes: 1 addition & 1 deletion configs/common/CpuConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from m5 import fatal
import m5.objects
from m5 import fatal


def config_etrace(cpu_cls, cpu_list, options):
Expand Down
5 changes: 3 additions & 2 deletions configs/common/FSConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from common import ObjectList
from common.Benchmarks import *

import m5
import m5.defines
from m5.objects import *
from m5.util import *
from common.Benchmarks import *
from common import ObjectList

# Populate to reflect supported os types per target ISA
os_types = set()
Expand Down
29 changes: 21 additions & 8 deletions configs/common/FileSystemConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,31 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import getpass
import operator
import os
import platform
from functools import reduce
from os import (
access,
getpid,
listdir,
makedirs,
mkdir,
stat,
)
from os.path import isdir
from os.path import join as joinpath
from pwd import getpwuid
from shutil import (
copyfile,
rmtree,
)

import m5
from m5.objects import *
from m5.util.convert import *

from functools import reduce
import operator, os, platform, getpass
from os import mkdir, makedirs, getpid, listdir, stat, access
from pwd import getpwuid
from os.path import join as joinpath
from os.path import isdir
from shutil import rmtree, copyfile


def hex_mask(terms):
dec_mask = reduce(operator.or_, [2**i for i in terms], 0)
Expand Down
8 changes: 6 additions & 2 deletions configs/common/MemConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from common import (
HMC,
ObjectList,
)

import m5.objects
from common import ObjectList
from common import HMC


def create_mem_intf(intf, r, i, intlv_bits, intlv_size, xor_low_bit):
Expand Down Expand Up @@ -174,6 +177,7 @@ def config_mem(options, system):
nbr_mem_ctrls = opt_mem_channels

import math

from m5.util import fatal

intlv_bits = int(math.log(nbr_mem_ctrls, 2))
Expand Down
8 changes: 5 additions & 3 deletions configs/common/ObjectList.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from gem5.runtime import get_supported_isas
import m5.objects
import m5.internal.params
import inspect
import sys
from textwrap import TextWrapper

import m5.internal.params
import m5.objects

from gem5.runtime import get_supported_isas


class ObjectList:
"""Creates a list of objects that are sub-classes of a given class."""
Expand Down
6 changes: 3 additions & 3 deletions configs/common/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

import argparse

from common import ObjectList
from common.Benchmarks import *

import m5
from m5.defines import buildEnv
from m5.objects import *

from common.Benchmarks import *
from common import ObjectList

vio_9p_help = """\
Enable the Virtio 9P device and set the path to share. The default 9p path is
m5ou5/9p/share, and it can be changed by setting VirtIO9p.root with --param. A
Expand Down
6 changes: 3 additions & 3 deletions configs/common/SimpleOpts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
# Module-level variable to track if we've called the parse_args function yet
called_parse_args = False

# For fatal
import m5

# import the argument parser
from argparse import ArgumentParser

# For fatal
import m5

# add the args we want to be able to control from the command line
parser = ArgumentParser()

Expand Down
13 changes: 9 additions & 4 deletions configs/common/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
from os import getcwd
from os.path import join as joinpath

from common import CpuConfig
from common import ObjectList
from common import (
CpuConfig,
ObjectList,
)

import m5
from m5.defines import buildEnv
Expand Down Expand Up @@ -128,9 +130,12 @@ def findCptDir(options, cptdir, testsys):
the appropriate directory.
"""

from os.path import isdir, exists
from os import listdir
import re
from os import listdir
from os.path import (
exists,
isdir,
)

if not isdir(cptdir):
fatal("checkpoint dir %s does not exist!", cptdir)
Expand Down
3 changes: 2 additions & 1 deletion configs/common/SysPaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os, sys
import os
import sys

config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
Expand Down
1 change: 1 addition & 0 deletions configs/common/cores/arm/O3_ARM_Etrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from m5.objects import *

from .O3_ARM_v7a import O3_ARM_v7a_3


Expand Down
2 changes: 1 addition & 1 deletion configs/common/cores/arm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from pkgutil import iter_modules
from importlib import import_module
from pkgutil import iter_modules

_cpu_modules = [name for _, name, ispkg in iter_modules(__path__) if not ispkg]

Expand Down
11 changes: 9 additions & 2 deletions configs/common/cpu2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@

import os
import sys
from os.path import basename, exists, join as joinpath, normpath
from os.path import isdir, isfile, islink
from os.path import (
basename,
exists,
isdir,
isfile,
islink,
)
from os.path import join as joinpath
from os.path import normpath

spec_dist = os.environ.get("M5_CPU2000", "/dist/m5/cpu2000")

Expand Down
28 changes: 17 additions & 11 deletions configs/deprecated/example/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,31 @@
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal, warn
from m5.util import (
addToPath,
fatal,
warn,
)
from m5.util.fdthelper import *

from gem5.isas import ISA
from gem5.runtime import get_runtime_isa

addToPath("../../")

from ruby import Ruby

from common.FSConfig import *
from common.SysPaths import *
from common import (
CacheConfig,
CpuConfig,
MemConfig,
ObjectList,
Options,
Simulation,
)
from common.Benchmarks import *
from common import Simulation
from common import CacheConfig
from common import CpuConfig
from common import MemConfig
from common import ObjectList
from common.Caches import *
from common import Options
from common.FSConfig import *
from common.SysPaths import *
from ruby import Ruby


def cmd_line_template():
Expand Down
Loading

0 comments on commit d11c40d

Please sign in to comment.