OpenCores
First Prev 2/2 no use no use
RE: initialize memory for openrisc
by s0parsaean on Nov 4, 2010
s0parsaean
Posts: 50
Joined: Nov 11, 2009
Last seen: Mar 10, 2012
I attach one assembly code. In this code you can see some "l.j", "l.jal", "l.bf", "l.bnf", "l.jr",...

but when you convert it to vmem code, compiler add some another jump code! why?

where is their assembly code?
RE: initialize memory for openrisc
by jeremybennett on Nov 4, 2010
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019
Hello,

When I run a simple program(hello_world.c) in openrisc, it add a lot of jumps in

assembly(hello_world.S), for example "l.jr r9", in my project I should control this jump, I found

some of them in printf.S , uart.S and or32-utils.S, what about remainder? where can I find them?

For example what means this in assembly code : .global __divsf3

If anyone could steer me in the right direction, I appreciate it!

r9 is the link register, i.e. it holds the return address after a l.jal or l.jalr instruction into a function. So l.jr r9 is now the code returns from a function.

__divsf3 is the library function implementing integer division in software. By default OpenRISC does not include a divide instruction. The assembly code uses .global to mark that the jump to this function is an external library function that must be linked in later. If you compile using -mhard-div, code will be generated to use the (optional) OpenRISC divide instructions. That will work fine with Or1ksim

You may want to look at Chapter 16 of the architecture manual, which describes the Application Binary Interface (ABI). This is the definition of how functions on OpenRISC should call each other, and the role of the registers in such calls.

HTH

Jeremy

RE: initialize memory for openrisc
by bhautikbaraiya on Aug 4, 2014
bhautikbaraiya
Posts: 2
Joined: Dec 16, 2013
Last seen: Oct 7, 2014
Hello

I am trying to convert the given uart.c file into uart.hex file in the /sw/ folder using makefile
cmd used :make all

I am getting following error :
make: or32-elf-gcc: Command not found
or32-elf-gcc -Wall -mhard-mul -mhard-div -nostdlib -g -O0 -I../support -I../drivers -c uart.c -o uart.o
make: or32-elf-gcc: Command not found
make: *** [uart.o] Error 127

how to solve this issue.

thanks in advance
RE: initialize memory for openrisc
by rafay_147 on Aug 4, 2014
rafay_147
Posts: 6
Joined: Nov 9, 2011
Last seen: Feb 9, 2025
Dear bhautikbaraiya

The error you have posted is due to not proper installation and configuration of gcc tool. in order to install and configure gcc, you need to download and install fresh gcc. if you are using cygwin then cygwin automatically install GCC package but you need to configure for or32-elf target.

hope it will help you.

Regards

Abdul Rafay Khatri.
First Prev 2/2 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.