|
|
@ -140,7 +140,7 @@ class LogicSim(sim.SimOps): |
|
|
|
self.s[0, self.ppio_s_locs, 0] = self.s[1, self.ppio_s_locs, 0] # final value is newly captured final value |
|
|
|
self.s[0, self.ppio_s_locs, 0] = self.s[1, self.ppio_s_locs, 0] # final value is newly captured final value |
|
|
|
self.s[0, self.ppio_s_locs, 2] = self.s[0, self.ppio_s_locs, 0] ^ self.s[0, self.ppio_s_locs, 1] # TODO: not correct for X, - |
|
|
|
self.s[0, self.ppio_s_locs, 2] = self.s[0, self.ppio_s_locs, 0] ^ self.s[0, self.ppio_s_locs, 1] # TODO: not correct for X, - |
|
|
|
|
|
|
|
|
|
|
|
def cycle(self, inject_cb=None): |
|
|
|
def cycle(self, cycles=1, inject_cb=None): |
|
|
|
"""Assigns the given state, propagates it and captures the new state. |
|
|
|
"""Assigns the given state, propagates it and captures the new state. |
|
|
|
|
|
|
|
|
|
|
|
:param state: A bit-parallel array in a compatible shape holding the current circuit state. |
|
|
|
:param state: A bit-parallel array in a compatible shape holding the current circuit state. |
|
|
@ -150,6 +150,7 @@ class LogicSim(sim.SimOps): |
|
|
|
:param inject_cb: A callback function for manipulating intermediate signal values. See :py:func:`propagate`. |
|
|
|
:param inject_cb: A callback function for manipulating intermediate signal values. See :py:func:`propagate`. |
|
|
|
:returns: The given state object. |
|
|
|
:returns: The given state object. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
for _ in range(cycles): |
|
|
|
self.s_to_c() |
|
|
|
self.s_to_c() |
|
|
|
self.c_prop(inject_cb) |
|
|
|
self.c_prop(inject_cb) |
|
|
|
self.c_to_s() |
|
|
|
self.c_to_s() |
|
|
|