cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
1,887 Views

Microblaze Compiler Option __MICROBLAZE__ not defined

Jump to solution

We have been working on a Microblaze based design for some time now. We are using Vivado 2017.2 and developing firmware using SDK of the same version. We are adding another DMA channel to move data from our IP engine to DDR3 external memory. I noticed while learning DMA using the Example DMA with SG and interrupt that the __MICROBLAZE__ pre-processor definition is not defined. I then checked my whole project for this and it is not defined anywhere. According to ug1043 page 29 it states and I quote: "When compiling with the Microblaze compiler, the pre-processor provides the definition __MICROBLAZE__  automatically. You can use this definition in any conditional code." My question is why is it not defined and could there be problems not having it?

 

When I build my projects I export hardware from Vivado to SDK with bit stream and use SDK for all firmware development. Everything seems to work fine, but is there something lurking?

 

Dan Dahl

0 Kudos
1 Solution

Accepted Solutions
sadanan
Xilinx Employee
Xilinx Employee
2,186 Views
Registered: ‎10-21-2010

Hi,

Yes, its defined when you use MB gcc

View solution in original post

0 Kudos
5 Replies
sadanan
Xilinx Employee
Xilinx Employee
1,844 Views
Registered: ‎10-21-2010

Hi,

__MICROBLAZE__ is defined in toolchain sources. You can safely use it

0 Kudos
Anonymous
Not applicable
1,819 Views

I'm not trying to use it, I want to know why my project does not see it. If it is defined (by default) then why does my BSP look like this. It looks like this in all usage locations. SDK 2017.2

 

undefined.jpg

Thanks,

 

Dan Dahl

 

0 Kudos
sadanan
Xilinx Employee
Xilinx Employee
1,812 Views
Registered: ‎10-21-2010

This is a problem with Eclipse (visual part only). It doesn't identify the macros correctly while highlighting/greying out code

0 Kudos
Anonymous
Not applicable
1,801 Views

Thanks. So this is a known problem with Eclipse, gcc is using the __MICROBLAZED__ define paths and that's for sure?

 

Dan Dahl

0 Kudos
sadanan
Xilinx Employee
Xilinx Employee
2,187 Views
Registered: ‎10-21-2010

Hi,

Yes, its defined when you use MB gcc

View solution in original post

0 Kudos