Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------- Makefile changes ---------
- else ifeq ($(TARGET),mercury2)
- PARTNAME:= xc7a35tftg256-1
- XDC:=${current_dir}/mercury2.xdc
- BOARD_BUILDDIR := ${BUILDDIR}/mercury2
- --------- mercury2.xdc ---------
- set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design}]
- # Clock pin
- set_property PACKAGE_PIN N14 [get_ports {clk}]
- set_property IOSTANDARD LVCMOS33 [get_ports {clk}]
- # LEDs
- set_property PACKAGE_PIN M1 [get_ports {led[0]}]
- set_property PACKAGE_PIN A14 [get_ports {led[1]}]
- set_property PACKAGE_PIN A13 [get_ports {led[2]}]
- set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]
- set_property IOSTANDARD LVCMOS33 [get_ports {led[1]}]
- set_property IOSTANDARD LVCMOS33 [get_ports {led[2]}]
- # Clock constraints
- create_clock -period 20.0 [get_ports {clk}]
- --------- counter.v ---------
- module top (
- input clk,
- output [2:0] led
- );
- localparam BITS = 3;
- localparam LOG2DELAY = 22;
- wire bufg;
- BUFG bufgctrl(.I(clk), .O(bufg));
- reg [BITS+LOG2DELAY-1:0] counter = 0;
- always @(posedge bufg) begin
- counter <= counter + 1;
- end
- assign led[2:0] = counter >> LOG2DELAY;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement