Using XILINX and ModelSim in LINUX and how to set PCMCIA to serial port card

Source: Internet
Author: User
Tags dmesg
Use XILINX and ModelSim in LINUX and set the PCMCIA to serial port card-Linux Enterprise Application-Linux server application information. For more information, see the following. This document is mainly based on how to use XILINX in gentoo-wiki. I have made some modifications to apply to the amd64 architecture and require that the gentoo configuration be multilib, because the latest ise 9.2i webpack version is only 32-bit, it does not provide 64-bit support.

1. How to make your ISE run

1.1 For tcl, because TCL is not installed on my machine, it is unnecessary to set TCL. Generally, large EDA programs integrate the tcl shell.

1.2 GLIBC
In this step, I did not follow what the website described. Two methods are provided in gentoo-wiki. The first one is to recompile many things, second, according to the description, the ise fails to run successfully. Currently, no new windows cannot be displayed. Therefore, this step can be safely omitted for the latest ISE 9.2i.

1.3 process the Linked Library, mainly for openmotif (openmotif must be upgraded to 2.3.0 first)
Openmotif-2.3/cd/usr/lib/
Ln-s libXm. so.4 libXm. so.3
Ln-s libXm. so.4.0.0 libXm. so.3.0.0
Ln-s libXm. so.4 ../libXm. so.3
Ln-s libXm. so.4.0.0 ../libXm. so.3.0.0

2. Installation

Here we will follow the descriptions in the tutorial.
Xhost + # as the regular user, to let root use the X display
Su # must be root to install
Export DISPLAY =: 0 # install script needs this? That's right. This step is critical for ise.

Go to the directory and run the installation file. Note the following:
2.1 install it in the/opt directory
2.2 ignore the lack of windrv errors because there are better solutions later

3. Run
The recommended method in wiki is
Cp/opt/Xilinx92i/settings. sh/usr/local/bin/startise
Echo "export DISPLAY =: 0">/usr/local/bin/startise # note 1
Echo "exec ise">/usr/local/bin/startise
Chmod + x/usr/local/bin/startise

However, note that amd64 is not supported in the latest ise, you must change the PLATFORM variable under x86_64 to lin in settings. sh. For gentoo configuration, we have a better solution:

Create a 83ise file in/etc/env. d.
PLAT = "lin"
XILINX = "/opt/Xilinx92i"
LMC_HOME = "$ {XILINX}/smartmodel/$ {PLAT}/installed _ $ {PLAT }:$ {LMC_HOME }"
PATH = "/opt/Xilinx92i/bin/lin"
LD_LIBRARY_PATH = "$ {XILINX}/bin/$ {PLAT }:: {LD_LIBRARY_PATH }"
NPX_PLUGIN_PATH = "$ {XILINX}/java/$ {PLAT}/jre/plugin/i386/ns4 :$ {NPX_PLUGIN_PATH }"

Note that these variables are extracted from settings. sh, but since ISE only has a 32-bit version, the versatility is good. This setting file is common.

Create the Startup File startise in/usr/local/bin.
#! /Bin/bash
Export DISPLAY =: 0
Export LD_PRELOAD =/opt/usb-driver/libusb-driver.so
Exec ise &

Note: If you use the impact script method
Impact-batch impact. bat
You must add
Export LD_PRELOAD =/opt/usb-driver/libusb-driver.so

In this way, ise can run smoothly and complete device configuration.

4. install cable support
In wiki, three methods are provided for selection:
Kernel module
Open-source burning Program
User-level cable driver

In the amd64 environment, the 3rd methods are the best. Method 1, mentioned in the original article, xilinx may consider providing driver code, but before that, each change requires re-compiling the kernel. At the same time, in my 64-bit environment, the compilation of the driver is always unable to be completed smoothly. I try to fix this part later and then update this article. For method 2, we can only expect xup to do better, but with the launch of ise webpack and the expectation of Open-driven code, we can only temporarily put it on hold. Here we will focus on the third method, which is fast and provides good support for 64-bit! :

The name is usb-driver, but in a broad sense, it is supported by various burning methods. I just tested the jtag burning method of usb in spartan III starter kit to run it correctly.

First install some necessary packages:
Su # root must emerge, install and change the config files.
Emerge libusb # install the generic user-mode usb library
Emerge fxload # install the generic USB firmware loader

Then download and compile the usb-driver:
Mkdir
Cd
Wget http://cvs.zerfleddert.de/cgi-bi... ver.tar.gz? View = tar
Tar xzvf usb-driver *
Cd usb-driver
More README # read this. It has better instructions for the steps after the make
Make
Mkdir/opt/usb-driver # or other directory of your choice
Mv *. so/opt/usb-driver

Then you can edit the ise STARTUP script file.
Nano/usr/local/bin/startise
Add the following line
Export LD_PRELOAD =/opt/usb-driver/libusb-driver.so
Of course, if you follow the previous step, the content is already in the ise startup script.

Note:
In the amd64 environment, the compiled connection file is 64-bit, and an error occurs in actual use. Here I use the following method:

Download a 32-bit libusb-0.1-4_0.1.12-9_i386.deb that can be downloaded from the debian website, and then
Emerge-v deb2targz
Install this tool, unzip, change the libusb-0.1.4_0.1.12.9.so inside to libusb. so, put it under/lib32, then, in the above make this step, we change
Make lib32
Compile a 32-bit dynamic connection file. Then follow the instructions described above.

5. Install modelsim
Download the modelsim-linux_x86_64.exe.gzfile from the hitftpfile to the same folder. The installation is relatively simple :)

Then, the license.datfile is generated, which must be used to download the keygen.exe file at the same time. It should be noted that, in theory, wine can be generated in linux, but the license generated by wine. there is no host-id in dat. The solution is to send it to the mailbox using the license generated in windows. dat. If anyone has a better solution, Let me know :)

Environment variable settings:
Create the 82modelsim file in/etc/env. d.
LM_LICENSE_FILE = "/personal/modelsim/modeltech/license. dat"
PATH = "/personal/modelsim/modeltech/linux_x86_64"

6. Use of PCMCIA to serial port Devices

It took me more than two hours to solve this problem. The following describes the solutions that can be used:

First, make some modifications to the serial port driver in the kernel. The patch has not been submitted in kernel version 2.6.23. The specific modification method is as follows: the diff file is easy to understand and can be manually modified by yourself :)

Diff-ru linux-2.6.16-orig/drivers/serial/8250_pci.c
Linux-2.6.16/drivers/serial/8250_pci.c
--- Linux-2.6.16-orig/drivers/serial/8250_pci.c 2006-03-23
13:32:17. 000000000 + 0200
++ Linux-2.6.16/drivers/serial/8250_pci.c 2006-03-23 13:39:08. 000000000
+ 0200
@-2045,6 + 2045,9 @@
{PCI_VENDOR_ID_OXSEMI, 0x950a,
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Pbn_b0_2_1130000 },
+ {PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_CB950,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ Pbn_b0_109115200 },
{PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Pbn_b0_4_115200 },

Diff-ru linux-2.6.16-orig/include/linux/pci_ids.h
Linux-2.6.16/include/linux/pci_ids.h
--- Linux-2.6.16-orig/include/linux/pci_ids.h 13:32:24. 000000000
+ 0200
++ Linux-2.6.16/include/linux/pci_ids.h 13:40:32. 000000000
+ 0200
@-1808,6 + 1808,7 @@
# Define PCI_VENDOR_ID_OXSEMI 0x1415
# Define PCI_DEVICE_ID_OXSEMI_12PCI840 0x8403
# Define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501
+ # Define PCI_DEVICE_ID_OXSEMI_CB950 0x950B/* OXCB950 Cardbus 16950 UART */
# Define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511
# Define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513
# Define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521

Then re-compile the kernel and select all the options under the pcmcia driver.

Then you can view the related information, including lspci-v and dmesg | grep tty, as shown below:
. 0 Serial controller: Oxford Semiconductor Ltd OXCB950 Cardbus 16950 UART (prog-if 06 [16950])
Subsystem: Oxford Semiconductor Ltd Unknown device 0001
Flags: medium devsel, IRQ 20
I/O ports at 1010
Memory at 58000000 (32-bit, non-prefetchable)
I/O ports at 1000
Memory at 58001000 (32-bit, non-prefetchable)
Memory at 58002000 (32-bit, non-prefetchable)
Capabilities: [40] Power Management version 1

TtyS0: detected caps 00000700 shocould be 00000100
. 0: ttyS0 at I/O 0x1010 (irq = 20) is a 16C950/954
Setserial sets custom speed on ttys0.this is deprecated.

If/dev/ttyS * is generated in dmesg, your PCMCIA serial port card can be used normally.
But for the OXFORD CB950 chip serial port card, you also need to set some additional (very strange) things:

First, use the following command to modify the serial port
#! /Bin/bash
Setserial/dev/ttyS0 spd_cust divisor 104

Then, according to the instructions on the linux-serial forum, the bit rate of the chip needs to be modified. The tutorial in the Xilinx Spartan III Board uses a 9600 baud rate, in minicom, you need to set specific settings for the PCMCIA serial port chip (CBP950:
Minicom-s
In port setting, set the baud rate (required) * to * 38400, and set other parameters as required to ensure that the serial port card communicates with each other at 9600. Then you can use the PCMCIA to connect to the serial port and debug the Xilinx board.
For the use of minicom, you can view the mini-com tutorial, which is not described in detail here.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.