Advertisement
Guest User

MicroNova Mercury 2 with SymbiFlow counter_test attempt

a guest
Apr 10th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. --------- Makefile changes ---------
  2.  
  3. else ifeq ($(TARGET),mercury2)
  4. PARTNAME:= xc7a35tftg256-1
  5. XDC:=${current_dir}/mercury2.xdc
  6. BOARD_BUILDDIR := ${BUILDDIR}/mercury2
  7.  
  8. --------- mercury2.xdc ---------
  9.  
  10. set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design}]
  11.  
  12. # Clock pin
  13. set_property PACKAGE_PIN N14 [get_ports {clk}]
  14. set_property IOSTANDARD LVCMOS33 [get_ports {clk}]
  15.  
  16. # LEDs
  17. set_property PACKAGE_PIN M1 [get_ports {led[0]}]
  18. set_property PACKAGE_PIN A14 [get_ports {led[1]}]
  19. set_property PACKAGE_PIN A13 [get_ports {led[2]}]
  20. set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]
  21. set_property IOSTANDARD LVCMOS33 [get_ports {led[1]}]
  22. set_property IOSTANDARD LVCMOS33 [get_ports {led[2]}]
  23.  
  24. # Clock constraints
  25. create_clock -period 20.0 [get_ports {clk}]
  26.  
  27. --------- counter.v ---------
  28.  
  29. module top (
  30. input clk,
  31. output [2:0] led
  32. );
  33.  
  34. localparam BITS = 3;
  35. localparam LOG2DELAY = 22;
  36.  
  37. wire bufg;
  38. BUFG bufgctrl(.I(clk), .O(bufg));
  39.  
  40. reg [BITS+LOG2DELAY-1:0] counter = 0;
  41.  
  42. always @(posedge bufg) begin
  43. counter <= counter + 1;
  44. end
  45.  
  46. assign led[2:0] = counter >> LOG2DELAY;
  47. endmodule
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement