seal5.transform.converter: add --prefix option #33
7 errors
Black found 7 errors
Annotations
Check failure on line 59 in /home/runner/work/seal5/seal5/examples/demo.py
github-actions / Black
/home/runner/work/seal5/seal5/examples/demo.py#L46-L59
seal5_flow.clean(temp=True, patches=True, models=True, inputs=True, interactive=INTERACTIVE)
# Clone LLVM and init seal5 metadata directory
seal5_flow.initialize(
clone=True,
- clone_url="[email protected]:de-tum-ei-eda-esl/llvm/core-v-llvm-project.git"
- if PREPATCHED
- else "https://github.com/llvm/llvm-project.git",
+ clone_url=(
+ "[email protected]:de-tum-ei-eda-esl/llvm/core-v-llvm-project.git"
+ if PREPATCHED
+ else "https://github.com/llvm/llvm-project.git"
+ ),
# clone_ref="llvmorg-17.0.6",
clone_ref="seal5-demo-prepatched" if PREPATCHED else "llvmorg-18.1.0-rc3",
force=True,
verbose=VERBOSE,
)
Check failure on line 122 in /home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py#L112-L122
artifacts[set_name] = []
metrics["n_sets"] += 1
ext_settings = set_def.settings
set_dir = out_path / set_name
includes = []
+
def process_instrunction(instr_def):
metrics["n_instructions"] += 1
input_file = out_path / set_name / f"{instr_def.name}.core_desc"
attrs = instr_def.attributes
if len(attrs) > 0:
Check failure on line 189 in /home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/backends/patterngen/writer.py#L179-L189
metrics["n_failed"] += 1
except AssertionError:
metrics["n_failed"] += 1
# errs.append((insn_name, str(ex)))
return True
+
with ThreadPoolExecutor(args.parallel) as executor:
futures = []
for instr_def in set_def.instructions.values():
future = executor.submit(process_instrunction, instr_def)
futures.append(future)
Check failure on line 171 in /home/runner/work/seal5/seal5/seal5/flow.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/flow.py#L160-L171
("collect_immediate_operands", passes.collect_immediate_operands, {}),
("collect_operand_types", passes.collect_operand_types, {}),
("detect_side_effects", passes.detect_side_effects, {}),
("detect_inouts", passes.detect_inouts, {}),
("detect_registers", passes.detect_registers, {}),
- ("write_cdsl_full", passes.write_cdsl, {"split": False, "compat": False})
+ ("write_cdsl_full", passes.write_cdsl, {"split": False, "compat": False}),
# TODO: determine static constraints (xlen,...) -> subtargetvmap
# detect memory adressing modes
# self.detect_adressing_modes(verbose) # TODO
# detect legal GMIR ops (and map to selectiondag?)
# self.detect_legal_ops(verbose=verbose) # TODO
Check failure on line 814 in /home/runner/work/seal5/seal5/seal5/pass_list.py
github-actions / Black
/home/runner/work/seal5/seal5/seal5/pass_list.py#L804-L814
if gen_index_file:
index_file = settings.temp_dir / (new_name + "_tblgen_patterns_index.yml")
args.extend(["--index", index_file])
if parallel:
import multiprocessing
+
num_threads = multiprocessing.cpu_count()
args.extend(["--parallel", str(num_threads)])
utils.python(
"-m",
"seal5.backends.patterngen.writer",
Check failure on line 207 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#L190-L207
# return name not in drop
# return True
def check_filter_regex(name, keep, drop):
if drop and keep:
- return not any(re.compile(expr).match(name) for expr in drop) and any(re.compile(expr).match(name) for expr in keep)
+ return not any(re.compile(expr).match(name) for expr in drop) and any(
+ re.compile(expr).match(name) for expr in keep
+ )
elif keep:
return any(re.compile(expr).match(name) for expr in keep)
elif drop:
return not any(re.compile(expr).match(name) for expr in drop)
return True
-
def check_encoding_filter(enc, keep, drop, keep2, drop2):
opcode = None
size = 0
for e in reversed(enc):
Check failure on line 245 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#L234-L245
elif drop:
return opcode not in drop
return True
model["sets"] = {
- set_name: set_def for set_name, set_def in model["sets"].items() if check_filter_regex(set_name, keep_sets, drop_sets)
+ set_name: set_def
+ for set_name, set_def in model["sets"].items()
+ if check_filter_regex(set_name, keep_sets, drop_sets)
}
for set_name, set_def in model["sets"].items():
set_def.instructions = {
key: instr_def
for key, instr_def in set_def.instructions.items()