[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [openrisc] problem with linker script for or1ksim



Hi,

Every test case has initialization of memory controller at the beginning
(after reset).
Changing the linker file is not enough, you should also change this
initialization and code for copying
data section from flash to ram.

Simon

Xiaoping Li wrote:
> 
> Hi,
> I compiled most of the sample codes under testbench in
> or1ksim using ?default.ld? linker script and ran the
> binary codes under or1k simulator using ?default.cfg?
> simulation configure file. Every code ran smoothly
> from the beginning to the end. Then, I changed the
> linker script in such a way that the ?flush? memory
> region is removed, that is, the memory is all ram (I
> want to allocate every thing within an 16MB SDRAM). I
> recompiled those sample codes and ran again with
> ?default.cfg?, but I got the following message:
> 
> Keyboard Interrupt.... kbd kresp 0 kbd_buf_count 4
> Keyboard Interrupt.... kbd kresp 0 kbd_buf_count 6
> Keyboard Interrupt.... kbd kresp 0 kbd_buf_count 8
> Keyboard Interrupt.... kbd kresp 0 kbd_buf_count c
> Keyboard Interrupt.... kbd kresp 0 kbd_buf_count e
> ....
> all the time for each sample program. I checked the
> execution log file and found nothing got executed
> except ?l.j 0x0? instruction at pc counter 0x100 and
> 0x104.
> 
> The following is the linker script I modified from
> ?default.ld?:
> MEMORY
>         {
>         except : ORIGIN = 0x00000000, LENGTH =
> 0x00002000
>         ram     : ORIGIN = 0x00002000, LENGTH =
> 0x01000000 - 0x00002000
>         }
> 
> SECTIONS
> {
> 
>         .text :
>         {
>         *(.text)
>         _src_beg = .;
>         } > ram
> 
>         .except :
>         {
>         _except_beg = .;
>         *(.crc)
>         *(.except)
>         _except_end = .;
>         } > except
> 
>         .data :
>         {
>         _dst_beg = .;
>         *(.data)
>         _dst_end = .;
>         } > ram
> 
>         .bss :
>         {
>         *(.bss)
>         } > ram
> 
>         .stack ALIGN(0x10) (NOLOAD):
>         {
>         *(.stack)
>         _ram_end = .;
>         } > ram
> }
> 
> I am not so familiar with gnu linker script, so I am
> wondering the above script may cause the problem.
> Please correct the script if something wrong with it.
> Another unclear thing to me is the simulation
> configuration file. In this case, do I need change
> ?default.cfg? for running the program (like disable
> memory device ?flush?)? Please show me what?s the
> correct configuration file for simulation.
> 
> Thanks
> 
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
> --
> To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml
--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml