What is the recommended way to programmatically reboot a mul

If you have a simple question and just want an answer.
Redeye
XCore Addict
Posts: 131
Joined: Wed Aug 03, 2011 9:13 am

What is the recommended way to programmatically reboot a mul

Post by Redeye »

What is the recommended way to programmatically reboot a multiple processor system (after a firmware upgrade)? In a single processor system it's straightforward to reset the switch, but as I understand it it's a whole lot more complicated in a multiple processor system. Is the simplest way just to use an output port to drive the reset circuitry in the same way that the JTAG does?



User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

You can use an output port to drive the reset circuitry of a multi-tile system for reboot, in the same was as JTAG does. 

User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You can reboot the local tile by writing to its PLL ctrl register (register 6).  You normally will wish to read the register and write back the same value.

You can also write the PLL ctrl register of a remote tile via the switch.  Below I include some example code to get you started:

    /* Note, this function is prototyped in xs1.h only from 13 tools onwards */
    unsigned get_tile_id(tileref);
    extern tileref tile[];
    unsigned int localTileId = get_local_tile_id();
    unsigned int tileId;

    /* Reset all remote tiles */
    for(int i = 0; i< tileArrayLength; i++)
    {
        /* Cannot cast tileref to unsigned! */
        tileId = get_tile_id(tile);
       
        /* Do not reboot local tile yet! */
        if(localTileId != tileId)
        {
           read_sswitch_reg(tileId, 6, pllVal);
           write_sswitch_reg_no_ack(tileId, 6, pllVal);
        }
     }
    
     /* Finally reboot this tile! */
     read_sswitch_reg(localTileId, 6, pllVal);
     write_sswitch_reg_no_ack(localTileId, 6, pllVal);

To find the length of the tile array in the 12 tools you can use the following trick:

Code: Select all

/* Find size of tile array - note in future tools versions this will be available from platform.h */asm volatile ("ldc %0, tile.globound":"=r"(tileArrayLength));