dummyBigBin.py 841 B

123456789101112131415161718192021222324252627282930313233
  1. import re
  2. import time
  3. import numpy as np
  4. import random
  5. preamble = 0xE1E4C312
  6. moduleId = 0x2cb31e7c
  7. jobId = 0x12345678
  8. data = [x+1 for x in range(1024)]
  9. cs = moduleId + jobId + np.sum(data)
  10. csc = 2**32 - cs % (2**32)
  11. if csc == 2**32:
  12. csc = 0
  13. delay = 50
  14. with open("vivado_project/vhdl-modules.sim/sim_1/behav/xsim/input.txt", "w") as inFile:
  15. inFile.write("{:d} ns {:032b}\n".format(delay, preamble))
  16. inFile.write("{:d} ns {:032b}\n".format(delay, jobId))
  17. inFile.write("{:d} ns {:032b}\n".format(delay, moduleId))
  18. for x in data:
  19. inFile.write("{:d} ns {:032b}\n".format(delay, x))
  20. inFile.write("{:d} ns {:032b}\n".format(delay, csc))
  21. with open("vivado_project/vhdl-modules.sim/sim_1/behav/xsim/outputTimings.txt", "w") as inFile:
  22. for i in range(8):
  23. inFile.write("{:d} ns\n".format(5))