This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NIOS2 kernel tests failing


On 2007-01-02, Nick Garnett <nickg@ecoscentric.com> wrote:

>> I've been unable to get all of the kernel tests to pass on a
>> NIOS2 platform.  Four fail consistently:
>> 
>>    except1.cxx
>>    kexcept1.cxx

[...]

> The programs attempt to provoke a hardware exception by first
> trying to generate an alignment/bus error/memory management
> exception by poking memory;

There are no memory alignment or bus-error exceptions in the
NIOS2 processor and misaligned accesses are forbidden.  The
CPU's reference manual states that misaligned accesses result
in "undefined operation".  Strict interpreation of that allows
the CPU to do absolutely anything when a misaligned operation
occurs.  My guess is that instruction execution continues
normally with an undefined value in the destination register,
but the spec is pretty clear that it's simply not allowed, and
CPU can do absolutely anything if it does happen.

> if that fails it tries a divide by zero.

No execption for that, just undefined values in result
registers.

> If none of these work, then the test will fail.

And it does. :)

The only hardware exceptions that can be caused by software
are:

 trap
 break
 valid but unimplemented instruction

[The last one is different from an undefined (invalid)
instruction -- which again results in "undefined operation".]
 
> I don't know what exceptions the NIOS2 support, so either
> there are no suitable exceptions supported,

It appears there aren't, and doing things like misaligned
memory accesses may result in "udefined operation".

-- 
Grant Edwards                   grante             Yow!  I'm into SOFTWARE!
                                  at               
                               visi.com            


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]