Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20705 Discussions

libjtag_atlantic.so (under linux)

Altera_Forum
Honored Contributor II
1,242 Views

Hello all, 

 

I came to know about "jtag_atlantic" Altera Mega-IP thanks to this forum. 

There are several threads already discussing about the IP and examples. 

It seems very handy way to sink/source data from FPGA or from PC. 

 

I would like to create software for "jtag_atlantic" under Linux. 

I found libjtag_atlantic.so under Altera Quartus directory so I thought it would be easy thing to do. 

 

However, when I tried to compile my test software, I got unexpected errors: 

% gcc -o test_link test_link.c -L(ALATERA/LIB_DIR) -ljtag_atlantic 

test_link.c:(.text+0x27): undefined reference to `jtagatlantic_open' 

test_link.c:(.text+0x6f): undefined reference to `jtagatlantic_close' 

test_link.c:(.text+0x8c): undefined reference to `jtagatlantic_get_error' 

 

// 

 

The libjtag_atlantic.so contains the above undefined functions: 

% nm (ALATERA/LIB_DIR/libjtag_atlantic.so 

... 

0000000000003024 T _Z17jtagatlantic_openPKciiS0_ 

0000000000001e80 T _Z17jtagatlantic_readP12JTAGATLANTICPcj 

000000000000206a T _Z18jtagatlantic_closeP12JTAGATLANTIC 

0000000000001d36 T _Z18jtagatlantic_flushP12JTAGATLANTIC 

0000000000001fa4 T _Z18jtagatlantic_writeP12JTAGATLANTICPKcj 

00000000000017b8 T _Z21jtagatlantic_get_infoP12JTAGATLANTICPPKcPiS4_ 

0000000000001780 T _Z22jtagatlantic_get_errorPPKc 

0000000000001cda T _Z22jtagatlantic_wait_openP12JTAGATLANTIC 

00000000000017c4 T _Z26jtagatlantic_cable_warningP12JTAGATLANTIC 

00000000000017e8 T _Z28jtagatlantic_bytes_availableP12JTAGATLANTIC 

... 

 

// 

 

Does anybody use jtag_atlantic under Linux environment? 

All examples I found are provided for PC (CygWin) environment and examples are using libjtag_atlantic.a, which is not compatible with Linux platform. 

 

As I'm not familiar with Linux and Software development, any suggestions, any comments are greatly appreciated. 

 

Aki-
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
503 Views

I'm not using Linux, but similar to the respective Windows libraries, the libjtag_atlantic function names are apparently "decorated" names (including a coding for function return and argument types, as required for function overloading in C++). You either need to interface the library from C++ code, or write a respective import library. 

 

It's a general C versus C++ problem and not particularly related to libjtag_atlantic.
0 Kudos
Altera_Forum
Honored Contributor II
503 Views

Hi FvM, 

 

Thank you for your reply. 

I consulted a software guru in my office and he pointed out the problem (basically the same thing you suggested). 

The API routines are provided in C++ (names are mangled) and it uses an explicit namespace, "JTAGATLANTIC". 

He showed me how to fix. 

 

I will provide the solution to other Altera users once I confirm all correct operations. 

 

Thanks, 

Aki-
0 Kudos
Altera_Forum
Honored Contributor II
503 Views

Can you share the solution ? Maybe with a small code sample ?

0 Kudos
Altera_Forum
Honored Contributor II
503 Views

Hi HardFault, 

 

Sorry to disappoint you. 

I could compile my test program but I couldn't get it to work with my simple test design. 

It is unfortunate that Altera didn't make this software interface available to Altera FPGA users. 

If I find a way to make this interface to work or some other similar interface becomes usable, I will post to the forum. 

 

Sorry! 

Aki-
0 Kudos
Reply