Skip to content

examples: add missing files #13

examples: add missing files

examples: add missing files #13

GitHub Actions / Black failed Mar 1, 2024 in 0s

15 errors

Black found 15 errors

Annotations

Check failure on line 130 in /home/runner/work/seal5/seal5/seal5/backends/llvmir/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/llvmir/writer.py#L119-L130

                         # install_dir / "llvm" / "build",
                         install_dir,
                         input_file,
                         output_file,
                         skip_patterns=True,
-                        skip_formats=True
+                        skip_formats=True,
                     )
                     metrics["n_success"] += 1
                 except AssertionError:
                     pass
                     metrics["n_failed"] += 1

Check failure on line 164 in /home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py#L153-L164

                         output_file,
                         skip_patterns=False,
                         skip_formats=not args.formats,
                         ext=predicate,
                         mattr=mattr,
-
                     )
                     if output_file.is_file():
                         metrics["n_success"] += 1
                         if args.formats:
                             file_artifact_fmt_dest = f"llvm/lib/Target/RISCV/seal5/{set_name}/{out_name_fmt}"

Check failure on line 31 in /home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py#L21-L31

 
 logger = logging.getLogger("riscv_gisel_legalizer")
 
 # if (ST.hasVendorXCvsimd()) {
 
+
 def type_helper(ty):
     print("type_helper", ty)
     ty_ = ty.replace("seal5_", "")
     if ty_.startswith("p"):
         sz = ty_[1:]

Check failure on line 50 in /home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py#L39-L50

         n = int(n)
         sz = int(sz)
         return f"const LLT {ty} = LLT::fixed_vector({n}, LLT::scalar({sz}));"
     else:
         raise RuntimeError(f"Unsupported: {ty}")
-
 
 
 def gen_riscv_gisel_legalizer_str(legalizer_settings: RISCVLegalizerSettings):
     print("legalizer_settings", legalizer_settings)
     ops = legalizer_settings.ops

Check failure on line 176 in /home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/riscv_gisel_legalizer/writer.py#L165-L176

                 if gisel_settings:
                     content = gen_riscv_gisel_legalizer_str(gisel_settings)
                     with open(out_path, "w") as f:
                         f.write(content)
                     riscv_gisel_legalizer_patch = NamedPatch(
-                        "llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp", key="riscv_legalizer_info", src_path=out_path
+                        "llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp",
+                        key="riscv_legalizer_info",
+                        src_path=out_path,
                     )
                     artifacts[None].append(riscv_gisel_legalizer_patch)
     if args.metrics:
         raise NotImplementedError
         metrics_file = args.metrics

Check failure on line 34 in /home/runner/work/seal5/seal5/seal5/backends/riscv_isa_info/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/riscv_isa_info/writer.py#L22-L34

 from seal5.settings import ExtensionsSettings, LLVMVersion
 
 logger = logging.getLogger("riscv_isa_info")
 
 
-MAKO_TEMPLATE = "    {\"${arch}\", RISCVExtensionVersion{${version_major}, ${version_minor}}},"
-MAKO_TEMPLATE_LLVM18 = "    {\"${arch}\", {${version_major}, ${version_minor}}},"
+MAKO_TEMPLATE = '    {"${arch}", RISCVExtensionVersion{${version_major}, ${version_minor}}},'
+MAKO_TEMPLATE_LLVM18 = '    {"${arch}", {${version_major}, ${version_minor}}},'
 
 
 def gen_riscv_isa_info_str(name: str, ext_settings: ExtensionsSettings, llvm_version: LLVMVersion):
     # print("name", name)
     # print("ext_settings", ext_settings)

Check failure on line 151 in /home/runner/work/seal5/seal5/seal5/backends/riscv_isa_info/writer.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/backends/riscv_isa_info/writer.py#L138-L151

                 f.write(content)
             if ext_settings.experimental:
                 key = "riscv_isa_info_experimental"
             else:
                 key = "riscv_isa_info"
-            riscv_isa_info_patch = NamedPatch(
-                "llvm/lib/Support/RISCVISAInfo.cpp", key=key, src_path=out_path
-            )
+            riscv_isa_info_patch = NamedPatch("llvm/lib/Support/RISCVISAInfo.cpp", key=key, src_path=out_path)
             artifacts[None].append(riscv_isa_info_patch)
     if args.metrics:
         metrics_file = args.metrics
         with open(metrics_file, "w") as f:
             f.write(",".join(metrics.keys()))

Check failure on line 27 in /home/runner/work/seal5/seal5/seal5/resources/lit.cfg.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/resources/lit.cfg.py#L13-L27

 from lit.llvm import llvm_config
 from lit.llvm.subst import FindTool
 from lit.llvm.subst import ToolSubst
 
 # name: The name of this test suite.
-config.name = 'LLVM'
+config.name = "LLVM"
 
 # testFormat: The test format to use to interpret tests.
 # config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
 config.test_format = lit.formats.ShTest(True)
 
 # # suffixes: A list of file extensions to treat as test files. This is overriden
 # # by individual lit.local.cfg files in the test subdirectories.
-config.suffixes = ['.ll', '.c', '.test', '.txt', '.s', '.mir', '.yaml']
+config.suffixes = [".ll", ".c", ".test", ".txt", ".s", ".mir", ".yaml"]

Check failure on line 466 in /home/runner/work/seal5/seal5/seal5/settings.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/settings.py#L447-L466

 @dataclass
 class LLVMSettings(YAMLSettings):
     state: Optional[LLVMState] = None
     configs: Optional[Dict[str, LLVMConfig]] = None
 
+
 @dataclass
 class RISCVLegalizerSetting(YAMLSettings):
     name: Optional[Union[str, List[str]]] = None
     types: Optional[Union[str, List[str]]] = None
     onlyif: Optional[Union[str, List[str]]] = None
 
+
 @dataclass
 class RISCVLegalizerSettings(YAMLSettings):
     ops: Optional[List[RISCVLegalizerSetting]] = None
+
 
 @dataclass
 class RISCVSettings(YAMLSettings):
     xlen: Optional[int] = None
     features: Optional[List[str]] = None

Check failure on line 488 in /home/runner/work/seal5/seal5/seal5/settings.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/settings.py#L478-L488

 
 
 @dataclass
 class ToolsSettings(YAMLSettings):
     pattern_gen: Optional[PatternGenSettings] = None
+
 
 @dataclass
 class Seal5Settings(YAMLSettings):
     logging: Optional[LoggingSettings] = None
     filter: Optional[FilterSettings] = None

Check failure on line 56 in /home/runner/work/seal5/seal5/seal5/tools/cdsl2llvm.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/tools/cdsl2llvm.py#L45-L56

         "pattern-gen", cwd=dest, print_func=logger.info if verbose else logger.debug, live=True, use_ninja=use_ninja
     )
 
 
 def get_pattern_gen_patches(
-    src: Path, temp_dir: Path, verbose: bool = False,
+    src: Path,
+    temp_dir: Path,
+    verbose: bool = False,
 ):
     # TODO: copy!
     artifacts = []
     directory_artifact = Directory(
         "llvm/tools/pattern-gen",

Check failure on line 180 in /home/runner/work/seal5/seal5/seal5/flow.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/flow.py#L169-L180

                 logger.error("Target directory does not exist! Aborting...")
                 sys.exit(1)
             sha, version_info = llvm.clone_llvm_repo(self.directory, clone_url, ref=clone_ref, label=self.name)
         else:
             if force:
-                sha, version_info = llvm.clone_llvm_repo(self.directory, clone_url, ref=clone_ref, refresh=True, label=self.name)
+                sha, version_info = llvm.clone_llvm_repo(
+                    self.directory, clone_url, ref=clone_ref, refresh=True, label=self.name
+                )
         if self.meta_dir.is_dir():
             if force is False and not utils.ask_user(
                 "Overwrite existing .seal5 diretcory?", default=False, interactive=interactive
             ):
                 logger.error(f"Directory {self.meta_dir} already exists! Aborting...")

Check failure on line 1271 in /home/runner/work/seal5/seal5/seal5/flow.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/flow.py#L1260-L1271

                             cdsl2llvm_build_dir = str(self.build_dir / config)
                         else:
                             cdsl2llvm_build_dir = str(self.deps_dir / "cdsl2llvm" / "llvm" / "build")
                         cdsl2llvm.convert_ll_to_gmir(
                             # self.deps_dir / "cdsl2llvm" / "llvm" / "build", ll_file, output_file
-                            cdsl2llvm_build_dir, ll_file, output_file
+                            cdsl2llvm_build_dir,
+                            ll_file,
+                            output_file,
                         )
                     except AssertionError:
                         pass
                         # errs.append((insn_name, str(ex)))
         if len(errs) > 0:

Check failure on line 1411 in /home/runner/work/seal5/seal5/seal5/flow.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/flow.py#L1400-L1411

         #     patches.extend(self.gen_mc_tests_patches())
 
         # # Codegen Level
         # if "selection_dag_legalizer" not in skip:
         #     patches.extend(self.gen_selection_dag_legalizer_patches())
-        if ("riscv_gisel_legalizer" in only or len(only) == 0) and ("riscv_gisel_legalizer" not in skip or len(skip) == 0):
+        if ("riscv_gisel_legalizer" in only or len(only) == 0) and (
+            "riscv_gisel_legalizer" not in skip or len(skip) == 0
+        ):
             self.gen_riscv_gisel_legalizer_patch(verbose=verbose)
         # if "scalar_costs" not in skip:
         #     patches.extend(self.gen_scalar_costs_patches())
         # if "simd_costs" not in skip:
         #     patches.extend(self.gen_simd_costs_patches())

Check failure on line 220 in /home/runner/work/seal5/seal5/seal5/transform/filter_model/filter.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/seal5/seal5/seal5/transform/filter_model/filter.py#L209-L220

             size += length
         assert size in [16, 32, 64, 128], f"Invalid size: {size}"
         if drop2 and keep2:
             ret = size not in drop2 and size in keep2
         elif keep2:
-            ret =  size in keep2
+            ret = size in keep2
         elif drop2:
             ret = size not in drop2
         if not ret:
             return False
         if opcode is None:  # not found (not a riscv insn?)