Advertisement
Guest User

Untitled

a guest
Jul 29th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. __kernel void ecore(__global int column, __global int row)
  2. {
  3.   ecore_t* core = &cores[column][row];
  4.  
  5.   while (1)
  6.   {
  7.     if(ACTIVE)
  8.     {
  9.       int32_t op = read_memory32(core, PC);
  10.      
  11.       if(PC & 0x01) {
  12.         uint32_t status = read_memory32(core, MEM_REG_STATUS);
  13.         status |= 0x00070000;                   // set EXCAUSE, don't know the exact value so I used 111b
  14.        
  15.         PC+=1;                                  // align to next word boundary
  16.        
  17.         raise_interrupt(INT_SOFTWARE_EXCEPTION);// basically reset the core  
  18.       }
  19.      
  20.       if(op & 0x01 || op & 0xF == 0xE || op & 0xF == 0xA)
  21.         op_16bit(op & 0x0000FFFF, core);
  22.       else
  23.         op_32bit(op, core);
  24.      
  25.     }
  26.   }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement