|
|
@ -76,8 +76,14 @@ class WaveSim(sim.SimOps): |
|
|
|
final values in the waveforms are still valid. |
|
|
|
final values in the waveforms are still valid. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
self.simctl_int = np.zeros((1, sims), dtype=np.int32) |
|
|
|
self.simctl_int = np.zeros((2, sims), dtype=np.int32) |
|
|
|
self.simctl_int[0] = range(sims) |
|
|
|
"""Per-simulation delay configuration. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* ``simctl_int[0]`` delay dataset or random seed for picking a delay |
|
|
|
|
|
|
|
* ``simctl_int[1]`` 0: seed parameter specifies dataset, 1: simctl_int[0] specifies dataset, 2: simctl_int[0] + seed param. is a random seed for picking a delay dataset |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
self.simctl_int[0] = range(sims) # unique seed for each sim by default, zero this to pick same delays for all sims. |
|
|
|
|
|
|
|
self.simctl_int[1] = 2 # random picking by default. |
|
|
|
|
|
|
|
|
|
|
|
self.nbytes = sum([a.nbytes for a in (self.c, self.s, self.c_locs, self.c_caps, self.ops, self.simctl_int)]) |
|
|
|
self.nbytes = sum([a.nbytes for a in (self.c, self.s, self.c_locs, self.c_caps, self.ops, self.simctl_int)]) |
|
|
|
|
|
|
|
|
|
|
@ -137,10 +143,15 @@ def _wave_eval(lut, z_idx, a_idx, b_idx, c_idx, d_idx, cbuf, c_locs, c_caps, sim |
|
|
|
overflows = int(0) |
|
|
|
overflows = int(0) |
|
|
|
|
|
|
|
|
|
|
|
if len(delays) > 1: |
|
|
|
if len(delays) > 1: |
|
|
|
_rnd = (seed << 4) + (z_idx << 20) + simctl_int[0] |
|
|
|
if simctl_int[1] == 0: |
|
|
|
for _ in range(4): |
|
|
|
delays = delays[seed] |
|
|
|
_rnd = int(0xDEECE66D) * _rnd + 0xB |
|
|
|
elif simctl_int[1] == 1: |
|
|
|
delays = delays[_rnd % len(delays)] |
|
|
|
delays = delays[simctl_int[0]] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
_rnd = (seed << 4) + (z_idx << 20) + simctl_int[0] |
|
|
|
|
|
|
|
for _ in range(4): |
|
|
|
|
|
|
|
_rnd = int(0xDEECE66D) * _rnd + 0xB |
|
|
|
|
|
|
|
delays = delays[_rnd % len(delays)] |
|
|
|
else: |
|
|
|
else: |
|
|
|
delays = delays[0] |
|
|
|
delays = delays[0] |
|
|
|
|
|
|
|
|
|
|
|