led_blink

<!DOCTYPE html> <html>

<head> <meta charset="utf-8">

<script async src="https://www.googletagmanager.com/gtag/js?id=G-NG21EXTML9"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());

gtag('config', 'G-NG21EXTML9'); </script> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <title>LED Blink Example</title> <meta name="keywords" content="FPGA, FPGA Prototyping, FPGA Tool, Voice Coding, procedural programming, FPGA Easy, VHDL, FPGA for beginners"> <meta name="description" content="This example shows how blink two LEDs using SpeakHDL hotkey commands using any Xilinx series 7 development board."> <link rel="icon" type="image/png" sizes="16x16" href="../assets/img/logo/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="32x32" href="../assets/img/logo/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="192x192" href="../assets/img/logo/android-chrome-192x192.png"> <link rel="icon" type="image/png" sizes="512x512" href="../assets/img/logo/android-chrome-512x512.png"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"> <link rel="stylesheet" href="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.css"> <link rel="stylesheet" href="../assets/css/doxy-override.css"> <link rel="stylesheet" href="../assets/css/Footer-Basic.css"> <link rel="stylesheet" href="../assets/css/Login-Form-Clean.css"> <link rel="stylesheet" href="../assets/css/banner.css"> <link rel="stylesheet" href="../assets/css/examples.css"> <link rel="stylesheet" href="../assets/css/speakhdl-styles.css"> </head>

<body class="body-fixed"> <header class="justify-content-center banner-header theme-outline" dx-block="block">

LED Blink Example

</header>

Design Objective(s):

  • Configure two general purpose hardware counters to blink two LEDs at different rates. One LED toggles on and off every second while the other LED toggles every 500ms.
  • Configure the FPGA system clock frequency, reset polarity and LED pinout locations by using commands.
Show Hotkey Command Sequence

Top Level Design Structure

Design Discussion

SpeakHDL makes it very easy to configure VHDL procedure calls and FPGA pinout locations through the use of commands. In order to synthesize the design, SpeakHDL requires a clk_pin location to be mapped to a clock oscillator on the development board and reset_pin location which can be mapped to any input pin location (button or switch, ect).  There just always needs to be a way reset the registered logic inside the framework module.  The pin locations that are specified by commands ultimately end up in the config file which can be edited directly if the user does not wish to use commands for pin locations.

Note that if we were only attempting to simulate the design, then the pin locations would not be necessary.

The Top Level Design Structure helps to conceptualize how a flat design structure is being utilized to create the FPGA design. Each FPGA design contains one or more application modules and at least one framework module, but the only responsibility of the developer is creating application modules.  In this case, we have a single application module named led blink. The implementation of the framework module is contained inside the SPEAKHDL_API_PKG.vhdp library file which is common to all SpeakHDL projects. All other files necessary for synthesis are autogenerated by SpeakHDL.

Hotkey Commands

Select a local directory location for output files *
clear .vhd file and rename application module 'led_blink'
  1. restart
  2. rename led_blink.vhd
assign clock pin location and clock frequency
  1. clk_pin = E3
  2. clk = 100E6 
assign reset pin location and pin reset polarity
  1. reset_pin = U9 
  2. reset_polarity = 1
setup 2 counters that rollover at different time intervals
  1. cc0
  2. count 2s
  3. cc1
  4.  count 1s
wire up output signals
  1. led(0);
  2. 1 when count0 > 1s
  3. else 0
  4. led(1);
  5. 1 when count1 > 500ms
  6. else 0
assign pin locations for output signals
  1. output led = T8, V9
run parser to update top level
  1. ok
Pin locations must be changed for user specific development board
  Writing to a local directory is supported with Chrome and Microsoft Edge browsers

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script> <script src="../assets/js/bss_custom_js.js"></script> <script src="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.js"></script> </body>

</html>