If you have a 5I20 or 4I65 follow the Spartan2 directions instead. Most newer MESA boards can use the directons below.
This is a guide showing how to generate a bitfile for your [Mesa] boards running [HostMot2] in [LinuxCNC] or at least what I encountered along the way. My LinuxCNC was installed on Ubuntu 10.04 from the live CD install and this tutorial uses Xilinx Design Suite 14.5 on Linux. If you haven't already installed the Xilinx Design Suite you can download it [here].
Open terminal and type sudo su to run as root. Navigate to the directory /opt/Xilinx/14.5/ISE_DS or where you installed Xilinx Design Suite.
Type in: source settings32.sh which came with the Design Suite to set up the environment. Launch the program from the terminal by typing: ise The Application should launch.
In this example I will be using the hostmot2 EPPHM2 firmware. You will need to choose:
Otherwise you will get bit hash/mish mash in PCW's words.
Here are a list of Top vhd files and their associated boards:
Top9054HostMot2.vhd 5I21,5I22,5I23,3X20, 4i68, 4I69+ TopEPPHostMot2.vhd 7I43, 7I61 EPP TopEPPSHostMot2.vhd 7I90 EPP TopPCIHostMot2.vhd 5I24, 5I25, 6i25, 4I74 TopUSBHostMot2.vhd 7I32, 7I61 USB TopEthernet16HostMot2.vhd 7I80, 7I76E, 7I77E Top9030HostMot2.vhd 5I20, 4i65 TopGCSPIHostMot2.vhd 7I90 SPI TopSerial16HostMot2.vhd 7I90 serial TopUSBHostMot2.vhd 7I43, 7I61 USB TopGCSPIHostMot2.vhd 7I90,7I91 SPI
Click on open project and navigate to where your mesa source is located. In this example it is: /home/tom/linuxcnc/mesa/7i43/CONFIGS/HOSTMOT2/EPPHM2/SOURCE/
Open the hm2epp.xise project file.
You will want to make a copy of one of the .vhd pin files to edit that will best match what you want. It is not a good idea to edit the original ones.
This is not a tutorial for editing bitfiles however here are a few things I have figured out about them:
'TAG, VERSION, CLOCK, INSTANCES, BASE ADDRESS, NUMBER OF REGISTERS, STRIDES, MPBITMASK'
Once you have edited your pin file you need to add the vhd file to the library.
About 2/3 the way down on the screen you should have a library tab in the left middle of the navigator pane. There should be four tabs: Start, Design, Libraries, and
Files. Select Libraries and click on work.
A list of all the source files will be seen then. Right click on work and Add Source then navigate to your new pin.vhd file and add it to the library.
Now chose the design pane. The top level file should have a little green pawn shop symbol by it. Double click on that file:
TopEPPHostMot2 - Behavioral (TopEPPHostMot2.vhd)
Scroll down in the file and clone one of the pinout lines (and comment out the currently selected one) as shown below.
For example:
--use work.PIN_SVST2_4_7I47_48.all;
For example:
use work.i43_400card.all;
Ok save the file (control s).
Due to a bug in xilinx you may need to change the synthesize setting to optimize for speed so right click on Synthesize - XST as shown:
Under Synthesis Options set -opt_mode to Speed instead of area an click on OK.
Now you should be good to go so double click on Generate Programming File in the pane to get a .bit file.
The bit file will be located in the source directory and named TopEPPHostMot2.bit in this case.
When it is done, navigate to the directory linuxcnc looks for your bitfiles and copy the new file over renaming it as you do:
cp /home/tom/linuxcnc/mesa/7i43/CONFIGS/HOSTMOT2/EPPHM2/SOURCE/TopEPPHostMot2?.bit /lib/firmware/hm2/7i43-4/SVST2_4_7I47SS.BIT
For help open a terminal, navigate to the mesaflash install directory and type:
I hope this was in some way helpful.