Invalid instruction EXCAUSE value not documented

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

Invalid instruction EXCAUSE value not documented

Postby alexrp » Wed Dec 18, 2013 10:19 pm

The manual says that a software exception can be triggered when an invalid instruction is encountered. However, it does not specify what value should be written to EXCAUSE for this case (see the table in Appendix D).
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Invalid instruction EXCAUSE value not documented

Postby aolofsson » Thu Dec 19, 2013 12:07 am

Thanks for catching this,I added it to the opcode table. There is an undocumented "UNIMPL" instruction with an opcode as follows:
0xXXXFXXXF

The instruction works like a NOP, except for the fact that it causes a software exception (and flushing the pipeline).

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Invalid instruction EXCAUSE value not documented

Postby alexrp » Thu Dec 19, 2013 1:40 am

Does UNIMPL cover every possible illegal instruction bit pattern? I.e. can I try to match every other instruction in the ISA and simply fall back to UNIMPL if none match?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Invalid instruction EXCAUSE value not documented

Postby alexrp » Thu Dec 19, 2013 2:03 am

Relatedly, what should happen if an instruction decodes successfully but has nonsensical fields? For example, a MOV<BL> makes no sense.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Invalid instruction EXCAUSE value not documented

Postby aolofsson » Thu Dec 19, 2013 2:20 am

Sorry, the unimpl is only one specific Opcode. Executing a non-supported opcode will result in weird and unpredictable behavior.

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Invalid instruction EXCAUSE value not documented

Postby alexrp » Thu Dec 19, 2013 2:41 am

OK. Table 24 in section 7.8.1 should probably be fixed to say "unimplemented exception" instead of "invalid instruction" then. It should probably also be documented that invalid instructions are undefined behavior.

Is it OK for a simulator to simply set ACTIVE=0 for these cases?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Invalid instruction EXCAUSE value not documented

Postby aolofsson » Thu Dec 19, 2013 2:46 am

Yes, that sounds right.
Thanks.
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 19 guests