From 041ccc4e5e4aa0de32670c438bbdacdf8a970adf Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 28 Jul 2020 11:35:49 +0100 Subject: [PATCH] move "wrap" function into nmutil.util --- src/nmutil/util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nmutil/util.py b/src/nmutil/util.py index b8f1ce4..3aae6ef 100644 --- a/src/nmutil/util.py +++ b/src/nmutil/util.py @@ -34,3 +34,15 @@ def eq32(is_32bit, dest, src): dest[32:64].eq(Mux(is_32bit, 0, src[32:64]))] +# a wrapper function formerly in run_simulation that is still useful. +# Simulation.add_sync_process now only takes functions, it does not +# take generators. so passing in arguments is no longer possible. +# with this wrapper, the following is possible: +# sim.add_sync_process(wrap.dut(parallel_sender_number=0)) +# sim.add_sync_process(wrap.dut(parallel_sender_number=1)) + +def wrap(process): + def wrapper(): + yield from process + return wrapper + -- 2.30.2