Actor-Oriented Programming for Resource Constrained Multiprocessor Networks on Chip
Total Page:16
File Type:pdf, Size:1020Kb
Actor-Oriented Programming for Resource Constrained Multiprocessor Networks on Chip Gary J. Plumbridge PhD University of York Computer Science August 2015 for Ellie Abstract Multiprocessor Networks on Chip (MPNoCs) are an attractive architecture for inte- grated circuits as they can benefit from the improved performance of ever smaller tran- sistors but are not severely constrained by the poor performance of global on-chip wires. As the number of processors increases it becomes ever more expensive to provide co- herent shared memory but this is a foundational assumption of thread-level parallelism. Threaded models of concurrency cannot efficiently address architectures where shared memory is not coherent or does not exist. In this thesis an extended actor oriented programming model is proposed to en- able the design of complex and general purpose software for highly parallel and de- centralised multiprocessor architectures. This model requires the encapsulation of an execution context and state into isolated Machines which may only initiate communica- tion with one another via explicitly named channels. An emphasis on message passing and strong isolation of computation encourages application structures that are congru- ent with the nature of non-shared memory multiprocessors, and the model also avoids creating dependences on specific hardware topologies. A realisation of the model called Machine Java is presented to demonstrate the ap- plicability of the model to a general purpose programming language. Applications designed with this framework are shown to be capable of scaling to large numbers of processors and remain independent of the hardware targets. Through the use of an efficient compilation technique, Machine Java is demonstrated to be portable across sev- eral architectures and viable even in the highly constrained context of an FPGA hosted MPNoC. 3 Contents Abstract 3 List of figures 9 List of tables 13 Acknowledgements 17 Declaration 19 1 Introduction 21 1.1 The Path to Networks-on-Chip . 22 1.2 Multiprocessor Shared Memory . 24 1.3 Challenges for Programming MPNoCs . 25 1.4 The Actor Model . 26 1.5 Thesis Hypothesis and Research Objectives . 28 1.5.1 Hypothesis . 29 1.5.2 Research Objectives . 29 1.5.3 Thesis Contributions . 30 1.6 Thesis Structure . 30 2 Background 33 2.1 Multiprocessor Networks on Chip . 33 2.2 Embedded System Design . 35 2.3 Programming MPNoCs . 38 2.3.1 Hardware-Specific Approaches . 40 2.3.2 General Purpose Communication-Centric Programming . 44 2.3.3 Summary . 46 5 Contents 2.4 Actor-Oriented Design and Programming . 46 2.4.1 Actor-Oriented Frameworks . 48 2.5 Java......................................... 51 2.5.1 Java in Resource Constrained Contexts . 52 2.5.2 Java in Hardware . 53 2.6 Summary . 54 3 Machine Abstract Architecture 57 3.1 Machine Abstract Architecture . 60 3.1.1 Systems . 60 3.2 Application Model . 61 3.2.1 Machines . 67 3.2.2 Timing, Scheduling and Synchronisation . 70 3.2.3 Intramachine Timing and Scheduling . 71 3.2.4 Creating Machines . 75 3.2.5 Communications . 76 3.2.6 Dynamic Synthesis and Communication . 95 3.2.7 Resource Usage . 107 3.3 Platform Model . 107 3.3.1 Processors . 110 3.3.2 Resources . 112 3.3.3 Communications Resources . 114 3.3.4 Making Use of the Platform . 116 3.3.5 A Platform API . 117 3.3.6 Realisation of the Platform API . 118 3.4 Frameworks and Runtime Behaviour . 119 3.4.1 Processor Managers . 120 3.5 Realisation of the Application Model . 121 3.5.1 Requirements for Programming Languages . 122 3.6 Summary . 125 4 Machine Java 127 4.1 Java......................................... 129 4.2 Machine Java . 130 6 Contents 4.3 Machine Oriented Programming . 131 4.3.1 Single-Thread Equivalence . 134 4.3.2 Machine Classes . 135 4.3.3 Machine Class Restrictions . 140 4.3.4 Machine Life Cycle . 144 4.3.5 Machine End-of-Life . 147 4.4 Platform Agnostic Framework . 150 4.4.1 Communications Channels . 150 4.4.2 Implementing Channel Protocols . 160 4.4.3 Spontaneous Event Sources . 168 4.4.4 Processor Managers . 169 4.5 Platform API . 174 4.5.1 Platform Classes . 176 4.5.2 Processors . 178 4.5.3 Resources . 179 4.5.4 Communications . 179 4.5.5 The XYNetwork Platform . 180 4.6 Implementation in Standard Java . 184 4.6.1 Starting the Machine Java Framework . 184 4.6.2 Machine Instance Identification . 186 4.6.3 Machine Creation and Channel Addressing . 186 4.6.4 Machine Isolation and Communication . 189 4.7 Implementation on Bare-Metal Hardware . 190 4.7.1 Compilation Strategy . 193 4.7.2 Language Runtime . 204 4.7.3 Network Runtime . 213 4.8 Summary . 221 5 Evaluation 223 5.1 Overview . 224 5.2 Hardware Evaluation Platform . 226 5.2.1 The Blueshell NoC Generator . 226 5.2.2 Evaluation Platform Specification . 230 5.3 Programming with Machine Java . 232 7 Contents 5.3.1 Defining, Extracting and Fixing Application Structure . 233 5.3.2 Application Platform Independence . 246 5.3.3 Complex and Dynamic Application Structures . 249 5.3.4 Concurrency Without Sharing . 254 5.3.5 Fault Tolerance in Machine Java . 262 5.4 Overheads and Scaling . 265 5.4.1 Static Memory Consumption . 265 5.4.2 Experimental Methodology . 276 5.4.3 Communications Overheads . 284 5.4.4 Computation Performance . 298 5.5 Summary . 306 6 Conclusion 309 6.1 Revisiting the Hypothesis . 309 6.2 Thesis Contributions . 311 6.2.1 Machine-Oriented Programming Model . 311 6.2.2 Machine Java Framework . 312 6.2.3 Chi Optimising Java Compiler . 313 6.2.4 An Empirical Evaluation of Machine-Oriented Programming . 313 6.3 Future Work . 314 6.3.1 Exploitation of Extracted Application and Platform Information . 314 6.3.2 Garbage Collecting Machines . 314 6.3.3 Relocating Active Machines . 315 6.3.4 Communications Performance Improvements . 316 6.3.5 Multiple Applications . 317 6.4 Epilogue . 318 A Machine Java API Class Examples 319 A.1 RemoteProcedureCall.java . 320 A.2 Period.java . 325 B Water Tank Level Control Application 327 B.1 FlowController . 327 B.2 RefillPump . 328 B.3 LevelSensor . 329 8 Contents B.4 EmergencyValve . 331 B.5 UnreliableSensor . 332 C Microbenchmark Source Code 333 C.1 SpeedTest . 333 C.1.1 SpeedTest.java . ..