TRAP and real hardware

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

Moderator: aolofsson

TRAP and real hardware

Postby alexrp » Thu Dec 19, 2013 12:02 am

The TRAP instruction supports a trap code that can be used to perform a particular task. This works fine in a simulator because it has easy immediate access to it when decoding the instruction. However, it doesn't seem like there's an easy way to grab the trap code when running on real hardware. Of course, the host could read PC, translate it to a host-side address, fetch the 16-bit instruction, and decode the trap code field, but this seems a bit hairy.

Is there a better way to do this, or should I go with what I described above?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: TRAP and real hardware

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

What you described is more or less the way we have it implemented today using the host device to do the somewhat tricky instruction inspection. In the case of GDB it's downright nasty, but it works.
Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: TRAP and real hardware

Postby mhonman » Thu Dec 19, 2013 9:37 pm

mhonman
 
Posts: 112
Joined: Thu Apr 25, 2013 2:22 pm


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 19 guests