From: Dmitry Selyutin Date: Thu, 30 Dec 2021 17:31:26 +0000 (+0000) Subject: sv_binutils: use stdin as input stream X-Git-Tag: sv_maxu_works-initial~588 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be549c3cf52a7949d2d066c7244ec4402b327319;p=openpower-isa.git sv_binutils: use stdin as input stream --- diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 5990c103..d3101c89 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -5,6 +5,7 @@ import dataclasses as _dataclasses import enum as _enum import pathlib as _pathlib import re as _re +import sys as _sys from openpower.decoder.power_enums import ( In1Sel as _In1Sel, @@ -198,16 +199,14 @@ def parse(stream): yield Entry(**entry) -def main(vhdl): - with _codecs.open(vhdl, "rb", "UTF-8") as stream: - entries = tuple(parse(stream)) +def main(): + entries = tuple(parse(_sys.stdin)) print(f"{len(entries)} entries found") if __name__ == "__main__": parser = _argparse.ArgumentParser() - parser.add_argument("vhdl", type=_pathlib.Path, help="sv_decode.vhdl path") args = vars(parser.parse_args()) main(**args)