# Towards a Scalable Software Defined Network-on-Chip for Next Generation Cloud
## 5 Software Interface  
The ISA of PE is extended with a small group of instructions that serves the purpose of managing the reconfiguration phase, monitoring links' traffic and supporting workload distribution. With the aim of keeping our interconnection agnostic with regards to the specific PEs (micro)-architecture (i.e., the processor word length, embedded local memories, cache hierarchy), a generic software interface (essentially the ISE) is presented. The interface is composed of instructions that can be conveniently wrapped by a function in standard high-level languages (e.g., Go, C/C++). Without losing generality, in the following, we assume a generic PE providing an in-order execution model, and embedding a small local scratchpad memory:  
* SetRouterCfg ($RD, $RS): sends a topology configuration request (i.e., topology configuration specifies for each input port, which output ports can be used to forward the traffic) to the routers, by specifying the memory address where the configuration is stored ($RS), while register $RD specifies the destination router. * 1, where K is the number of PEs in the VT). The destination router is encoded in the $RD register, while register $RS specifies the memory base address where the router LUT content is stored. * ReadCounter ($RD, $RS1, $RS2): reads the content of a link's counter, by specifying the link to read. Performance counters can be read back from any PE, by specifying either the router or the ringlet-PE pair from which to read the corresponding counter. A sequence of control flits containing the counter data is sent back by destination router ($RD). The $RS1 register contains a mask specifying the link target, while source register $RS2 will store the value that has been read. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Instruction** & **Packet Number** & **Packet Description** & **Packet Payload** \\ \hline \multirow{3}{*}{SetRouterLUT} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x00000001 \\  & 3–88 & Configuration & 0b00X...X \\ \hline \multirow{3}{*}{SetRouterCfg} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x00000002 \\  & 3–4 & Configuration & 0 bXX...X \\ \hline \multirow{3}{*}{ReadCounter} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x0000 XX03 \\  & 3–4 & Reply & 0 bXX...X \\ \hline \multirow{3}{*}{ResetCounter} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x0000 XX04 \\ \hline \multirow{3}{*}{ResetRouterCfg} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x00000005 \\ \hline \multirow{3}{*}{ResetRouterLUT} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x0000006 \\ \hline \multirow{3}{*}{EnableRouterCfg} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x0000007 \\ \hline \multirow{3}{*}{DisableRouterCfg} & 1 & Starting & 0 xFFFFFFFF \\  & 2 & Command & 0x00000008 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Configuration packet sequences used to configure the router logic and to collect statistics. These packet sequences are generated as a response to the execution of configuration instructions. * ResetCounter ($RD, $RS): allows for resetting traffic statistics by specifying link performance counters to reset ($RD). The $RS register stores the mask used to select the counters (either routers or ringlet-PE pairs can be targeted). * ResetRouterCfg ($RD): allows for resetting the current topology configuration. The target router is specified by the destination register $RD. * ResetRouterLUT ($RD): allows for resetting the content of the internal router LUT. The target router is specified by the destination register $RD. * EnableRouterCfg: allows for enabling routers' configuration. Once the instruction is executed, a corresponding control flit is sent in a broadcast (actually, a sequence of control flits is generated, each targeting a router) to force the corresponding bit within each router to be set. * DisableRouterCfg: allows for disabling the entire chip configuration (i.e., the physical chip fabric becomes accessible.