From be549c3cf52a7949d2d066c7244ec4402b327319 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 30 Dec 2021 17:31:26 +0000 Subject: [PATCH] sv_binutils: use stdin as input stream --- src/openpower/sv/sv_binutils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) -- 2.30.2