|
|
@ -44,12 +44,13 @@ class WaveSim(sim.SimOps): |
|
|
|
:param strip_forks: If enabled, the simulator will not evaluate fork nodes explicitly. This saves simulation time |
|
|
|
:param strip_forks: If enabled, the simulator will not evaluate fork nodes explicitly. This saves simulation time |
|
|
|
by reducing the number of nodes to simulate, but (interconnect) delay annotations of lines read by fork nodes |
|
|
|
by reducing the number of nodes to simulate, but (interconnect) delay annotations of lines read by fork nodes |
|
|
|
are ignored. |
|
|
|
are ignored. |
|
|
|
:param keep_waveforms: If disabled, memory of intermediate signal waveforms will be re-used. This greatly reduces |
|
|
|
:param c_reuse: If enabled, memory of intermediate signal waveforms will be re-used. This greatly reduces |
|
|
|
memory footprint, but intermediate signal waveforms become unaccessible after a propagation. |
|
|
|
memory footprint, but intermediate signal waveforms become unaccessible after a propagation. |
|
|
|
""" |
|
|
|
""" |
|
|
|
def __init__(self, circuit, delays, sims=8, c_caps=16, c_reuse=False, strip_forks=False): |
|
|
|
def __init__(self, circuit, delays, sims=8, c_caps=16, c_reuse=False, strip_forks=False): |
|
|
|
super().__init__(circuit, c_caps=c_caps, c_caps_min=4, c_reuse=c_reuse, strip_forks=strip_forks) |
|
|
|
super().__init__(circuit, c_caps=c_caps, c_caps_min=4, c_reuse=c_reuse, strip_forks=strip_forks) |
|
|
|
self.sims = sims |
|
|
|
self.sims = sims |
|
|
|
|
|
|
|
if delays.ndim == 3: delays = np.expand_dims(delays, axis=0) |
|
|
|
self.delays = np.zeros((len(delays), self.c_locs_len, 2, 2), dtype=delays.dtype) |
|
|
|
self.delays = np.zeros((len(delays), self.c_locs_len, 2, 2), dtype=delays.dtype) |
|
|
|
self.delays[:, :delays.shape[1]] = delays |
|
|
|
self.delays[:, :delays.shape[1]] = delays |
|
|
|
|
|
|
|
|
|
|
@ -72,8 +73,8 @@ class WaveSim(sim.SimOps): |
|
|
|
* ``s[8]`` (P)PO sampled capture value: decided by random sampling according to a given seed. |
|
|
|
* ``s[8]`` (P)PO sampled capture value: decided by random sampling according to a given seed. |
|
|
|
* ``s[9]`` (P)PO sampled capture slack: (capture time - LST) - decided by random sampling according to a given seed. |
|
|
|
* ``s[9]`` (P)PO sampled capture slack: (capture time - LST) - decided by random sampling according to a given seed. |
|
|
|
* ``s[10]`` Overflow indicator: If non-zero, some signals in the input cone of this output had more |
|
|
|
* ``s[10]`` Overflow indicator: If non-zero, some signals in the input cone of this output had more |
|
|
|
transitions than specified in ``c_caps``. Some transitions have been discarded, the |
|
|
|
transitions than specified in ``c_caps``. Some transitions have been discarded, the |
|
|
|
final values in the waveforms are still valid. |
|
|
|
final values in the waveforms are still valid. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
self.simctl_int = np.zeros((2, sims), dtype=np.int32) |
|
|
|
self.simctl_int = np.zeros((2, sims), dtype=np.int32) |
|
|
@ -128,7 +129,7 @@ class WaveSim(sim.SimOps): |
|
|
|
self.s[3:, s_loc, vector] = wave_capture_cpu(self.c, c_loc, c_len, vector, time=time, sd=sd, seed=seed) |
|
|
|
self.s[3:, s_loc, vector] = wave_capture_cpu(self.c, c_loc, c_len, vector, time=time, sd=sd, seed=seed) |
|
|
|
|
|
|
|
|
|
|
|
def s_ppo_to_ppi(self, time=0.0): |
|
|
|
def s_ppo_to_ppi(self, time=0.0): |
|
|
|
"""Re-assigns the last sampled capture to the appropriate pseudo-primary inputs (PPI). |
|
|
|
"""Re-assigns the last sampled capture to the appropriate pseudo-primary inputs (PPI). |
|
|
|
Each PPI transition is constructed from its previous final value, the |
|
|
|
Each PPI transition is constructed from its previous final value, the |
|
|
|
given time, and the sampled captured value of its PPO. Reads and modifies ``self.s``. |
|
|
|
given time, and the sampled captured value of its PPO. Reads and modifies ``self.s``. |
|
|
|
|
|
|
|
|
|
|
|