From 2088f16c127ce1c03b469617a1475a7bfb9caad2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 12 Feb 2020 14:42:24 +0000 Subject: [PATCH] cli: update use of deprecated code. --- nmigen/cli.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) -- 2.30.2