OpenCores
Issue List
compile and run #48
Closed kroumann opened this issue over 10 years ago
kroumann commented over 10 years ago

Hi,

This is the output of test program running on mlite emulator:


2088880171: two billion '??? eight million eight hundred '??? thousand one hundred '??? one 1971673217: one billion nine hundred '??? one million six hundred '??? three thousand two hundred seventeen 1620052355: one billion six hundred twenty million '??? two thousand three hundred '??? five 0565189769: five hundred '??? five million one hundred '??? nine thousand seven hundred '??? nine


When I run the same program using modelsim, the program goes into a kind of infinte loop. here is the output:


0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three 0000000003: three


I have tested different cross compilers (mips-elf, mips-gnu-linux ...) but nothing worked. Did someone have had the same issue ?
Thanks for helping

kroumann commented over 10 years ago

BTW I'm running Debian Wheezy x64 on parallel virtual machine.

kroumann commented over 10 years ago

BTW I'm running Debian Wheezy x64 on parallel virtual machine.

theshadowx commented over 10 years ago

I had also some issues with these compilers, but the best thing that worked for me is to use cygwin

rhoads commented over 10 years ago

Could you please send me the test.axf and test.bin files from your compile of count.c.

It may be a problem with the convert_bin program. Could you also please try using objcopy instead of convert_bin:

objcopy -I elf32-big -O binary test.axf test.bin

Thanks, Steve rhoadss@yahoo.com

rhoads was assigned over 10 years ago
rhoads commented about 10 years ago

The compiler was not placing the function "entry" as the first function at address 0x0. Instead it was placing "main" as the first function as address 0x0.

The problem was solved by getting the default linker script by adding "-verbose" to the ld command. Then create and modify the "link.scr" linker script to have the start address be 0x0 and have boot.o be first:

< .text 0x80020000 : < {

< _ftext = . ;

.text 0x0 : { _ftext = . ; boot.o

And the entry be "entry":

< ENTRY(__start)

ENTRY(entry)

And change the alignment: < . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));

. = ALIGN(8);

Then used the linker script by adding "-T link.scr" to the ld command.

Another option is to change boot.asm and rename the function "entry to "main". Then change "jal main" to "jal main2". Then in count.c change "main" to "main2". Then in makefile change "-e entry" to "-e main".

rhoads commented about 10 years ago

Reformatted so there aren't any less-than characters:

The compiler was not placing the function "entry" as the first function at address 0x0. Instead it was placing "main" as the first function as address 0x0.

The problem was solved by getting the default linker script by adding "-verbose" to the ld command. Then create and modify the "link.scr" linker script to have the start address be 0x0 and have boot.o be first:

{ .text 0x80020000 : { {

{ _ftext = . ;

} .text 0x0 : } { } _ftext = . ; } boot.o

And the entry be "entry":

{ ENTRY(__start)

} ENTRY(entry)

And change the alignment: { . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); } . = ALIGN(8);

Then used the linker script by adding "-T link.scr" to the ld command.

Another option is to change boot.asm and rename the function "entry to "main". Then change "jal main" to "jal main2". Then in count.c change "main" to "main2". Then in makefile change "-e entry" to "-e main".

rhoads closed this about 10 years ago

Assignee
rhoads
Labels
Request