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?
What is the recommended way to programmatically reboot a mul
-
- XCore Addict
- Posts: 131
- Joined: Wed Aug 03, 2011 9:13 am
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
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.
-
Verified
- XCore Legend
- Posts: 1163
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
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:
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));
Technical Director @ XMOS. Opinions expressed are my own