artiq-zynq/test.py
morgan e5036c4307 temp: flake,libunwind,scripts,notes,diagram
flake: download llvm11 binary instead of compiling
local_run: preset cxp zc706 dev board ip addr
flake: add pillow for sim
libunwind build: suppress libunwind warning
2025-01-28 11:14:33 +08:00

31 lines
729 B
Python

from math import lcm
word_dw = 32
size = 8
sink_dw, source_dw = word_dw, size * 4
shift_reg_size = lcm(sink_dw, source_dw)
if (shift_reg_size // sink_dw) < 2:
shift_reg_size = shift_reg_size * 2
if (shift_reg_size // source_dw) < 2:
shift_reg_size = shift_reg_size * 2
sink_aligned_bound = sink_dw
result = []
for i in range(4, shift_reg_size // size):
if i % 4 == 0:
while not (sink_aligned_bound + sink_dw >= i * size >= sink_aligned_bound):
sink_aligned_bound += word_dw
else:
if sink_aligned_bound + sink_dw >= i * size >= sink_aligned_bound:
result.append(i)
# print(i * size, sink_aligned_bound, sink_aligned_bound + sink_dw)
print(source_dw % sink_dw)