From: Luke Kenneth Casson Leighton Date: Thu, 4 Apr 2019 07:28:59 +0000 (+0100) Subject: add syncmode, selects sync/comb on ObjectProxy assignment X-Git-Tag: ls180-24jan2020~1349 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c07f6e53e64ea560fbbf4766ae29a55f3612e774;p=ieee754fpu.git add syncmode, selects sync/comb on ObjectProxy assignment --- diff --git a/src/add/pipeline.py b/src/add/pipeline.py index 59b6004d..4970dd2a 100644 --- a/src/add/pipeline.py +++ b/src/add/pipeline.py @@ -49,12 +49,13 @@ def get_eqs(_eqs): class ObjectProxy: - def __init__(self, m, name=None, pipemode=False): + def __init__(self, m, name=None, pipemode=False, syncmode=True): self._m = m if name is None: name = tracer.get_var_name(default=None) self.name = name self._pipemode = pipemode + self._syncmode = syncmode self._eqs = {} self._assigns = [] self._preg_map = {} @@ -130,8 +131,11 @@ class ObjectProxy: #object.__setattr__(self, name, new_pipereg) if self._pipemode: print ("OP pipemode", new_pipereg, value) - #self._m.d.comb += eq(new_pipereg, value) - pass + assign = eq(new_pipereg, value) + if self._syncmode: + self._m.d.sync += assign + else: + self._m.d.comb += assign elif self._m: print ("OP !pipemode assign", new_pipereg, value, type(value)) self._m.d.comb += eq(new_pipereg, value)