Playing Around With Vhdl and Artix7 15T

by nikkischulz6 in Circuits > Electronics

235 Views, 0 Favorites, 0 Comments

Playing Around With Vhdl and Artix7 15T

index.jpeg

Hi there,

let us create a synthezisable toggling LED with :

  • Artix7 15T cpg236-1
  • usb
  • *.xdc
  • vhdl

we have to create *.xdc- file for telling vivado the led outputs and clock input!

Using onboard hardware:

  • 12 MHz clk source
  • 2 x onboard LEDs.

Program description:

  • Just let one LED shine, then the other and so on :)
  • Here is also a video where to LEDs are just toggling.
  • It's not much. But better than nothing.



VHDL Description of Behaviour

gnome-shell-screenshot-JPVTK1.png
VHDL Code:

This is the configuration:


--counter:  https://startingelectronics.org/software/VHDL-CPL...
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity top_lvl is Port (

 sysclk : in std_logic;
 output1 : out std_logic; -- led onboard
 output2 : out std_logic   -- led onboard

); end top_lvl;

architecture Behavioral of top_lvl is

signal count : STD_LOGIC_VECTOR (23 downto 0) := X"000000";
signal toggle : std_logic:='0';

 begin
 ----------
  p_led_blink : process (sysclk, count)
 variable toggle_var : std_logic := '0';

begin
 if rising_edge (sysclk) then
 count <= count + '1'; -- counting up
 if count = X"B71B00" then
    toggle <= '1'; -- set for toggling.....
    count <= X"000000";
  end if;
    if toggle = '1' then
    output1 <= not toggle_var;
    output2 <= toggle_var;
    toggle <= '0'; -- reset toggle
    toggle_var := not toggle_var;
    end if;
    end if;
        end process p_led_blink ;

end Behavioral;


*.XDC Constraints

gnome-shell-screenshot-5J3WK1.png
xdc

this is the xdc file:

## 12 MHz Clock Signal
set_property -dict { PACKAGE_PIN L17 IOSTANDARD LVCMOS33 } [get_ports { sysclk }]; #IO_L12P_T1_MRCC_14 Sch=gclk
create_clock -add -name sys_clk_pin -period 83.33 -waveform {0 41.66} [get_ports {sysclk}];

## LEDs
set_property -dict { PACKAGE_PIN A17 IOSTANDARD LVCMOS33 } [get_ports { output1 }];
set_property -dict { PACKAGE_PIN C16 IOSTANDARD LVCMOS33 } [get_ports { output2 }];

## RGB LED
#set_property -dict { PACKAGE_PIN B17 IOSTANDARD LVCMOS33 } [get_ports { led0_b }]; #IO_L14N_T2_SRCC_16 Sch=le

Synthezise

gnome-shell-screenshot-NPPIK1.png

Just click on "Run Synthesis" so it will synthesize.

Up right it appears a really really progress text with a really really little circrle.

When the green hook appears its finished.

Implement

Then run the Implementation step by clicking Run Implementation.

Create the Bitstream

To "download" your "configuration" into the FPGA you need to generate a bitstream.

Open Hardware Manager

gnome-shell-screenshot-MA6BK1.png


Easier said than it is in reality but you need to find your device somehow.

In Linux sometimes the drivers are not installed! It can be pretty crazy to install them.

But it is possible.

Also chmod 777 your USB port.

Only then access is provided to the FPGA Board.

After around 200 times you will do it :)

You can upload the generated bit file e.g. /top_lvl.bit by clicking program.


Then your FPGAs LEDs should toggle as long as it is connected to electricity.