Sign in

Not a member? | Forgot your Password?

Search blogs

Search tips

Free PDF Downloads

Adam Taylor's MicroZed Chronicles

Performance driven FPGA design with an ASIC perspective

FPGAs!? Now What?

Architecture of FPGAs and CPLDs: A Tutorial

FPGA Implementation of Digital Filters

Recent Blogs on FPGARelated

I don’t often convert VHDL to Verilog but when I do ...
posted by Christopher Felton

Spline interpolation
posted by Markus Nentwig

BGA and QFP at Home 1 - A Practical Guide.
posted by Victor Yurkovsky

Introducing the VPCIe framework
posted by Fabien Le Mentec

How FPGAs work, and why you'll buy one
posted by Yossi Kreinin

Learning VHDL - Basics
posted by Enrico Garante

Yet another PWM
posted by Anton Babushkin

Two jobs
posted by Stephane Boucher

How to start in FPGA development? - Simulation software tools
posted by Nuria Orduna

An Editor for HDLs
posted by Dave Vandenbout

Articles by category

See Also

DSPEmbedded Systems

FPGA Blogs > Christopher Felton > binary hello world

Christopher Felton (contact)
Christopher Felton's current favorite projects are implementing DSP digital circuits with MyHDL for FPGAs. More information @ show full bio

Would you like to be notified by email when Christopher Felton publishes a new blog?


Pageviews: 1374

binary hello world

Posted by Christopher Felton on Aug 2 2013 under Xilinx | Basics | MyHDL   

Python + Ohio + MyHDL + FPGA

Recently I had the opportunity to coordinate a hands-on programmable hardware (FPGA) workshop (open-space) at a regional Python conference - @pyohio. The workshop was for those that had little to no exposure to programmable hardware. For this situation I used two basic examples: two versions of a binary hello world.

The binary hello world -- blinking an LED -- is a good starting point to introduce programmable hardware, hardware descriptions languages, and the vendor FPGA tool flow. In this case, the FPGA tool flow was simplified with a collection of Python scripts.

The complete source is available on a bitbucket repository. Feel free to grab the examples and try them out. The FPGA development boards used were Xess Xula boards. Dave Vandenbout was gracious to loan a set of boards for the workshop.

The boards are very flexible for prototyping and experimenting. We used a prototype PMOD with a button and an LED.


Button Push'n

The first example was a module that simply wired the button to the LED. When the button is pressed the LED is turned off.


Compiling the example was as simple as:

>> python

This would convert, synthesize, map, place-n-route, and generate the bit stream. After the bit stream was created configuring the FPGA was as simple as:

>> --fpga xilinx/ise/button_led/xula.bit

To compile the design the Xilinx webpack software is required. See the tools install page for additional instructions to load the packages and tools.

The first example had two variants. The first, wire the pins together and the second, placed a flip-flop (1-bit register) in between the button and LED. The second variant was merely to introduce a register and the HDL syntax. These two variants provided minimalistic modules for the attendees to experiment with.



More Blinking

The second example was slightly more involved. It changed the LED blink rate when the button was pressed. The HDL needed to debounce the button (only one rate change per press) and then increase the blink rate.

Again, compiling the design (once the tools are all installed) is as simple as:

>> python

And load the same as above.

Journey into Programmable Hardware

These minimal examples are good starting points for anyones journey into the world of programmable hardware. If you have a board with a push-button and an LED try out the examples. Experiment with the LED blink rates: how fast, duty cycle (the amount of time on versus the amount of time off), random patterns, etc.

What's Next

See the following pages for additions exmaples and links.

Rate this article:
Rating: 0 | Votes: 0
posted by Christopher Felton
Christopher Felton's current favorite projects are implementing DSP digital circuits with MyHDL for FPGAs. More information @ LinkedIn.

Previous post by Christopher Felton: Tool install for examples
Next post by Christopher Felton: MyHDL @EDAPlayground
all articles by Christopher Felton

Comments / Replies

Oh my. This looks miles more user-friendly than ...anything in ISE.

I'll be doing some reading on this. Any support for the Virtex-2 and its built in PPC cores?
2 years ago
Sorry, you need javascript enabled to post any comments.
The scripts can be used with the virtexII (not sure if webpack supports the PPC devices?). Nothing specific for the PPC interface/programming. Nothing limiting either.

2 years ago
Sorry, you need javascript enabled to post any comments.