From: whitequark Date: Wed, 12 Feb 2020 14:42:24 +0000 (+0000) Subject: cli: update use of deprecated code. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2088f16c127ce1c03b469617a1475a7bfb9caad2;p=nmigen.git cli: update use of deprecated code. --- diff --git a/nmigen/cli.py b/nmigen/cli.py index 3914182..e6757a0 100644 --- a/nmigen/cli.py +++ b/nmigen/cli.py @@ -63,11 +63,9 @@ def main_runner(parser, args, design, platform=None, name="top", ports=()): if args.action == "simulate": fragment = Fragment.get(design, platform) - with pysim.Simulator(fragment, - vcd_file=args.vcd_file, - gtkw_file=args.gtkw_file, - traces=ports) as sim: - sim.add_clock(args.sync_period) + sim = pysim.Simulator(fragment) + sim.add_clock(args.sync_period) + with sim.write_vcd(vcd_file=args.vcd_file, gtkw_file=args.gtkw_file, traces=ports): sim.run_until(args.sync_period * args.sync_clocks, run_passive=True)