Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
giriprakash
Level 1
Level 1
First reply posted First question asked Welcome!

I need to test the below traps. Can you help me simulate the traps for testing?

  • StackOverflow
  • Illegal Opcode
  • Memory Protection Write
0 Likes
1 Solution
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

You can refer to chapter 6 of the core architecture manual to know about different types of traps.
1. Aurix uses context save area to manage the function call, interrupts, etc. Class 3 traps occur if there is an error in context management.
2. When the instruction decoded doesn't correspond to the defined opcode.
3. When data write access is done to the memory protected region.

Thanks.

View solution in original post

0 Likes
3 Replies
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

You can refer to chapter 6 of the core architecture manual to know about different types of traps.
1. Aurix uses context save area to manage the function call, interrupts, etc. Class 3 traps occur if there is an error in context management.
2. When the instruction decoded doesn't correspond to the defined opcode.
3. When data write access is done to the memory protected region.

Thanks.

0 Likes
giriprakash
Level 1
Level 1
First reply posted First question asked Welcome!

Hi,

Regarding Illegal opcode, do you have any example code or document to force the  Illegal opcode trap?. This is only for testing purposes.

Thanks 

0 Likes
cwunder
Employee
Employee
10 likes given 100 solutions authored 5 likes given

Here are some snippets for Class 2 traps

 

typedef void (*func_t)(void);
/*TIN:1 IOPC Synch. HW Illegal Opcode*/
/* Unused program memory filled with 0x36363636 etc will generate a IOPC (Invalid Opcode) trap if execution is attempted*/
*(volatile uint32*) (0x70101000) = 0x36363636;
__dsync();
__isync();
((func_t) 0x70101000)();
/*TIN:2 UOPC Synch. HW Unimplemented Opcode*/
/* __asm("tlbdemap d2");  */
*(volatile uint32*) (0x70101000) = 0x275;
__dsync();
__isync();
((func_t) 0x70101000)();
/*TIN:3 OPD Synch. HW Invalid Operand specification*/
/**
* 6B 0B 00 C0  PACK      d12,e0,d11
* 6B 0B 00 C1  PACK      d12,e1,d11 change the e0 to e1 to make it odd
*/
*(volatile uint32*) (0x70101000) = 0xC1000B6B;
__dsync();
__isync();
((func_t) 0x70101000)();

 

 

0 Likes