support for static variations

This commit is contained in:
Stefan Holst committed 2023-03-28 11:10:38 +09:00
1 parent 03802ac9f8
commit 7a060b1831
3 files changed
+46 -47

No files matched your search

+2 -2
View File
@@ -28,11 +28,11 @@ def test_nand_delays():
delays[0, 3, :, 0] = 0.7 # as above for D -> Z
delays[0, 3, :, 1] = 0.8
sdata = np.asarray([1, -1, 0, 0], dtype='float32')
simctl_int = np.asarray([0], dtype=np.int32)
def wave_assert(inputs, output):
for i, a in zip(inputs, c.reshape(-1,16)): a[:len(i)] = i
wave_eval_cpu(op, c, c_locs, c_caps, 0, delays, sdata)
wave_eval_cpu(op, c, c_locs, c_caps, 0, delays, simctl_int)
for i, v in enumerate(output): np.testing.assert_allclose(c.reshape(-1,16)[4,i], v)
wave_assert([[TMAX,TMAX],[TMAX,TMAX],[TMIN,TMAX],[TMIN,TMAX]], [TMIN,TMAX]) # NAND(0,0,1,1) => 1