In this article, we will show you how to use Vivado to program the EBAZ4205 board with a simple LED blink example. We will assume that you have already installed Vivado on your PC and have downloaded the EBAZ4205 board files from this GitHub repository.
Step 1: Create a New Project
Launch Vivado and create a new project by clicking on File > New Project. Give your project a name and a location, and click Next. On the Project Type page, select RTL Project and click Next. On the Add Sources page, click Create File and enter "top.v" as the file name. Select Verilog as the file type and click OK. Then click Next.
On the Add Existing IP page, click Next. On the Add Constraints page, click Create File and enter "constraints.xdc" as the file name. Select XDC as the file type and click OK. Then click Next. On the Default Part page, click Boards and select EBAZ4205 from the list. Then click Next and Finish.
Step 2: Write the Verilog Code
In the Sources window, double-click on top.v to open it in the editor. Replace the default code with the following code:
module top(
input clk,
input reset,
output led
);
// Define clock frequency (in Hz)
`define CLK_FREQ 125000000
// Create a counter register
reg [31:0] counter;
// Increment counter every clock cycle
always @(posedge clk) begin
counter
This code defines a simple module that takes a clock and a reset input, and outputs a signal to an LED. The module uses a 32-bit counter register that increments every clock cycle. The LED output is assigned to the most significant bit (MSB) of the counter, which means it will toggle every 2^31 clock cycles. Since the clock frequency is 125 MHz (defined by `CLK_FREQ`), this means the LED will blink every 17 seconds.
Step 3: Write the Constraints File
In the Sources window, double-click on constraints.xdc to open it in the editor. Replace the default code with the following code:
# Define clock pin and period
set_property PACKAGE_PIN R7 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
create_clock -add -name sys_clk_pin -period 8.00 -waveform 0 4 [get_ports clk]
# Define reset pin
set_property PACKAGE_PIN M15 [get_ports reset]
set_property IOSTANDARD LVCMOS33 [get_ports reset]
# Define led pin
set_property PACKAGE_PIN U16 [get_ports led]
set_property IOSTANDARD LVCMOS33 [get_ports led]
This code defines the physical pins and electrical standards for each port of the module. The clock pin is R7, which corresponds to pin 15 of connector J6 on the board. The reset pin is M15, which corresponds to pin 16 of connector J6 on the board. The led pin is U16, which corresponds
c8f7815bcf