11 errors
Black found 11 errors
Annotations
Check failure on line 164 in /home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py
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}"
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:]
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
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
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
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 465 in /home/runner/work/seal5/seal5/seal5/settings.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/settings.py#L446-L465
@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 487 in /home/runner/work/seal5/seal5/seal5/settings.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/settings.py#L477-L487
@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
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 169 in /home/runner/work/seal5/seal5/seal5/flow.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/flow.py#L158-L169
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 220 in /home/runner/work/seal5/seal5/seal5/transform/filter_model/filter.py
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?)