Many-Core Platforms in the Real-Time Embedded Computing Domain
Full text
FACULDADE DE ENGENHARIA DA UNIVERSIDADE DO PORTO Many-Core Platforms in the Real-Time Embedded Computing Domain Borislav Nikoli´ c Doctoral Programme in Electrical and Computer Engineering Supervisor: Dr. Stefan Markus Ernst Petters April 24, 2015
c Borislav Nikoli´ c, 2015
Many-Core Platforms in the Real-Time Embedded Computing Domain Borislav Nikoli´ c Doctoral Programme in Electrical and Computer Engineering Approved by: President: Dr. José Silva Matos External Referee: Dr. Petru Eles External Referee: Dr. Leandro Soares Indrusiak Internal Referee: Dr. Luís Miguel Pinho FEUP Referee: Dr. Pedro Ferreira do Souto FEUP Referee: Dr. Mário Jorge Rodrigues de Sousa Supervisor: Dr. Stefan Markus Ernst Petters April 24, 2015
Abstract Over the past few decades, the technological advancements made our lives increasingly permeated by and dependent on embedded systems. At the present day, these devices account for more than 98% of all produced computing systems, with applications that span over a wide range of areas, from medicine to avionics. Some embedded systems interact with the physical environment and have to guarantee not only that a certain action will be performed correctly, but also that the action will complete within a certain time. These devices are called real-time embedded systems, and some notable examples are medical pacemakers, airbags in cars and autopilots in airplanes. The process of analysing the temporal behaviour of a real-time embedded system is called real-time analysis. In many cases, the purpose of the analysis is to derive guarantees that a device will perform its functions correctly, while at the same time meeting all timing requirements. A real-time analysis is mostly performed at design-time, thus its efficiency highly depends on the amount of predictability of the entire system, whereas any non-deterministic aspect of the system behaviour has to be accounted for in the analysis with a certain degree of pessimism. A pessimistic analysis may cause a significant resource over-provisioning in the design phase, and consequently lead to a severe underutilisation of available resources at runtime. Therefore, reducing the analysis pessimism is one of the ever-present objectives in the real-time embedded computing domain. The first real-time embedded systems were predominantly single-core devices with limited sets of functionalities. However, constantly increasing demands for more advanced and sophisticated functionalities required more powerful computational devices. When faced with the same challenge, the other computing areas (e.g. general-purpose or high-performance computing) opted for platforms consisting of several cores – multi-cores and more than a dozen of cores – manycores. It comes as no surprise that the same trends, although with an offset, are noticeable in the evolution of the real-time embedded systems, where many-core platforms present the new frontier technology. Besides giving the options to implement more advanced functionalities, many-core platforms offer other beneficial possibilities as well. For instance, multiple functionalities, that were previously implemented on a set of single-core devices, can be integrated within fewer many-core platforms with significant design-cost reductions. Moreover, the abundance of available cores allows to implement efficient thermal and power management strategies by deliberately performing temporary shutdowns of idle cores. At the same time, the existence of idle cores, which can be used if necessary, makes these devices more resilient to hardware failures. Yet, despite the aforementioned benefits, the integration of many-cores into the real-time embedded domain is a big challenge. The most notable reasons are (i) increasingly complex designs of hardware components, promoting performance, often at the expense of predictability, and (ii) more significant and hard-to-analyse contention patterns for accesses to shared resources. These facts may contribute to a non-deterministic system behaviour, while, as explained above, every non-deterministic aspect of the system behaviour has to be accounted for in the real-time analysis with a certain degree of pessimism. i
ii In this dissertation, the focus is on the analysis of real-time embedded systems deployed on many-core platforms. Specifically, a comprehensive collection of techniques and design choices is presented, with the common objective to make many-cores more amenable to the real-time analysis, and consequently more suitable and applicable to the real-time embedded domain. The proposed methods achieve this end in several ways: (i) by extending the state-of-the-art approaches in order to reduce the analysis pessimism, (ii) by exploiting novel hardware features, as well as enforcing constraints which cause a more deterministic and analysable system behaviour, and (iii) by elaborating on promising OS and workload paradigms, which have not been previously considered in the real-time embedded computing domain. The contributions of this dissertation can be classified into two groups. In the first set of contributions the focus is on the interconnect medium, which is one of the most complex-to- analyse resources in many-core platforms. Initially, the target interconnect is the network-on-chip with a 2-D mesh topology, which utilises the wormhole switching mechanism and the XY routing technique. For such a generic model, which is present in the most of contemporary many-cores, a novel worst-case communication delay analysis is proposed, and subsequently compared with the state-of-the-art method. Then, assuming the additional hardware support in the form of virtual channels, improvements over the state-of-the-art approaches are proposed, which, not only reduce the analysis pessimism, but also significantly reduce the requirements for hardware resources. Finally, a novel arbitration policy for NoC routers is proposed. In the second set of contributions the focus is on a novel paradigm in the real-time embedded domain, called the Limited Migrative Model. This model is inspired by the latest trends in the high-performance and general-purpose computing. First, the model is introduced and the cost of maintaining it is analytically estimated, both in terms of computational and interconnect resources, where, for the later aspect, the findings from the first set of contributions are used (see the previous paragraph). Then, three aspects of the application workload are studied, namely: (i) communication requirements, (ii) memory requirements, and (iii) computation requirements. The first aspect is addressed by imposing several constraints, which make the communication patterns more predictable, and subsequently allow to derive a communication delay analysis. Moreover, the workload assignment to computational resources is investigated, but only from the communication perspective, with the objective to spatially distribute the workload in such a way that all timing constraints posed on communication delays are met. Then, the focus is shifted towards the memory requirements, and a set of analysis techniques are proposed, which can be used to check whether the memory traffic requirements are also fulfilled. In the final part, the computation requirements of the application workload are studied. However, for this aspect only a coarse-grained analysis with several simplifying assumptions is presented. The proposed method represents an initial step towards the complete analysis related to the computation requirements. Subsequently, assuming this initial analysis, the problem of the workload assignment to computational resources is revisited, but this time with an orthogonal objective, which is to assure that the computational requirements of the workload are fulfilled. The findings suggest that the first set of contributions significantly improves over the state-of- the-art methods in the real-time analysis of interconnects. The improvements are manifested with the reduced analysis pessimism, as well as reduced hardware requirements. Both these aspects are essential for mitigating the resource over-provisioning effects when designing a new system. Additionally, the findings suggest that the Limited Migrative Model has a lot of potential, and represents a promising step towards the application of many-core platforms into the real-time embedded computing domain.
Resumo Ao longo da últimas décadas, os avanços tecnológicos tornaram a vida das pessoas cada vez mais dependentes de sistemas embebidos. Actualmente, estes dispositivos representam mais de 98% de todos os sistemas computacionais produzidos e são usados numa grande variedade de áreas, desde a medicina até à aviação. Alguns destes sistemas embebidos interagem com o meio envolvente e têm que garantir não só que determinada acção é executada correctamente, mas também que essa acção é terminada dentro de um certo limite temporal. Este tipo de dispositivos são designados de sistemas embebidos de tempo real e alguns exemplos são os “pacemakers” usados na saúde, “airbags” nos automóveis e os pilotos automáticos nos aviões. O processo de analisar o comportamento temporal de um sistema de embebido de tempo real é designado de análise de tempo real. Em muitos casos, o propósito da análise é garantir que o dispositivo vai executar correctamente e que as restrições temporais vão ser respeitadas. A análise de tempo real é essencialmente efectuada antes de execução, isto é, na fase de projecto. Deste modo, a sua eficiência depende muito do determinismo do sistema, uma vez que qualquer não determinismo resultará na introdução de pessimismo na análise. Uma análise pessimista pode causar um excessivo uso de recursos na fase de projecto, o que, geralmente, tem como consequência uma baixa utilização desses recursos em tempo de execução. Portanto, reduzir o pessimismo na análise é um dos objectivos prementes nesta área dos sistemas embebidos de tempo real. Os primeiros sistemas embebidos de tempo real eram maioritariamente dispositivos com uma única unidade de execução (designados de “single-core”) com um conjunto limitado de funcionalidades. Porém, a crescente necessidade de suportar funcionalidades cada vez mais avançadas e mais sofisticadas viria a exigir dispositivos com maior capacidade computacional. Noutras áreas da computação (como por exemplo, computação de alto desempenho e mesmo na computação usada sem nenhuma especificidade, isto é, de uso geral) este requisito de maior poder computacional foi abordado com recurso a sistemas compostos por várias unidades de execução (designados por “many-cores”). Consequentemente, e sem qualquer surpresa, a mesma estratégia tem vindo a ser seguida no domínio dos sistemas embebidos de tempo real, onde as plataformas “many-core” constituem o mais recente desafio tecnológico. Além da possibilidade de implementar funcionalidades mais avançadas, as plataformas “manycore” oferecem outras possibilidades. Por exemplo, muitas funcionalidades que eram implementadas num conjunto de sistemas “single-core”, podem ser integradas num conjunto mais reduzido de plataformas “many-core” com uma redução significativa dos custos de projecto. Para além disso, a abundância de unidades de execução permite implementar estratégias eficientes de gestão energética e térmica, desligando ou “adormecendo”, temporariamente, as unidades de execução que não tenham nenhuma tarefa para executar. Ao mesmo tempo, a existência de unidades de execução “adormecidas”, que podem ser “acordadas” sempre que necessário, torna estes dispositivos mais resilientes a falhas de hardware. Contudo, apesar dos benefícios referidos anteriormente, a integração das plataformas “manycore” nos sistemas embebidos de tempo real apresenta-se como um grande desafio. As razões para iii
iv tal são (i) a cada vez maior complexidade dos componentes de hardware, que permite aumentar o desempenho, contudo, muitas vezes diminuindo a previsibilidade dos sistemas, e (ii) a crescente dificuldade na análise da contenção no acesso à utilização dos recursos partilhados. Estes factos podem contribuir para um comportamento menos determinista dos sistemas, o que, como referido anteriormente, implica adopção de níveis de pessimismo na analise. O enfoque desta dissertação é a analise de sistemas embebidos de tempo real para plataformas “many-core”. Especificamente, uma compreensiva colecção de técnicas e opções de projecto é apresentada, com o objectivo comum de tornar as plataformas “many-core” mais acessíveis (ou menos complexas) à analise de tempo real e consequentemente, mais apropriadas e aplicadas na área dos sistemas embebidos de tempo real. Os métodos propostos alcançam este objectivo de vários formas: (i) estendendo as abordagens existentes por forma a reduzir o pessimismo na analise, (ii) explorando novas características (ou elementos) de hardware e aplicando restrições que aumentem o determinismo e a analisabilidade dos sistemas e, por fim (iii) explorando novos paradigmas e funcionalidades presentes em alguns Sistemas Operativos e estratégias inovadoras ainda não consideradas no domínio dos sistemas computacionais de tempo real. As contribuições apresentadas nesta dissertação podem ser classificadas em dois grupos. O primeiro grupo de contribuições está relacionada com o meio de interconexão, que é o mais complexo de analisar nas plataformas “many-core”. Inicialmente, o meio de interconexão considerado foi o “Network-on-Chip” (NoC) com uma topologia em malha 2-D, que utiliza o mecanismo de comutação “wormhole” e a técnica de encaminhamento XY. Nesta dissertação é proposta uma nova análise para determinar o pior atraso nas comunicações para este modelo tão presente na maior parte das plataformas “many-cores” de hoje. Depois, assumindo suporte adicional de hardware na forma de canais virtuais, foram propostos melhoramentos às analises existentes, que além de reduzirem o pessimismo, também reduzem significamente os requisitos de recursos de hardware. Finalmente, foi também proposta uma nova politica de arbítrio para os encaminhadores NoC. O segundo grupo de contribuições está relacionado com um novo paradigma no domínio dos sistemas embebidos de tempo real designado de “Limited Migrative Model”. Este modelo é inspirado na tendência actual dos sistema computacionais de alto desempenho e de utilização geral. Em primeiro lugar, o modelo é descrito e o custo da sua manutenção é estimado analiticamente, quer em termos de recursos computacionais quer em termos de recursos de interconexão, sendo para este caso, utilizadas as primeiras contribuições apresentadas no último parágrafo. Depois, são estudados três requisitos relacionados com cada tarefa, nomeadamente requisitos de: (i) comunicações, (ii) memória e (iii) computacionais. Em relação ao primeiro requisito, é imposto um conjunto de restrições, que tornam os padrões de comunicação mais determinísticos e consequentemente permitem a derivação analítica do atraso das comunicações. Para além disso, e de forma a garatir que os requisitos temporais impostos às comunicações são cumpridos, a carga atribuída aos diversos recursos computacionais é tratada apenas da perspectiva das comunicações. Em seguida, o enfoque é alterado para a memória, e é proposto um conjunto de métodos de análise tendo como objectivo verificar se os requisitos são também aqui cumpridos. Por fim, são estudados os requisitos computacionais para uma determinada carga. Contudo, em relação a este último aspecto, a análise apresentada é bastante simplificada uma vez que se trata de uma primeira abordagem para uma análise mais completa. Assim, o problema a alocação de carga computacional é revisitado, desta vez com o objectivo ortogonal de garantir que também os requisitos computacionais são cumpridos. Os resultados mostram que o primeiro grupo de contribuições melhora substancialmente o estado da arte na análise de tempo real de interconexões. Estas melhorias estão sobretudo patentes na redução do pessimismo da análise e também na diminuição dos requisitos de hardware. Estes dois aspectos revelam-se essenciais para mitigar os efeitos do sobre-provisionamento aquando do
v projecto de um novo sistema. Para além disso, os resultados sugerem que o “Limited Migrative Model” possui bastante potencial e este apresenta-se como bastante promissor para a suportar a aplicação de plataformas “many-core” no domínio dos sistemas embebidos e de tempo real.
xii
Contents Abstract i Acknowledgements vii List of Publications ix 1 Introduction 1 1.1 Real-Time Embedded Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Real-TimeAnalysis................................. 2 1.3 Single-Core ⇒Multi-Core ⇒Many-Core..................... 3 1.4 BenefitsofMany-Cores............................... 4 1.5 Many-Cores in Real-Time Embedded Computing Domain . . . . . . . . . . . . 4 1.5.1 ComputationProcess............................ 4 1.5.2 Interconnectmedium............................ 9 1.5.3 DataInputandOutput ........................... 27 1.5.4 Recapitulation ............................... 32 1.6 ThesisStatement .................................. 34 2 Several Steps Closer to Real-Time NoCs 35 2.1 TrafficModel .................................... 35 2.2 NoCs with the Round-Robin Arbitration Policy . . . . . . . . . . . . . . . . . . 36 2.2.1 State-of-the-Art Method . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.2 AnalysisPessimism ............................ 40 2.2.3 Branch and Prune (BP) Method . . . . . . . . . . . . . . . . . . . . . . 43 2.2.4 Branch, Prune and Collapse (BPC) - More Efficient Method . . . . . . . 48 2.2.5 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.2.6 Discussion ................................. 59 2.3 NoCs with Priority-Preemptive Arbitration Policies . . . . . . . . . . . . . . . . 59 2.3.1 State-of-the-Art Method for NoCs with Fixed-Priority Arbitration Policy 61 2.3.2 Priority-SharePolicy............................ 63 2.3.3 Relaxing Hardware Requirements . . . . . . . . . . . . . . . . . . . . . 65 2.3.4 EDF as Arbitration Policy . . . . . . . . . . . . . . . . . . . . . . . . . 78 2.3.5 Reducing Analysis Pessimism . . . . . . . . . . . . . . . . . . . . . . . 93 3 Limited Migrative Model - LMM 107 3.1 LMMinDetail ................................... 107 3.1.1 OperatingSystem(OS)........................... 107 3.1.2 ApplicationLayer ............................. 108 3.1.3 LMMBenefits ............................... 109 xiii
xiv CONTENTS 3.2 ApplicationWorkload................................ 110 3.3 AgreementProtocols ................................ 111 3.3.1 Master-Slave Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 3.3.2 ListProtocol ................................ 120 3.3.3 HybridProtocol............................... 125 3.3.4 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 132 3.4 Inter-application Communication . . . . . . . . . . . . . . . . . . . . . . . . . . 136 3.5 Towards More Deterministic Communication Patterns . . . . . . . . . . . . . . . 139 3.5.1 Supermessages and Proxies . . . . . . . . . . . . . . . . . . . . . . . . 140 3.5.2 Maximum Number of Message Occurrences . . . . . . . . . . . . . . . 142 3.5.3 Performing the Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 148 3.5.4 Discussion ................................. 150 3.5.5 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 151 3.6 ApplicationMapping................................ 159 3.6.1 ProblemStatement............................. 160 3.6.2 MappingQuality.............................. 160 3.6.3 MappingProcess.............................. 163 3.6.4 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 170 3.6.5 Discussion ................................. 178 3.7 MemoryTraffic................................... 179 3.7.1 Workload.................................. 179 3.7.2 Challenges and Inapplicability of Existing Techniques . . . . . . . . . . 179 3.7.3 Access Constraints and Bounding Messages . . . . . . . . . . . . . . . . 180 3.7.4 Solution to Mutually Exclusive Bounding Messages . . . . . . . . . . . 182 3.7.5 Approach One: Per-Packet Analysis . . . . . . . . . . . . . . . . . . . . 182 3.7.6 Intermediate Step: Partial Per-Pattern Analysis . . . . . . . . . . . . . . 183 3.7.7 Approach Two: Full per-pattern analysis . . . . . . . . . . . . . . . . . . 184 3.7.8 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 185 3.8 Computation .................................... 189 3.8.1 CoreShutdowns .............................. 189 3.8.2 Workload.................................. 190 3.8.3 ProblemStatement............................. 191 3.8.4 Offline Schedulability Guarantees . . . . . . . . . . . . . . . . . . . . . 191 3.8.5 Online Schedulability . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 3.8.6 Semi-Schedulability Guarantees . . . . . . . . . . . . . . . . . . . . . . 193 3.8.7 Blind Synchronisation . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 3.8.8 Parent-Child Relationship . . . . . . . . . . . . . . . . . . . . . . . . . 198 3.8.9 Schedulability and Agreement Protocols . . . . . . . . . . . . . . . . . . 198 3.8.10 Priority Assignment and Mapping . . . . . . . . . . . . . . . . . . . . . 199 3.8.11 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 201 3.8.12 Discussion ................................. 207 4 Conclusions and Future Work 209 Appendix 211 References 215
List of Figures 1.1 Fully partitioned scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 Semi-partitioned scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Globalscheduling.................................. 7 1.4 Clusteredscheduling ................................ 8 1.5 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.6 Network-on-Chip communication . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.7 DifferentNoCtopologies.............................. 11 1.8 PackettransferoverNoC.............................. 12 1.9 Minimal dimension-ordered routing algorithms . . . . . . . . . . . . . . . . . . 13 1.10 Simplified 2-D mesh NoC router architecture . . . . . . . . . . . . . . . . . . . 14 1.11 Store-and-forward switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.12Wormholeswitching ................................ 15 1.13 Credit-based flow control mechanism . . . . . . . . . . . . . . . . . . . . . . . 16 1.14 Packet traversals without contentions . . . . . . . . . . . . . . . . . . . . . . . . 17 1.15 Packet traversals with contentions . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.16Contendingpackets................................. 18 1.17Indirectcontentions................................. 20 1.18 Indirect interference with virtual channels . . . . . . . . . . . . . . . . . . . . . 22 1.19Packetpreemptions................................. 23 1.20AssumedNoCplatform............................... 26 1.21 Memory system of single-core devices . . . . . . . . . . . . . . . . . . . . . . . 28 1.22 Memory system of multi-core devices . . . . . . . . . . . . . . . . . . . . . . . 29 1.23Assumedmemorysystem.............................. 32 2.1 Trafficflows(example1).............................. 36 2.2 Trafficflows(example2).............................. 37 2.3 Computation tree for flow f2from Figure 2.2, in isolation (Ferrandiz et al. [32] method)....................................... 39 2.4 Computation tree for flow f2from Figure 2.2 (Ferrandiz et al. [32] method) . . . 40 2.5 Computation subtrees for Figure 2.4 ........................ 40 2.6 Traversal of packets from two adjacent periods . . . . . . . . . . . . . . . . . . 41 2.7 Traversal of packets from several successive periods . . . . . . . . . . . . . . . . 42 2.8 Computation tree for flow f2from Figure 2.2 (BP method) . . . . . . . . . . . . 44 2.9 Computation subtrees constructed after branching in Figure 2.8 .......... 44 2.10 Traffic flows (revisited example 2) . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.11 Distribution of WCTT improvement across flows (legends represent improvement ranges) 54 2.12 BPC method with varying SIRL vs. Ferrandiz et al. [32] method . . . . . . . . . 55 2.13Inter-SIRLratios .................................. 56 xv
xvi LIST OF FIGURES 2.14 All-to-one contending flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.15 Impact of MIRT on flow f1............................. 58 2.16Trafficflows(example3).............................. 61 2.17 Deadline miss for flow-set from Figure 2.16 and Table 2.2 ............ 62 2.18 Assignment of virtual channels to flow-set with distinctive priorities . . . . . . . 66 2.19 Assignment of virtual channels to flow-set with priority-share policy . . . . . . . 66 2.20 Per-router assignment of virtual channels to flow-set with distinctive priorities . . 66 2.21 Core selection methodology proposed by Ali et al. [4]............... 70 2.22 Virtual channels do scale with respect to number of flows . . . . . . . . . . . . . 75 2.23 Additional virtual channels do not help in schedulability guarantees . . . . . . . 76 2.24 Link bandwidths are bottlenecks . . . . . . . . . . . . . . . . . . . . . . . . . . 77 2.25Trafficflows(example4).............................. 80 2.26 Deadline miss for flow-set from Figure 2.25 and Table 2.5 ............ 81 2.27 Chain of dependencies for Figure 2.25 ....................... 83 2.28Trafficflows(example5).............................. 86 2.29EDFvsRM..................................... 90 2.30EDFvsHSA .................................... 90 2.31EDFvsRM,HSA(1-hop).............................. 91 2.32Analysistimevariations............................... 92 2.33 Influence of ∆onEDF ............................... 92 2.34Trafficflows(example6).............................. 94 2.35 Detailed interference analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 2.36Trafficflows(example7).............................. 99 2.37Trafficflows(example8).............................. 100 2.38 Improvement in the worst-case traversal time of f2, for two contending flows f1 and f2, where P(f1)>P(f2),|L(f1)|=|L(f2)|, and f1preempts f2only once . 101 2.39 Improvements wrt flow sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 2.40 Improvements wrt path sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 2.41 Improvements wrt flow-set sizes . . . . . . . . . . . . . . . . . . . . . . . . . . 104 2.42 Improvements wrt flow and path sizes ......................... 104 2.43 Improvements wrt priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 2.44Analysistightness.................................. 105 3.1 LimitedMigrativeModel.............................. 108 3.2 Example of application’s computation, memory access and communication patterns 111 3.3 Agreement protocol messages are master-dependent . . . . . . . . . . . . . . . . 114 3.4 Analysispessimism................................. 134 3.5 Impact of dispatchers on WCPD . . . . . . . . . . . . . . . . . . . . . . . . . . 135 3.6 Inter-application communication . . . . . . . . . . . . . . . . . . . . . . . . . . 137 3.7 Application which shape and messages comply with Definitions 3-4....... 140 3.8 Supermessages for different application shapes . . . . . . . . . . . . . . . . . . 140 3.9 Inter-application communication . . . . . . . . . . . . . . . . . . . . . . . . . . 142 3.10 Intra-application messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 3.11 Analysis improvements (1/2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 3.12 Analysis improvements (2/2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 3.13 Performance comparison (1/2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 3.14 Performance comparison (2/2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 3.15 Performance comparison for Hybrid protocol . . . . . . . . . . . . . . . . . . . 157 3.16 Analysis tightness across number of dispatchers . . . . . . . . . . . . . . . . . . 157
LIST OF FIGURES xvii 3.17Analysistightness.................................. 158 3.18 Different dispatcher mappings for the same application-shape . . . . . . . . . . . 162 3.19Shapecomparison.................................. 171 3.20 Rerouting penalty estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 3.21 Influence of application-set size on analysis time (1/2) . . . . . . . . . . . . . . . 173 3.22 Influence of application-set size on analysis time (2/2) . . . . . . . . . . . . . . . 174 3.23 Influence of grid size on analysis time . . . . . . . . . . . . . . . . . . . . . . . 175 3.24 Influence of parameter P on mapping process . . . . . . . . . . . . . . . . . . . 176 3.25 Influence of parameter G on mapping process . . . . . . . . . . . . . . . . . . . 177 3.26Memoryoperations................................. 179 3.27 Master volatility problem for memory operations . . . . . . . . . . . . . . . . . 180 3.28 Memory operations via proxy dispatchers . . . . . . . . . . . . . . . . . . . . . 180 3.29Boundingmessages................................. 181 3.30Analysescomparison................................ 186 3.31 Improvement with single controller . . . . . . . . . . . . . . . . . . . . . . . . . 187 3.32 Different memory operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 3.33 Full per-pattern vs. per-packet . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 3.34 Penalty of multiple controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 3.35Semi-schedulability................................. 194 3.36 Non-synchronised semi-schedulability . . . . . . . . . . . . . . . . . . . . . . . 195 3.37 Future release schedulability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 3.38 Priority assignment upon dispatchers . . . . . . . . . . . . . . . . . . . . . . . . 199 3.39Speculativemapping ................................ 200 3.40 Impact of RTA priorities and SS on schedulability guarantees . . . . . . . . . . . 203 3.41 Impact of number of dispatchers on schedulability guarantees . . . . . . . . . . . 203 3.42 Impact of mapping strategies on schedulability guarantees . . . . . . . . . . . . 204 3.43 Efficiency of online tests when using remaining computation times . . . . . . . . 204 3.44 Efficiency of online tests without remaining computation times . . . . . . . . . . 205 3.45 Impact of number of dispatchers on runtime behaviour, without core shutdowns . 205 3.46 Impact of number of dispatchers on runtime behaviour, with core shutdowns . . . 206 3.47 Impact of mapping strategies on runtime behaviour, without core shutdowns . . . 206 3.48 Impact of mapping strategies on runtime behaviour, with core shutdowns . . . . . 207 3.49 Blind synchronisation mode (BSM) . . . . . . . . . . . . . . . . . . . . . . . . 207 4.1 General form of Bordered Hessian for nvariables and one constraint .......... 213 4.2 Bordered Hessian for λ=0............................. 213 4.3 Bordered Hessian for λ6=0............................. 213
xviii LIST OF FIGURES
List of Tables 1 List of symbols used in this dissertation (1/6) . . . . . . . . . . . . . . . . . . . xxi 2 List of symbols used in this dissertation (2/6) . . . . . . . . . . . . . . . . . . . xxii 3 List of symbols used in this dissertation (3/6) . . . . . . . . . . . . . . . . . . . xxiii 4 List of symbols used in this dissertation (4/6) . . . . . . . . . . . . . . . . . . . xxiv 5 List of symbols used in this dissertation (5/6) . . . . . . . . . . . . . . . . . . . xxv 6 List of symbols used in this dissertation (6/6) . . . . . . . . . . . . . . . . . . . xxvi 1.1 List of symbols related to the assumed platform . . . . . . . . . . . . . . . . . . 33 2.1 Analysis parameters for Section 2.2.5 ....................... 53 2.2 Flow-set parameters for Figure 2.16 (example1).................. 62 2.3 Flow-set parameters for Figure 2.16 (example2).................. 64 2.4 Analysis parameters for Section 2.3.3.5 ...................... 74 2.5 Flow-set parameters for Figure 2.25 ........................ 80 2.6 Flow-set parameters for two contending flows . . . . . . . . . . . . . . . . . . . 86 2.7 Flow-set parameters for Figure 2.28 ........................ 87 2.8 Comparison of approaches (schedulability) . . . . . . . . . . . . . . . . . . . . 88 2.9 Analysis parameters for Section 2.3.4.5 ...................... 89 2.10 Flow-set parameters for Figure 2.34 (example1).................. 98 2.11 Flow-set parameters for Figure 2.34 (example2).................. 100 2.12 Analysis parameters for Section 2.3.5.5 ...................... 102 3.1 OS operations related to agreement protocols . . . . . . . . . . . . . . . . . . . 112 3.2 Analysis and simulation parameters for Section 3.3.4 ............... 133 3.3 OS operations related to inter-application communication . . . . . . . . . . . . . 136 3.4 Analysis and simulation parameters for Section 3.5.5 ............... 152 3.5 Analysis and simulation parameters for Section 3.6.4 ............... 172 3.6 Analysis parameters for Section 3.7.8 ....................... 185 3.7 Speculative mapping computation for Figure 3.39 ................. 201 3.8 Analysis and simulation parameters for Section 3.8.11 .............. 202 xix
xx LIST OF TABLES
List of Symbols Table 1: List of symbols used in this dissertation (1/6) Symbol Description HARDWARE ΨThe assumed platform. ΠThe set of processing elements (cores) of Ψ. zThe number of cores in Π. πiThe ith core of Π, where i∈ {1,...,z}. ∆The maximum clock skew between any two cores of Π. ηA generic 2-D mesh NoC interconnect of Ψ. ηRR ηwith the round-robin arbitration policy and a single channel. ηPP ηwith the priority-preemptive arbitration policy and virtual channels. xThe horizontal dimension of η, where x·y=z. yThe vertical dimension of η, where x·y=z. ρThe set of routers of η. ρiThe ith router of ρ, where i∈ {1,...,z}. λThe set of links of ηdedicated to the communication traffic. λi,jThe communication link from ρi(source) to ρj(destination). λc,iThe communication link from πi(source) to ρi(destination). λi,cThe communication link from ρi(source) to πi(destination). σf lit The size of the flit and the width of each link of λ. b vlim The number of virtual channels of η. δLThe time it takes a flit to traverse a link. δρThe time it takes a header flit to traverse a router. δRThe time it takes to reroute one packet. νρThe frequency of routers. xxi
2Introduction The importance of the temporal behaviour of the real-time embedded system highly depends on its purpose. For instance, in some scenarios, not fulfilling the posed timing requirements has mild, almost negligible effects, usually expressed as a degradation in the quality of service. Examples of this category are live audio/video systems, and these devices are referred to as the soft real-time systems. Conversely, in some other scenarios, fulfilling all timing requirements is an absolute imperative, while any failure to do so may have catastrophic consequences. The aforementioned example with the airbag system falls in this category, and these devices are called the hard real-time systems. In this dissertation, the focus is on hard real-time systems. 1.2 Real-Time Analysis Simulations and measurement-based techniques are some of the methods that can be used to observe the temporal behaviour of the system. However, these techniques face several limitations. For instance, they are often time-consuming. Moreover, they give the possibility to observe the system behaviour during a certain time interval, which is usually not enough to capture all possible system states. These limitations become very obvious in the context of hard real-time systems, where one of the requirements is to investigate whether a given system will always meet all timing requirements, even under the worst-case conditions. In such cases the only viable approach is the real-time analysis. Real-time analysis is a technique where an analytic description of the system characteristics is used to derive conclusions regarding the system runtime behaviour. The main advantage of this technique is that it can be used to analytically describe corner cases (worst-case scenarios), often with a certain degree of pessimism, whereas the analysis complexity and pessimism are usually in a trade-off relationship. If the focus of the analysis is on extracting the temporal properties of an identified, or artificially generated worst-case scenario, the analysis is called the worst-case analysis. This analysis is predominantly used in the hard real-time domain, where one of the fundamental requirements is to derive guarantees that a system behaviour will never violate any temporal constraint, not even in the worst-case scenarios. The worst-case analysis is usually performed at design-time. Evidently, its efficiency highly depends on an accurate prediction of the system behaviour at runtime. In order to prevent the underestimation of the worst-case scenario, that is, to keep the worst-case analysis safe, any unpredictable and non-deterministic aspect of the system behaviour has to be accounted for in the analysis with a certain degree of pessimism. A more pessimistic analysis may cause a significant resource over-provisioning at design-time, and consequently lead to a severe underutilisation of platform resources at runtime. Thus, the foremost objective in the hard real-time domain is to propose analyses which are (i) safe, (ii) with acceptable computational complexity and (iii) with a tolerable amount of pessimism. In this dissertation, the focus is on worst-case analysis.
1.3 Single-Core ⇒Multi-Core ⇒Many-Core 3 1.3 Single-Core ⇒Multi-Core ⇒Many-Core As the technological advancements provided the environment for thriving of real-time embedded systems, the demands for more advanced and sophisticated functionalities kept emerging each year. Until recently, a steady progress in the semi-conductor technology was able to successfully cope with the constantly rising requirements, thus resulting in a vast amount of transistors accommodated within a single processing unit. However, the miniaturisation process hit the limit [60], due to inability to manage dissipated heat and consequently increasing temperatures at high frequencies, thus hindering further continuation of an established trend of processing power enhancements related to single-core processors. In order to continue the progress of computational devices, a paradigm shift in the processor design was needed. The chip manufacturers applied a different strategy; rather than enhancing the abilities of a single-core device, the idea is to integrate multiple cores within a single chip. From that moment onwards, the number of cores integrated within a same chip started to grow, and that trend is present even today. The first such platforms that emerged contained only a few cores, and they were referred to as multi-cores. When the number of cores integrated within a single chip outgrew the number of ten, the new term was coined for such devices - they were called manycores. Even though that it may appear at this stage that the difference between multi-cores and many-cores is just in the mere number of cores, that is not true. In fact, multi-core and many-core platforms significantly differ in numerous aspects, such as: the interconnect medium, the memory system, the process of managing the correct and consistent system-wide state, etc. The scientific area which transitioned the fastest and the smoothest from single-cores to multi- and many-cores is the high-performance computing. This comes as no surprise, as the development trends in the chip design are predominantly driven by the need for more powerful and efficient computational devices (better performance), which entirely coincides with the requirements of the aforementioned area. Very similar evolution trends, although with a small offset, are visible in the general-purpose computing area. The real-time embedded computing area lags even more behind the aforementioned areas. In fact, at the present date, single-cores and multi-cores present the majority of the systems that are considered for practical implementations in the realtime embedded domain, while many-core platforms are perceived only as an emerging technology that will be used in the forthcoming years. The integration of many-core platforms in the real-time embedded domain goes slowly because the advancements in the field of chip design significantly differ, and, to an extent, contradict the requirements from the said domain. Specifically, the system predictability is one of the essential prerequisites for the efficient real-time analysis, while the topmost objective of chip designers is to improve the efficiency and the performance of the system, usually at the expense of the system predictability. In fact, there is a common opinion among researchers that the many-core domain presents a significantly more challenging environment for the real-time research, than the single-core domain. In this dissertation, the focus is on many-core platforms.
4Introduction 1.4 Benefits of Many-Cores Many-core platforms have the potential to bring numerous benefits to the real-time embedded domain, of which only few will be listed here. •Functionality enhancements. The abundance of cores brings more computational power, which gives to possibility to extend the existing functionalities, or implement new ones. •Cost reductions. Integrating into fewer many-core devices the functionalities that were previously executed on numerous single-core systems can significantly reduce design costs. •Flexibility. The abundance of cores allows to accommodate workload changes at runtime. That is, admission tests can be performed and subsequently the existing functionalities can be extended, or new ones deployed. Similarly, obsolete functionalities can be removed from the system, so as to save more capacities for future extensions/deploys. •Energy/thermal management. The abundance of cores allows to perform load balancing for energy and thermal management. That is, the workload can be efficiently migrated around the platform to prevent thermal hotspots and/or contribute to the durability of the system. Moreover, in cases where the capacity of the platform significantly exceeds the requirements, idle cores can be temporary shut down for two reasons: (i) to increase the durability of the system, and (ii) to decrease the power consumption. •Better fault tolerance. The abundance of cores allows to recover from hardware failures. That is, once a malfunctioning of one core has been suspected or noticed, that core can be preventively shut down and the platform can continue to work with the remaining capacities. 1.5 Many-Cores in Real-Time Embedded Computing Domain Despite the aforementioned benefits, numerous challenges arise when researchers try to put manycore platforms in the real-time embedded context. Perhaps the greatest challenge is the complex design. In order to circumvent this problem, the researchers usually do not analyse an entire system, but rather focus on a subset of aspects, typically one type of resources, e.g. processing elements, interconnect mediums, memory subsystems, and analyse them independently of the rest of the platform. Subsequently, based on the analysed aspect, the state-of-the-art approaches can be classified into categories. In the rest of this section the overview of the many-cores and their perspective in the realtime embedded domain will be given. However, rather than focusing on the entire platform, the individual aspects will be emphasised and discussed independently. 1.5.1 Computation Process Each functionality implemented within a many-core platform occasionally requires certain computation processes to be performed. These activities are executed on the processing elements –
1.5 Many-Cores in Real-Time Embedded Computing Domain 5 cores. Besides in the mere number of cores, which can range from a dozen to hundreds, manycore platforms differ from each other in other aspects as well, such as types of cores. Nowadays, the most established trend in the chip design are platforms with cores which are identical in terms of physical characteristics, called the homogeneous many-cores. The most notable examples are the Tilera family of processors [93], the Single-Chip-Cloud Computer (SCC) manufactured by Intel [42] and the Epiphany processors designed by Adapteva [3]. One of the implications of such a design is that a computation requirements related to some functionality will always be the same, irrespective of the actual core that has been selected to perform the computation. In recent years, chip manufacturers also explored the possibilities to integrate different types of cores within the same many-core platform. Usually, cores of a certain type are specialised in some activities, and the types are combined within the platform in such a way to complement each other. These computers are referred to as the heterogeneous platforms, and one example is the MPPA-256 Manycore Processor developed by Kalray [44]. The focus of the majority of works in the real-time domain is on homogeneous platforms, and the same is true with this dissertation. How to assign the available cores to the functionalities existing within the platform has been, and still is, one of the most extensively studied problems in the real-time analysis of many-cores. The area that covers this aspect is called the multiprocessor scheduling theory. If the functionality does not have the ability to change cores, but always has to perform its computation on the same core, in the scheduling theory it is referred to as non-migrative. Conversely, if the functionality has the possibility to use multiple cores, it is considered as migrative. Depending on the level of migrative freedom given to functionalities, all state-of-the-art approaches can be classified into several groups. 1.5.1.1 Non-migrative (Fully Partitioned) Approaches These approaches are in the scheduling theory also known as the fully partitioned approaches. Each functionality is statically, at design-time, assigned to a specific core where it has to perform its computation. Once assigned, the functionality cannot switch to another core (migrate), but instead, it has to always perform the computation on the same core. The scheduling of the workload on each core is performed by a local scheduler, in a single-core fashion, independent of the rest of the system. An illustrative example of this scheme is given in Figure 1.1. π1 2 π π3 Scheduling algorithm Scheduling Scheduling algorithm algorithm π4 Scheduling algorithm Functionalities Cores Figure 1.1: Fully partitioned scheduling
6Introduction The advantage of this concept is reflected in the fact that the prevention of functionality migrations makes the system more predictable and hence analysable, which is beneficial when deriving real-time guarantees. Moreover, the problem of workload scheduling is, relatively speaking, significantly simplified, because each core can be perceived (analysed) as an independent single-core system, and the uniprocessor scheduling theory [18,58], which is very advanced, can be applied in this context. However, the advantage of this concept is at the same time its weakness. The inability to perform migrations makes these approaches rigid and inflexible, which renders them ineffective in scenarios with dynamic load changes, or scenarios where runtime load balancing is required, for energy/thermal management and fault tolerance reasons. These limitations significantly narrow the application domain of the fully partitioned approaches. 1.5.1.2 Semi-Partitioned Approaches These techniques (e.g. [15,47]), to some extent, embrace the concept of workload migrations. However, each migrative functionality still has its computation pattern defined at design-time. That is, a migrative functionality may have its computation split among two (or more) cores, but always has to perform a prescribed amount of work on each of the cores where it migrates, in a given order. A semi-partitioned scheduling is illustrated in Figure 1.2. π1 2 π π3 Scheduling algorithm Scheduling Scheduling algorithm algorithm π4 Scheduling algorithm Functionalities Cores Figure 1.2: Semi-partitioned scheduling When compared to the fully partitioned concept, the semi-partitioned one allows for more efficient workload assignment and consequently more effective resource utilisation [15]. However, these approaches suffer from the same limitations as the previous category, that is, they are inapplicable in scenarios where dynamic load changes occur, or where the runtime load balancing is required. In terms of scheduling, both the aforementioned approaches tend to perceive the many-core platform as a collection of independent single-core systems. Evidently, this strategy removes the platform flexibility, which has been already identified as one of its greatest benefits (see Section 1.4). 1.5.1.3 Fully Migrative (Global) Approaches These approaches (e.g. [7,9]), in the scheduling theory also known as the global approaches, allow unconstrained workload migrations, which means that each functionality has the possibility
1.5 Many-Cores in Real-Time Embedded Computing Domain 7 to migrate at any time to any core within the platform, and perform its computation there. All migration decisions are made at runtime, by a single global scheduler. An illustrative example of global scheduling is given in Figure 1.3. Functionalities π1 2 π π3 Cores π4 Scheduling algorithm Figure 1.3: Global scheduling Global approaches are much more flexible than the two aforementioned categories, and as such do not suffer from the same limitations. That is, due to the fact that migration-related decisions are made at runtime, the global approaches can successfully cope with dynamic load changes. Moreover, the load balancing is inherently supported by the design itself, which makes it possible to implement some energy/thermal management policies by shutting down some of the cores at runtime. However, the global approaches require a global notion of time, and also global, centralised structures, such as a scheduler and a ready queue. As the number of cores and the workload within the platform increase, the contentions for the global structures also increase, thus scalability issues become more apparent. It is important to mention that these scalability issues are indeed some of the key reasons why multi-core and many-core platforms are considered as different systems. That is, in multi-cores some fully migrative scheduling approaches can be efficiently implemented, because the scalability issues are mild due to the small number of cores. Conversely, in the manycore domain, global scheduling is not considered as an efficient and viable approach. In fact, numerous challenges arise when attempting implementations [10]. 1.5.1.4 Clustered Approaches Clustered approaches (e.g. [19]) present a concept which combines the properties of the nonmigrative and fully migrative approaches. Specifically, all cores are divided into disjoint groups, where each group forms one cluster. A cluster is perceived and treated as an independent system, with the global scheduling policy applied on the cluster-level. Moreover, each functionality is assigned to exactly one cluster, and it has the possibility to freely migrate within its cluster. Figure 1.4 depicts the system with the clustered scheduling. These approaches offer both runtime load balancing (the positive aspect of fully migrative approaches) and scalability (the positive aspect of non-migrative approaches). However, they are inefficient in scenarios where workload migrations are driven by fault tolerance or energy/thermal
8Introduction π1 2 π π3π4 Scheduling algorithm Scheduling algorithm Cores Functionalities Figure 1.4: Clustered scheduling management, where inter-cluster migrations (preferably spatially distant ones) are a necessary option. This limitation narrows the scope of application of these approaches. 1.5.1.5 Discussion So far, different workload execution techniques have been analysed solely from the perspective of processing elements, i.e. cores. Yet, it is worth mentioning that the selection of the workload execution method impacts not only cores, but also other system resources, such as the interconnect medium. For example, in the non-migrative approaches, the core of each functionality is known at design-time. This implies that the communication between any two functionalities will always involve the same two cores, and with a deterministic routing mechanism it can be assured that the exchanged data always uses the same resources of the interconnect medium, e.g. always traverses the same path over the interconnect. This possibility to inject the predictability into the communication between functionalities can significantly ease the real-time analysis of the interconnect mediums. Conversely, in fully migrative and clustered approaches it is impossible to predict on which core will which functionality be at runtime. This infers that the communication patterns among functionalities are unpredictable and impossible to analyse at design-time. For example, any two communicating functionalities may at some point during runtime share the same core, but later migrate to two spatially very distant cores. Performing the real-time analysis of the interconnect medium under these schemes is very hard, if not impossible. The aforementioned discussion shows that the selection of the workload execution technique has a broad effect and impacts the entire system, not just the cores. The benefits and limitations of different techniques have been presented. One of the goals of this dissertation is to propose a novel workload execution concept, that will make many-cores more amenable to the real-time analysis. Specifically, such a concept should exploit the full flexibility of the many-core platform by allowing workload migrations, like the fully migrative and clustered approaches, but also be scalable and predictable, like the non-migrative approaches. For that purpose, in Chapter 3a novel concept, called the Limited Migrative Model is proposed.
1.5 Many-Cores in Real-Time Embedded Computing Domain 9 1.5.1.6 Assumptions Regarding Processing Elements The platform under consideration Ψcontains a set of processing elements Π, which is a collection of zidentical cores Π={π1,π2,...,πx−1,πz}. The value of zis not fixed, but it can be in the range 50−150, which corresponds to the number of processors in currently available many-core platforms, e.g. [3,42,93]. The decision to keep the number of cores parametrised rather than constant is based on the fact that this strategy allows to test the scalability potential of the concepts proposed in this dissertation, simply by varying the parameter z. In this dissertation, the focus is on homogeneous many-core platforms. 1.5.2 Interconnect medium As soon as the idea to integrate multiple cores within the same platform emerged, the most important question was how to efficiently interconnect them. In the multi-core domain that problem is usually solved by providing a direct point-to-point communication between all core-pairs. An illustrative example of a point-to-point communication is given in Figure 1.5, where a data packet is sent from the core π1to the core π2. Notice, that this concept is not scalable, because the number of necessary communication links grows sub-quadratically with the number of cores, i.e. for zcores in total z·(z−1) 2bidirectional links are needed. This is another major difference between the multi-core and the many-core platforms, where, for the former, the point-to-point communication is an efficient approach, while for the latter an alternative method is needed [26]. packet π1 2 π Figure 1.5: Point-to-point communication 1.5.2.1 Network-on-Chip Paradigm The quest for scalable interconnect mediums was highly popular around 15 years ago. Eventually, the research efforts paid off, and a new interconnect paradigm emerged. It is called the Networkon-Chip, or simply NoC [12,26,37]. The NoC paradigm abstracts away the communication medium from the communicating entities. In other words, the functionalities that exchange data packets are totally agnostic about the transfer process. This is possible with the additional logic that is implemented within the NoC elements called the routers. Routers serve as a network interface to the cores, and cores access them in order to send/receive data. Although there are routers that are accessed by multiple cores, e.g. [42], usually in many-core platforms there is one router per core, e.g. [3,93]. Thus, the data transfer between two functionalities that are located on different cores is performed in the following way: (i) the packet is sent by the sender’s core
10 Introduction to the local router, (ii) the packet is transferred through the network of routers until it reaches the destination router, and (iii) the packet is sent by the receiver’s router to the local core. packet 1ρ ...... ...... π2 ...... ...... π ρ2 1 Figure 1.6: Network-on-Chip communication It is worth mentioning that not all pairs of routers have a direct link between each other. In fact, in the majority of NoCs, each router is connected only with a small set of neighbouring routers. In such cases, a packet may need to traverse multiple routers before reaching the destination. An illustrative example of the communication over the NoC architecture is given in Figure 1.6, where the data packet is exchanged between the two cores π1and π2. The shaded rectangles ρ1and ρ2 depict the routers belonging to π1and π2, respectively. Notice that ρ1and ρ2do not have a direct link connection, so the packet needs to traverse one or more intermediate routers before reaching ρ2. For better clarity, the intermediate routers were omitted from the figure. In this dissertation, the focus is on the NoC-based many-core platforms. 1.5.2.2 Topologies How to efficiently arrange the routers inside the NoC architecture and how to organise the interrouter connections is one of the most important questions in the NoC design theory. This is understandable, as the selection of the topology has a significant impact on numerous aspects, such as the system performance, the design complexity, the design cost, etc. Some NoC topologies are depicted in Figure 1.7. For clarity purposes, a single line was used to represent the connection between all directly connected routers, whereas the connection is typically implemented with two unidirectional links of opposite directions. Notice, that the fully connected topology (Figure 1.7(d)) is very similar to the point-to-point approach. To better understand the differences between topologies, a simple comparison is performed between the 2-D mesh topology (Figure 1.7(c)) and the fully connected one. In terms of required resources, the 2-D mesh design is much more scalable, as illustrated with the following numerical example. Assuming the platform with 100 cores, the fully connected design requires in total 100·99 2=4950 bidirectional links, while the 10×10 NoC architecture requires only 2·10·9=180 bidirectional links, which represents less than 4% of the number of links required by the former design. However, it is also worth mentioning that in the fully connected approach all packets traverse only two routers, irrespective of the locations of the sender and the receiver, while on a 2-D mesh platform that is not always the case. Specifically, on a 10×10 2-D mesh, a packet that is
1.5 Many-Cores in Real-Time Embedded Computing Domain 11 (a) Star (b) Ring (c) 2-D Mesh (d) Fully Connected Figure 1.7: Different NoC topologies exchanged by two diagonally placed corner routers must traverse 10+9=19 routers! This infers that, as pointed out in the beginning of this section, different topologies have significantly different properties, and the preference of one topology over another highly depends on the purpose of the system. An interested reader may consult the work of Abba and Lee [1], where a comprehensive comparison of numerous different NoC topologies is performed. Despite the variety of possible topologies, so far, only few of them have been used as the interconnect mediums in many-cores. For example, a 2-D mesh is one of the most popular choices, and it is present in some currently available many-cores, e.g. [3,42,93]. Additionally the ring topology is also present in the Xeon Phi family of processors [43], manufactured by Intel, while in the MPPA-256 Manycore Processor developed by Kalray [44] a 2-D torus topology is used. In this dissertation, the focus is on the 2-D Mesh NoC interconnect medium. 1.5.2.3 Routing As already described in the previous section, in many topologies, including the 2-D mesh, not all the router-pairs are directly connected. Therefore, in such cases, depending on the position of the sender and the receiver, a packet may need to travel across multiple intermediate links and
18 Introduction p21p p3 p4 (a) Packets Crossbar switch input port south output port port input south north output north port port output west port input west input port output port easteast p3 2p (b) Common Router of p2and p3 Figure 1.15: Packet traversals with contentions Assume that packets p1,p2,p3and p4enter the common router from the input ports west, east,north and core respectively, as illustrated in Figure 1.16. Moreover, consider that all the aforementioned packets need to progress in the south direction, hence try to access the south output port of the depicted router. Evidently, these packets contend, so only one of them can progress at any time instance, while the other packets will be stalled. p1p2 3p p4 Figure 1.16: Contending packets As already described, the arbitration policy decides which packet has the precedence among all contending packets. The round-robin arbitration policy changes the precedence of packets, based on an input port from which they entered the router, in a orderly fashion. The change occurs after each transfer, that is, if p1had the precedence to progress, another packet from the west input port, say p0 1, will not be able to progress until p2,p3and p4have progressed. However, p0 1will have the precedence over the other packets from the input ports of p2,p3and p4, say p0 2,p0 3and p0 4, respectively. Thus, one round-robin arbiter, applied to the aforementioned example, might give the precedence to the packets in the following order: p1,p2,p3,p4,p0 1,p0 2,p0 3,p0 4. Note, that other round-robin implementations are also possible, and that the only fundamental property of this scheme can be summarised as follows: any packet, coming from the input port of the last transferred packet, will not be able to progress, until the packets from all other input ports have been considered. Also note, that if there are no packets coming from a certain port, the same is immediately skipped, and the packets from the next port are considered. The round-robin arbitration policy assures fairness among packets and prevents starvation, which makes it very popular choice in the currently available many-cores, e.g. [3,93]. In this dissertation, the round-robin arbitration policy is analysed.
1.5 Many-Cores in Real-Time Embedded Computing Domain 19 1.5.2.6 Worst-Case Real-Time Analyses Applicable to Round-Robin-Arbitrated NoCs In the early works related to the timing analysis of wormhole-switched networks, e.g. [23,29], the researchers attempted to apply the concepts from the queuing theory. The focus of these studies is on the performance (the average-case behaviour), hence are not suitable for the hard real-time domain. Moreover, there was an attempt to employ the concepts of the network calculus theory [54] in the worst-case analysis of wormhole-switched networks, assuming a weighted roundrobin arbitration policy [79], however, one significant limitation of this approach is that it is overly pessimistic [33]. An additional element called the wormhole section was introduced [34], with the primary objective to decrease the pessimism of the worst-case analysis, which is based on the network calculus theory. Yet, this approach targets SpaceWire networks, which are small-scale interconnects with few links and flows, while it faces challenges, such as scalability and pessimism, when applied to larger networks with more flows, like NoCs for many-cores [35]. Moreover, the approach for the worst-case analysis called the recursive calculus method [32] was proposed, also for SpaceWire networks. This method is scalable, and hence can be applied to NoCs, however, its greatest limitation is that it does not take into account the inter-arrival times of packets and, as comprehensively covered in Section 2, it can be very pessimistic. So far, there is a lack of adequate techniques for the worst-case analysis of round-robin-arbitrated wormhole-switched NoCs, and one of the objectives of this dissertation is to propose a novel method to compute safe and tight upper-bound estimates on the worst-case delays of individual traffic packets. 1.5.2.7 Indirect Contentions As already explained, the main advantages of the wormhole switching technique are good throughput and small buffering requirements [48]. These benefits come from the fact that flits of a packet may traverse in parallel. However, concurrent use of multiple resources (i.e. routers and links on the path of the packet), may, at the same time, cause very complex contention scenarios. Specifically, a traversing packet can suffer interference not only from the packets with which it shares some resources, but also from other packets with which it does not. This is explained with an illustrative example given in Figure 1.17. As it is visible from the figure, there exist 3 packets, p1,p2and p3. Each packet has 8 flits, and each port has the capacity to accept 2 flits. The ports of interest are depicted outside of their respective routers. Packets p1and p2share 2 routes and 1 link, which is both a necessary and a sufficient condition for the contention between them. The same is true for p2and p3. However, p1and p3do not have common resources, and hence they do not contend. Consider that all packets start traversing at the same time (Figure 1.17(a)). When the flits of p1reach the router that is common for p1and p2, they cannot progress further, because the output port of that router, and its respective link, are busy transferring the flits of p2. Therefore, the further progress of p1is impossible, and it is said that p1suffers blocking from p2(Figure 1.17(b)). Because the links on their paths are still free, p2and p3uninterruptedly progress (Figure 1.17(c)). However, when the flits of p2reach the router which is common for p2and p3, the blocking occurs again
20 Introduction 1p p3 2p 1 1 1 (a) p1,p2,p3start traversing 1p p3 2p 2 2 1 1 12 (b) p1blocked by p2 1p p3 2p 2 3 3 2 2 1 113 (c) p1still blocked by p2 1p p3 2p 2 4 432 13 3 2 1 (d) p2blocked by p3 1p p3 2p 2 6 8 13 4 2 167 35 (e) p2still blocked by p3 1p p3 2p 2 613 4 2 78 35 1 (f) p2continues traversing 1p p3 2p 2 13 7 6 5 8 4 (g) p1still blocked by p2 1p p3 2p 23 8 6 1 5 7 (h) p1continues traversing 1p p3 2p 34 1 7 2 6 8 (i) no more blocking Figure 1.17: Indirect contentions (Figure 1.17(d)). Notice that p1is blocked by p2, which is in turn blocked by p3. This infers that, due to the traversal of p3, the progress of p1will be delayed even more, despite the fact that p1and p3do not have common resources. In other words, p3indirectly blocks p1. The indirect blocking will be revisited at the end of the example. p1and p2remain blocked until the last flit of p3leaves the common router of p2and p3(Figure 1.17(e)). When the last flit leaves the router, p2continues traversing (Figure 1.17(f)). Similarly, p1remains blocked as long at there is at least one flit of p2in their common router (Figure 1.17(g)). After the last flit of p2leaves the common router, p1continues traversing (Figure 1.17(h)). Finally, all packets finish their traversals uninterrupted (Figure 1.17(i)). The previous example demonstrated that a packet may suffer the delay from packets with which it contends directly, but may also suffer the delay from packets with which it contends
1.5 Many-Cores in Real-Time Embedded Computing Domain 21 indirectly (no common resources). The indirect contentions can significantly affect the timing properties of packets. This is demonstrated with a simple numerical computation for the aforementioned example. For the sake of simplicity, consider that the traversal of each flit between each pair of adjacent routers takes 1 time unit. The time instances at which p1,p2and p3complete their traversals can be easily deduced from the illustrated example, and are 21,16 and 9, respectively. However, if p3did not exist, the traversal of p1would be completed at time instance 16. Thus, the existence of p3caused the additional delay of 5 time units to the traversal of p1. From this example it is obvious that, in order to perform the worst-case analysis of NoC traffic, it is necessary to take into account both direct and indirect contentions. 1.5.2.8 Virtual Channels The effects of indirect contentions can be, to some extent, mitigated by enforcing a rule on the usage of port-buffers. Consider the example introduced in the previous section, but with one additional rule, that each packet may store at most 1 flit in each port-buffer along its path. In other words, inside each port-buffer, each packet has a private, dedicated slot of the size of 1 flit. This is illustrated in Figure 1.18, where the slots to different packets are depicted with different colors. Moreover, for clarity purposes, only the slots of interest are shown, which implies that for the routers that are traversed by only one packet, only a single slot is shown (the corner routers in this example). Consider again the scenario where p1,p2and p3are released at the same time (Figure 1.18(a)). Like in the previous example, p1is blocked when its flits reach the router that is common for p1and p2(Figure 1.18(b)). The links on the paths of p2and p3are free, so these packets uninterruptedly progress (Figure 1.18(c)). When the flits of p2reach the router that is common for p2and p3, the blocking occurs again (Figure 1.18(d)). Recall, that in the previous example this was the moment when the indirect contention between p1and p3occurred, when only p3could progress, while p1 and p2were blocked. However, due to the existence of per-packet slots inside port buffers, this problem can be mitigated. Specifically, once p2becomes blocked, p1can continue its traversal because all resources on its path are free. Therefore, the moment when p2becomes blocked by p3 is the moment when p1continues traversing (Figure 1.18(d)). The situation remains the same until the moment when the last flit of p3leaves the router that is common for p2and p3(Figure 1.18(e)). When that last flits leaves the router, p2can continue its traversal. At the same time the traversal of p2causes another blocking to p1(Figure 1.18(f)). p1remains blocked until the last flit of p2leaves the router that is common for p1and p2(Figure 1.18(g)). When that happens, p1can continue its progress (Figure 1.18(h)). Finally, all packets finish their traversals without further contentions (Figure 1.18(i)). The rule of allowing each packet to consume only 1 slot in each router it traverses can significantly improve the throughput, as demonstrated here. Consider again that the traversal of each flit between two adjacent routers takes 1 time unit. For the example illustrated in Figure 1.18 it can be deduced that p1,p2and p3complete their traversals at time instances 17,16 and 9, respectively. Notice that the completion times of p2and p3remained the same as in the previous example, while
22 Introduction 1p p3 2p 1 1 1 (a) p1,p2,p3start traversing 1p p3 2p 2 2 1 1 12 (b) p1blocked by p2 1p p3 2p 2 3 3 2 2 1 11 (c) p1still blocked by p2 1p p3 2p 2 4 4 3 2 1 3 2 1 (d) p2blocked by p3,p1contin- ues traversing 1p p3 2p 4 8 7 6 3 2 1 6 5 4 (e) p2still blocked by p3,p1still traversing 1p p3 2p 4 8 7 3 2 1 7 6 5 (f) p2continues traversing, p1 blocked by p2 1p p3 2p 5 8 4 3 2 7 6 5 1 (g) p1still blocked by p2 1p p3 2p 7 7 6 5 6 8 (h) p1continues traversing 1p p3 2p 8 8 7 6 7 (i) no more blocking Figure 1.18: Indirect interference with virtual channels the completion time of p1decreased from 21 to 17. This is expected, because the newly introduced rule of dedicated per-packet flit-sized slots within each port indeed reduces the effects of indirect contentions. However, the aforementioned rule does not entirely remove the effects of indirect contentions, it just makes its effects milder. This will receive additional attention in Chapter 2. This possibility to improve the performance of wormhole-switched networks via dedicated slots has been recognised shortly after the wormhole switching mechanism was introduced. In the literature, this strategy is called the virtual channels [24,25], and some currently available many-cores support this concept, e.g. [42]. If a packet has a dedicated slot in each router along its path, it is said that the packet has a virtual channel. A reader may notice that, counter-intuitively, the expression virtual channel does not refer to the links, but to the slots in port-buffers.
1.5 Many-Cores in Real-Time Embedded Computing Domain 23 As demonstrated with the examples in Figure 1.17 and Figure 1.18, virtual channels allow for more efficient use of available resources. That is, in the former case, when p2was blocked by p3, p1could not use the links along its path, despite the fact that all the links were idle. Conversely, virtual channels always allow to exploit available links, which has been in the latter example demonstrated by a traversal of p1while p2was blocked. In this dissertation, the NoCs both with and without virtual channels are analysed. 1.5.2.9 Flit-Level Preemptions and Priority-Preemptive Arbitration Besides improving the throughput, the concept of virtual channels offers one more very beneficial possibility – to enforce preemptions among packets. The preemption is a well-established term in the scheduling theory, and it refers to the situation where the computation process of the lower priority functionality on a core is temporary suspended, so that the computation process of the higher priority functionality can be performed. Similarly, in NoCs, the preemption is the scenario where a lower priority packet is temporary stalled, in order to allow the traversal of a higher priority packet over the resources that these two packets have in common. Note, in the example illustrated in Figure 1.18 the preemptions are implicitly assumed, and one such scenario is visible in Figure 1.18(f). Due to the fact that p3is not blocking p2any more, p2continues its progress by reclaiming the resources (links) from p1, causing p1to be blocked again. 1p p2 1 (a) p1starts traversing 1p p2 4 3 2 11 (b) p2preempts p1 1p p2 4 3 22 1 (c) p1preempted by p2 1p p2 4 3 8 7 (d) p1still preempted by p2 1p p2 4 3 8 (e) p1continues traversing 1p p2 5 4 3 (f) no more preemptions Figure 1.19: Packet preemptions The concept of packet preemptions is explained in detail with the illustrative example given in Figure 1.19. Consider two packets p1and p2, where both packets consist of 8 flits, and where the latter packet is considered to be of higher priority. Let p1start traversing (Figure 1.19(a)). At the moment when the first flit of p1reached the destination, the packet p2was released (Figure 1.19(b)). Due to the fact that p2has a higher priority than p1, the former packet preempts the latter, causing the third and the fourth flit of p1to stall within their respective routers, while p2 progresses (Figure 1.19(c)). This scenario is referred to as the preemption, and p1is called the preempted packet, while p2is called the preempting packet. The situation remains the same as long as there are flits of p2traversing the common link (Figure 1.19(d)). When the last flit of p2
24 Introduction traverses the common link, p1can continue its transfer (Figure 1.19(e)). After that, p1completes its transfer and no more preemptions occur (Figure 1.19(f)). Since the preemptions occur with the flit-level granularity, this concept is called the flit-level preemptions [89]. Notice, that in order to be implemented, this concept requires an adequate arbitration policy. That is, in Figure 1.19(b), when p2was released, the arbitration mechanism must compare the priorities of p1and p2, and subsequently make a decision which packet will be given the permission to progress. The arbitration policy which makes decisions based on packet priorities is called the priority-preemptive arbitration. In this dissertation, the priority-preemptive arbitration policy is analysed. 1.5.2.10 Worst-Case Real-Time Analyses Applicable to Priority-Preemptive NoCs Many researchers have studied the timing properties of priority-aware interconnects. Some of these studies do not analyse the worst-case scenarios, e.g. [16,38,89], and hence are not applicable to the hard real-time domain. Of studies that analyse the worst-case scenarios, some have been classified as pessimistic [8,49], while some other have been classified as optimistic [59,66]. The limitations of the aforementioned approaches are covered in more detail in the dissertation of Zheng Shi [83]. Later, the method for the worst-case analysis was proposed [85] with the following assumptions: (i) flit-level preemptions, (ii) per-traffic-flow distinctive priorities, (iii) per-priority virtual channels, and (iv) a traffic model with constrained deadlines. For this model the priority assignment algorithm for traffic flows was proposed [84]. For the same model the workload mapping approaches based on genetic algorithms were proposed [62,80]. Subsequently, the method for the worst-case analysis was extended to cover the model with arbitrary traffic deadlines [88]. One limitation of the aforementioned concept is that the number of virtual channels should be at least equal to the number of traffic-flows, which is a requirement that is not easy to fulfil, e.g. the SCC platform [42] has only 8 virtual channels, and according to this method, it can accommodate at most 8 traffic flows. As a solution to this problem, the novel concept called the priority share policy and its accompanying analysis were introduced. This method reduces the total number of required virtual channels by forcing some traffic flows to share the same channel [86]. Based on the priority-share policy and its worst-case analysis, the application mapping process was proposed [87]. Note, that both the aforementioned concepts require that each virtual channels has the capacity to store at least one flit. Very recently, a novel approach called the stage level analysis [46] was introduced. When compared with the aforementioned approaches, this method indeed renders tighter estimates, however, it has the same requirement regarding the number of virtual channels as the initial method [85]. Yet, the fundamental limitation of this approach is the fact that it requires unrealistically big port buffers, where, in many cases, the capacity of virtual channels should be such that an entire packet can be stored [45] (and not a single flit, like in the aforementioned approaches). Notice that this
1.5 Many-Cores in Real-Time Embedded Computing Domain 25 requirement is very similar to the buffering requirements of the store-and-forward switching technique, which is the main reason why the wormhole-switching was introduced in the first place. 1.5.2.11 Discussion The design choices and the evolution trends of NoCs are mostly driven by performance reasons, usually at the expense of predictability. These strategies not only further increase the gap between the average-case and the worst-case behaviour of NoCs, but also make it increasingly hard to perform any meaningful worst-case analysis. For example, some currently available NoCs (e.g. [3,93]) use a round-robin arbitration policy in routers, because it promotes fairness and avoids starvation, both of which are beneficial from the performance perspective. However, the round-robin arbitration policy displays a non-deterministic behaviour, where the precedence between two contending packets depends not only on the packets and their paths, but also on the state of routers at the very moment of contention (i.e. which arbitration decisions immediately preceded the moment of observation). Due to this fact, it is impossible to deduce the arbitration decisions at design-time, which subsequently has to be reflected in the worst-case analysis with a certain degree of pessimism. This further implies that the round-robin arbitration policy, despite its wide presence in the currently available many-cores, may not be the most suitable option for the real-time embedded domain. The existence of virtual channels inside the NoC architecture (e.g. [42]) significantly changes the perspective. Specifically, multiple virtual channels offer the possibility to introduce prioritypreemptive arbitration policies, and in that way make the NoC platform more predictable and hence suitable for the worst-case analysis. For instance, assuming that packets have fixed priorities, the one with the higher priority will always have the precedence over the other, irrespective of the moment of observation. This infers that all arbitration decisions are known at design-time, and consequently the worst-case analysis can be performed for priority-preemptive NoCs with substantially less pessimism than the analysis for round-robin-arbitrated NoCs. It comes as no surprise that the majority of the real-time works addressing NoCs indeed assume that the platform provides virtual channels and priority-preemptive arbitration techniques. In the next chapter the focus will be on improving over the state-of-the-art methods for both types of platforms, with and without virtual channels. Moreover, assuming that multiple virtual channels are available, a novel arbitration policy for routers will be proposed. These aspects are covered in detail in Chapter 2. 1.5.2.12 Assumptions Regarding Interconnect Medium Recall (Section 1.5.1.6), that the platform under consideration in this dissertation Ψcontains a set of zprocessing elements Π={π1,π2,...,πz−1,πz}. Moreover, the platform contains an interconnect medium η, which is a 2-D mesh NoC of dimensions xand y. The NoC contains a collection of y·xrouters ρ={ρ1,ρ2,...,ρy·x−1,ρy·x}, where the number of routers is equal to the number of cores, i.e. y·x=z. Thus, one router corresponds to one core, like in Epiphany [3], or Tilera [93]
26 Introduction ... ... ... ... ... ... ... ... ρ ρ yx−1 (y−1)x−1 ρ(y−1)x ρ yx (y−2)x+2 ρ (y−1)x+2 ρρ (y−1)x+1 (y−2)x+1 ρ ρ 2x−1 ρ 2x x−1 ρx ρρ 21 ρ ρ ρ x+1 x+2 π π π π ππππ π π π π π ππ π πxλx,c λ x c,x λx,x−1 x−1,x λρ x,2x λ λ2x,x Figure 1.20: Assumed NoC platform platforms. Figure 1.20 depicts the assumed NoC platform. Each router can have at most 10 other ports, namely East Input,East Output,West Input,West Output,North Input,North Output,South Input,South Output,Core Input and Core Output. A router uses core ports to exchange the data with the local core, while the rest of the ports are used for the communication between the router and its neighbouring routers. The number of ports inside a router depends on the position of the router within the NoC. Central routers have all 10 ports (e.g. ρx+2in Figure 1.20), routers on the edges have 8 (e.g. ρ2in Figure 1.20), whereas corner routers have only 6 ports (e.g. ρ1in Figure 1.20). Each pair of communicating routers is connected with two unidirectional links, between their closest ports. For instance, in Figure 1.20 the routers ρx−1and ρxare connected with two unidirectional links λx−1,xand λx,x−1, where the first number represents the source router of the link and the second number denotes the destination router. Therefore, over λx,x−1, the packets are transferred from the west output port of ρxto the east input port of ρx−1. Moreover, the core ports of each router ρi, are connected with the local core πivia two unidirectional links λi,c, and λc,i. Note, that for clarity purposes, the links between the cores and the routers have been omitted from the left part of Figure 1.20. The platform employs the X-Y routing policy and a wormhole switching technique with the credit-based flow control mechanism. All links have identical physical characteristics. The width of each link is σf lit, which is equal to the size of one flit. All flits travel with the same speed, and it takes δLclock cycles for a flit to travel between the output port of the sender and the input port of the receiver router, i.e. to traverse one link. For example, it takes δLclock cycles for a flit from the core πxto traverse the link λc,xand enter the core input port of ρx, and it also takes δLclock cycles for a flit from the west output port of ρxto traverse λx,x−1and enter the east input port of ρx−1. Additionally, the flits travel through routers. A header flit contains the information about the destination, which is used to pre-compute the path which will be followed by the remaining flits. Therefore the routing delay is suffered only by a header flit and it takes δρclock cycles for a header to traverse one router. All routers work on the same frequency νρ.
1.5 Many-Cores in Real-Time Embedded Computing Domain 27 Moreover, the NoC ηmay or may not provide the support for virtual channels. In this dissertation, both types of NoCs will be analysed. Therefore, let ηRR and ηPP be the NoCs without and with virtual channels, respectively. For ηRR, it is assumed that the round-robin arbitration policy is used. Moreover, the capacity of the buffers inside ports should be such that at least 1 flit can be stored, i.e. σf lit. As explained in previous sections, assuming a single channel, it is not possible to implement inter-packet preemptions. Note that the Epiphany [3] and Tilera [93] platforms, in terms of their characteristics, can be classified as ηRR. For ηPP, the number of virtual channels should be at least equal to the maximum number of traffic-flows. This requirement guarantees that each packet can be (if needed) successfully stored inside a dedicated virtual channel along its path. Subsequently, each virtual channel should be able to accommodate at least 1 flit. Moreover, the priority-preemptive arbitration mechanism is assumed, where a higher-priority packet can preempt a lower-priority packet with the flit-level granularity. 1.5.3 Data Input and Output In many cases, in order to perform the computation, functionalities need some input data. Depending on the purpose of the system, the required data can be (i) values sensed from the environment with which the device is interacting, and/or (ii) the results from the previous computations of the functionality itself, as well as other functionalities interacting with it. When the computation is performed, in-core registers are used to manipulate the data. However, the capacity of the registers is not enough to store the necessary data for all functionalities, not even for a single functionality. Thus, there must exist an external medium where data can be stored, and there must exist an accompanying mechanism which performs the data transfer between the registers and the external medium, i.e. to send data to the medium when it is not needed any more, and retrieve it when it is needed again. The part of the hardware that is responsible for these operations is called the memory system. 1.5.3.1 Memory Systems in Single-Core and Multi-Core Platforms Over the years, the memory systems underwent a multitude of changes. Chip manufacturers decided to implement changes in order to improve the performance of the system, usually at the expense of a more complex design. These evolution trends of memory systems are very beneficial for some areas, such as the high-performance or general purpose computing, where the averagecase behaviour (performance) is an important aspect. However, a more complex design, at the same time, makes it increasingly hard to analyse the temporal behaviour of the memory system, which is an important aspect in other areas, such as the real-time embedded domain. It is no surprising that, as the memory design grows more complex, new challenges in the real-time analysis of memory systems keep emerging. Figure 1.21 depicts a typical memory system of a single-core platform. As already stated, the computation process uses in-processor registers. When the data that is needed for the computation
34 Introduction 1.6 Thesis Statement Many-core platforms are the imperative and the sine qua non in the design of future real-time embedded systems. With: •adequate hardware support for (i) the message passing communication paradigm and (ii) virtual channels, •operating system design choices which promote scalability and predictability via messagepassing, •mindful and thoughtful worst-case analyses, it is possible to make many-cores amenable to real-time analysis and applicable to the real-time embedded domain.
Chapter 2 Several Steps Closer to Real-Time NoCs In this chapter, a set of contributions concerning the NoC interconnect ηof the assumed manycore platform Ψis presented. The common aim of all contributions is to make the existing NoC platforms more amenable to the real-time domain, by reducing the analysis pessimism and/or by reducing the hardware requirements. This chapter is organised as follows. In Section 2.1 the traffic model is introduced. This model is used to analytically describe the communication and memory traffic. Then, in Section 2.2, the existing method for the worst-case traffic analysis of round-robin- arbitrated NoCs is covered, and subsequently the novel, less pessimistic method called the Branch, Prune and Collapse is proposed. In Section 2.3 the focus is on priority-preemptive NoCs. First, the existing approach for the worst-case traffic analyses is introduced, and then the new method to reduce the requirements for hardware resources is proposed. After that, in Section 2.3.4 the novel arbitration policy for priority-preemptive NoCs is covered. This policy is based on the Earliest Deadline First scheduling paradigm. Finally, in Section 2.3.5 an improvement over the existing methods for priority-preemptive NoCs is presented. This improvement allows to perform a less pessimistic analysis. 2.1 Traffic Model The communication (core-to-core) traffic, as well as the memory (core-to-memory) traffic is modelled by a sporadic flow-set F, which is a collection of wflows F={f1,f2,..., fw−1,fw}. Each flow fihas a source src(fi), and a destination dst(fi), where the source and the destination can be cores or memory controllers, i.e. src(fi)∈ {π∪µ} ∧ dst(fi)∈ {π∪µ}. Additionally, fiis characterised by a set of traversed links L(fi), its size σ(fi), its minimum inter-arrival period T(fi), its deadline D(fi), and its priority P(fi). Each flow figenerates a potentially infinite sequence of packets. A packet released from src(fi)at the time instant tshould be received by dst(fi)no later than t+D(fi). Otherwise, it has missed a deadline. In this dissertation, it is assumed that all flows have constrained or implicit deadlines, i.e. ∀fi∈F|D(fi)≤T(fi). In Figure 2.1 are depicted 3 flows, f1,f2and f3. From the figure it is visible that the flow characteristics are as follows: 35
36 Several Steps Closer to Real-Time NoCs ρ ρ 4 5 f1f32 f ρ1ρ2ρ3 Figure 2.1: Traffic flows (example 1) src(f1) = π1,dst(f1) = π3,L(f1) = {λc,1,λ1,2,λ2,3,λ3,c}. src(f2) = π2,dst(f2) = π4,L(f2) = {λc,2,λ2,3,λ3,4,λ4,c}. src(f3) = π3,dst(f3) = π5,L(f3) = {λc,3,λ3,4,λ4,5,λ5,c}. Notice that the flows f1and f2are directly competing because of the common link λ2,3. The same is also true for the flows f2and f3, because of the common link λ3,4. However, f1and f3are not directly competing because they do not have any common link. 2.2 NoCs with the Round-Robin Arbitration Policy Irrespective of the type of the traffic (communication or memory), and irrespective of the arbitration policy (round-robin or priority preemptive), if every packet of one flow meets its deadline, then that flow is considered schedulable. Subsequently, if every flow of the flow-set is schedulable, then the flow-set is considered schedulable. The schedulability can be investigated via simulations or measurement-based techniques, however, as mentioned in Section 1.2, these methods have several fundamental limitations. In the hard real-time domain the most common approach to test the schedulability is to perform the worst-case traffic analysis. Specifically, it is investigated whether a packet of the analysed flow can meet a deadline, while facing the worst-case occurrence patterns of packets belonging to other flows. This case is called the worst-case scenario. If the packet of the analysed flow can meet a deadline in the worst-case scenario, it means that every packet of that flow will be able to meet its deadline, and hence the flow is schedulable. One of the key challenges is to recognise and analytically describe the worst-case scenario. Depending on the conditions, finding the worst-case scenario can be a relatively straightforward activity, or it can be an intractable process, and both situations will be encountered throughout this dissertation. In the latter case, as will be shown in this very section, the goal is to identify an artificial worst-case scenario. Its advantages are that it is easier to capture that the actual worstcase scenario and that it is safe, i.e. never leads to an underestimation. However, its disadvantage is that it is more pessimistic than the actual worst-case scenario. 2.2.1 State-of-the-Art Method Ferrandiz et al. [32] proposed a method to perform the worst-case analysis for round-robin- arbitrated SpaceWire networks, and this method is also applicable to NoCs. This approach is
2.2 NoCs with the Round-Robin Arbitration Policy 37 based on two observations: Observation 1. A packet may, at any router, be blocked by at most one packet from each of the other input ports. Observation 2. A packet may be directly blocked by at most one packet of each flow. 1f32 ff f f54 ρ2 ρ1ρ3 ρ4ρ5ρ6 ρ7 Figure 2.2: Traffic flows (example 2) Observations 1-2are the consequence of the roundrobin arbitration policy. Figure 2.2 is used to illustrate the implications of these observations. Consider that the flow f2is under analysis. Upon its release, it can be blocked by f1and f3. However, after the blocking, when it progresses to ρ5, it cannot suffer any more blocking from f1and f3 (Observation 2). Moreover, if there exist other flows f0 1 and f0 3, with the same paths as f1and f3, respectively, only one flow from each direction would be able to block f2 (Observation 1). That is, only one of f1and f0 1would be able to block f2, and the same is true for f3and f0 3. Although a flow can be blocked directly by any flow at most once, it may happen that the analysed flow is additionally blocked by the same flow multiple times indirectly. In other words, in Figure 2.2, when f2is blocked by f1, then f1can be blocked by f4and f5in ρ5, which causes indirect blocking to f2. However, when f2reaches ρ5, it can also be blocked by f4and f5, but this time directly. In fact, in the illustrated example, f2can be blocked three times by f4and f5, two times indirectly when f1and f3 reach ρ5, and once directly when itself reaches ρ5. This scenario is illustrated with the following flow traversal sequence: f4,f5,f1,f4,f5,f3,f4,f5,f2. Ferrandiz et al. [32] proposed to compute the worst-case traversal time (WCTT) of flows by invoking the Algorithm 1, with the following parameters delay(fi,get(L(fi),1)), where fiis the flow under analysis, and get(L(fi),1)denotes the first link on the path L(fi). First, it is checked whether λm,nis null (line 2). If it is, this means that the header of fireached the destination, so the only remaining activity is to transfer the rest of the flits (line 3). Otherwise, it is checked whether λm,nis the first link on the flow path. If it is, this means that fican be blocked on λm,nonly by the flows with the same source as fi. All such flows are grouped into the set Fsrc (lines 7 −9). Then, WCTT of fiis equal to the sum of: (i) the delay of all flows from Fsrc to traverse λm,n, (ii) the delay of all flows from Fsrc to reach the destination, (iii) the delay of fito traverse λm,n, and (iv) the delay of fito reach the destination (lines 10−13). Conversely, if λm,nis not the first link of fi, then fican suffer blocking only from flows which also traverse λm,n, but enter the router ρmfrom a different link than the one from which fidoes (which is λk,m). Thus, all such links are added to the set of blocking links BL (lines 18−20). For each blocking link λg,m∈BL, a set of flows Fg,mis created. Fg,mcontains all flows that traverse λg,mand subsequently compete with fion λm,n(lines 21 −26). For each λg,m∈BL, a
38 Several Steps Closer to Real-Time NoCs Algorithm 1 delay(fi,λm,n) Input: flow fi, link λm,n Output: WCTT of fi, starting from λm,n, to the destination 1: if (λm,n=null)then 2: // the header flit reached the destination, so the remaining flits have to be transferred 3: return lσ(fi) σf lit m·δL; 4: end if 5: if (get(L(fi),1) = λm,n)then 6: // λm,nis the first link of fi, so only the flows with the same source as fican block 7: for each (fj∈F|fj6=fi∧get(L(fj),1) = λm,n)do 8: Fsrc ←fj;// find all flows with the same source as fi 9: end for 10: VAL1←∑ ∀fj∈Fsrc (δL+delay(fj,get(L(fj),2))); 11: VAL2←δL+delay(fi,get(L(fj),2)); 12: WCTT ←VAL1+VAL2; 13: return WCT T ; 14: end if 15: // find λk,m, which fitraversed immediately before λm,n 16: λk,m←get prev(L(fi),λm,n); 17: // fican be blocked by flows which traverse λm,n, but have previous link different than λk,m 18: for each (g∈N|λg,m∈λ∧g6=k)do 19: BL ←λg,m; 20: end for 21: for each (g∈N|λg,m∈BL)do 22: // find the set of flows Fg,mthat traverse λg,mand λm,n, and hence can block fi 23: for each (fj∈F|λg,m∈L(fj)∧λm,n∈L(fj)) do 24: Fg,m←fj; 25: end for 26: end for 27: VAL1←∑ ∀λg,m∈BL max ∀fj∈Fg,m {δρ+δL+delay(fj,getnext(L(fj),λm,n))}; 28: VAL2←δρ+δL+delay(fi,getnext(L(fi),λm,n)); 29: WCTT ←VAL1+VAL2; 30: return WCT T ;
2.2 NoCs with the Round-Robin Arbitration Policy 39 single flow from Fg,mis found, such that it can cause the maximum delay to fi. Subsequently, for all such flows the following values are computed: (i) the delay to traverse ρm, (ii) the delay to traverse λm,n, and (iii) the delay to reach the destination. All these delays jointly contribute to the delay of fi(line 27). Then, the following values are computed: (i) the delay of fito traverse ρm, (ii) the delay of fito traverse λm,n, and (iii) the delay of fito reach the destination (line 28). Finally, the worst-case traversal time of fiis equal to the sum of these terms (line 29). δ+ + delay( f2,) L δnull = σ( 2)f σflit δL . delay( f,) 2λ5,7 delay( f,) L δ+δ+2λ7,c f, delay( ) λc,22 f, delay( ) λ2,52 L δ+ L δ+δ+ ρ ρ ρ Figure 2.3: Computation tree for flow f2 from Figure 2.2, in isolation (Ferrandiz et al. [32] method) The execution of Algorithm 1is demonstrated by using the example given in Figure 2.2. Consider that f1,f3,f4and f5do not exist, and that f2is the only flow, which, due to inexistence of other flows, can uninterruptedly progress. By invoking Algorithm 1for this example, the computation process follows the steps illustrated in Figure 2.3, and returns the following result: WCTT(f2) = 4·δL+3·δρ+lσ(f2) σf lit m·δL. This result is intuitive, because f2traverses four links (four hops) and three routers, so its header flit suffers the link traversal delay four times, and the routing delay three times before reaching the destination. Additionally, when the header flit is received, the rest of the flits are transferred, and the last term in the aforementioned computation corresponds to that delay. This example allows to make a more general observation: Observation 3. Consider a schedulable flow-set F. A packet of a flow fi∈F, when traversing in isolation, will suffer a constant delay C(fi), expressed with Equation (2.1). C(fi) = |L(fi)|·δL+(|L(fi)|−1)·δρ+σ(fi) σf lit ·δL(2.1) Recall, that |L(fi)|denotes the cardinality of the path, which is also called the number of hops, and it represents the number of links that fitraverses, i.e. the number of elements in the L(fi)set. C(fi)is in the literature also called the basic network latency [30]. When the flow traverses in isolation, its worst-case traversal time is equal to its basic network latency: WCTT(fi) = C(fi), which also holds for the previous example: WCTT(f2) = C(f2) = 4·δL+3·δρ+lσ(f2) σf lit m·δL. However, in the presence of other flows, fimay suffer additional delay, which can makeWCTT(fi) significantly greater than C(fi). Thus, C(fi)it is the minimum delay that any packet of fimay
40 Several Steps Closer to Real-Time NoCs suffer while traversing the NoC, and C(fi)≤D(fi)is a necessary but not a sufficient condition for the schedulability of fi. Now, consider the example from Figure 2.2, but this time assuming all depicted flows. By invoking Algorithm 1to compute WCTT(f2), the computation trees illustrated in Figures 2.4-2.5 will be generated. The computation process returns the following value: WCT T(f2) = 22·δL+21·δρ+3·lσ(f4) σf lit m+lσ(f5) σf lit m·δL+lσ(f1) σf lit m+lσ(f3) σf lit m+lσ(f2) σf lit m·δL delay( f)δ+δ,L2 5,7 delay( f)+ λ δ, 3 5,7 delay( f,) 2λc,2 delay( f,) 2λ2,5 δ+ L delay( )δ+δ+λ ,L5,71 λ δ+ L ρ ρρ f+ + + Figure 2.4: Computation tree for flow f2from Figure 2.2 (Ferrandiz et al. [32] method) = δ+ + delay( f4,) L δλ7,c δρ+ + delay( f4,) L δnull σ( 4)f σflit δL . ρ = = delay( f) λ ,5,71 δ+delay( f5,) L δδρ+ + delay( f1,) L δ + + +λ7,c λ7,c δρ+delay( f5,) L δnull δρ+ + delay( f1,) L δnull + + + σ( 1)f σflit δL . σ( 5)f σflit δL . ρ = = = delay( f) , 2 5,7 δρ+ + delay( f,) L δ δ + + delay( f5,) L δ δρ+ + delay( f2,) L δ 4+ + λ7,c λ λ7,c λ7,c δρ+ + delay( f,) L δnull δρ+ + delay( f5,) L δnull δρ+ + delay( f2,) L δnull 4+ + σ( 2)f σflit δL . σ( 5)f σflit δL . σ( 4)f σflit δL . ρ = = = delay( f) λ , 3 5,7 δρ+ + delay( 4,) L δfδρ+ + delay( f5,) L δ δρ+ + delay( f3,) L δ+ + λ7,c λ7,c λ7,c δρ+ + delay( 4,) L δnull fδρ+ + delay( f5,) L δnull δρ+ + delay( f3,) L δnull + + σ( 3)f σflit δL . σ( 5)f σflit δL . σ( 4)f σflit δL . Figure 2.5: Computation subtrees for Figure 2.4 Notice, that in this case, due to the presence of other flows, the worst-case traversal time of f2 is significantly greater than its basic network latency, i.e. WCTT(f2)>C(f2). 2.2.2 Analysis Pessimism The method proposed by Ferrandiz et al. [32] renders safe upper-bound estimates on WCTT, and the related computation terminates within a reasonable time, as demonstrated by the authors in their work. However, this method does not take into account traffic characteristics when constructing contention trees, which may lead to pessimistic results. This is illustrated with the example from Figure 2.2, and the corresponding computation tree, given in Figure 2.4. It is visible from the figure that both f4and f5occurred three times during the traversal of the analysed flow f2. However, if the periods of f4and f5are greater than the worst-case delay of f2, then these flows
2.2 NoCs with the Round-Robin Arbitration Policy 41 cannot appear that often, and hence cannot contribute that significantly to WCT T(f2). Yet, the state-of-the-art method does not have a mechanism to take into account this information, but instead allows each flow to appear at the maximum possible rate, which clearly may lead to overly pessimistic worst-case traversal time estimates. In this dissertation, two sources of pessimism of the state-of-the-art method [32] are identified, referred to as the packet-level pessimism and the flow-level pessimism. The packet-level pessimism is related to the fact that, in the existing method, it is assumed that two packets of a flow, released during adjacent periods, can reach the same router successively. However, the time interval between two packets from adjacent periods depends on their characteristics, as demonstrated with Theorem 1. Theorem 1. Consider a schedulable flow-set F. Two packets of a flow fi∈F, related to two adjacent periods, cannot traverse the same router in the time interval which is less than or equal to T(fi)−D(fi)+C(fi). Proof. Proven directly. Consider the case when the first packet of fistarts traversing as late as possible, while the second packet starts traversing as early as possible, as illustrated in Figure 2.6. The traversal of the first packet can be delayed by at most D(fi)−C(fi), as delaying it any further would cause a deadline miss, which contradicts the initial assumption of a schedulable flow-set. The second packet can be released at earliest immediately after the period, i.e. at T(fi). Let ε be an infinitesimally small but finite value, representing the delay of the second packet to leave the source and reach the NoC. Thus, the time interval between two packet occurrences within any router of the NoC can not be less than T(fi)−(D(fi)−C(fi))+ε>T(fi)−D(fi)+C(fi). f)D( iD( i) f fi+ )T( f T( i)i) f C(0 C( i f −) Figure 2.6: Traversal of packets from two adjacent periods Theorem 1can be used to reduce the packet-level pessimism in the following way. Within each router ρithat the flow fjtraverses, a pair <fj,t∗>is stored, where t∗denotes the timestamp of the last traversal of fjthrough ρi. Subsequently, during the analysis, the next traversal of fjthrough ρiwould be possible only at t∗+T(fj)−D(fj)+C(fj). Of course, every new feasible traversal of fjthrough ρiwould be followed by an update of the time-stamp. Similarly, the flow-level pessimism is related to the fact that, in the existing approach, it is assumed that an arbitrary number of packets of a flow, released during adjacent periods, can reach the same router successively. However, Theorem 1demonstrated that there indeed exists a time interval between the occurrences of two adjacent packets, and the same is true for an arbitrary number of successive packets, as proven with Theorem 2. Theorem 2. Consider a schedulable flow-set F. Within the time interval t, the maximum number of packets of a flow fi∈Fthat can reach the same router is lt+D(fi)−C(fi) T(fi)m.
42 Several Steps Closer to Real-Time NoCs f T( i)fi+ )T( i) f C( f)D( iD( i) f 0 C( i f −)fi) . n T( fi+ )T( i) f C(n. ... Figure 2.7: Traversal of packets from several successive periods Proof. Two cases need to be investigated: 1. t≤T(fi)−D(fi)+C(fi): Proven directly. From Theorem 1it follows that at most 1 packet can reach the same router within t. By substituting the value of tinto the computation for this theorem, it follows that lt+D(fi)−C(fi) T(fi)m<lT(fi) T(fi)m=1, which coincides with the result of Theorem 1. 2. t>T(fi)−D(fi) +C(fi): Proven by contradiction. Consider that within the time interval t, at most lt+D(fi)−C(fi) T(fi)m+1 packets can reach the same router. By initial assumptions, lt+D(fi)−C(fi) T(fi)m+1≥3. Consider that the first packet reached the router as late as possible, while all the other packets reached it as early as possible, as illustrated in Figure 2.7. Consider lt+D(fi)−C(fi) T(fi)m−1 packets, that are surrounded by the first and the last. These packets are referred to as the inner packets. All the inner packets contribute to twith their entire periods, therefore require time interval of at least lt+D(fi)−C(fi) T(fi)m−1·T(fi)where only these can reach the router. According to Theorem 1, the first packet could not reach the router later than T(fi)−D(fi) +C(fi)time units before the first inner packet. Finally, the last packet can reach the router only εtime units after its period. Recall, that εis an infinitesimally small but finite value representing the delay of the packet to leave the source and reach the NoC. T(fi)−D(fi)+C(fi)+ t+D(fi)−C(fi) T(fi)−1·T(fi)+ε= t+D(fi)−C(fi) T(fi)·T(fi)−D(fi)+C(fi)+ ε≥ t+D(fi)−C(fi) T(fi)· T(fi)−D(fi)+C(fi)+ ε= t+ε≤t The contradiction has been reached. Theorem 2can be used to decrease the flow-level pessimism in the following way. Within each router ρithat the flow fjtraverses, not only the time-stamp of the last traversal is stored, as proposed for the reduction of the packet-level pessimism, but a time-stamp of each traversal of fj through ρiis stored. Specifically, for each flow fjthat traverses through ρi, the traversal information is stored in the form <fj,t∗ 0,t∗ 1,...,t∗ n>, where t∗ 0denotes the time-stamp of the traversal of the first packet of fjthrough ρi,t∗ 1of the second packet, etc. Subsequently, during the analysis,
2.2 NoCs with the Round-Robin Arbitration Policy 43 the traversal of fj, through ρi, at the time instant t, will be possible only if n+1≤lt+D(fi)−C(fi) T(fi)m, where ndenotes the number of packets of fjthat already traversed ρi. 2.2.3 Branch and Prune (BP) Method In this section, a novel method to compute worst-case traversal times of flows will be presented. This method is called the Branch and Prune (BP) Method, and it renders tigher estimates than the state-of-the-art approach [32]. This method is developed from the same fundamental idea as the existing work, which is to recursively track the progress of flows over the NoC. However, the BP method additionally takes into account the traffic characteristics, so as to reduce the packet- and flow-level pessimism. 2.2.3.1 Overview As in the existing approach, in the BP method the tracking of the flow progress remains the same. That is, within each router that the flow traverses, a set of input links from which blocking flows may arrive is considered. Then, for each blocking link, the flow which can cause the greatest delay is identified. However, in the existing method [32], the maximum delay from each blocking link was computed before the next blocking link was considered. This causes the depth-first traversal of the computation tree. For example, when computing the worst-case traversal time for f2from Figure 2.2, first the blocking delay caused by f1is computed, then the delay by f3, and then f2progresses to the next router. Note that the order in which the blocking links and hence blocking flows are considered is entirely irrelevant. In other words, the computed value is the same, irrespective of whether the blocking delay was computed first for f1, and then for f3, or the other way around. This is possible, because the existing method does not take into account flow characteristics. Conversely, in the BP method, before the computation process starts, a construction of all possible orderings of blocking flows at the current router is performed. This has to be done, because, as explained later, in the BP method the flow ordering does matter. One ordering of flow traversals through the router is called the interfering scenario, and all possible traversals constitute the list of interfering scenarios –LIS. For the example with the flow f2, illustrated in Figure 2.2, the LIS for the traversal of f2through ρ2contains the following elements: LIS(f2,ρ2) = {f1,f3,f2}, {f3,f1,f2},{f1,f2},{f3,f2},{f2}. Notice that this is equivalent to branching into several independent computation trees, where each interfering scenario represents one computation tree, like illustrated in Figures 2.8-2.9. Then, each scenario (branch) is evaluated whether the flows can arrive in the given order, without violating the constraints of Theorems 1-2. If an investigated scenario is infeasible, the entire branch related to it is pruned. The tests for compliance with Theorems 1-2are applied every time a new branching occurs, which gives the possibility to detect and prune infeasible scenarios (branches) as early as possible. Notice that pruning a given scenario in fact prunes an entire sub-tree that would result from it, which vastly reduces the search space. This is especially beneficial for loaded networks, where, due to the complex contention patterns,
50 Several Steps Closer to Real-Time NoCs 2.2.4.2 Necessity to Create Dummy Sequence At any intermediate stage of the analysis, when the number of sequences reaches the value of the parameter SIRL, a single sequence that will provably lead to the WCTT cannot be detected. This has already been explained in Sections 2.2.3.2-2.2.3.3, and this is the main reason why in the BP method all contexts need to be combined with all scenarios, and subsequently why all resulting contexts need to be retained for future computations. Therefore, during the collapse phase, from the set of the constituent sequences, a specific single sequence cannot be solely carried forward in the computation. This is due to the fact that a single sequence, that was recognised as the local maximum at the intermediate stage, may in the later stages of the computation be subject to pruning, because of its flow history, and thereby may not contribute to the global maximum delay. In order to prevent this, the history information regarding the previous flow traversals is entirely dropped (thereby reducing the chances of the collapsed sequence to be subject to pruning during the later stages of the computation process). In fact, only the local maximum delay is retained within a new dummy sequence, consisting of a single dummy flow. To summarize, during the collapse phase, the BPC method creates a dummy sequence which inherits the delay of the local maximum, but entirely drops the traversal history of the flows constituting that sequence. 2.2.4.3 Illustrative Example The behaviour of the BPC method is illustrated with an example of flows given in Figure 2.10, which is identical to the example depicted in Figure 2.2, but has been repeated here for the reader’s convenience. 1f32 ff f f54 ρ2 ρ1ρ3 ρ4ρ5ρ6 ρ7 Figure 2.10: Traffic flows (revisited example 2) Consider the flow f2between the cores π2and π7.f2 traverses the routers ρ2,ρ5, and ρ7. As mentioned in Section 2.2.1, the flows f4and f5can potentially block f2three times: twice indirectly by blocking f1and f3at ρ5(f1and f3block f2directly at ρ2), and finally once directly at ρ5 when f2reaches it. Thus, f4and f5are the promising candidates for pruning (line 32 of Algorithm 3). Assume that SIRL =5. On the link λc,2the analysed flow f2can suffer blocking only from flows originating from the same core π2. However, there are no such flows, so f2uninterruptedly progresses to the router ρ2. For the next link on the path of f2, i.e. λ2,5, the BPC method constructs the LIS for f2as follows: LIS(f2,ρ2) = {f1,f3,f2}, {f3,f1,f2},{f1,f2},{f3,f2},{f2}. First, the scenario {f1,f3,f2}is explored. At this time, the list SCList is reseted to the current (initial) context (at line 28 of Algorithm 3). Note, that SCList will ultimately contain all generated contexts arising from the analysis of this scenario {f1,f3,f2}, before being appended to the global list of contexts GCList
2.2 NoCs with the Round-Robin Arbitration Policy 51 (line 43 of Algorithm 3). Now, a recursive call is invoked for the router ρ5with f1being the analysed flow. This will result in a new LIS constructed at ρ5as: LIS(f1,ρ5) = {f4,f5,f1}, {f5,f4,f1},{f4,f1},{f5,f1},{f1}. Similarly, LIS is generated for the flow f3at the router ρ5 as: LIS(f3,ρ5) = {f4,f5,f3},{f5,f4,f3},{f4,f3},{f5,f3},{f3}. These sequences are propagated back, and should be combined with the current (initial) context before f2progresses to ρ5. As both LIS(f1,ρ5)and LIS(f3,ρ5)contain 5 elements, the combined set of sequences may contain 25 elements (i.e. 5 sequences from f1combined with 5 from f3). It is obvious that for large flow-sets this back-propagation may produce a large number of sequences and even cause intractability, which is the main drawback of the BP method. Given that SIRL =5 in this example, the collapsing requirement is met. Those 25 sequences are collapsed into a single one, which contains a dummy flow fX, while its delay is set to maximum delay amongst all collapsed sequences. When f2finally progresses to ρ5and encounters the potentially blocking flows f4and f5, the method checks the context related to the current sequence {fX}. Since there is no prior information regarding f4, nor f5, the algorithm considers that these two flows are arriving for the first time and thus allows them to pass and additionally block f2. The resulting sequences would be {fX,f4,f5,f2},{fX,f5,f4,f2},{fX,f4,f2},{fX,f5,f2}and {fX,f2}. Conversely, BP would have retained the contexts for all sequences, which would give the possibility to potentially prune another traversals of f4and f5, but at the expense of investigating 25·5=125 sequences. Note that this includes only the investigation of the first scenario {f1,f3,f2}. Similarly, the number of sequences that can arise from the scenario {f1,f3,f2}is also 53. The number of sequences from the scenarios {f1,f2}and {f3,f2}is 52, while the number of sequences from the scenario {f1}is 51. Thus, the total number of possible flow sequences for this example is 53+53+52+52+51=305. 2.2.4.4 Proof of Safety of BPC From the previous example it is obvious that the BPC method, by collapsing upon reaching the SIRL threshold and hence discarding some history information, may output more pessimistic WCTT estimates than the BP method. In this section, it is proven that the values obtained by the BPC method will under no circumstance lead to an unsafe WCTT estimate. Let wcs (short for the worst-case sequence) be the flow sequence leading to the worst-case delay of the analysed flow. By definition, wcs is a feasible flow sequence. In order to prove that BPC is safe, it will be proven that it will never eliminate wcs from the set of investigated sequences, i.e. BPC will never return a value which is smaller than the delay of wcs. First, it should be noted that if SIRL →∞, then the BPC method behaves like the BP method: it performs an exhaustive enumeration of all possible sequences at each router, and thus considers all possible blocking patterns of other flows during the traversal of the analysed flow (a brute-force approach, which is inherently safe). The pruning mechanisms (line 32 of Algorithm 3) exploit the information regarding the previous flow occurrences, in order to identify infeasible flow sequences, and in that way reduce the list of sequences that need to be investigated. By definition, wcs is a feasible flow sequence and therefore, it will not be eliminated by these pruning techniques.
52 Several Steps Closer to Real-Time NoCs Given the loss of the history information during the collapse phase, the BPC method is unable to identify as many infeasible flow sequences as the BP method. These infeasible sequences contain flows that cannot traverse that frequently due to Theorems 1-2, and hence additionally contribute to the worst-case traversal time of the analysed flow. Eventually, the set of explored sequences will also include the set of feasible sequences, which includes wcs, but will also include some infeasible sequences, which were not identified due to loss of history information during the collapse phase. Finally, after computing the maximum traversal time of all the sequences, the method will return a value which is greater than, or equal to the WCTT corresponding to wcs, and therefore the method is safe. To summarize, the BP method investigates all feasible flow sequences (including wcs) and all infeasible ones. The infeasible sequences are pruned due to the retained contexts, and thereby the method is safe. BPC investigates all feasible and infeasible sequences, prunes only a fraction of infeasible ones, and as a consequence is still safe but may be pessimistic. 2.2.4.5 Proof of Termination of Algorithm 3 Let Sbe the set of flow-link pairs hfi,λk,li, where fi∈Fand λk,l∈λ, such that hfi,λk,li ∈ S⇐⇒ λk,l∈L(fi). Since λand Fare the sets of the finite number of elements, it holds that Shas a finite number of elements as well. A progress of a flow fifrom a link λk,lto a subsequent link λl,mon its path is equivalent to the progress from the pair hfi,λk,lito the pair hfi,λl,mi. If some flow fjblocks the flow fion the link λk,l, it corresponds to the progress from the pair hfi,λk,lito the pair hfj,λk,li. For a given flow fi, and a current link λk,l, the algorithm progresses in a forward manner to the next link getnext(L(fi),λk,l)on the path of the flow fiby invoking the function getContexts() (line 38 of Algorithm 3). Starting from any pair hfi,λk.li ∈ S, Algorithm 3investigates all flow-link pairs from Sthat are reachable, assuming the round-robin arbitration policy. Then, the algorithm is recursively invoked for every transitioned pair. From the deadlock-free property of the X-Y routing mechanism [40] it follows that the initial pair hfi,λk,li will never be revisited. As soon as all the explored contexts are popped (line 31 of Algorithm 3), the algorithm will terminate. 2.2.5 Experimental Evaluation In this section, the experimental evaluation is performed with the dual objective: to compare the BP and BPC methods with the existing approach [32], and to study the impact of different parameters on the tightness of derived WCTT estimates. The analysis parameters are summarized in Table 2.1, where an asterisk sign denotes a randomly generated value, assuming a uniform distribution. 2.2.5.1 Experiment 1: BPC vs Existing Method of Ferrandiz et al. [32] The improvements of the BPC method over the existing one cannot be quantified in a general sense, because the results largely depend on the characteristics of the flow-set upon which the
2.2 NoCs with the Round-Robin Arbitration Policy 53 Table 2.1: Analysis parameters for Section 2.2.5 NoC topology and size 2-D mesh with 8×8 routers Router frequency νρ250 MHz Routing delay δρ3 cycles (12 ns) Link traversal delay δL1 cycle (4 ns) Flow packet size σ(fi),∀fi∈F512 bytes Link width = flit size σf lit 16 bytes Testing platform Intel dual-core desktop & Java (Max heap-size: 4 GB) techniques are applied. Therefore, in order to observe the trends and the ranges of improvements that are achieved by employing the proposed approach, the comparison is performed on a wide range of different flow-sets. Experiment 1a (NoC with moderate number of flows): 200 random flow-sets are generated, each consisting of 64 flows. The flows originate from each core, but terminate at a randomly generated destination by following an X-Y routed path. A deadline and a period for each flow are randomly generated values in the range [20−100]µs, assuming a uniform distribution, where D(fi)≤T(fi),∀fi∈F. The upper-bounds on the worst-case traversal times (WCTT) of each flow are computed, using both the approaches. Subsequently, the results are compared. For the BPC method, the value of the parameter SIRL =10000. In order to quantify the range of improvements, a metric called the Percentage Improvement Ratio (PIR) is used. PIR =100·(WCT TU−WCT T10000 O) WCTTU, where WCT TUdenotes the upper-bound on WCTT computed by the existing approach, which is also referred to as the unoptimized WCTT, and WCTT10000 Ois the value computed by the BPC method for SIRL =10000, which is also reffered to as the optimized WCTT. Therefore, PIR =25% implies that BPC derived a 25% smaller (tighter) WCTT upper-bound. Figure 2.11(a) illustrates the results. For 31.84% of the flows, the bounds computed by both methods are equal, that is WCTT10000 O=WCTTU, and hence PIR =0%. For the rest of the 68.16% the BPC method renders tighter WCTT estimates. Specifically, 1.29% of the flows have PIR in the range [1−10%], 13.22% in the range [11−20%], and so on. At the higher end of the PIR scale, for 3.55% of the analysed flows the BPC method computed [71−100%)tighter WCTT bounds. The WCTT* parameter: If the computation finishes with the number of investigated sequences not exceeding SIRL, this means that no collapses occurred, and that the BPC method computed a value of the traversal time as would be computed by the BP method. This further implies that all possible flow sequences were investigated, and the one causing the greatest worst-case delay to the analysed flow was identified. The delay of such a sequence is denoted WCTT∗. Conversely, in cases where collapses do occur, the returned value presents only an upperbound on the worst-case traversal time of the analysed flow, without any additional information on how tight that bound actually is. When viewed from that perspective, the existing approach [32] presents a special case of the BPC method where SIRL =1. Therefore, the existing approach obtains WCTT∗only when the number of possible flow sequences is equal to 1.
54 Several Steps Closer to Real-Time NoCs (a) NoC with moderate number of flows (b) NoC with high number of flows Figure 2.11: Distribution of WCTT improvement across flows (legends represent improvement ranges) Of those 31.84% of the flows for which both methods returned equal WCTT values (i.e. WCTT10000 O=WCTTU), for 3 4of them, (23.96% of all the flows), the existing method was able to capture WCTT∗, inferring that these cases were simple and involved the investigation of a single flow sequence. Therefore, in these cases there was no scope for improvements. Based on the computed bounds, it can be concluded that the BPC method performs equally well or dominates the existing method. Also, for the selected SIRL value, BPC managed to capture WCTT∗in 92.13% of the cases, implying that any additional increase in SIRL would not provide significantly tighter WCTT bounds, but would require factorially greater amount of computation time. The analysis completes within 24 hours, averaging a little bit more than 7 minutes per flow-set (each with 64 flows). The most complex flow-set took around an hour to compute all WCTT values. This finding suggests that the execution times may vary drastically, when analysing flow-sets with identical characteristics but different flow routes. Indeed, for flow-sets with complex contention patterns, the analysis time can be an order of magnitude greater than the average analysis time for the flow-set with similar traffic characteristics. Experiment 1b (NoC with high number of flows): The main purposes of this experiment are to test the scalability potential of the BPC method, and to observe its efficiency when applied to larger flow-sets. Again, 200 random flow-sets are generated, each consisting of 128 flows, with two flows originating from each core, but terminating at a random destination by following an X-Y routed path. Flow deadlines and periods are randomly generated values in the range [0.1−1]ms, assuming a uniform distribution, where D(fi)≤T(fi),∀fi∈F. For all flows, the values of WCTTUand WCT T10000 Owere computed and compared. The analysis completed in 5 days, averaging 36 minutes per flow-set. The most complex ones consumed around 3 hours, demonstrating that the BPC method is scalable and applicable to practical scenarios involving hundreds of concurrent flows.
2.2 NoCs with the Round-Robin Arbitration Policy 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 00 00 00 00 00 00 00 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 00 00 00 00 00 00 11 11 11 11 11 11 000 000 000 000 000 000 111 111 111 111 111 111 000 000 000 000 000 111 111 111 111 111 000 000 000 000 000 000 111 111 111 111 111 111 00 00 00 00 00 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 111 111 111 111 111 00 00 00 00 00 11 11 11 11 11 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 00000 00000 00000 00000 11111 11111 11111 11111 00000 00000 00000 11111 11111 11111 0000 0000 0000 1111 1111 1111 00000 00000 00000 11111 11111 11111 00000 00000 11111 11111 00000 00000 00000 11111 11111 11111 0000 0000 1111 1111 00 00 00 00 00 00 11 11 11 11 11 11 000 000 000 111 111 111 000 000 111 111 00 00 00 11 11 11 000 000 111 111 000 000 000 111 111 111 000 000 000 111 111 111 00 00 11 11 00 00 11 11 00 00 11 11 0011 0011 00 00 11 11 0011 0011 00 00 11 11 0011 000 000 111 111 00 00 11 11 0% 20% 40% 60% 80% 100% Lim4 Lim20 Lim100 Lim200 Lim1,000 Lim2,000 Lim4,000 lim10,000 Percentage of flows 91−100% improvement 81−90% improvement 71−80% improvement 61−70% improvement 51−60% improvement 41−50% improvement 31−40% improvement 21−30% improvement 11−20% improvement 1−10% improvement No improvement 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 00 00 00 00 00 00 00 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 00 00 00 00 00 00 11 11 11 11 11 11 000 000 000 000 000 000 111 111 111 111 111 111 000 000 000 000 000 111 111 111 111 111 000 000 000 000 000 000 111 111 111 111 111 111 00 00 00 00 00 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 000 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 111 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 000 000 111 111 111 111 111 111 111 000 000 000 000 000 111 111 111 111 111 00 00 00 00 00 11 11 11 11 11 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 00000 00000 00000 00000 11111 11111 11111 11111 00000 00000 00000 11111 11111 11111 0000 0000 0000 1111 1111 1111 00000 00000 00000 11111 11111 11111 00000 00000 11111 11111 00000 00000 00000 11111 11111 11111 0000 0000 1111 1111 00 00 00 00 00 00 11 11 11 11 11 11 000 000 000 111 111 111 000 000 111 111 00 00 00 11 11 11 000 000 111 111 000 000 000 111 111 111 000 000 000 111 111 111 00 00 11 11 00 00 11 11 00 00 11 11 0011 0011 00 00 11 11 0011 0011 00 00 11 11 0011 000 000 111 111 00 00 11 11 0% 20% 40% 60% 80% 100% Lim4 Lim20 Lim100 Lim200 Lim1,000 Lim2,000 Lim4,000 lim10,000 Percentage of flows 91−100% improvement 81−90% improvement 71−80% improvement 61−70% improvement 51−60% improvement 41−50% improvement 31−40% improvement 21−30% improvement 11−20% improvement 1−10% improvement No improvement Figure 2.12: BPC method with varying SIRL vs. Ferrandiz et al. [32] method As in the previous experiment, the PIR metric is used to quantitatively express the improvements of the BPC method over the existing one [32]. Figure 2.11(b) illustrates the results. For 9.23% of the flows, no improvements were made (PIR =0%). For most of the flows without any improvements (8.11%), the existing method indeed managed to capture WCTT∗, which implies that for these simple sequences consisting of a single flow no improvements were possible. For the rest, i.e. 90.77% of the analysed flows, it holds that WCTT10000 O<WCTTU, that is, the BPC method rendered tighter estimates. It is interesting to see that, for more than 13% of the flows, the improvements were in the range [61 −70%], while for more than 8% of them the improvements were greater than 70%. Due to more complex traffic patterns, resulting from the increased amount of traffic, BPC with SIRL =10000 identified WCTT∗for 41.71% of the flows, which is significantly less, when compared with the same for moderately loaded NoCs. This suggests that in these cases the improvements can be achieved by increasing SIRL beyond 10000, but at the expense of additional computational and spatial complexity. Although the computation time of the BPC method is longer than that of the existing method, BPC clearly dominates the existing approach in terms of tightness of obtained bounds. The selection of the parameter SIRL creates a trade-off between the computational and spatial complexity on one side, and the analysis tightness on another, as will be investigated in the next experiment. 2.2.5.2 Experiment 2: Impact of SIRL on Analysis The objective of this experiment is to observe the impact of SIRL on the tightness of computed WCTT estimates. Intuitively, retaining more information about flow sequences provides more opportunities for pruning (eliminating infeasible flow sequences), and therefore leads to tighter estimates. To validate this assumption, considering the flow-sets from Experiment 1b, the BPC method is invoked and the WCTT estimates are obtained for different values of the parameter SIRL. Subsequently, the obtained bounds are compared against the bounds obtained by the existing method [32]. The results are illustrated in Figure 2.12. As in Experiment 1, the PIR metric is used.
56 Several Steps Closer to Real-Time NoCs 1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 0 5 10 15 20 25 30 35 40 Limit size Quantity of captured WCTT*, in % of total flow−set (a) Identified worst-cases (WCTT*) across SIRLs Anomalies Equal 1−10% 11−20% 21−30% 31−100% 0 10 20 30 40 50 60 Quantity of flows, in % of total flow−set Improvement SIRL1 = 100 / SIRL2 = 40 SIRL1 = 256 / SIRL2 = 100 SIRL1 = 640 / SIRL2 = 256 SIRL1 = 1600 / SIRL2 = 640 SIRL1 = 4000 / SIRL2 = 1600 SIRL1 = 10000 / SIRL2 = 4000 (b) Improvements across SIRLs Figure 2.13: Inter-SIRL ratios It is visible that as SIRL increases, the percentage of flows with no improvements decreases. Thus, with SIRL =4, the WCTT estimates computed for 43.6% of the flows exhibit no improvements, while with SIRL =2000 only 9.29% of the flows show no improvements (and the rest 90.71% of the flows have tighter WCTT bounds). Notice, that the percentage of flows within high PIR categories increases as SIRL increases. This is in accordance with the method rationale that the retention of contexts, and within them the information regarding past flow traversals, can provide opportunities for pruning and tightening the WCTT estimates. But, as seen in the shift from SIRL =4000 to SIRL =10000, the distribution of improvements across PIR categories does not differ much, because almost all opportunities for pruning infeasible sequences are exhausted. This further implies that choosing limits beyond a given SIRL will only burden the system to retain the contexts of flow sequences which have very small chances to lead towards a tighter WCTT estimate. So, a judicious decision must be taken by the system designer, considering the desired tightness of results, and the time in which the analysis must complete. In that respect, the BPC method provides the full flexibility via the parameter SIRL. 2.2.5.3 Experiment 3: Inter-SIRL Ratios In the previous experiment, the BPC method with different values of the SIRL parameter was compared against the existing approach [32]. In order to get a deeper insight into the impact of SIRL on the tightness of derived bounds, in this experiment the bounds are obtained assuming BPC with different SIRL values, where the flow-sets from Experiment 1b are used. The obtained bounds are compared against each other, and subsequently the results are plotted in Figure 2.13. The results coincide with the intuition, suggesting that greater values of SIRL improve the chances of capturing WCTT∗. This claim is confirmed with a logarithmic growth in the number of noncollapsed sequences, as SIRL increases (Figure 2.13(a)). Figure 2.13(b) demonstrates that the relative improvements across SIRLs diminish as SIRL increases. That is, in 60% of the cases the BPC method with SIRL =100 shows improvements
2.2 NoCs with the Round-Robin Arbitration Policy 57 f1f f 2 4 ffff 5678 f9 f3 Figure 2.14: All-to-one contending flows over BPC with SIRL =40, while the improvements are reported only in 30% of the cases when comparing results of SIRL =10000 and SIRL =4000. Thus, the number of cases with no improvements increases with SIRL. Conversely, as SIRL increases, the cases with improvements decrease across all improvement ranges, suggesting that it may not be efficient to perform the analysis with very high values of SIRL. The benefits of the analysis with higher SIRL diminish as SIRL increases (especially for sequences comprising of flows that can occur at most once within the observed interval). As already stated, the value of the SIRL influences the frequency of collapses. However, one interesting and counter-intuitive observation is the fact that higher SIRL does not necessarily always lead to a tighter WCTT upper-bound. This is explained with the following example. Consider the flow f2from the example depicted by Figure 2.10. Assume that f4and f5are potential candidates for pruning. Now, assume that greater SIRL performs a collapse between occurrences of f1and f2. As the history information is lost, the flows f4and f5will contribute to the delays of both f1and f2. On the other hand, a smaller SIRL might trigger a collapse, for example, before (and after) the appearance of f1and f2. In this case, it may successfully prune one appearance of f4and f5, thereby causing the situation (which is referred to as an anomaly), where, with a smaller value of SIRL, BPC returns a tighter WCTT estimate. As is visible from the results, the number of anomalies never exceeds 8%, for all the analysed flow-sets. 2.2.5.4 Experiment 4: All-to-One Case Study Figure 2.14 shows one flow-set where all flows have the same destination. This example is used to demonstrate some interesting properties. Consider the flow f1. The flows f2,f3,f4,f5,f6,f7, f8and f9are the other flows which can block f1. By applying the existing approach [32], one of the sequences which might lead to the worst-case scenario for f1is: Seq1={f9,f8,f9,f5,f9, f4,f9,f8,f9,f5,f9,f3,f9,f8,f9,f5,f9,f4,f9,f8,f9,f5,f9,f2,f9,f8,f9,f5,f9,f4,f9,f8, f9,f5,f9,f3,f9,f8,f9,f5,f9,f4,f9,f8,f9,f5,f9,f1}. This sequence is a good example of the
58 Several Steps Closer to Real-Time NoCs 0 5 10 15 20 25 0 10 20 30 40 50 60 70 80 90 Blocking flow occurences MITR in microseconds (a) Number of blockings by f9vs. MIRT 90 100 110 120 130 140 150 160 170 180 190 0 10 20 30 40 50 60 70 80 90 WCTT in microseconds MITR in microseconds Unoptimized Optimized (b) WCTT of f1vs. MIRT Figure 2.15: Impact of MIRT on flow f1 potential packet-level and flow-level pessimism, and illustrates the case of a highly over-estimated WCTT, when infeasible sequences are not pruned. Flows f9and f8are positioned in such a way that they can frequently block the other flows. That is, in the aforementioned sequence, during one traversal of f1, the flows f9and f8appear 24 and 8 times, respectively. However, due to their characteristics, it may be impossible that the packets of f9and f8appear so often, inferring that the computed sequence may be overly pessimistic. Yet, in order to assess whether the aforementioned sequence is indeed pessimistic, and to what extent, flow characteristics must be taken into account. In the reminder of the experiment the focus will be on this aspect. As already observed, the flows originating closer to the destination have a higher tendency to block f1directly and indirectly (by blocking the other flows which are also on its path). To verify this, the deadline and the period of each flow are assigned the same value, which is equal to the worst-case traversal time of the respective flow, computed with the existing method [32]. For example, the deadline and period of the flow f9are assigned the delay of the sequence Seq9= {f1,f9}. Similarly, the deadline and period of f8are assigned the delay of the following sequence: Seq8={f9,f1,f9,f8}. This process is repeated for all flows, and it assures that all flows can generate their packets as frequently as possible, while still being schedulable. Assuming this flow-set, the worst-case traversal times are computed for each flow. Then, the periods of all flows are increased by the value of the newly introduced parameter MITR, while the deadlines remain the same, i.e. Dnew(fi) = Dold(fi)∧Tnew(fi) = Told(fi) + MIT R,∀fi∈F. The worst-case traversal times are computed again, and the obtained values are compared. The objective of this experiment is to see how the obtained values change with the increase in flow periods (parameter MITR). Figure 2.15 shows that as MIRT increases, the number of times the other flows can block f1decreases, and thus the WCTT estimate of f1decreases, as expected. In contrast, since the existing approach [32] does not take into account flow characteristics, the infeasible sequences are not pruned and as a result, irrespective of the change in the flow parameters, the obtained WCTT bounds remain constant (see solid line in Figure 2.15(b)).
2.3 NoCs with Priority-Preemptive Arbitration Policies 59 2.2.6 Discussion Branch, Prune and Collapse (BPC) is a method for the worst-case analysis of wormhole-switched round-robin-arbitrated NoCs. BPC uses a branch and prune technique, which improves over the work of Ferrandiz et al. [32] by taking into account the flow characteristics, and thereby provides tighter upper-bound estimates on the worst-case traversal times of traffic flows. In order to tackle the complexity issues of the branch and prune technique, a collapse phase was introduced. The concept of collapses allows the system designer to efficiently use the BPC method, and, via a configurable parameter, control the trade-off between the computational and spatial complexity on one side and the analysis tightness on another. A large set of experiments demonstrated the performance of the proposed method in comparison with the existing approach. In particular, BPC dominates the state-of-the-art method by yielding tighter WCTT estimates at the cost of additional computational and spatial resources, where these effects can be, to some extent, mitigated by the right selection of the configurable parameter. This inability of the existing methods to efficiently derive tight bounds for large complex flow-sets is the consequence of two inherent properties of the round-robin arbitration policy itself, namely the indirect contentions and the commutative property. As already noticed, each flow can be blocked not only by other flows with which it directly competes for some links on its path, but also by other flows with which it does not. Consequently, the set of possible flow sequences that needs to be investigated constitutes a vast solution space, which may be impossible to efficiently explore within a reasonable time, even for small flow-sets. For example, for the flow-set of only 5 flows, illustrated in Figure 2.10, there are 305 possible flow sequences, while for the example of 9 flows illustrated in Figure 2.14, a single flow sequence may contain 48 elements. Moreover, the commutative property applied to flow blocking may hold in the context of the round-robin arbitration policy. In other words, if two flows fiand fjcompete for some link on their path, in some cases fiwould be given a precedence, while in some others fjwould be allowed to progress. This infers that fican block fj, but the opposite is also true. Since the arbitration decisions are based on the router state at runtime (previous routing decisions), it is impossible to predict routing decisions at design-time, which means that this arbitration non-determinism has to be covered in the worst-case analysis either by exploring all possible scenarios, or by making some pessimistic assumptions. Thus, it can be concluded that, despite its high popularity and wide presence in currently available many-core interconnects, the round-robin arbitration policy may not be the most efficient arbitration technique for the real-time many-cores. 2.3 NoCs with Priority-Preemptive Arbitration Policies In this section, the focus is on priority-preemptive arbitration policies. As already discussed and demonstrated in Chapter 1, by allowing priority-based preemptions among flows, the effects of indirect contentions are significantly mitigated, which will be explored in detail later in this section. Moreover, for schemes with fixed flow priorities, the commutative property applied to flow
66 Several Steps Closer to Real-Time NoCs which traverse them. The limitation of this approach is explained with Figure 2.18 where 4 flows with distinctive priorities traverse 4 virtual channels, and where different virtual channels are depicted with different colors. Notice that the virtual channel for f1(the darkest color) is used only in the first two routers, while in the rest of the platform remains unused. f21 f f3f4 Figure 2.18: Assignment of virtual channels to flow-set with distinctive priorities The priority-share policy suffers from the same limitation, which is illustrated with Figure 2.19. Consider the depicted flow-set where flows f1and f4are grouped within the same priority (virtual channel), and the same is true for f2and f3. Notice that the virtual channel shared by f1and f4 (the darker color) is used only in the first two and the last two routers, while in the middle two routers remains unused. f21 f f3f4 Figure 2.19: Assignment of virtual channels to flow-set with priority-share policy 2.3.3.2 Dynamically Changing Virtual Channels The SCC platform [42] provides a feature that can be used to overcome the aforementioned limitation. Specifically, SCC offers the possibility that a flow can dynamically change virtual channels along its path. This feature was described using an analogy about how cars switch lanes on the highway. This implies that the assignment of virtual channels to priorities does not need to be done in a consistent manner across the entire platform, but can be performed individually, for each contending element – link (port). The benefits of this feature are illustrated in Figure 2.20, where for 4 flows with distinctive priorities only 2 virtual channels are needed. Notice, that f2changes virtual channels twice along its path (the darkest color). f21 f f3f4 Figure 2.20: Per-router assignment of virtual channels to flow-set with distinctive priorities
2.3 NoCs with Priority-Preemptive Arbitration Policies 67 This approach brings two benefits. First, within each port, the virtual channels are assigned to a certain priority only if necessary (the flow or flows with that priority traverse that port). Second, the number of required virtual channels within the entire platform is significantly reduced. Specifically, assuming that each flow has a distinctive priority, the number of necessary virtual channels decreases from the total number of flows in the flow-set to the maximum number of contentions for any link within the platform. In the illustrated example, it dropped from 4 (Figure 2.18) to only 2 (Figure 2.20). Notice, that unlike the priority-share policy, this technique to reduce the number of virtual channels does not have an impact on the schedulability and that the analysis remains the same as in the case with the per-flow distinctive priorities (Section 2.3.1), which makes it a more preferable approach than the priority-share policy. One overhead of this approach is that, for each flow, a list of traversed virtual channels should be specified. This can be implemented in the following way. The header of each flow fiis extended with the list of virtual channels V(fi), where the number of elements in V(fi)is equal to the number of ports on the path L(fi)of the flow fi, i.e. if routers have only input or output ports, |V(fi)|=|L(fi)−1|, otherwise |V(fi)|=2· |L(fi)−1|. In other words, for each port that fi traverses, there is an information in which virtual channel it should be stored. One alternative implementation is that the flows are agnostic with respect to virtual channels, but the information is stored within each router, and upon the arrival of a flow, it is router’s responsibility to retrieve that information and select the corresponding virtual channel. 2.3.3.3 Importance of Mapping As soon as the methods for the worst-case analysis of NoCs were proposed, the researchers realised that the schedulability of flow-sets is highly dependent on the mapping process. This is expected, because as observed in the previous sections, the flow can suffer the interference only from directly contending flows, while flow relationships are in fact the consequence of the mapping process. In their studies, Mesidis and Indrusiak [62] and Racu and Indrusiak [80] focus on deriving mappings which maximise the schedulability potential of the flow-sets, but without any impact on the number of employed virtual channels, because the authors assumed the model with distinctive per-flow priorities. Similarly, Shi and Burns [87] explore the flow-set mapping problem, but for the model with the priority-share policy. Their primary objective is to improve the schedulability, while the secondary objective is to decrease the number of employed virtual channels by packing as much flows in the same priority (virtual channel) as possible. So far, no work has considered that flows may dynamically change virtual channels. Notice, that under this assumption, the mapping process becomes even more important, because the number of necessary virtual channels is equal to the maximum number of contentions for any link, which is directly dependant on the mapping process. At this stage several questions can be raised: 1. What is reduction in the number of virtual channels that can be achieved by allowing flows to change virtual channels? 2. What is the further reduction in the number of virtual channels that can be achieved through mapping? 3. Does SCC (or any other platform with a desired feature) offer enough virtual channels to satisfy the
68 Several Steps Closer to Real-Time NoCs requirements of present and future real-time systems? 4. If not, how big is the gap between the existing platforms and the platforms suitable for the real-time domain? In order to answer these questions, the novel approach will be proposed, which combines the dynamically changing flow priorities with the workload mapping. 2.3.3.4 Proposed Mapping Method Mapping Workload Before the mapping process can be described, the mapping workload has to be introduced. Recall, so far it has been assumed that each flow is specified with the source core and the destination core. However, flows model the communication between functionalities, thus the source and destination cores of each flow are in fact the cores of the sending and receiving functionality, respectively. Therefore, the mapping workload is a collection of functionalities F={F1,F2,...Fz−1,Fz}, where zis equal to the number of cores/routers. The assumption valid in this section is that each functionality can be mapped to any core within the platform, however, each core can accept at most one functionality. Each functionality Fiis characterised by a set of sent flows FS(Fi)and the set of received flows FR(Fi). Method Overview The mapping method is based on the assumption that, while traversing, flows are allowed to change virtual channels. The method derives a mapping plan (solution) M, for a given set of functionalities F, on a given platform Ψ, i.e. M=F→Ψ. The primary objective is to minimise the maximum number of contentions for any link on the platform. The motivation behind this concept is to relax the requirements for virtual channels as much as possible. The secondary objective is to maximise the schedulability, without increasing the number of necessary virtual channels. Such a mapping method allows to identify the minimum platform characteristics (e.g. the number of virtual channels, the link bandwidths) that are necessary to accommodate a given workload. A mapping method should be used by a system designer, and should ideally provide a mapping M, of the given workload F, to the given platform Ψ, such that the flow-set is schedulable, i.e. WCTT(fi)≤D(fi),∀fi∈F. In cases where this requirement can not be fulfilled, the method should provide information about the service that a given platform can provide to a given workload, e.g. (i) the number of available virtual channels is enough to accommodate only half of the flow-set, or (ii) assuming initial flow sizes the system is not schedulable, however, assuming that each flow has a half of its initial size the system is schedulable. This information is useful for two reasons. First, it gives system designer feedback on how close/far the current configuration is from the one that can accommodate the entire workload and provide real-time guarantees. Consequently the system designer can reconfigure the platform characteristics and repeat the mapping process until finding the configuration which guarantees the fulfilment of all constraints, with as less resources as possible. Second, if the platform is already specified, the designer can decide (i) which least essential functionalities (and their respective flows) should be dropped from the
2.3 NoCs with Priority-Preemptive Arbitration Policies 69 system, such that the constraint on the number of virtual channels is satisfied, and/or (ii) to which sizes should the flows be reduced, such that timing constraints of all flows can be met. Note, that variable flow sizes are in many scenarios acceptable, e.g. [13], and proportional to the provided quality of service. Hence, when mapping such a workload, the system designer might find it more convenient to use a platform where a workload is schedulable with a certain quality (flow sizes), rather than buying a much more expensive platform which will guarantee the best quality (schedulable system with initial flow sizes). This approach also allows to study the effect of different platform characteristics on the provided guarantees and will help to identify the bottlenecks of NoCs in commodity many-cores. Detailed Description of Mapping Method The proposed method consists of three mapping stages: (i) initial phase, (ii) VC minimisation phase and (iii) workload-exploration phase. The initial phase is inspired by the mapping algorithm of dataflow applications on manycore platforms [4], where the objective is to map the set of functionalities Fon the set of cores Πin such a way that heavily communicating functionalities are mapped as close to each other as possible. This strategy should help in reducing contentions and provide a "good" starting point, i.e. initial solution Min, which will undergo further optimisations during subsequent phases. While mapping, the initial phase does not consider flow, nor platform properties (i.e. flow sizes, timing constraints, link bandwidths, available virtual channels). The communicating functionalities are mapped near to each other by using a core selection methodology proposed by Ali et al. [4], that proved to decrease communication overhead and response times of applications. This methodology consists of two main functions, spiralMove and findNearestCore, which are illustrated in Figure 2.21. The first function, spiralMove, defines a fixed spiral path on the platform that is followed while mapping the set of functionalities F. The spiralMove function returns the next core on the spiral path every time it is called, as shown in Figure 2.21(a). The second function, findNearestCore, takes a reference core as an input and starts searching for a free core one hop away from the reference core. If not possible, it searches for a free core two hops away, and so on, until finding a possible core to map the functionality. The search criteria starts by finding the nearest core in this order: North, South, East and West. The first core that the findNearestCore function finds is returned for mapping. Figure 2.21(b) shows the searching regions, classified according to the distance from the reference core. The mapping algorithm of the initial phase (shown in Algorithm 4), starts by sorting the functionalities in a non-increasing order of total number of flows (both sent and received). Then, it picks the functionalities in that order and checks whether they are mapped or not. If the functionality Fiwas already mapped, the algorithm checks the children of Fi(the functionalities that communicate with Fi, either via received or sent flows), and maps them near Fiby using the function findNearestCore. On the other hand, if the picked up functionality was not mapped yet, the algorithm calls the spiralMove function to determine the next free core on the spiral path to map it. Then, it maps its children functionalities using the findNearestCore function in the same way
70 Several Steps Closer to Real-Time NoCs 0 0 123 1 2 3 Current Core Next Corespiral_move (a) spiralMove 0 0 123 1 2 3 3 hop 1 hop 2 hop 4 hop Current Core (b) findNearestCore Figure 2.21: Core selection methodology proposed by Ali et al. [4] Algorithm 4 mapInitialPhase(F,Ψ) Input: set of functionalities F, platform Ψ Output: initial mapping Min 1: Ford ←orderFunctionalities(F);// sort functionalities by the number of flows, non-increasingly 2: for each (Fi∈Ford)do 3: if (Fi.mapped 6=true)then 4: πk←spiralMove();// find the best core for mapping 5: map(Fi,πk); 6: Fi.mapped ←true; 7: end if 8: Fch(i)←findChildFunctionalities(Fi);// find all child functionalities of Fi 9: if (Fch(i)6=/0)then 10: for each (Fj∈Fch(i)) do 11: πm←findNearestCore(Fi); 12: map(Fj,πm); 13: Fj.mapped ←true; 14: end for 15: end if 16: end for 17: return Min; as explained previously. The VC minimisation phase takes the solution of the initial phase Min as an input, and optimises it in such a way that the number of needed virtual channels is minimised. The VC minimisation phase is implemented as a Simulated Annealing (SA) meta-heuristic [50]. The justification for this approach is the fact that the problem of workload mapping is equivalent to the quadratic assignment problem, which is NP-Hard, hence searching for the optimal solution can be
2.3 NoCs with Priority-Preemptive Arbitration Policies 71 Algorithm 5 mapVCMinPhase(F,Ψ,Min) Input: set of functionalities F, platform Ψ, initial solution Min Parameters: tmin – min SA temperature, tmax – max SA temperature, tstep – temperature step, c– iterations in each step, Pw– probability of transitioning from the current state Output: intermediate solution Mmin 1: Mmin ←Min; 2: for (tcurr ←tmax;tcurr >tmin;tcurr ←tcurr −tstep)do 3: it ←0; // number of iterations at the current temperature 4: while (it ≤c)do 5: {Fi,Fj|(Fi∧Fj)∈F,Fi6=Fj}// select two random functionalities Fiand Fj 6: Mcurr ←swap(Mmin,Fi,Fj);// create new solution by swapping the positions of Fiand Fj 7: if (b v(Mcurr)≤b v(Mmin)) then 8: if ((¯v(Mcurr)<¯v(Mmin))∨(rnd() <Pw·tcurr/tmax )) then 9: Mmin ←Mcurr;// new solution accepted 10: end if 11: end if 12: it ←it +1; 13: end while 14: end for 15: return Mmin; prohibitively expensive even for small NoCs [40], e.g. 4×4. Note that the majority of workload mapping methods are also heuristic-based. As the single objective of the VC minimisation phase is to minimise the number of virtual channels, this phase also does not consider flow nor platform properties. This phase is described with Algorithm 5. Through the exploration of the solution space, the algorithm makes a transition from one solution Mmin to another Mcurr with respect to an acceptance test. This test consists of two conditions, of which at least one must be satisfied in order to accept the new solution. These two conditions are: (i) the average number of contentions (computed for all links) of the new solution is less than the average number of contentions of the solution which currently requires the minimal number of virtual channels ¯v(Mcurr)<¯v(Mmin), and (ii) the acceptance probability test function (rnd() <Pw·tcurr/tmax ), where rnd() is a random number from the range [0,1],Pwis the probability of accepting a new solution, while tcurr and tmax are the current and the maximum temperature of the algorithm, respectively. As is visible, the acceptance probability test is a function of tcurr. This means that at high temperatures the algorithm has a higher tendency to accept worse solutions in an attempt to transition to a new solution space where it can find a better solution. As the algorithm temperature cools down, this tendency decreases and the algorithm starts to lock on the best solution in the current neighbourhood. As shown in Algorithm 5, the algorithm starts its iterations by setting the current temperature tcurr to a high value tmax. Then, two functionalities are randomly selected and swapped. Consequently, the rerouting of their respective incoming and outgoing flows is performed. If the number of needed virtual channels for the new solution b v(Mcurr)is less than or equal to the number of virtual channels for the currently best solution b v(Mmin), the new solution is eligible to evaluate
72 Several Steps Closer to Real-Time NoCs its acceptance probability using the acceptance test previously described, otherwise, it is rejected. In cases where the new solution progresses to the acceptance test and subsequently passes, the algorithm accepts the new solution, i.e. Mmin ←Mcurr. Otherwise, the best solution remains the same. The workload-exploration phase is the last phase and its main role is to discover and quantify the guarantees that can be provided for a given workload Fby a given platform Ψ. It takes the output of the VC minimisation phase Mmin as an input, which assures that the starting point is the solution with the minimal number of virtual channels b v(Mmin), and performs the optimisation with the objective to derive a feasible solution Mwe (if possible), assuming specific platform characteristics (i.e. link bandwidth Blink =σf lit δρ+δLand available virtual channels b vlim ≥b v(Mmin)) as well as workload temporal constraints. The workload-exploration phase is also implemented as a SA meta-heuristic, and it should ideally derive a feasible solution Mwe. In cases where it is not possible, the workload-exploration phase investigates to what percentage of initial sizes all flows have to be uniformly reduced, such that the feasibility can be guaranteed, and consequently tries to find a solution where the reduction is the least possible. The workload-exploration phase attempts to maximize the size of all flows b Straversing the NoC, such that flows’ timing constraints are satisfied, and that the number of employed virtual channels does not exceed the limit – b vlim, which represents the number of channels provided by the platform Π. Similar to the VC minimisation phase, this phase is also based on a SA metaheuristic, but with a different goal, which is in this case to find a solution Mwe, such that b S(Mwe) is maximised. This algorithm also makes a transition from one solution to another with respect to an acceptance test. However, the acceptance test of the workload-exploration phase differs in the first condition, where it compares the new and the best values of maximum feasible flow sizes, b S(Mcurr)>b S(Mwe), in order to accept new solutions. As shown in Algorithm 6, the algorithm starts its iterations by setting the current temperature tcurr to a high value tmax. Then, two functionalities Fiand Fjare randomly picked and swapped in order to generate a new solution Mcurr. This also requires the rerouting of incoming and outgoing flows of the remapped functionalities. If the number of needed virtual channels of the new solution b v(Mcurr)exceeds the number of virtual channels provided by the platform b vlim, the new solution Mcurr is rejected. Otherwise, the maximum schedulable flow sizes of the new solution b S(Mcurr) and the best one b S(Mwe)are compared as a part of the acceptance test. These values are calculated by incrementing sizes of all flows of the flow-set uniformly, from zero up to their original sizes, and repeatedly testing whether all flows’ timing constraints are still satisfied. Assuming the mapping M, the value 0 <b S(M)≤1 represents the maximum flow sizes for which the flow-set is still schedulable, where the value of 1 corresponds to the original flow sizes. In cases where the new solution passes the acceptance test, the algorithm accepts the new solution as the best one, i.e. Mwe ←Mcurr. Otherwise, the new solution is discarded. After several iterations, the maximum flow size b S(Mwe)can reach the value of 1. This means that the current mapping Mwe of the set of functionalities Fon the set of cores Πis schedulable with original sizes of all flows, so the mapping process can terminate. Otherwise, if b S(Mwe)is less
2.3 NoCs with Priority-Preemptive Arbitration Policies 73 Algorithm 6 mapWorkloadExplorationPhase(F,Ψ,Mmin) Input: set of functionalities F, platform Ψ, intermediate solution Mmin Parameters: tmin,tmax,tstep,c,Pw,b vlim – number of virtual channels available within the platform Output: final solution Mwe 1: Mwe ←Mmin; 2: for (tcurr ←tmax;tcurr >tmin;tcurr ←tcurr −tstep)do 3: it ←0; // number of iterations at the current temperature 4: while (it ≤c)do 5: {Fi,Fj|(Fi∧Fj)∈F,Fi6=Fj}// select two random functionalities Fiand Fj 6: Mcurr ←swap(Mmin,Fi,Fj);// create new solution by swapping the positions of Fiand Fj 7: if (b v(Mcurr)≤b vlim)then 8: if ((b S(Mcurr)>b S(Mwe))∨(rnd() <Pw·tcurr/tmax )) then 9: Mwe ←Mcurr; 10: if (b S(Mwe) = 1)then 11: return Mwe; 12: end if 13: end if 14: end if 15: it ←it +1; 16: end while 17: end for 18: return Mwe; than 1, this means that the system can guarantee the schedulability, but only assuming that sizes of all flows are uniformly reduced to b S(Mwe), so the mapping process will keep trying to find a better solution in subsequent iterations. 2.3.3.5 Experimental Evaluation In this section, assuming the proposed mapping approach, several tests are performed in order to observe how platform characteristics influence derived schedulability guarantees. Specifically, it is investigated how guarantees change with varying number of virtual channels and link bandwidths. In order to provide a complete and comprehensive study, and cover a wide range of scenarios ranging from lightly to extremely loaded networks, different workloads are generated and consequently analysed. Experimental Setup The analysis parameters are given in Table 2.4, where flow sizes are randomly generated values, assuming a uniform distribution. For each flow a source and a functionalities FSand FDare randomly selected. Experiment 1: Do Virtual Channels Scale? The proposed approach is applicable to the mapping solution Monly if a platform provides at least b v(M)virtual channels, where b v(M)is equal to the maximum number of contentions for any port within the NoC. The objective of this experiment is to test how (un)realistic that
74 Several Steps Closer to Real-Time NoCs Table 2.4: Analysis parameters for Section 2.3.3.5 NoC topology and size 2-D mesh with 10×10 routers Router frequency νρ2 GHz Routing delay δρ3 cycles (1.5 ns) Link traversal delay δL1 cycle (0.5 ns) Link width = flit size σf lit 16 bytes Flow packet size σ(fi),∀fi∈F[32B−32kB]∗bytes Number of functionalities |F|100 requirement is. This is performed as follows. First, for a given workload F, the mapping process is performed until reaching the final solution Mwe, and subsequently the number of needed virtual channels is identified. Then it is observed how the number of needed virtual channels change when the number of flows increases. For that purpose, different workload categories are generated, ranging from 50 to 1000 flows for an entire set of functionalities. Each category consists of 1000 sets of functionalities. For each functionality the mapping is performed (only initial and VC minimisation phases of the proposed approach, which output is the intermediate solution Mmin), and subsequently the minimum number of virtual channels needed to support it – b v(Mmin)is computed. The results are given in Figure 2.22, where a horizontal axis corresponds to the number of flows and a vertical axis stands for the number of virtual channels. The whiskers were set to 25th and 75th percentile. As already known, the NoC architecture is widely accepted due to its scalability potential related to traffic in general, hence an intuitive guess would be that the number of needed virtual channels also scales. Figure 2.22 confirms that assumption with an almost-linear dependency between the number of flows and virtual channels, and also gives a quantitative estimate regarding how many channels are needed for various workloads. In particular, currently available SCC platform, with its 8 virtual channels, can accommodate around 300 flows. On average, an addition of one channel increases the potential of the platform to accept 50 new flows. Recall, that the traditional distinctive-priority approach requires that the number of virtual channels is equal to the number of flows, and notice the reduction achievable with the proposed approach where flows are allowed to dynamically change virtual channels, i.e for 1000 flows the proposed method requires, on average, only 23 channels. The practical implications of these findings are further elaborated in Section 2.3.3.6. Experiment 2: Do Virtual Channels Help? The previous experiment demonstrated that the proposed approach efficiently maps the workload, such that the number of needed virtual channels is minimised to the level beyond any reasonable expectation. This implies that the mapping process evenly distributes the contentions across the entire platform and avoids hotspots. However, as the minimisation of port-contentions (i.e. virtual channels) is the central criteria, this can result in solutions where some flows are forced to traverse long routes, which can in turn have an impact on the schedulability. Conversely, placing highly communicative functionalities close to each other would minimise the flow routes
2.3 NoCs with Priority-Preemptive Arbitration Policies 75 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 0 5 10 15 20 25 Number of virtual channels Number of flows Figure 2.22: Virtual channels do scale with respect to number of flows and might potentially improve the schedulability, but would create hotspots and cause more contentions for some ports. Thus, an intuitive guess would be that the schedulability highly depends on the number of available virtual channels, and the objective of this experiment is to quantify that trade-off, that is, to observe to what degree can the schedulability be improved by employing an additional virtual channel. 3 workload categories are generated, containing 100, 300 and 500 flows with implicit deadlines, i.e. D(fi) = T(fi),∀fi∈F. For each category there are 3 subcategories with the following flow minimum inter-arrival periods: T1∈[1−5]µs,T2∈[2−10]µsand T3∈[5−20]µs. For each subcategory 200 sets of functionalities are generated and consequently mapped. The results are given in Figure 2.23, where a horizontal axis stands for the number of virtual channels provided by the platform – b vlim, and the vertical axis stands for the provided schedulability guarantees, that is, to what percentage of initial sizes all flows have to be uniformly reduced, such that the system is schedulable. A value VCmin corresponds to the number of virtual channels obtained by the VC minimisation phase, i.e. VCmin =b v(Mmin). This experiment reported highly unexpected and unintuitive results, which implies that adding virtual channels might negatively impact the efficiency of the mapping process and produce a solution which is worse than the one obtained with the minimum number of virtual channels b v(Mmin). These surprising results may be related to specific workloads or the consequence of inherent properties of SA meta-heuristic itself. To rule out the former possibility, the experiment was repeated several times, as described above, with very diverse traffic loads. However, the results remained very similar and consistently demonstrated a systematic decrease in schedulability guarantees as the number of virtual channels increased. To rule out the latter possibility, more experimentation is needed, with different heuristic and meta-heuristic approaches. Thus, we can conclude that, when mapping the workload with the aforementioned method, virtual channels are not bottlenecks. This can be interpreted in the following way: minimising virtual channels (contentions) indeed contributes to the schedulability. As this objective tends to distribute the contentions on
82 Several Steps Closer to Real-Time NoCs Tcrit(fi) = S ∀fj∈FD((fi)k∗T(fj)−T(fi),k∈N0∩[0,W(fi)], hereafter referred to as the critical instants. Assuming that a packet is released at the critical instant t∈Tcrit(fi), its worst-case traversal time L(fi,t)(expressed in absolute values) is computed by solving Equation 2.10. L(fi,t) = 1+t+JR(fi)+JN(fi) T(fi)·C(fi)+ ∑ ∀fj∈FD(fi) T(fj)≤t+T(fi)+JR(fj)+JN(fj)+∆ minL(fi,t)+ JR(fj)+JN(fj) T(fj),t+T(fi)+JR(fj)+JN(fj) +∆ T(fj)·C(fj) (2.10) Equation 2.10 consists of the sum of the latencies of all packets of fi, which were released in the interval [0−L(fi,t)], augmented by the interference that the packets of fimay suffer from the packets of other flows. Individual terms are obtained by finding the smaller between (i) the maximum number of releases of an interfering flow within the interval [0−L(fi,t)], and (ii) the maximum number of those releases which deadline falls before, or coincides with L(fi,t). Note, Equation 2.10 is similar to the one Spuri [90] proposed for an EDF-scheduled single-core systems with release jitters. The differences are that this approach considers the maximum clock skew (parameter ∆), two types of jitters and constrained or implicit deadlines. The worst-case traversal time of a packet of the flow fi, released at the critical instant t, denoted by WCTT(fi,t), is computed by subtracting its release tfrom the obtained value L(fi,t). The additional remark is that the result cannot be less than C(fi)(Equation 2.11). WCTT(fi,t) = max{C(fi),L(fi,t)−t}(2.11) Finally, upon obtaining the traversal times for all the critical instants, the worst-case traversal time of a flow fi, denoted by WCT T (fi), can be computed by finding the maximum for all critical instants (Equation 2.12). Of course, both the necessary and sufficient schedulability condition is WCTT(fi)≤D(fi). WCTT(fi) = max{WCT T(fi,t),∀t∈Tcrit(fi)}(2.12) 2.3.4.3 Network Jitter Computation The analysis proposed in the previous section is applicable under the assumption that network jitters of all flows are known in advance. Recall (Equation 2.3), network jitters are the way to model the effects of indirect interferences, and have non-zero values only for those directly competing flows which are involved in the indirect interference relationship (from the perspective of the analysed flow). Thus, it is trivial to see that the network jitter of the analysed flow is always zero, i.e. in Equations 2.9-2.10 JN(fi) = 0. Remember that in the analysis for the fixed-priority model (Section 2.3.1), it is safely assumed that each contending flow that is involved in the indirect interference relationship (from
2.3 NoCs with Priority-Preemptive Arbitration Policies 83 WCTT( f WCTT( WCTT( f f ) )J ) N(f JN(f2 JN(f3) JN( ) 5 f = 0 = 0 3) ) 4 2 4 JN(f1) Figure 2.27: Chain of dependencies for Figure 2.25 the perspective of the analysed flow) experiences the maximum possible jitter, while still being schedulable, i.e. JN(fi) = WCTT(fi)−C(fi). That approach was straightforwardly applicable, because in the fixed-priority model the commutative property applied to preemptions does not hold. In other words, for any two contending flows fiand fjit holds that, if P(fi)>P(fj), then fi can preempt fj, but fjcannot preempt fi. Thus, the existence of fjhas no effect on the analysis of fiand the worst-case traversal time and the jitter can be computed first for fiand then for fj. In fact, by sorting the flows decreasingly by their priorities, and by performing the analysis in that order, the worst-case traversal times and jitters of all flows can be obtained in a single pass. Conversely, in the model with the EDF arbitration policy, the commutative property applied to preemptions may hold, that is, two contending flows fiand fjmay preempt each other. This infers that if the aforementioned approach to compute jitters (JN(fi) = WCTT(fi)−C(fi)) is applied to this model, circular dependencies may occur. This is demonstrated with an illustrative example. Consider the flow-set from Figure 2.25. Moreover, assume that the objective is to compute the worst-case traversal time of the flow f3. It is visible that WCT T(f3)depends on both JN(f2)and JN(f4), which both have non-zero values due to the existence of f1and f5, respectively. Both jitters JN(f2)and JN(f4)depend on the respective worst-case traversal timesWCTT(f2)and WCTT(f4). Furthermore, WCTT(f2)depends on JN(f1)and JN(f3).JN(f1)has a value of zero, because f1 does not have directly competing flows which may cause indirect interference to f2. However, JN(f3)has a non-zero value, due to the existence of f4.JN(f3)depends on WCTT(f3). Notice, that the computation of WCTT(f3)is reached for the second time, which infers that a circular dependency has been encountered. And indeed, by constructing the chain of dependencies for the given example (Figure 2.27), it can be noticed that WCTT(f3)→JN(f2)→WCTT(f2)→JN(f3)→WCT T (f3) and WCTT(f3)→JN(f4)→WCTT(f4)→JN(f3)→WCT T (f3) are circles of dependencies. As discussed above, the commutative property with respect to preemptions may hold for EDF- arbitrated NoCs, and may cause circular dependencies. Therefore, jitters and the worst-case traversal times cannot be straightforwardly computed like in the fixed-priority model. One way to solve this problem in a nested iterative approach, where inner iterations correspond to individual flows,
84 Several Steps Closer to Real-Time NoCs Algorithm 7 isSchedulable(F) Input: flow-set F Output: the information whether Fis schedulable 1: for each (fi∈F)do 2: WCTT(fi)←C(fi);// New WCTT 3: WCTTold(fi)←0; // Old WCTT 4: end for 5: while (∃fi∈F|WCTTold(fi)6=WCTT(fi)) do 6: for each (fi∈F)do 7: WCTTold(fi)←WCT T(fi); 8: WCTT(fi)←compWCT T (fi,F); 9: if (WCT T(fi)>D(fi)) then 10: return false; 11: end if 12: end for 13: end while 14: return true similar to the fixed-priority model, while outer iterations correspond to the entire flow-set. Algorithms 7-8describe how to compute jitters and the worst-case traversal times, in an interleaved fashion. The computation process starts by invoking the function described with Algorithm 7. For each flow fiof the flow-set the previously computed value of the worst-case traversal time WCTTold(fi)and the newly computed value WCT T(fi)are kept. Initially, the computation starts by setting the worst-case traversal time of each flow to its isolation latency (line 2). Then, for each flow, the function described with the Algorithm 8is invoked, which computes the worst-case traversal time of a flow (line 8). While there exists at least one flow for which the new and the old value of the worst-case traversal times are different, the process is repeated (line 5). Finally, when the worst-case traversal times from two successive iterations are equal for every flow, the computation process terminates. That is, the stopping condition is: WCTTold(fi) = WCTT(fi),∀fi∈F. If, at any stage, the computed worst-case traversal time of any flow exceeds its deadline, the entire flow-set is rendered unschedulable (lines 9−11). The computation of the worst-case traversal time of an individual flow is described with Algorithm 8. The algorithm has three stages. The first one generates a list FD(fi), which contains all flows that are directly contending with the analysed flow fi(lines 1−5). Then, for each flow fj∈FD(fi), it is tested whether it has a contending flow fkwhich may indirectly interfere with fi. If at least one such flow exists, the network jitter JN(fj)has a non-zero value and is computed by subtracting the isolation latency of fjfrom its worst-case traversal time (lines 8 −10). Conversely, if there exists no fkwhich can cause indirect interference to fithrough fj, it follows that JN(fj) = 0 (lines 10 −12). Once the jitters of all contending flows are obtained, WCTT(fi)is computed from Equations 2.9-2.12 (lines 15−22).
2.3 NoCs with Priority-Preemptive Arbitration Policies 85 Algorithm 8 compWCT T(fi,F) Input: analysed flow fi, flow-set F Output: the worst-case traversal time WCT T(fi) 1: // 1. Find all flows contending with fi 2: FD(fi)←/0; 3: for each (fj∈F|fj6=fi∧L(fj)∩L(fi)6=/0)do 4: add (FD(fi),fj); 5: end for 6: // 2. Compute jitters of all contending flows 7: for each (fj∈FD(fi)) do 8: if (∃fk∈F|fk6∈ FD(fi)∧L(fk)∩L(fj)6=/0)then 9: JN(fj)←WCTT(fj)−C(fj); 10: else 11: JN(fj)←0; 12: end if 13: end for 14: // 3. Compute the WC traversal time of fi 15: W(fi)←compBusyInterval(fi∪FD(fi)); // Equation 2.9 16: Tcrit(fi)←findCritPts(fi∪FD(fi),W(fi)); // Section 2.3.4.2 17: WCTT(fi)←C(fi); 18: for each (t∈Tcrit(fi)) do 19: L(fi,t)←compAbsTime(fi∪FD(fi),t); // Equation 2.10 20: WCTT(fi)←max{WCT T(fi),L(fi,t)−t};// Equation 2.12 21: end for 22: return WCT T (fi); 2.3.4.4 Discussion In the previous two sections, the method to compute the worst-case traversal times of flows was proposed. This method is applicable to the NoCs with the EDF arbitration policy. Consequently, if it holds that WCT T (fi)≤D(fi),∀fi∈F, then the entire flow-set Fis schedulable. Despite the fact that the worst-case analysis of NoCs is similar to the single-core scheduling theory, there are some differences as well, which have several interesting implications. For instance, Shi and Burns [84] showed that the rate-monotonic priority assignment technique is not optimal in the NoC context where flows have fixed priorities, while the opposite is the well-known fact in the single-core scheduling theory [58]. Similarly, it is well-known that EDF is the optimal scheduling policy for single-core systems [58], so it will be interesting to investigate if there exist cases in the NoC context where the fixed-priority arbitration policy outperforms EDF. The following two case studies further explore these ideas. Case-study 1 (EDF outperforms FP) Consider the example of only two contending flows, with the characteristics given in Table 2.6. Since only two flows are involved, there are no indirect interferences, i.e. both jitters JN(f1)and JN(f2)are zero. Consider the schedulability test for this flow-set, assuming that the priorities have been assigned in the rate-monotonic fashion: T(f1)<T(f2)⇒P(f1)>P(f2).
86 Several Steps Closer to Real-Time NoCs Table 2.6: Flow-set parameters for two contending flows Flow C(f) JR(f) D(f) = T(f) f15 0 10 f26 0 15 WCTT(f1) = C(f1) = 5<D(f1) WCTT(f2) = C(f2)+WCTT(f2)+JR(f1)+JN(f1) T(f1)·C(f1) = 16 >D(f2) The flow f2is unschedulable. Now consider again the schedulability test if the priorities are assigned differently: P(f2)>P(f1). WCTT(f2) = C(f2) = 6<D(f2) WCTT(f1) = C(f1)+WCTT(f1)+JR(f2)+JN(f2) T(f2·C(f2) = 11 >D(f1) In this case, the flow f1is unschedulable. Now, consider the schedulability test of this flow-set assuming the EDF arbitration policy. Since both network jitters JN(f1)and JN(f2)are zero, it is sufficient to only test if the utilisations of their paths L(f1)and L(f2)are less than one. U(f1) = U(f2) = C(f1) T(f1)+C(f2) T(f2)=0.9 As U(f1) = U(f2)<1, the flow-set is schedulable. Case-study 2 (FP outperforms EDF) Consider the example of flows given in Figure 2.28, with the flow characteristics given in Table 2.7. By applying the rate-monotonic priority assignment policy it follows that P(f1)> P(f2)and P(f3)>P(f2), thus, there are again no indirect interferences and jitters. Consider the schedulability test for this example. ρ ρ 4 5 f1f32 f ρ1ρ2ρ3 Figure 2.28: Traffic flows (example 5) WCTT(f1) = C(f1) = 2<D(f1) WCTT(f3) = C(f3) = 2<D(f3)
2.3 NoCs with Priority-Preemptive Arbitration Policies 87 Table 2.7: Flow-set parameters for Figure 2.28 Flow C(f) JR(f) D(f) = T(f) f12 0 6 f23 0 7 f32 0 6 WCTT(f2) = C(f2)+WCTT(f2)+JR(f1)+JN(f1) T(f1)·C(f1)+ +WCTT(f2)+JR(f3)+JN(f3) T(f3)·C(f3) = 11 >D(f2) The flow f2is unschedulable. Now consider the schedulability test for this example when the priorities are assigned differently: P2>P1∧P2>P3. It is easy to see that again indirect interferences do not exist, and hence jitters are equal to zero. WCTT(f2) = C(f2) = 3<D(f2) WCTT(f1) = C(f1)+WCTT(f1)+JR(f2)+JN(f2) T(f2)·C(f2) = 5<D(f1) WCTT(f3) = C(f3)+WCTT(f3)+JR(f2)+JN(f2) T(f2)·C(f2) = 5<D(f3) The flow-set is now schedulable. Finally, consider the schedulability test for the EDF arbitration policy. Notice, that in this case, indirect interferences do exist, i.e. when f1is under analysis, then f3can indirectly interfere, and vice versa. First, consider the busy period for the flow f2. W(f2) = W(f2)+JR(f2)+JN(f2) T(f2)·C(f2)+ W(f2)+JR(f1)+JN(f1) T(f1)·C(f1)+W(f2) +JR(f3)+JN(f3) T(f3)·C(f3)→∞ As the busy period cannot be computed, the flow-set is unschedulable. The same conclusion can be reached by computing the utilisation of L(fj), because U(fj)≈1.095. These two case studies have shown that there are scenarios where the EDF arbitration policy can schedule a flow-set, while no priority assignment exists which can cause the fixed-priority arbitration policy to do the same (the first row in Table 2.8). Similarly, it has been demonstrated that the opposite is true as well, and also the findings of Shi and Burns [84] regarding the existence of a priority-assignment that can schedule the flow-set which is unschedulable with priorities assigned in the rate-monotonic fashion have been confirmed (the second row in the Table 2.8). The case-studies for which the third and the fourth row of Table 2.8 are true are omitted, however, in Section 2.3.4.5 it will be demonstrated that such cases indeed exist. Finally, it is trivial to see that there exist flow-sets for which the fifth and the sixth row are true. This allows to identify the second major difference between the single-core scheduling theory and the worst-case analysis of
88 Several Steps Closer to Real-Time NoCs priority-preemptive NoCs. Although in the former EDF is proven to be optimal [58], in the latter a flow-set can be schedulable with the fixed-priority arbitration policy, but not with EDF (see Case-study 2). Table 2.8: Comparison of approaches (schedulability) EDF Rate-monotonic Exists priority assignment POSSIBLE SCENARIOS 1XX X 2 X X X 3XXX 4 X X X 5X X X 6 X X X 2.3.4.5 Experimental Evaluation Recall, in this dissertation, it is assumed that cores access local routers via a core link and a core port. However, in many cases, the manufacturers identify these elements as bottlenecks, and in order to improve the performance, allow cores to directly access the ports of the local router. This is equivalent to eliminating the first and the last link on the path of each flow. The benefit of this approach is that two flows that are originating from the same core, and going into opposite directions, do not have a common link any more, and thus do not contend with each other. This further implies that the flow between two adjacent cores does not traverse three links, but only one. In this section, it will be assumed that cores can directly access the ports in their respective routers. The reason is that this approach allows to study flow-sets where flow paths consist of a single hop, and in such scenarios the EDF arbitration policy displays some interesting properties, as will be covered later in this section. The evaluation is performed by comparing the proposed analysis for EDF-arbitrated NoCs, in the further text referred to as the EDF method, against the two existing state-of-the-art approaches for FP-arbitrated NoCs [84,85]. In the former, the priorities are assigned in the rate-monotonic fashion. In the latter, the heuristics-based search algorithm (HSA) is used to find a priority ordering, if one exists, such that the flow-set is schedulable. These methods are referred to as the RM method and the HSA method, respectively. Although HSA is based on the heuristics, it has one limitation: if it is unable to find a priority ordering with which the flow-set is schedulable, it will exhaustively enumerate all possible priority orderings. This infers that HSA has a factorial computational complexity (i.e. for flow-sets with |F|flows there exist |F|! different priority orderings), which further implies that HSA can be inapplicable in scenarios where flow-sets consist of 50 or more flows. Thus, in this section, for HSA is imposed the limit on the maximum number of orderings that can be evaluated. Specifically, for the flow-set of |F|flows, HSA is allowed to attempt at most 5· |F|different priority orderings. If HSA fails to find an ordering with which the flow-set is schedulable, the process terminates.
2.3 NoCs with Priority-Preemptive Arbitration Policies 89 Evaluation Metrics and Parameters The comparison of the approaches is performed through the sensitivity analysis with respect to flow sizes. Specifically, if a flow-set is unschedulable with initial flow sizes, then the sizes of all flows are uniformly decreased until the flow-set becomes schedulable. Similarly, if a flowset is schedulable with initial sizes, then the sizes of all flows are uniformly increased until the flow-set becomes unschedulable. The maximum flow sizes for which one method can guarantee the schedulability of a flow-set is called the schedulability threshold (ST). Of course, a higher ST infers that the method is more efficient. Upon obtaining the STs for the same flow-set with all the approaches, the comparison is performed. Let STEDF ,STRM and STHSA be the STs obtained for the EDF method and with the two state-of-the-art methods. The improvements of the proposed approach over the existing ones are measured in the following way: ImpEDF/RM =STEDF −STRM STRM , and ImpEDF/HSA =STEDF −STHSA STHSA . The flow-set and analysis parameters are summarised in Table 2.9, where an asterisk sign denotes a randomly generated value assuming a uniform distribution. Table 2.9: Analysis parameters for Section 2.3.4.5 NoC topology and size 2-D mesh with 8×8 routers Router frequency νρ2 GHz Routing delay δρ3 cycles (1.5 ns) Link traversal delay δL1 cycle (0.5 ns) Link width = flit size σf lit 16 bytes Flow packet size σ(fi),∀fi∈F[1−128]∗kB Flow periods D(fi) = T(fi),∀fi∈F[20−100]∗µs Testing platform Intel dual-core desktop & Java (Max heap-size: 4 GB) Experiment 1: Overall improvements In this experiment, the improvement trends related to flow path lengths are observed. This is done by imposing a constraint that the maximum path length (expressed in hops), of any flow of the flow-set, cannot exceed the value of the newly introduced parameter LIM, i.e. |L(fi)| ≤ LIM,∀fi∈F. The parameter LIM is varied in the range [1−14].LIM =1 means that only single-hop paths are allowed. Conversely, LIM =14 allows all possible paths, because, assuming the XY routing, the maximum path length on a 8 ×8 platform is 14 hops long. For each value of the parameter LIM, 1000 flow-sets are randomly generated, each consisting of 200 flows. For each flow, the initial size and the period are randomly generated, while the source and the destination router were generated in a way that the path length does not exceed the imposed limit LIM. Subsequently, STEDF ,STRM and STHSA are computed for each flow-set, and the obtained values are compared. Figure 2.29 shows the improvements of EDF over RM. It is visible that, for cases where LIM =1, EDF dominates RM. The explanation is as follows. When LIM =1 the transitivity property always holds, and consequently indirect interferences do not exist. This infers that the rules from the uniprocessor scheduling theory also hold in this context: (i) EDF is the optimal
90 Several Steps Closer to Real-Time NoCs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 −30 −20 −10 0 10 20 30 40 Maximum length of flow paths (in hops) Improvements (in %) Figure 2.29: EDF vs RM 1 2 3 4 5 6 7 8 9 10 11 12 13 14 −50 −40 −30 −20 −10 0 10 20 30 Maximum length of flow paths (in hops) Improvements (in %) Figure 2.30: EDF vs HSA policy and hence always outperforms RM, and (ii) RM is optimal among fixed-priority policies. On the rest of the domain (LIM >1), the transitivity property may not hold, which implies that indirect interferences are possible. Thus, as exhibited in Case Studies 1-2, there exist scenarios where EDF outperforms RM, but the opposite is also true. Yet, the cases in which EDF performs better are more frequent, and on average EDF outperforms RM by 7%. As LIM grows, the average improvements also grow, however, the increase is barely noticeable. Figure 2.30 illustrates the improvements of EDF over HSA. It is visible, that for LIM =1, EDF also dominates HSA, in fact, the improvements are the same as in the example with RM. This is expected, because, as stated in the previous paragraph, RM is optimal among fixed-priority policies, and hence it should be HSA = RM. Thus, it can be concluded that EDF presents a very promising approach for systems where flows mostly traverse single-hop distances. On the rest of the domain (LIM >1) HSA significantly outperforms EDF, and as the lengths of flow paths increase, the dominance of HSA becomes more apparent. This is a very counter-intuitive finding and the explanation is as follows. In EDF the commutative property holds, and in order a flow-set to be schedulable, the necessary condition is that the utilisation of the path of each flow is less than or equal to 1. Conversely, in the fixed-priority scheme, the commutative property does not hold, and the flow can be schedulable even though the utilisation of its path is greater than 1 (see Case Study 2). In fact, it can be concluded that, when LIM >1, almost always there exists a priority ordering that can schedule a flow-set which is unschedulable with EDF. This is a crucial finding which suggests that EDF (or any other arbitration policy with dynamically changing flow priorities) may not be the most efficient arbitration technique for flow-sets with arbitrary path lengths. Yet, before this can be discussed, another important question has to be answered: how hard it is to find a priority ordering which will succeed in cases where EDF fails? This is covered in Experiment 2. Assuming that all flows traverse single-hop distances, Figure 2.31 illustrates the improvements of EDF over the optimal fixed-priority scheme (i.e. RM). The same data as in Figures 2.29-2.30 was used, but the focus is on LIM =1 only . It is visible that the average improvements are around 10%, while in some cases can reach up to 30%.
2.3 NoCs with Priority-Preemptive Arbitration Policies 91 0 5 10 15 20 25 30 0 1 2 3 4 5 6 7 8 Improvements (in %) Quantity of flow−sets (in %) Equal Better Figure 2.31: EDF vs RM,HSA (1-hop) Experiment 2: Scalability In this experiment, the objective is to observe how the analysis duration time changes as a function of the flow-set size. In other words, the aim is to investigate how scalable EDF, RM and HSA are. The number of flows constituting the flow-set is varied in the range [100−400], with an incremental step of 50 flows. For each flow-set size 1000 flow-sets are randomly generated. For each flow the initial size, the period, the source and the destination routers are randomly generated, without the maximum path length constraint, i.e. LIM =14. For each flow-set, the time it takes to compute STEDF ,STRM and STHSA is measured. Subsequently, the obtained values are compared. Figure 2.32 demonstrates that the computational complexity of EDF is higher than that of RM. This is expected, because in RM the commutative property does not hold, and hence the worstcase traversal times and the jitters can be obtained in a single pass, if flows are ordered by their priorities, decreasingly. Conversely, in EDF the commutative property holds, and hence several passes are needed until the worst-case traversal times and jitters stabilise for two successive passes (see Section 2.3.4.3 and Algorithms 7-8). In spite of imposing the limit on the maximum number of orderings in HSA to only 5·|F|, its computational complexity significantly surpasses that of EDF and RM, and the duration time of the analysis grows exponentially. This occurs because HSA exhaustively enumerates the maximum allowed number of orderings before eventually rendering the flow-set unschedulable, while RM and EDF reach that conclusion much faster. These findings imply that HSA is the least scalable of the compared approaches, and that searching for STHSA may be prohibitively expensive for flowsets with more than 500 flows. Therefore, it can be concluded that, for massive flow-sets, RM and EDF are preferable options. Experiment 3: Applicability The common underlying assumption of the previous experiments is that the clock skew does not exist, i.e. ∆=0 in Equation 2.10. In this experiment, the objective is to quantify the sensitivity
98 Several Steps Closer to Real-Time NoCs however, note that any conclusion reached for this scheme will also hold for the EDF arbitration policy. Table 2.10: Flow-set parameters for Figure 2.34 (example 1) Flow Priority σ(f) JR(f) D(f) = T(f) f1P(f1)48 B 0 1 µs f2P(f2)<P(f1)48 B 0 1 µs Since only two flows exist, there are no indirect interferences, thus network jitters are equal to zero, i.e. JN(f1) = JN(f2) = 0. f1is the higher-priority flow, so its worst-case traversal time will be the same with both methods: WCTT(f1) = WCT T+(f1) = C(f1) = |L(f1)|·δL+(|L(f1)|− 1)·δρ+σ(f1) σf lit ·δL=14ns However, the worst-case traversal time of f2is different. First, the value will be obtained with the existing analysis. For that, C(f2)is needed. C(f2) = |L(f2)|·δL+(|L(f2)|−1)·δρ+σ(f2) σf lit ·δL=6ns Now, WCT T(f2)can be computed as follows: WCTT(f2) = C(f2)+WCTT(f2)+JR(f1)+JI(f1) T(f1)·C(f1) = 20ns Now, WCT T+(f2)will be obtained. To do so, first I(f1→f2)has to be computed. Recall, that I(f1→f2)denotes the interference that f1causes to f2with a single preemption. The lengths of the relevant sections are: |Lpre−CD 1,2|=3, |LCD 1,2|=1 and |Lpost−CD 1,2|=3 (see Figure 2.34). Remember that the first and the last link of each flow are the core links, which have been omitted from Figure 2.34 for clarity purposes. I(f1→f2) = C(f1)−|Lpre−CD 1,2|·δL−maxn0,|Lpre−CD 1,2|−1o·δρ−|Lpost−CD 1,2|·δL=8ns Now, WCT T+(f2)can be obtained as follows: WCTT+(f2) = C(f2)+WCTT+(f2)+JR(f1)+JN(f1) T(f1)·I(f1→f2) = 14ns It is visible that the worst-case traversal time of f2obtained with the new approach is 14ns, while it was 20ns with the existing method, which is an improvement of 6ns, or in relative terms, an improvement of 30%. Observation 6. The improvements of the proposed approach over the existing one depend on the lengths of the pre-CD, CD and post-CD sections of interfering flows.
2.3 NoCs with Priority-Preemptive Arbitration Policies 99 Consider again the example from Figure 2.34, where P(f1)>P(f2). Assuming that the path of f1is constant, i.e. |L(f1)|=const, from Equations 2.21-2.22 it straightforwardly follows that the improvements in the worst-case traversal time of f2are greater when both |Lpre−CD 1,2|and |Lpost−CD 1,2|are bigger. Since, the interference relationship between f1and f2is possible if and only if a contention between these two flows exist, i.e. |LCD 1,2| ≥ 1, it follows that the necessary condition for the maximum improvements is: |Lpre−CD 1,2|+|Lpost−CD 1,2|=|L(f1)|−1. This is demonstrated with an illustrative example given in Figure 2.36. Consider the same flow characteristics as in the previous example (Table 2.10). If the worst-case traversal times of both flows are computed with both methods, the following results are produced: WCTT(f1) = WCTT+(f1) = 14ns,WCTT(f2) = 24ns and WCTT+(f2) = 20.5ns. When compared with the previous example, it is visible that the improvements in the worst-case traversal time of f2dropped from 6ns to 3.5ns, or expressed relatively, from 30% to less than 15%. f1 2 f pre−CD CD post−CD Figure 2.36: Traffic flows (example 7) Note, a special case occurs when paths of interfering flows entirely overlap, i.e. |Lpre−CD 1,2|= Lpost−CD 1,2|=0, |LCD 1,2|=|L(f1)|. In such scenarios there are no improvements because both approaches return the same values. Observation 7. The improvements of the proposed approach over the existing one depend on the position of the CD section of interfering flows. Consider again the example given in Figure 2.34, where P1>P2. Assuming that the path of f1 and the length of the CD section are constant, i.e. |L(f1)|=const,|LCD 1,2|=const, from Equations 2.21-2.22 it straightforwardly follows that the improvements in the worst-case traversal time of f2are more influenced by the length of the pre-CD than the post-CD section. Thus, a necessary and sufficient condition for maximum improvements is: |Lpre−CD 1,2|=|L(f1)|−1,|LCD 1,2|=1 and |Lpost−CD 1,2|=0. To demonstrate that, consider the example from Figure 2.37, which differs from the example from Observation 5(Figure 2.34) only in the position of the CD section. If the worst-case traversal times for both flows are computed again, assuming the same flow characteristics (Table 2.10), the following values are produced: WCTT(f1) = WCTT+(f1) = 14ns,WCTT(f2) = 20ns and WCTT+(f2) = 12.5ns. When compared with the example from Observation 5, it is visible that the improvements in the worst-case traversal time of f2increased from 6ns to 7.5ns, or expressed relatively, from 30% to 37.5%.
100 Several Steps Closer to Real-Time NoCs f1 2 f pre−CD CD post−CD Figure 2.37: Traffic flows (example 8) Observation 8. The improvements of the proposed approach over the existing one do not depend on flow-sizes. Indeed, from Equations 2.21-2.22 it is visible that only the paths, but not the sizes of the flows influence the improvements. Therefore, with the increase in flow sizes, the worst-case traversal times also grow, but the improvements remain the same in absolute values, and hence report decrease in relative values. If the worst-case traversal times are computed for the example given in Figure 2.34, but this time with bigger flow sizes (Table 2.11), the following results are produced: WCTT(f1) = WCTT+(f1) = 17.5ns,WCTT(f2) = 27ns and WCTT+(f2) = 21ns. Like in the equivalent case for σ(f1) = σ(f2) = 48B, again WCT T (f2)−WCT T+(f2) = 6ns, however, the relative improvements drop from 30% to 22.2%. This implies that, as flow sizes increase, the absolute improvements remain unaffected, however, the relative improvement decrease. In fact, in a hypothetical case with flows of infinitely large sizes, the relative improvements asymptotically converge towards 0%. Table 2.11: Flow-set parameters for Figure 2.34 (example 2) Flow Priority σ(f) JR(f) D(f) = T(f) f1P(f1)160 B 0 1 µs f2P(f2)<P(f1)160 B 0 1 µs 2.3.5.4 Numerical Example In order to get a better insight into how different parameters influence analysis improvements, a small-scale numerical example is used. Consider two contending flows f1and f2, where P1>P2, FD(f2) = {f1}and f1preempts f2only once. The length of the CD section, the sizes, and the paths of the flows are varied parameters. For each particular scenario the worst-case traversal times of f2are computed with both approaches. The objective is to observe the relative improvements, achieved by the proposed method. Figure 2.38 demonstrates the results. In each subfigure, a lower surface covers a corner case where the length of the pre-CD section is equal to zero, i.e. |Lpre−CD 1,2|=0 and |Lpost−CD 1,2|=|L(f1)| − |LCD 1,2|, while the upper surface represents the opposite corner case, i.e. the length of the post-CD section is equal to zero, i.e.
2.3 NoCs with Priority-Preemptive Arbitration Policies 101 (a) |LCD 1,2|=1 (b) |LCD 1,2|=min{5,|L(f1)|} (c) |LCD 1,2|=min{10,|L(f1)|} Figure 2.38: Improvement in the worst-case traversal time of f2, for two contending flows f1and f2, where P(f1)>P(f2),|L(f1)|=|L(f2)|, and f1preempts f2only once |Lpre−CD 1,2|=|L(f1)|−|LCD 1,2|and |Lpost−CD 1,2|=0. The trends in Figure 2.38 entirely coincide with all the conclusions from Observations 5-8. Moreover, it is visible that the improvements are equal to zero in cases where the path of f1entirely belongs to the CD section, i.e. |LCD 1,2|=|L(f1)|, which has already been mentioned in Observation 6. 2.3.5.5 Experimental Evaluation In the previous section, the improvements of the proposed analysis over the existing one were analysed on small-scale illustrative examples consisting of only two flows. In this section, a largescale comprehensive experimental evaluation is performed, with the main objective to quantify the improvements of the new approach over the existing ones, but this time assuming flow-sets with hundreds of flows. This will help us to investigate whether the improvement trends from a smallscale example also hold for large flow-sets, and to what extent. Subsequently, scenarios (flow characteristics) can be identified, for which the proposed improvement reports the best results.
102 Several Steps Closer to Real-Time NoCs Analysis parameters are given in Table 2.123. Note, that again the fixed-priority arbitration policy is assumed, however, any conclusions reached for this scheme also hold in the context of the EDF arbitration policy. Table 2.12: Analysis parameters for Section 2.3.5.5 NoC topology and size 2-D mesh with 8×8 routers Link width = flit size σf lit 16 bytes Router frequency νρ2 GHz Routing delay δρ3 cycles (1.5 ns) Link traversal delay δL1 cycle (0.5 ns) Flow periods D(fi) = T(fi),∀fi∈F[10−100]∗µs Experiment 1: Improvements wrt flow sizes In this experiment, the objective is to investigate how different flow sizes influence the improvements of the proposed method. Several categories of flow-sets are generated, with different flow size ranges: 1B−16B,16B−64B,...,64kB −256kB. For each category 100 flow-sets are generated, where a flow-set consists of 200 flows. The size of each flow is randomly generated, within the limits of the respective flow-set category. Also, for each flow, the priority, the source core and the destination core are randomly generated, where flow paths comply with the XY routing policy. Subsequently, for each flow of the flow-set, the worst-case traversal time is computed with both methods, and the improvements are measured in relative terms. Figure 2.39 shows the results. Since the improvements do not depend on flow sizes (see Observation 8), the absolute improvements of the new method are constant, irrespective of the flow sizes. However, as the increase in the flow size causes a uniform increase in the worst-case traversal times obtained with both methods, the relative improvements of the new approach (yaxis) decrease as the flow sizes increase (x-axis). Another interesting finding is that, irrespective of the flow sizes, there are always flows for which the proposed method does not yield better results. These are the highest-priority flows which do not suffer any interference, hence for them both methods return the same results. Experiment 2: Improvements wrt paths sizes In this experiment, the lengths of flow paths are varied, and subsequently their influence on the improvements are observed. Again, several categories of flow-sets are generated, but this time with different lengths of flow paths: 3 −4,3−6,...,3−16. For each category 100 flow-sets are generated, where a flow-set consists of 200 flows. The priority, the source and destination cores are generated randomly for each flow, but in accordance with the constraint on the maximum path size, posed by the respective category to which the flow-set belongs. Each flow has a size which 3A period of each flow is randomly generated, within the given limits. If a generated flow-set is not schedulable, then periods of all flows are uniformly increased (even beyond the limits) until the flow-set becomes schedulable.
2.3 NoCs with Priority-Preemptive Arbitration Policies 103 1 − 16 16 − 64 64 − 256 256 − 1k 1k − 4k 4k − 16k 16k − 64k 64k − 256k 0 10 20 30 40 50 60 70 80 Flow size (in bytes) Improvement (in %) Figure 2.39: Improvements wrt flow sizes 3 − 4 3 − 6 3 − 8 3 − 10 3 − 12 3 − 14 3 − 16 0 10 20 30 40 50 60 Path size (in hops) Improvement (in %) Figure 2.40: Improvements wrt path sizes is randomly generated in the range [1B−1kB]. The worst-case traversal times of all flows are computed with both methods, and the improvements are measured in relative terms. Figure 2.40 demonstrates that as the paths of the flows increase (x-axis), the relative improvements also increase (y-axis). The explanation is that short paths substantially decrease the number of contentions and interferences, thus decreasing the scenarios in which the new approach can cause improvements. In fact, even in scenarios where contentions do occur, due to short flow paths, CD sections cover large fractions of them, which has a significant impact on the improvements (Observation 6). Conversely, longer paths cause more interferences, but also longer pre-CD and post-CD sections. All these facts have a positive effect on the improvements (see Observation 6). Experiment 3: Improvements wrt flow and path sizes The objective of this experiment is to get a better insight into how both the aforementioned flow characteristics (the flow size and the path size) together influence the improvements of the new method. Different flow-set categoties are generated, where both parameters are varied. Again, each category consists of 100 flow-sets, each with 200 flows with randomly generated priorities, source and destination cores. For each flow the worst-case traversal times are computed with both methods. Subsequently, for each category the average improvements achieved with the new method are computed and expressed in relative terms. Figure 2.41 shows the improvement trends (z-axis) associated with flow sizes (x-axis) and path sizes (y-axis). The improvement trends are identical to those from Experiments 1-2, inferring that the increase in the flow sizes and the decrease in the path sizes both have a negative effect on the relative improvements. This infers that small flows with long paths benefit the most from the proposed approach. Note, that a similar conclusion was reached for a small-scale numerical example with two flows (see Section 2.3.5.4 and Figure 2.38). Experiment 4: Improvements wrt flow-set sizes The emphasis of this experiment is on the flow-set size. In other words, the objective is to investigate how the improvement trends change with the number of flows constituting a flow-set.
104 Several Steps Closer to Real-Time NoCs 3 - 4 3 - 6 3 - 8 3 - 10 3 - 12 3 - 14 3 - 16 1 - 16 32 - 64 128 - 256 512 - 1k 2k - 4k 8k - 16k 32k - 64k 0 5 10 15 20 25 30 35 40 45 Flow size (in bytes) Path size (in hops) Improvement (in %) Figure 2.41: Improvements wrt flow-set sizes 100 150 200 250 300 350 400 450 500 0 10 20 30 40 50 60 Flow−set size Improvement (in %) Figure 2.42: Improvements wrt flow and path sizes Several flow-set categories are generated, where each category has the number of flows equal to one of these values: 100,150,...,500. For each category 100 flow-sets are generated, with random priorities, source and destination cores. Moreover, each flow has a size which is randomly generated in the range [1B−1kB]. Subsequently, for each flow the worst-case traversal times are obtained with both methods, and then compared. The improvements are measured in relative terms. Figure 2.42 demonstrates that as the flow-set size increases, so do the improvements. The explanation is that larger flow-sets have more substantial contentions, which favours the proposed approach. Yet, irrespective of the flow-set size, there always exist the highest-priority flows which do not suffer interference and hence for them no improvements can be achieved. However, as the flow-set size increases, the highest-priority flows constitute smaller and smaller fraction of the entire flow-set, hence for sets with more than 200 flows these cases are below the 25th percentile, and are therefore classified as outliers (depicted with red crosses in Figure 2.42). Experiment 5: Improvements wrt priorities The objective of this experiment is to investigate how the improvement trends change with different flow priorities. 100 flow-sets are generated, each with 200 flows, where priorities, flow sizes, source and destination cores are randomly generated, and flow sizes are in the following range: [1B−1kB]. For each flow, the worst-case traversal times are computed with both methods, and the improvements achieved by the new approach are measured in relative terms. Figure 2.43 confirms that, as flow priorities decrease (bigger numbers on the x-axis), the relative improvements increase (y-axis). This confirms the initial assumption that the new approach does not produce significant improvements for the highest-priority flows, because these flows suffer very little interference (if at all). As flow priorities decrease, the interference that flows suffer becomes more substantial, which favours the proposed approach. Experiment 6: Analysis tightness The objective of this experiment is to investigate the tightness of the obtained upper-bounds on the worst-case traversal times. To achieve this, a single flow-set consisting of 42 flows is
2.3 NoCs with Priority-Preemptive Arbitration Policies 105 1−5 20−25 45−50 70−75 95−100 120−125 145−150 170−175 195−200 0 10 20 30 40 50 60 Priority Improvement (in %) Figure 2.43: Improvements wrt priorities 0 5 10 15 20 25 30 35 40 0 0.5 1 1.5 2 2.5 3 3.5 4 Priority Time (in µs) Worst−case traversal time (old analysis) Worst−case traversal time (new analysis) Worst−case traversal time (measurement) Average−case traversal time (measurement) Best−case traversal time (measurement) Figure 2.44: Analysis tightness generated, and subsequently mapped on a 6 ×6 platform with randomly generated source and destination cores. Each flow has a payload in the range [2−48]flits, and one additional header flit. Moreover, each flow has a period in the range [0.5−9]ms, and a unique priority. The router frequency is 100 MHz. The worst-case traversal times of all flows are computed with both analyses, and also the execution is simulated on a cycle-accurate simulator. The simulated time is 2 hyper-periods4. Subsequently, the analysis estimates are compared with the values obtained via simulations, namely (i) the worst-case, (ii) the average-case and (iii) the best-case. Results are depicted in Figure 2.44. It is visible that for high-priority flows both the analyses provide tight bounds. This is expected, given that these flows suffer very little interference, if at all. With the decrease in the priority (bigger numbers on the x-axis), the differences between the observed values and the analysis results become more noticeable (y-axis), because the analysis pessimism accumulates. Also, notice that the difference between the estimates increases with the decrease in priorities. In fact, in some cases the proposed approach provides significantly tighter estimates, which entirely coincides with the conclusions from the previous experiments, and further motivates this work. However, the results also suggest that there is still room for improvement, and this area remains a potential topic for future work. 2.3.5.6 Discussion In the previous section, the pessimism of the state-of-the-art methods for the worst-case analysis of wormhole-switched priority-preemptive NoCs was identified. Consequently, an improvement was proposed, which overcomes the identified limitations. Through the experimental evaluation, it has been observed that the proposed approach efficiently reduces the pessimism of the existing methods, with respect to direct interference between contending traffic flows. The experiments demonstrate that the proposed approach yields significant improvements in almost all cases, while the greatest pessimism reductions are achieved in scenarios with large flow-sets, where flows have small sizes and traverse long paths. These traffic characteristics correspond to control core-to-core traffic as well as to read requests and write responses in core-to-memory traffic. Given that these 4A hyper-period is the least common multiplier of all flow-periods.
106 Several Steps Closer to Real-Time NoCs traffic types constitute a significant fraction of the entire NoC traffic, the proposed method not only can help to exploit the platform more efficiently and decrease the resource over-provisioning, but also can render many flow-sets schedulable, even though the existing methods classified them as unschedulable. These findings will most likely motivate and elicit further research efforts in the area of the worst-case analysis of wormhole-switched priority-preemptive NoCs, with the main objective to additionally decrease the analysis pessimism, especially in the domain of indirect interferences, which still remains an unexplored topic.
Chapter 3 Limited Migrative Model - LMM In this chapter, a new workload execution paradigm is presented. This approach is called the Limited Migrative Model,LMM hereafter. There are two major differences between LMM and the existing approaches: 1. In LMM, each functionality may be executed on an arbitrary number of cores. The candidate cores for each functionality are selected at design-time, and during runtime the functionality may freely migrate across its respective candidate cores. 2. The release/migration decisions of each functionality are made by the functionality itself, which removes the requirement of a mandatory centralised scheduling entity. That is, the functionality decides on which core it will perform its computation, while a local kernel on that core is responsible to schedule the execution in a single-core fashion. This unique design allows to embrace the positive characteristics of the existing techniques. For example, on each core a local kernel is responsible to schedule the workload, which is a scalable approach, very similar to the systems with the fully-partitioned scheduling. At the same time, each functionality has the possibility to migrate across its candidate cores, which makes the approach flexible, similar to the systems with the global scheduling. So far, LMM appears to be a promising approach for integration of many-cores into the real-time embedded domain, and the research activities presented in the rest of this chapter are motivated with that reasoning. The graphical representation of LMM is given in Figure 3.1, where dotted arrows symbolise candidate cores for each functionality. 3.1 LMM in Detail 3.1.1 Operating System (OS) As already mentioned, the LMM approach has been developed from the assumption that each core has an independent local kernel. A kernel is responsible to schedule the execution on its core, i.e. to organise and arbitrate the computation requests by the functionalities which reside on that 107
114 Limited Migrative Model - LMM times, (iii) query the kernel for the information regarding the next release, (iv) elect the next master, and (v) transfer the context to the new master. Thus, the delay of the protocol execution on the core of the master, denoted by Cη M(ai), can be expressed with Equation 3.1. Cη M(ai) = (|D(ai)|−1)·δ→ P+(|D(ai)|−1)·δ← P+δQ+δE+δ→ C(3.1) Similarly, the delay of the protocol execution on the core of the slave that will not become the next master, denoted by Cη S(ai), can be expressed with Equation 3.2. Cη S(ai) = δ← P+δQ+δ→ P(3.2) Finally, the delay of the protocol execution on the core of the slave that will become the next master, denoted by Cη N(ai), can be expressed with Equation 3.3. Cη N(ai) = δ← P+δQ+δ→ P+δ← C(3.3) Besides the aforementioned terms, in order to compute the total delay of the protocol execution, it is necessary to calculate the delay of the message transfer over the NoC interconnect. However, due to the master volatility, that task is not trivial. This problem is depicted in Figure 3.3, where the master broadcast (the beginning of the protocol) of the same application is captured at two different time instants. Notice that depending on which dispatcher is the current master (emphasised circle), produced messages may traverse entirely different routes. (a) Bottom-left dispatcher is the master (b) Top-right dispatcher is the master Figure 3.3: Agreement protocol messages are master-dependent This problem can be circumvented in the following way. Recall (Equation 2.1) that the traversal delay of each flow (message) fjin isolation is the function of two properties: (i) it’s size σ(fj)and (ii) its path length |L(fj)|. The size of the message is deterministic, but the path is not. Let maxhops(ai)be the maximum distance between any two dispatchers of the application aito which fjbelongs. As maxhops(ai)is an upper-bound on the path length of each protocol message fj, the analysis covers the worst-case by assuming that each fjtraverses that distance, |L(fj)|=maxhops(ai),∀fj∈Fη(ai). With this assumption, the message transfer delay Cη #(ai)can be computed by solving Equation 3.4. In total 2 ·(|D(ai)| − 1)protocol messages are exchanged between the master and all slaves, followed by a context transfer to the new master.
3.3 Agreement Protocols 115 Cη #(ai) = 2·(|D(ai)|−1)·maxhops(ai)·δL+ (maxhops(ai)−1)·δρ+σprt σf lit ·δL+ maxhops(ai)·δL+(maxhops(ai)−1)·δρ+σctx σf lit ·δL(3.4) In Equation 3.4,σprt and σctx denote the size of one protocol message and one context message, respectively. After these terms have been obtained, the total delay of the protocol execution Cη(ai)can be computed by solving Equation 3.5. Notice that because all slaves perform their protocols in parallel, it is sufficient to take into account only one of them (the next master). Cη(ai) = old master delay z}|{ Cη M(ai) + next master delay z}|{ Cη N(ai) + network delay z}|{ Cη #(ai)(3.5) Equation 3.5 represents the delay of the protocol execution of an application in isolation, assuming that it does not suffer any interference from other applications. In order to obtain the worst-case protocol delay, the interference from other applications has to be taken into account. First, consider the interference that any dispatcher, master or slave, may suffer on its core while performing the protocol-related OS operations. The dispatcher may suffer interference from other masters or slaves residing on the same core and performing their agreement protocols. In order to compute the maximum interference that a dispatcher may suffer, Theorem 6is used. Theorem 6. The number of protocol executions of any application aiwithin the time interval t can be at most 1+lt−Dτ+µ(ai) T(ai)m. Proof. Proven by contradiction. Assume that 2+lt−Dτ+µ(ai) T(ai)mprotocol executions occurred within the time interval t. There are lt−Dτ+µ(ai) T(ai)mprotocol executions surrounded by the first and the last and these are refer to as the inner executions. All the inner executions contribute to twith their entire application inter-arrival period T(ai), and therefore require time interval of at least lt−Dτ+µ(ai) T(ai)m·T(ai)where only these can execute. Additionally, assume that εis infinitesimally small but finite value representing the shortest possible duration of the protocol and that the first protocol execution with the duration of εwas delayed as much as possible and hence completed just before the interval of the inner executions started. Finally, the last protocol execution could not start before the joint deadline of the computation and memory accesses – Dτ+µ(ai)expired. ε+t−Dτ+µ(ai) T(ai)·T(ai)+Dτ+µ(ai)≥ε+t−Dτ+µ(ai) T(ai)· T(ai)+Dτ+µ(ai) = ε+t≤t The contradiction has been reached.
116 Limited Migrative Model - LMM The worst-case interference that a dispatcher dj ican suffer on its core within the time interval t, termed Iη(dj i,t)can be computed by solving Equation 3.6. Iη(dj i,t) = ∑ ∀dm k∈Dπ(dj i)|dm k6=dj i1+t−Dτ+µ(ak) T(ak)· Cη M(ak)if dm kis master Cη N(ak)if dm kis slave (next master) Cη S(ak)if dm kis slave (not next master) (3.6) In Equation 3.6 the term π(dj i)represents the core of the dispatcher dj i, while Dπ(dj i)denotes all dispatchers residing on that core. In addition to the on-core interference, when performing its agreement protocol, an application may also suffer the interference within the NoC interconnect, called the network interference. The network interference that the application of interest aisuffers from other applications within the time interval t, denoted by Iη #(ai,t), can be computed by solving Equation 3.7. Iη #(ai,t) = ∑ ∀ak∈A|P(ak)>P(ai)1+t−Dτ+µ(ak) T(ak)·Cη #(ak)(3.7) In other words, it is assumed that the protocol messages of each higher-priority application akwill cause the interference to the protocol messages of ai, irrespective of their potential paths. This indeed is a conservative assumption, however, it is one way to circumvent the problem of non-deterministic message paths caused by the master volatility property. The worst-case protocol delay can be computed by summing up the aforementioned terms. That is expressed with Equation 3.8, where the latest slave interference corresponds to the delay of the slave which was the last to deliver its response to the master. Additionally, the terms t∗ and t+are the sub-intervals of the worst-case protocol delay, and correspond to the time intervals during which the latest slave and the next master can suffer the interference, respectively. Rη(ai) = isolation delay z}|{ Cη(ai) + master interference z }| { Iη(dj i,Rη(ai)) + latest slave interference z }| { Iη(dk i,t∗) + next master interference z }| { Iη(dm i,t+) + network interference z }| { Iη #(ai,Rη(ai)) (3.8) Notice that in Equation 3.8 the first and the last term and master-independent. However, the remaining terms depend not only on the decision which dispatchers perform the roles of the master, the latest slave and the next master of the analysed application ai, but also on the roles that dispatchers of other applications perform during the analysed period. Thus, in order to solve Equation 3.8 it is necessary to identify roles of all dispatchers that will lead to the worst-case (the biggest protocol delay). Algorithm 10 demonstrates how to identify individual dispatcher roles on the core of the analysed dispatcher, which will lead to its worst-case interference within the time interval t. The value
3.3 Agreement Protocols 117 Algorithm 10 maxDispIn f (dj i,isMaster,t) Input: analysed dispatcher dj i, boolean variable isMaster, time interval of interest t Output: worst-case interference of dj iwithin t 1: DM←/0; // initialise set of on-core masters 2: DS←/0; // initialise set of on-core slaves 3: if (isMaster)then 4: DM←DMS{dj i}; 5: else 6: DS←DSS{dj i}; 7: end if 8: for each (dm k∈Dπ(dj i)|dm k6=dj i)do 9: if (|DM|<b M)then 10: DM←DMS{dm k};// add dispatcher to the list of masters 11: master(dm k)←true; 12: else 13: // find master which causes the minimum interference 14: minMasterDelay ←0; 15: for each (dp n∈DM|dp n6=dj i)do 16: currMasterDelay ←Iη(dp n,t);// Equation 3.6 17: if (currMasterDelay <minMasterDelay)then 18: minMasterDelay ←currMasterDelay; 19: minMaster ←dp n; 20: end if 21: end for 22: if (Iη(dm k,t)>minMasterDelay)then 23: DM←DM\ {minMaster};// remove the minimum from current masters 24: master(minMaster)←f alse; 25: DS←DSS{minMaster};// add the minimum to current slaves 26: DM←DMS{dm k};// add dispatcher to current masters 27: master(dm k)←true; 28: else 29: DS←DSS{dm k};// add dispatcher to current slaves 30: end if 31: end if 32: end for 33: // all roles assigned so compute maximum interference 34: maxDispIn f ←0; 35: for each (dm k∈Dπ(dj i)|dm k6=dj i)do 36: maxDispIn f ←maxDispIn f +Iη(dm k,t);// Equation 3.6 37: end for 38: return maxDispIn f ;
118 Limited Migrative Model - LMM b Mdenotes the maximum number of concurrent masters on a single core, and it is assumed that this value has already been specified. Algorithm 10 works as follows. First the lists of on-core masters and slaves are initialised (lines 1−2). Then, if the analysed dispatcher dj iis the master, it is added to the list of masters (line 4). Otherwise, it is added to the list of slaves (line 6). After that, each dispatcher dm kthat shares the core with dj iis considered for assignment to one of the aforementioned lists. If the current number of assigned masters is less than the maximum, dm kis added to the list of masters (lines 10−11). Otherwise, the master dispatcher which causes the minimum interference is identified (lines 14− 21). If the interference caused by the current dispatcher dm kis greater than the interference caused by the identified minMaster, then minMaster is transferred to the list of slaves, while dm kis added to the list of masters (lines 23−27). Otherwise, dm kis added to the list of slaves (line 29). This process is repeated for every dispatcher. After the lists of masters and slaves have been populated with all on-core dispatchers, the worst-case interference is computed (lines 34−37) and returned (line 38). Algorithm 10 demonstrates how to identify on-core master and slave dispatchers of other applications which lead to the worst-case delay to the analysed dispatcher within the observed time interval. However, in order to compute the worst-case protocol delay, it is necessary to also identify dispatcher roles for the application under analysis. For that Algorithm 11 is used. Algorithm 11 is divided into 4 parts. First, the master of the analysed application is identified (lines 4−11) in the following way. For each dispatcher dj i, the maximum interference that it can suffer within the observed interval is computed. That value is obtained by invoking previously described Algorithm 10 (line 7). The dispatcher with the maximum interference is identified, and assigned the master role (line 9). Then, the latest slave of the analysed application is identified in a similar way (lines 12−23). The process is slightly more complex than identifying the master, because the latest slave can suffer the interference only during t∗, which is a sub-interval of the entire worst-case protocol delay. For each dispatcher dk ithat is not the master, the analysed interval t∗is initially computed for the minimal value – δ← P+δQ+δ→ P(line 18). It is obtained by invoking Algorithm 10. After the new value of t∗is obtained, it is fed back into the computation as the input. The process is repeated until the fixed converging point is reached. The stopping condition is the same value of t∗for two consecutive iterations (line 19). The process is repeated for every dispatcher, until the one with the biggest interval t∗is identified and assigned the latest slave role (line 21). After that, the next master is identified (24 −35). Notice that it can also be the latest slave, thus the same dispatcher may be identified for both roles. The computation process is very similar to the previous one. The only difference is that the analysed interval t+is initially computed for the minimal value, which represents a single OS operation – receiving the execution context (line 30). Again, the stopping condition is that the value of t+has the same value for two successive iterations (line 31). Of all slave dispatchers, the one with the biggest interval t+is identified and assigned the next master role (line 33).
3.3 Agreement Protocols 119 Algorithm 11 compWorstCaseDelay(ai,A) Input: application ai, application-set A Output: worst-case protocol delay of ai 1: Rη(ai)←0; // initialise the worst-case protocol delay 2: repeat 3: Rη old(ai)←Rη(ai); 4: // 1. identify the master 5: maxMasterIn f ←0; 6: for each (dk i∈D(ai)) do 7: currMasterIn f ←maxDispIn f (dk i,true,Rη old(ai));// Algorithm 10 and Equation 3.6 8: if (currMasterIn f >maxMasterIn f )then 9: maxMasterIn f ←currMasterIn f ;master ←dj i; 10: end if 11: end for 12: // 2. identify the latest slave 13: maxSlaveIn f ←0; 14: for each (dk i∈D(ai)|dk i6=master)do 15: t∗←0; 16: repeat 17: t∗ old ←t∗; 18: t∗←maxDispIn f (dk i,f alse,t∗ old +δ← P+δQ+δ→ P);// Algorithm 10 and Equation 3.6 19: until (t∗ old =t∗); 20: if (t∗>maxSlaveIn f )then 21: latestSlave ←dj i;maxSlaveIn f ←t∗; 22: end if 23: end for 24: // 3. identify the next master 25: maxNextMasterIn f ←0; 26: for each (dk i∈D(ai)|dk i6=master)do 27: t+←0; 28: repeat 29: t+ old ←t+; 30: t+←maxDispIn f (dk i,f alse,t+ old +δ← C);// Algorithm 10 and Equation 3.6 31: until (t+ old =t+); 32: if (t+>maxNextMasterIn f )then 33: nextMaster ←dj i;maxNextMasterIn f ←t+; 34: end if 35: end for 36: // 4. compute the worst-case protocol delay; 37: iso ←Cη(ai);// compute isolation delay (Equation 3.5) 38: netIn f ←Iη #(ai,Rη old(ai));// compute network interference (Equation 3.7) 39: Rη(ai)←iso +netIn f +maxMasterIn f +maxSlaveIn f +maxNextMasterIn f ;// Equation 3.8 40: until (Rη old(ai) = Rη(ai)); 41: return Rη(ai);
120 Limited Migrative Model - LMM Finally, the worst-case protocol delay can be computed. As shown in Equation 3.8, it consists of five components: (i) the isolation delay, (ii) the master interference, (iii) the latest slave interference, (iv) the next master interference, and (v) the network interference. In previous steps the second, the third and the fourth component were obtained. Thus, the remaining components are obtained by solving Equations 3.5 and Equation 3.7 (lines 37−38). The worst-case protocol delay is equal to the sum of these terms (line 39 and Equation 3.8). Similarly to intervals t∗and t+, the worst-case protocol delay Rη(ai)is also computed iteratively, until the computed value is the same in two successive iterations. The schedulability condition is that the obtained value is less than or equal to the communication deadline, i.e. Rη(ai)≤Dη(ai). 3.3.1.3 Discussion The decision made on the core of the master dispatcher is based on the information received from every individual slave. However, in the moment when the master makes a decision, there are no guarantees that the state of the system on the core of each slave is still identical to the one made during the individual observations. One extreme, yet possible scenario occurs when one slave gives a positive reply to its master regarding the next job execution on its core. Additionally, some other dispatchers from the same core might have also sent positive replies to their respective masters during their protocol executions. As a result, multiple applications might elect dispatchers from that particular core for the next masters, and hence overload the core, which inevitably leads towards missed deadlines. Therefore, the race condition is identified as the greatest flaw of this protocol. The performance of the protocol will receive additional attention in Section 3.3.4. 3.3.2 List Protocol 3.3.2.1 Protocol Description In this protocol, dispatchers form a singly linked list, and each dispatcher knows its successor, termed nextDisp. The dispatcher behaviour under this protocol is illustrated with Algorithm 12. Within every inter-arrival period of application, after its computation and memory access deadlines expire, the agreement protocol begins. At that time instant, the master initiates the protocol by getting the information regarding the next job release from its kernel (line 5). If the kernel provides a positive reply, nothing changes; the master requests the next job release from the kernel (line 8), and waits for the time instant to start the next protocol (line 4). In cases when the kernel provides a negative reply, the master sends the message to its successor dispatcher (line 10). When that dispatcher receives the message (line 17), it requests the information regarding the next job release from its kernel (line 18). If the kernel does not allow a new job release, the dispatcher sends the message to its successor dispatcher (line 25). This process continues until the kernel of one dispatcher provides a positive reply. That dispatcher will become the next master. Therefore, it informs the old master about the outcome by requesting the execution context (line 20), and waits for the context to be transferred (line 21). The old master
3.3 Agreement Protocols 121 sends the context (line 12), and demotes itself to the slave role (line 13). After receiving the context, the new master claims the master role (line 22), and requests the next job release from its kernel (line 23). Algorithm 12 run() 1: while (true)do 2: if (isMaster =true)then 3: // dispatcher is master 4: wait(startTime);// wait for the time instant to start protocol 5: getNextReleaseIn f o(); 6: if (canReleaseDe f erredJob() = true)then 7: // master remains the same 8: releaseDe f erredJob(); 9: else 10: sendMsg(nextDisp);// send a message to the successor dispatcher 11: wait(ctxReqRcvd); 12: sendCtx(nextMaster);// master changes (migration occurs) 13: isMaster ←f alse; 14: end if 15: else 16: // dispatcher is slave 17: wait(msgRcvd); 18: getNextReleaseIn f o(); 19: if (canReleaseDe f erredJob() = true)then 20: sendCtxReq(master);// send a context request to the master 21: wait(ctxRcvd); 22: isMaster ←true;// master changes (migration occurs) 23: releaseDe f erredJob(); 24: else 25: sendMsg(nextDisp);// send a message to the successor dispatcher 26: end if 27: end if 28: end while 3.3.2.2 Timing Analysis The worst-case scenario occurs when only the last dispatcher of the list is granted the permission to release the next job, and that case has to be considered when performing the analysis. Providing guarantees that, at any time instant, at least one of the dispatchers will be able to accommodate the next job on its core falls into the domain of the schedulability analysis, and that topic will receive additional attention in Section 3.8. During this protocol, in the worst-case the master can perform the following OS operations: (i) query the kernel for the information regarding the next release, (ii) send the protocol message, (iii) receive the context request, and (iv) transfer the context to the next master. Thus, the delay
122 Limited Migrative Model - LMM of the protocol execution on the core of the master, denoted by Cη M(ai), can be expressed with Equation 3.9. Cη M(ai) = δQ+δ→ P+δ← P+δ→ C(3.9) Similarly, the delay of the protocol execution on the core of the slave that will not become the next master, denoted by Cη S(ai), can be expressed with Equation 3.10. Cη S(ai) = δ← P+δQ+δ→ P(3.10) The delay of the protocol execution on the core of the slave that will become the next master, denoted by Cη N(ai), can be expressed with Equation 3.11. Cη N(ai) = δ← P+δQ+δ→ P+δ← C(3.11) The message transfer delay Cη #(ai)can be computed by solving Equation 3.12. In total |D(ai)| protocol messages are exchanged when traversing the singly linked list of dispatchers, followed by a context transfer to the new master. Cη #(ai) = |D(ai)|·maxhops(ai)·δL+(maxhops(ai)−1)·δρ+σprt σf lit ·δL+ maxhops(ai)·δL+(maxhops(ai)−1)·δρ+σctx σf lit ·δL(3.12) After these terms have been obtained, the total delay of the protocol execution Cη(ai)can be computed by solving Equation 3.13. Notice that in this protocol the slaves perform their protocolrelated OS operations sequentially, and therefore all of them have to be taken into account when computing the total protocol delay. Cη(ai) = old master delay z}|{ Cη M(ai) + delay of all slaves except next master z }| { (|D(ai)|−2)·Cη S(ai) + next master delay z}|{ Cη N(ai) + network delay z}|{ Cη #(ai) (3.13) Equation 3.13 represents the delay of the protocol execution of an application in isolation, assuming that it does not suffer any interference from other applications. In order to obtain the worst-case protocol delay, the interference from other applications has to be taken into account. The interference that any dispatcher, master or slave, may suffer while performing its protocolrelated OS operations within the time interval t, termed Iη(dj i,t), has already been computed for the Master-Slave protocol (Equation 3.6). Since this term is protocol-independent, it can be reused in this context. The same holds for the network interference that an application might suffer on the NoC within the time interval t, denoted by Iη #(ai,t)(Equation 3.7).
3.3 Agreement Protocols 123 After all the relevant terms have been identified, the worst-case protocol delay can be computed by solving Equation 3.14. Rη(ai) = isolation delay z}|{ Cη(ai) + master interference z }| { Iη(dj i,Rη(ai)) + all slaves interference z }| { ∑ ∀dk i∈D(ai)|dk i6=dj i Iη(dk i,t∗)+ next master interference z }| { Iη(dm i,t+) + network interference z }| { Iη #(ai,Rη(ai)) (3.14) The term t∗corresponds to the individual time interval during which each slave suffers the interference, while t+represents an additional interval during which the next master suffers the interference when receiving the context. Of course, both t∗and t+are the sub-intervals of Rη(ai). Notice that in Equation 3.14 the first and the last term and master-independent. However, the remaining terms depend not only on the decision which dispatchers of the analysed application aiperform the roles of the old and the new master, but also on the roles that dispatchers of other applications perform during the analysed period. Thus, like in the previous case, in order to solve Equation 3.14 it is necessary to identify roles of all dispatchers that will lead to the worst-case (the biggest protocol delay). Algorithm 10 was introduced before, and it was used to compute the maximum interference that an individual dispatcher might suffer during the time interval t, due to the other on-core dispatchers. Since that algorithm is protocol-independent, it will also be reused in this context. Therefore, the only remaining activity is to identify the dispatcher roles for the application under analysis. For that, Algorithm 13 is used. Algorithm 13 is divided into 4 parts. First, the master of the analysed application is identified (lines 4−11). This process is identical to the process of identifying the master for the Master-Slave protocol. Then, the joint interference suffered by all slaves of the analysed application is computed (lines 12 −21). Each slave can suffer the interference only during its individual interval t∗. This term represents an interval during which the slave performs its protocol-related OS operations, and it is the sub-interval of the entire worst-case protocol delay. For each dispatcher dk ithat is not the master, the analysed interval t∗is initially computed for the minimal value – δ← P+δQ+δ→ P(line 18). It is obtained by invoking Algorithm 10. After the new value of t∗is computed, it is fed back into the computation as the input. The process is repeated until the fixed converging point is reached. The stopping condition is the same value of t∗for two consecutive iterations (line 19). The process is repeated for every slave dispatcher, and the obtained values of t∗are summed up (line 20). The summation corresponds to the maximum interference that all slaves might suffer during the protocol execution. After that, the next master is identified (22 −33). This process is identical to the process of identifying the next master of the Master-Slave protocol.