Guest User

Untitled

a guest
Apr 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import string
  4.  
  5. tmpl = string.Template('''
  6. module tb;
  7. reg [7:0] x;
  8. reg [7:0] y;
  9. reg [8:0] z;
  10.  
  11. always_comb begin
  12. z = x + y;
  13. end
  14.  
  15. initial begin
  16. x = 0;
  17. y = 0;
  18. #100;
  19. x = ${xval};
  20. y = ${yval};
  21. #100;
  22. end
  23. endmodule : tb
  24. ''')
  25.  
  26. print(tmpl.substitute(xval=10, yval=200))
  27. print(tmpl.substitute(xval=33, yval=111))
Add Comment
Please, Sign In to add comment