On Thu, 2012-03-22 at 20:43 +0100, R. Diez wrote: 
> Hi all:
> 
> Most tests in the or1ksim's test suite are written in C and do not 
> initialise the BSS section properly. They still work because the 
> simulator initialises all memories with zeroes. This is an excerpt from 
> file default.cfg used by most test cases:
> 
>    section memory
>      pattern = 0x00
>      type = unknown /* Fastest */
>      ...
> 
> I changed that configuration to "type = exitnops" and some of the tests 
> stopped working. There is no guarantee that all RAM contents will be 
> zeroed on reset, so decided to add code to clear the BSS section properly.

<snip> 

> However, that does not seem to work for the OpenRISC toolchain either. I 
> added a couple of "char xxxx" variables and BSS's size was no longer 
> aligned. It's not so important, but I'm worried that something may not 
> be working properly in the OpenRISC port. Or maybe I don't quite 
> understand what's going on with the linker script.

Hi R Diez,

When I put the original Or1ksim test suite together, it was before the
modern newlib implementation. As far as I am aware, newlib gets this
stuff right.

We recognized some time ago that the solution is that almost all the C
tests should use plain newlib. You really only need a custom bootloader
for the assembler tests, and possibly the exception handling tests.

It is a good idea to run the tests with a range of starting conditions,
but remember that slows Or1ksim (you have to initialize the memory), so
the tests will take longer. IIRC Or1ksim by default doesn't actively
initialize memory to zero, it just uses whatever is there.

HTH,


Jeremy

-- 
Tel:      +44 (1590) 610184
Cell:     +44 (7970) 676050
SkypeID: jeremybennett
Email:   [email protected]
Web:     www.embecosm.com

_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to