New Horizons







Welcome to my blog

My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
and FPGA.
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company

Contact

You are welcome to contact me
and ask questions or make comments
about my blog.

View Sven Andersson's profile on LinkedIn

Content

New Horizons
What's new
Starting a blog
Writing a blog
Using an RSS reader

Zynq Design From Scratch
www.zynqfromscratch.com
Started February 2014
Introduction
Changes and updates
Zynq-7000 All Programmable SoC
ZedBoard and other boards
Computer platform and VirtualBox
Installing Ubuntu
Fixing Ubuntu
Installing Vivado
Starting Vivado
Using Vivado
Lab 1. Create a Zynq project
Lab 1. Build a hardware platform
Lab 1. Create a software application
Lab 1. Connect to ZedBoard
Lab 1. Run a software application
Lab 1. Benchmarking ARM Cortex-A9
Lab 2. Adding a GPIO peripheral
Lab 2. Create a custom HDL module
Lab 2. Connect package pins and implement
Lab 2. Create a software application and configure the PL
Lab 2. Debugging a software application
Running Linux from SD card
Installing PetaLinux
Booting PetaLinux
Connect to ZedBoad via ethernet
Rebuilding the PetaLinux kernel image
Running a DHCP server on the host
Running a TFTP server on the host
PetaLinux boot via U-boot
PetaLinux application development
Fixing the host computer
Running NFS servers
VirtualBox seamless mode
Mounting guest file system using sshfs
PetaLinux. Setting up a web server
PetaLinux. Using cgi scripts
PetaLinux. Web enabled application
Convert from VirtualBox to VMware
Running Linaro Ubuntu on ZedBoard
Running Android on ZedBoard

Chipotle Verification System
Introduction

Four soft-core processors
Started January 2012

Xilinx FPGA Design
New start August 2011
Problems, fixes and solutions
FPGA design from scratch. Part 51
FPGA design from scratch. Part 52
FPGA design from scratch. Part 53
FPGA design from scratch. Part 54
FPGA design from scratch. Part 55
FPGA design from scratch. Part 56
FPGA design from scratch. Part 57
FPGA design from scratch. Part 58
FPGA design from scratch. Part 59
FPGA design from scratch. Part 60
Using the Spartan-6 LX9 MicroBoard
Table of contents
FPGA design from scratch. Part 61
FPGA design from scratch. Part 62
FPGA design from scratch. Part 63
FPGA design from scratch. Part 64
FPGA design from scratch. Part 65
FPGA design from scratch. Part 66
FPGA design from scratch. Part 67
FPGA design from scratch. Part 68
FPGA design from scratch. Part 69
FPGA design from scratch. Part 70
FPGA design from scratch. Part 71
FPGA design from scratch. Part 72
FPGA design from scratch. Part 73
FPGA design from scratch. Part 74
FPGA design from scratch. Part 75
FPGA design from scratch. Part 76
FPGA design from scratch. Part 77
FPGA design from scratch. Part 78
FPGA design from scratch. Part 79
FPGA design from scratch. Part 80
FPGA design from scratch. Part 81
FPGA design from scratch. Part 82
FPGA design from scratch. Part 83
FPGA design from scratch. Part 84
FPGA design from scratch. Part 85
FPGA design from scratch. Part 86
FPGA design from scratch. Part 87
FPGA design from scratch. Part 88
FPGA design from scratch. Part 89
FPGA design from scratch. Part 90
FPGA design from scratch. Part 91
Started December 2006
Table of contents
Index
FPGA design from scratch. Part 1
FPGA design from scratch. Part 2
FPGA design from scratch. Part 3
FPGA design from scratch. Part 4
FPGA design from scratch. Part 5
FPGA design from scratch. Part 6
FPGA design from scratch. Part 7
FPGA design from scratch. Part 8
FPGA design from scratch. Part 9
FPGA design from scratch. Part 10
FPGA design from scratch. Part 11
FPGA design from scratch. Part 12
FPGA design from scratch. Part 13
FPGA design from scratch. Part 14
FPGA design from scratch. Part 15
FPGA design from scratch. Part 16
FPGA design from scratch. Part 17
FPGA design from scratch. Part 18
FPGA design from scratch. Part 19
FPGA design from scratch. Part 20
FPGA design from scratch. Part 21
FPGA design from scratch. Part 22
FPGA design from scratch. Part 23
FPGA design from scratch. Part 24
FPGA design from scratch. Part 25
FPGA design from scratch. Part 26
FPGA design from scratch. Part 27
FPGA design from scratch. Part 28
FPGA design from scratch. Part 29
FPGA design from scratch. Part 30
FPGA design from scratch. Part 31
FPGA design from scratch. Part 32
FPGA design from scratch. Part 33
FPGA design from scratch. Part 34
FPGA design from scratch. Part 35
FPGA design from scratch. Part 36
FPGA design from scratch. Part 37
FPGA design from scratch. Part 38
FPGA design from scratch. Part 39
FPGA design from scratch. Part 40
FPGA design from scratch. Part 41
FPGA design from scratch. Part 42
FPGA design from scratch. Part 43
FPGA design from scratch. Part 44
FPGA design from scratch. Part 45
FPGA design from scratch. Part 46
FPGA design from scratch. Part 47
FPGA design from scratch. Part 48
FPGA design from scratch. Part 49
FPGA design from scratch. Part 50
Acronyms and abbreviations
Actel FPGA design
Designing with an Actel FPGA. Part 1
Designing with an Actel FPGA. Part 2
Designing with an Actel FPGA. Part 3
Designing with an Actel FPGA. Part 4
Designing with an Actel FPGA. Part 5
CAD
A hardware designer's best friend
Zoo Design Platform
Linux
Installing Cobra Command Tool
A processor benchmark
Mac
Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true
Running
The New York City Marathon
Skiing/Skating
Kittelfjäll Lappland
Tour skating in Sweden and around the world
Top
Introduction
SSSK
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Calendar
Links
Books, photos, films and videos
Weather forecasts

Travel
38000 feet above see level
A trip to Spain
Florida the sunshine state

Photo Albums
Seaside Florida
Ronda Spain
Sevilla Spain
Cordoba Spain
Alhambra Spain
Kittelfjäll Lapland
Landsort Art Walk
Skating on thin ice

Books
100 Power Tips for FPGA Designers

Favorites
Adventures in ASIC
ChipHit
Computer History Museum
DeepChip
Design & Reuse
Dilbert
d9 Tech Blog
EDA Cafe
EDA DesignLine
Eli's tech Blog
Embedded.com
EmbeddedRelated.com
FPGA Arcade
FPGA Blog
FPGA Central
FPGA CPU News
FPGA developer
FPGA Journal
FPGA World
Lesley Shannon Courses
Mac 2 Ubuntu
Programmable Logic DesignLine
OpenCores
Simplehelp
SOCcentral
World of ASIC



If you want to be updated on this weblog Enter your email here:



rss feed



 
Saturday, November 26, 2011
FPGA design from scratch. Part 83
Building a virtual machine

A virtual machine (VM) is a completely isolated guest operating system installation within a normal host operating system. Modern virtual machines are implemented with either software emulation or hardware virtualization or (in the most cases) both together.

Wouldn't it be nice to put everything we have done so far in  a virtual machine and run it on any computer we like (my MacBook Pro for example).
Let us find out if it is possible. We will start by choosing a virtualization product.

Choosing a virtualization product

There are several virtualization products to choose from. Here are
four examples:

After taking a closer look at the alternatives I decided to go for VirtualBox.

VirtualBox

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization  product for enterprise as well as home use. Not only is VirtualBox a feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2. Here is the User Guide and here are some How To tutorials.


Installing VirtualBox

For information on how to install and setup VirtualBox see Using VirtualBox Part 1-3 in this blog.

Guest OS

We will install Debian 6.0.3 (Squeeze) in our virtual machine. For more information see www.debian.org. We are free to use any other Linux OS we prefer, but it will be harder to follow this guide with another Linux OS running. Both Xilinx and PetaLogix are recommending RedHat Enterprise or Cent OS.

Fixes to Debian 6.0.3

The Debian installation will not work right out of the box. Here are a few things we have to fix:

  • Changing default shell
  • Adding missing packages
  • Adding gmake
  • Replace Acroread PDF reader

Changing default shell

Debian uses dash as their default shell. Most of the PetaLogix scripts are written to use bash as the default shell. You can find out what the default shell is by executing the following command:

--> ls -al /bin/sh

If the /bin/sh links to dash use this command to change from dash to bash:

--> sudo dpkg-reconfigure dash

Adding missing packages

The Debian OS doesn't include all the software we need but it can easily be added using the command: sudo apt-get install <package>. Here is one example:

--> sudo apg-get install gawk

Adding gmake

PetaLogix and Xilinx uses gmake for running their makefiles. Debian call their the gmake program
make. To add the gmake program we just execute the following command:

--> sudo ln -s /usr/bin/make /usr/bin/gmake


Replacing Acroread

Xilinx supports only the Acroread program for displaying PDF files. Acroread is not installed in Debian and is not part of the normal repository. Instead we can use evince or xpdf.

--> sudo ln -s /usr/bin/evince /usr/bin/acroread

VirtualBox setup

Connecting USB ports

Our LX9 MicroBoard has two USB ports. They are recognized by their names and when we connect our board to the host computer they will show up in the VirtualBox USB settings window. We will add them to the USB Device Filter list (click the icon with the + to the right) which will make the USB ports always connected in our virtual machine. 



Shared folders

Shared folders makes it possible to move files between our host computer and the guest. We will setup a directory called Shared that will be shared with our guest OS.



Network connections

We will use the Bridged Adapter network setup. More information about networking will follow later on in this tutorial. 




VirtualBox running

Use this command to start VirtualBox:

--> virtualbox &





Booting Debian

Select the virtual machine to run and click the Start button. This is what it looks like when the Debian Linux is running in our virtual machine.






Installing Xilinx Design Suite

We will install the lastest version of Design Suite (13.3). Follow the instruction in
part 51 to install the Xilinx software.

Installing PetaLinux SDK

Follow the instruction in part 73 to install the PetaLinux SDK.

Setting up TFTP and NFS servers

Follow the instruction in part 74 to install and start TFTP and NFS servers.

Mounting shared file system

Use the following command to mount the shared file system in directory Host in our guest OS:

--> sudo mount -t vboxsf -o uid=1000,gid=1000 Shared ~/Host


Fixing problems with permissions

I ran into some problems when using the usb ports from the guest OS. I don't really understand why but here are some fixes to the problems. There may be other ways to solve it.

Starting GTKterm

When trying to connect to ttyUSB0 I got the following error message. There seems to be some problems with the file permissions.



This is what the file permissions looks like for the file ttyUSB0:




One easy fix is to add us to the unix group dialout. Let's open  System->Administration->Users and Groups:




Click Manage Groups and select dialout.




Click the Properties button and mark our name . We must have root permissions.




Click OK and we are done. Logout and login for the changes to take affect.





Adding a group using a Linux command

There is a much easier way using the usermod command:

--> sudo /usr/sbin/usermod -a -G dialout svan


Running iMPACT

When starting iMPACT we get the following error message:


USB setup

Starting with 10.1 Service Pack 1, the libusb package can be used to connect to the Platform Cable USB on the Linux platforms. This package replaces the functionality provided by the Jungo windrvr6 module. The use of libusb provides an alternative approach for users who encounter problems during the building and installation of the existing driver solution.

Here is a listing of the USB device nodes. We have no write permission.




Writing udev rules

udev is targeted at Linux kernels 2.6 and beyond to provide a userspace solution for a dynamic /dev directory, with persistent device naming. The previous /dev implementation, devfs, is now deprecated, and udev is seen as the successor. The udev rules can be found in the directory: /etc/udev/rules.d



Editing udev rules


The rules file for our JTAG to USB connection is called 52-diligent-usb.rules. We will edit this file and add a group statement (GROUP="plugdev") like this:



After restarting our guest the permission looks like this:




Running Xilinx Platform Studio XPS

We can configure the FPGA from XPS.





PetaLinux console in the virtual machine

We will start GTKterm and setup the port configuration. When we press the program button on the MicroBoard the PetaLinux will boot and display the login screen on the console in the virtual machine.




Writing our first application program

Follow the instructions in part 77-78 on how to write an application program in c.


Explore new things

Our virtual machine is up and running. We are all set and ready for new adventures.


Top  Previous  Next



Posted at 09:35 by svenand

 

Leave a Comment:

Name


Homepage (optional)


Comments




Previous Entry Home Next Entry