cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
9,829 Views
Registered: ‎08-24-2008

MicroBlaze Programming Language ???

 

Hello . . . 

 

Is It possible to program the MicroBlaze soft processor using VHDL rathar than c language ???

 

because i am familar in VHDL programming , and i am dont know to programming with c .

 

Thanks . . .

oms
0 Kudos
7 Replies
Highlighted
Xilinx Employee
Xilinx Employee
9,825 Views
Registered: ‎08-13-2007

oms,

 

No. VHDL is used to model and synthesize hardware. MicroBlaze is a 32-bit soft processor that has already been developed. You can program it in C, C++, assembly, or machine code.

 

You can use VHDL to develop additional peripherals for MicroBlaze.

 

bt

0 Kudos
Highlighted
Adventurer
Adventurer
9,616 Views
Registered: ‎08-24-2008

Dear

thanks for replying

 

so how can i make the compiler to distinguish between thos languages ,

because when i create a new software application the file exension is .c?

or to write the assembly program by c language?

 

 

 

oms
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
9,605 Views
Registered: ‎08-13-2007

There are different compilers for the different languages:

mb-gcc for C

mb-g++ for C++

mb-as for assembly (ok, this one is actually an assembler)

 

The options likely depend on your development flow, as there are multiple possibilities: XPS in GUI mode, XPS in batch mode (e.g. TCL), makefile, SDK, etc.

The XPS GUI gives you the option when you add source to an application of adding a C file (default file type, note the option to change this in the dialog box), C++ source, or other (e.g. .s)

 

Most users likely use C. It is also possible to in-line assembly into your C file:

http://www.xilinx.com/support/answers/18561.htm (9.2i EDK - How do I include inline assembly within my C source files?)
http://forums.xilinx.com/xlnx/board/message?board.id=Virtex&message.id=1997#M1997 (Microblaze , vertex 4 ML403, Accessing register values from C)

 

bt

 

 

0 Kudos
Highlighted
Adventurer
Adventurer
9,499 Views
Registered: ‎08-24-2008

Thanks for replyng me ,

 

you wrote that The XPS GUI gives you the option when you add source to an application of adding a C file (default file type, note the option to change this in the dialog box), C++ source, or other (e.g. .s)

 

i want to write my source code using assembly language , Is this possible ? is the file extension (*.s) is used for assembly codes files ? and is

 

there a need to adjust the compiler (mb-as for assembly ) manually whether in XPS or in SDK ??? if yes , where to do that ?

 

i want to use assembly because it is familiar to me and i used it before unlike c .

 

Thanks.

oms
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
9,476 Views
Registered: ‎08-13-2007

Yes, it should be possible.

 

Many of the low-level MicroBlaze (and PPC) routines were written in assembly.

For example, see

%XILINX_EDK%\sw\lib\bsp\standalone_v2_00_a\src\microblaze
%XILINX_EDK%\sw\lib\microblaze\src

Yes:

 .S Assembly file, but might have preprocessor directives
 .s Assembly file with no preprocessor directives
per http://www.xilinx.com/support/documentation/sw_manuals/edk10_est_rm.pdf (Embedded System Tools Reference Manual)

 

I've never used assembly in XPS before.

A quick test shows adding a .s file to a project still uses mb-gcc (accoding to the makefiles automaticcally generated by XPS). I don't necessarily see this as incorrect since mb-gcc obviously can use mb-as. But I'll admit I haven't used assembly here.

 

It is also possible to script EDK after you use the EDK GUI to create the hardware subsystem.

http://forums.xilinx.com/xlnx/board/message?board.id=EDK&message.id=7063 (Using EDK in batch mode ?)

 

bt

 


 

 

 

0 Kudos
Highlighted
Adventurer
Adventurer
9,458 Views
Registered: ‎08-24-2008

Can you guide me to any document or anything to use assembly language in microblaze programming like the form of the header and source files , how to make comments , ....etc

 

i was read the microblaze processor reference gide including chapter 4 (microblaze instruction set arcitecture) , it provides details on instructions but not details but no how to program

oms
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
9,441 Views
Registered: ‎08-13-2007

If you've already read the MicroBlaze reference guide (which is where I would start), the next step is likely to review the existing assembly files I mentioned above as an example:

%XILINX_EDK%\sw\lib\bsp\standalone_v2_00_a\src\microblaze
%XILINX_EDK%\sw\lib\microblaze\src

 

You may also find the GNU Assembler documentation useful:

http://sourceware.org/binutils/docs/as/index.html
http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/
http://savannah.nongnu.org/projects/gas-user/
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

 

bt

Message Edited by timpe on 01-25-2009 10:58 PM
0 Kudos