yosys: add command line arg to be quiet

This commit is contained in:
Andrew Dennison 2023-01-18 10:58:02 +11:00 committed by Florent Kermarrec
parent 4eed62143c
commit e10643bfd5
3 changed files with 8 additions and 2 deletions

View file

@ -92,6 +92,7 @@ class LatticeRadiantToolchain(GenericToolchain):
self._timingstrict = timingstrict
self._synth_mode = synth_mode
self._quiet = kwargs.pop("quiet", False)
return GenericToolchain.build(self, platform, fragment, **kwargs)
@ -123,7 +124,7 @@ class LatticeRadiantToolchain(GenericToolchain):
self._yosys = YosysWrapper(self.platform, self._build_name,
output_name=self._build_name+"_yosys", target="nexus",
template=[], yosys_cmds=yosys_cmds,
yosys_opts=self._synth_opts, synth_format="vm")
yosys_opts=self._synth_opts, synth_format="vm", quiet = self._quiet)
# Constraints (.ldc) ---------------------------------------------------------------------------

View file

@ -122,6 +122,7 @@ class YosysNextPNRToolchain(GenericToolchain):
self.timingstrict = timingstrict
self.ignoreloops = ignoreloops
self.seed = seed
self._quiet = kwargs.pop("quiet", False)
return GenericToolchain.build(self, platform, fragment, **kwargs)
@ -139,6 +140,7 @@ class YosysNextPNRToolchain(GenericToolchain):
synth_format = self.synth_fmt,
nowidelut = self._nowidelut,
abc9 = self._abc9,
quiet = self._quiet,
)
# NextPnr options

View file

@ -57,6 +57,7 @@ class YosysWrapper():
self._synth_format = synth_format
self._yosys_opts = yosys_opts
self._yosys_cmds = yosys_cmds
self._quiet = "" if not kwargs.pop("quiet", False) else '-Qq'
self._target = target
@ -132,7 +133,7 @@ class YosysWrapper():
=======
str containing instruction and/or rule
"""
base_cmd = f"yosys -l {self._build_name}.rpt {self._build_name}.ys"
base_cmd = f"yosys {self._quiet} -l {self._build_name}.rpt {self._build_name}.ys"
if target == "makefile":
return f"{self._build_name}.{self._synth_format}:\n\t" + base_cmd + "\n"
elif target == "script":
@ -144,10 +145,12 @@ def yosys_args(parser):
parser.add_argument("--yosys-nowidelut", action="store_true", help="Use Yosys's nowidelut mode.")
parser.add_argument("--yosys-abc9", action="store_true", help="Use Yosys's abc9 mode.")
parser.add_argument("--yosys-flow3", action="store_true", help="Use Yosys's abc9 mode with the flow3 script.")
parser.add_argument("--yosys-quiet", action="store_true", help="Use Yosys's '-Qq' to be quiet")
def yosys_argdict(args):
return {
"nowidelut": args.yosys_nowidelut,
"abc9": args.yosys_abc9,
"flow3": args.yosys_flow3,
"quiet": args.yosys_quiet,
}