Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Use MCU to configer the xilinx FPGA

Status
Not open for further replies.

Dick Hou

Member level 1
Member level 1
Joined
Jul 31, 2001
Messages
40
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
338
xilinx xsvf to hex convert

Xilinx application notes xapp058 describe how to use mcu to configer its FPGA/CPLD/PROM through JTAG port,but which tools use to compile the source file?
 

programming xilinx with mcu

ISE generat the programming file. if you take a look at the left pannel of ISE GUI you will find the end step called "Generat Programming Files"
 

mcu xilinx fpga

Yes,I know the ISE can generate bit/mcs/hex... file to use xilinx cable download it to FPGA,but I want configer the FPGA off-line,to do this,first program the configer data to ROM,then use MCU read it and use JTAG or slave serial mode configer the FPGA. I can configer it at slave serial mode now, but don't know how to use JTAG port to do the same thing?
 

lvtdocaptured

The source code of app058 is C. You can compile it with any C compiler. The only thing you need to do is define four functions in the source code according to the MCU you are using. You can drive the JTAG pins TDI, TDO, TCK and TMS with MCU's general I/O pins. I've accomplished it with AT91FR4081, which is ATMEL's MCU with ARM7TDMI core.
 

mcu top xilinx

Please read the app058 carefully.
 

readbyte xsvf

sucan said:
The source code of app058 is C. You can compile it with any C compiler. The only thing you need to do is define four functions in the source code according to the MCU you are using. You can drive the JTAG pins TDI, TDO, TCK and TMS with MCU's general I/O pins. I've accomplished it with AT91FR4081, which is ATMEL's MCU with ARM7TDMI core.

First,thanks for your reply.

I had read the all application notes, it introduce what as you said:just define the TDI/TDO/TCK/TMS for the MCU connection,but I meet some questions about it:
1)at the port.c file,some codes:
/* if in debugging mode, then just set the variables */
void setPort(short p,short val)
{
#ifdef WIN95PP
if (once == 0) {
out_word.bits.one = 1;
out_word.bits.zero = 0;
once = 1;
}
if (p==TMS)
out_word.bits.tms = (unsigned char) val;
if (p==TDI)
out_word.bits.tdi = (unsigned char) val;
if (p==TCK) {
out_word.bits.tck = (unsigned char) val;
(void) _outp( (unsigned short) (base_port + 0), out_word.value );
}
#endif
}

these code only show output data from PC printer port,no code for MCU.

2)the lenval.h define the structure lenVal:
typedef struct var_len_byte
{
short len; /* number of chars in this value */
unsigned char val[MAX_LEN+1]; /* bytes of data */
} lenVal;
I define MAX_LEN 4,so lenVal need 7 bytes,the micro.c define the structure tagSXsvfInfo:
typedef struct tagSXsvfInfo
{
/* XSVF status information */
unsigned char ucComplete; /* 0 = running; 1 = complete */
unsigned char ucCommand; /* Current XSVF command byte */
long lCommandCount; /* Number of commands processed */
int iErrorCode; /* An error code. 0 = no error. */

/* TAP state/sequencing information */
unsigned char ucTapState; /* Current TAP state */
unsigned char ucEndIR; /* ENDIR TAP state (See SVF) */
unsigned char ucEndDR; /* ENDDR TAP state (See SVF) */

/* RUNTEST information */
unsigned char ucMaxRepeat; /* Max repeat loops (for xc9500/xl) */
long lRunTestTime; /* Pre-specified RUNTEST time (usec) */

/* Shift Data Info and Buffers */
long lShiftLengthBits; /* Len. current shift data in bits */
short sShiftLengthBytes; /* Len. current shift data in bytes */

lenVal lvTdi; /* Current TDI shift data */
lenVal lvTdoExpected; /* Expected TDO shift data */
lenVal lvTdoCaptured; /* Captured TDO shift data */
lenVal lvTdoMask; /* TDO mask: 0=dontcare; 1=compare */

#ifdef XSVF_SUPPORT_COMPRESSION
/* XSDRINC Data Buffers */
lenVal lvAddressMask; /* Address mask for XSDRINC */
lenVal lvDataMask; /* Data mask for XSDRINC */
lenVal lvNextData; /* Next data for XSDRINC */
#endif /* XSVF_SUPPORT_COMPRESSION */
} SXsvfInfo;
this structure include many lenVal, So I don't think a AT89C52 mcu have so much ram.
 

how to convert mcs to xsvf

The size of my ultimate image is about 10Kbytes, it's small.
You must define the functions setPort(), pulseClock(), readByte(), readTDOBit() and waitTime() yourself according to the MCU you're using. The source code provided by app058 is just for reference. You can define your functions as follows:
void setPort(short p, short val)
{
if (p==TMS)
out_word.bits.tms = (unsigned char) val;
if (p==TDI)
out_word.bits.tdi = (unsigned char) val;
if (p==TCK) {
out_word.bits.tck = (unsigned char) val;
yourMCUwriteBitFunc(xxx, out_word.bits.tms);
yourMCUwriteBitFunc(xxx, out_word.bits.tdi);
yourMCUwriteBitFunc(xxx, out_word.bits.tck);}
}

void pulseClock()
{
setPort(TCK,0);
setPort(TCK,1);
setPort(TCK,0);
}

void readByte(unsigned char *data)
{
*data=*mark; /* unsigned char* mark=(unsigned char* yourconfigfileaddress */
mark++;
}

unsigned char readTDOBit()
{
if (yourMCUreadBitFunc() == 1){
in_word.tdo = 1;}
in_word.tdo = 0;
}

void waitTime(long microsec)
{
static long tckCyclesPerMicrosec = (long)your clk number in MHz;
long tckCycles = microsec * tckCyclesPerMicrosec;
long i;
for ( i = 0; i < tckCycles; ++i );
{
pulseClock();
}
}
 

interface fpga mcu

I use altera fpgas to design system.
Can you provide altera's jtag version for ACEX or Excalibur?
 

Hi all

from Xapp058 i not understand something

how i can convert xsvf file to hex file and program to EPROM.

Thanks
 

Ok friend now i understand about Xapp058 . but I can't complie C Code in Keil

what is problem ?
 

You have to modify the port io .c file to fit your application... somehow, as you say, the file provided in XAPP058 is a demonstration of how should port io be done. you have to do it yourself for your own microcontroller.
 

sucan said:
The source code of app058 is C. You can compile it with any C compiler. .

Can't complie with Keil .:!:

i use P89LV51RD2 but i can't complie with keil V8.01

Pls. help me

Thanks
 

It will be of no use even if you can compile it, IT MUST BE MODIFIED to suite your microcontroller...
 

BuBEE said:
Hi all

from Xapp058 i not understand something

how i can convert xsvf file to hex file and program to EPROM.

Thanks

usually eprom programmers have utility to converty from one binary format to other.
 

Hey,

I recently finished doing a Xilinx FPGA configuration via an AVR project. It's described in detail in the February issue of Circuit Cellar, which should be out soon. As well once Feb is here it should be online for free at https://www.circuitcellar.com if you don't subscribe.

The code is GPL at **broken link removed**

HTH,

-Colin
 

Hello everybody, i'm nooby;
Could you explain me how to convert my xsvf file, improved with Impact software, in hex file for this STEVAL-IME003V1 https://www.st.com/internet/evalboard/product/252388.jsp.
I have to write my code in DFU format; the hex file can be converted in DFU file with a converter of ST (DFU file manager).
I have compilated the C code in www.xilinx.com/support/documentation/application_notes/xapp058.pdf with dec++ without problems and now I don't know how to convert with exe file compilated my xsvf code.
Help me, i have many problems.
best regards.
Vins81
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top