UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar mrbietola
Scholar
12,327 Views
Registered: ‎05-31-2012

Big Endian Little Endian confusion

Hi,

i am doing a tcp application in SDK, i use microblaze with AXI Bus.

I see that microblaze endianness is little endian because of the AXI Bus,

in  SDK i see that in the Symbol tab in the compiler option is active the symbol "__BIG_ENDIAN__"

what is the endianness of the platform?

0 Kudos
6 Replies
Adventurer
Adventurer
12,314 Views
Registered: ‎04-07-2014

Re: Big Endian Little Endian confusion

When MicroBlaze is configured for AXI, it will use little-endian mode

 

Thanks,

Akshay

Xilinx Employee
Xilinx Employee
12,310 Views
Registered: ‎08-01-2012

Re: Big Endian Little Endian confusion

You can find some useeful information in the following AR http://www.xilinx.com/support/answers/45841.html also

________________________________________________

Please mark this post as an "Accept as solution" in case if it helped to resolve your query. So that it will help to other forum users to directly refer to the answer.

Give kudos to this post in case if you think the information is useful and reply oriented.

0 Kudos
Scholar sampatd
Scholar
12,308 Views
Registered: ‎09-05-2011

Re: Big Endian Little Endian confusion

MicroBlaze uses Big-Endian or Little-Endian format to represent data, depending on the parameter C_ENDIANNESS

The C_ENDIANNESS parameter is automatically set to little endian when using AXI4, but can be overridden by the user.

Can you attach your SDK workspace here?
0 Kudos
Scholar stephenm
Scholar
12,289 Views
Registered: ‎05-06-2012

Re: Big Endian Little Endian confusion

The feature to over write the endianess is removed in Vivado. This was in XPS to support the PLB which supports big endian

0 Kudos
Scholar mrbietola
Scholar
12,284 Views
Registered: ‎05-31-2012

Re: Big Endian Little Endian confusion

I continue to not understand,

i use a free TCP/IP library, it has some controls on the endianness of the platform to do some conversion (htons ntohs) to correctly forward addresses on the network..

 

#ifdef __BIG_ENDIAN__
#ifndef htons
  #define htons(x) (x)
#endif

#ifndef ntohs
#define ntohs(x) (x)
#endif

#ifndef htonl
#define htonl(x) (x)
#endif

#ifndef ntohl
#define ntohl(x) (x)
#endif

 i see that __BIG_ENDIAN__ is defined,   i see that microblaze is little endian, i see that the application works

where is the trick?    maybe microblaze use some functions to convert from little endian to big endian?

 

how can i attach my workspace?

 

0 Kudos
Xilinx Employee
Xilinx Employee
12,271 Views
Registered: ‎08-02-2007

Re: Big Endian Little Endian confusion

Hi,

 

You are right. ntoh and hton that you are referring in the below post are a part of xil_io.h that comes along with Standalone BSP. These functions are also a part of the LWIP source code too. You can find the information about these functions in page 38 of UG647 http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_4/oslib_rm.pdf

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos