Sunteți pe pagina 1din 12

5/16/2017 Arty Hello World!

| EB's Blog

EB's Blog

FPGA

ARTY HELLO WORLD!


NOVEMBER 16, 2015 | EB | 5 COMMENTS

Ok, the rst design Im going to try with Arty will be the most simple one that I can come up
with. The idea is just to test the basic Vivado design ow.

Ill put my Arty projects under C:\Projects\Arty.

Creating the project


First lets start Vivado and select Create New Project. Theres an easy to use wizard that will
guide you through the needed setup steps. The project name will be HelloWorld.

The project type will be RTL project.

http://eb.dy.fi/2015/11/arty-hello-world/ 1/12
5/16/2017 Arty Hello World! | EB's Blog

For the default part lets choose the Arty board.

http://eb.dy.fi/2015/11/arty-hello-world/ 2/12
5/16/2017 Arty Hello World! | EB's Blog

Here is the project summary showing the board and FPGA details.

http://eb.dy.fi/2015/11/arty-hello-world/ 3/12
5/16/2017 Arty Hello World! | EB's Blog

Next I will need to describe my design. Lets have a look at the Arty reference manual.

http://eb.dy.fi/2015/11/arty-hello-world/ 4/12
5/16/2017 Arty Hello World! | EB's Blog

Hmm, looks like I could directly wire the push buttons BTN0-3 to the leds LD4-7. Shouldnt be
too complicated.

Adding sources
Lets add the design source: in the Sources window right click Design Sources and select Add
Sources and Add or create design sources. Click the plus-button and select: Create File.
Ill select VHDL as the le type and the le name will be HelloWorld.

After clicking Finish a new window opens: De ne Module. Lets de ne an entity HelloWorld
(and related architecture Behavioral) with one 4-bit input port (push_buttons_4bits) and
one 4-bit output port (led_4bits).

http://eb.dy.fi/2015/11/arty-hello-world/ 5/12
5/16/2017 Arty Hello World! | EB's Blog

Vivado will create one VHDL source le for us:


C:\Projects\Arty\HelloWorld\HelloWorld.srcs\sources_1\new\HelloWorld.vhd. For my
intended design I just need to connect the input port to the output port inside the architecture
part.

1 library IEEE;
2 use IEEE.STD_LOGIC_1164.ALL;
3
4 entity HelloWorld is
5 Port ( push_buttons_4bits : in STD_LOGIC_VECTOR (3 downto 0);
6 led_4bits : out STD_LOGIC_VECTOR (3 downto 0));
7 end HelloWorld;
8
9 architecture Behavioral of HelloWorld is
10
11 begin
12 led_4bits <= push_buttons_4bits;
13 end Behavioral;

Synthesizing the design


The next step is to synthesize our VHDL design description and create a netlist. Just click Run
Synthesis in the Flow Navigator window. After the synthesis has nished Vivado prompts to
run the implementation i.e. to map the netlist components to the Artix FPGA elements.

http://eb.dy.fi/2015/11/arty-hello-world/ 6/12
5/16/2017 Arty Hello World! | EB's Blog

However, before that we need to specify the pins for each of our input and output ports.

Pin mapping
In the Flow Navigator under Synthesized Design click Schematic. This will show our synthesized
design which consists of 4 input buffers and 4 output buffers (as expected).

Right click the input port and select I/O Port Bus Properties. In the properties window select
the I/O Ports tab. For each port we need to specify the site (the pin name) and the I/O standard.
We can get that information from the part0_pins.xml le that was part the the board package
(the pin names were also marked in the component schematic shown earlier).

http://eb.dy.fi/2015/11/arty-hello-world/ 7/12
5/16/2017 Arty Hello World! | EB's Blog

The input port push_buttons_4bits properties should look like this:

Do the same for the output port led_4bits. The updated properties are shown below:

So now we have locked (constrained) the input and output ports to the correct pins.

Implementation
Click Run Implementation in the Flow Navigator. Vivado will ask to save the pin constraints.
Lets do that.

Name the constraint le HelloWorld ( le type is XDC). The constraint le is just an ordinary text
le. It can be opened from the Sources window.

http://eb.dy.fi/2015/11/arty-hello-world/ 8/12
5/16/2017 Arty Hello World! | EB's Blog

Synthesis will be re-run and then the implementation will start.

Bitstream generation
When the implementation phase ends you can generate the Bitstream i.e. the con guration le
for the FPGA.

The con guration le is called HelloWorld.bit (it is placed in the folder


HelloWorld\HelloWorld.runs\impl_1).

Programming the FPGA


After the con guration bitstream is generated we can open the Hardware Manager to program
http://eb.dy.fi/2015/11/arty-hello-world/ 9/12
5/16/2017 Arty Hello World! | EB's Blog

the hardware.

Assuming the Arty has been connected to the PC with an USB cable we can select Open
Target and then Program Device. Just specify the Bitstream le.

Were done! Pressing one of the buttons BTN0-3 will light up the corresponding led LD4-7.

Some nal notes


Instead of setting the port properties you can also download an Arty master constraint le from
the Digilent site:

https://reference.digilentinc.com/_media/arty_master.zip

Then add this le as the constraint le and uncomment and edit the push button and led ports.

1 ##LEDs
2
3 set_property -dict { PACKAGE_PIN H5 IOSTANDARD LVCMOS33 } [get_ports
4 set_property -dict { PACKAGE_PIN J5
http://eb.dy.fi/2015/11/arty-hello-world/ IOSTANDARD LVCMOS33 } [get _ports
10/12
5/16/2017 Arty Hello World! | EB's Blog

4 set_property -dict { PACKAGE_PIN J5 IOSTANDARD LVCMOS33 } [get_ports


5 set_property -dict { PACKAGE_PIN T9 IOSTANDARD LVCMOS33 } [get_ports
6 set_property -dict { PACKAGE_PIN T10 IOSTANDARD LVCMOS33 } [get_ports
7
8 ##Buttons
9
10 set_property -dict { PACKAGE_PIN D9 IOSTANDARD LVCMOS33 } [get_ports
11 set_property -dict { PACKAGE_PIN C9 IOSTANDARD LVCMOS33 } [get_ports
12 set_property -dict { PACKAGE_PIN B9 IOSTANDARD LVCMOS33 } [get_ports
13 set_property -dict { PACKAGE_PIN B8 IOSTANDARD LVCMOS33 } [get_ports

Here is also a local copy of the master constraint le in case the digilent link stops working.

arty_master

5 THOUGHTS ON ARTY HELLO WORLD!

Jesus Carmona
JANUARY 7, 2016 AT 00:28

Hi I just bought an Arty board (it came with a Voucher for a Vivado locked to my board)
I tried following your example but I got stuck at the moment of Selecting the Part/Board
when creating the project In my case I do not get the option to select the Arty board I
only get the Artix-7 Evaluation Platform and some other boards but not the ARTY

Do you know how could I include this board in the Vivado environment?

Thanks

EB
JANUARY 8, 2016 AT 19:02

Hi! I think all you need to do is to install the board de nition le. You can download the
the board package from the Digilent site:
https://reference.digilentinc.com/_media/vivado:board_ les_09252015.zip
And then extract the arty folder and put it into the Vivado board repository in
C:\Xilinx\Vivado\2015.2\data\boards\board_ les. For more information please take a
look at my previous post http://eb.dy. /2015/11/installing-vivado-for-arty/.

Chris
APRIL 28, 2016 AT 18:56

http://eb.dy.fi/2015/11/arty-hello-world/ 11/12
5/16/2017 Arty Hello World! | EB's Blog

You also have to restart Vivado after you copy the arty directory to the board_ les
directory, otherwise the arty board will not show up in the dialog box.

Vadim
MAY 10, 2016 AT 12:59

Thanks EB! Your posts are easy to follow and very informative.
Just got HelloWorld working on my Arty within minutes!

D. M. Akbar
DECEMBER 1, 2016 AT 09:08

Great Job, wonderful so complete and accurate information.


I am sure people are bene ting from this blog in a big way.
Thank you so much
Cheers

http://eb.dy.fi/2015/11/arty-hello-world/ 12/12

S-ar putea să vă placă și