36
6 Example Architectures In this chapter, seven example processor architectures that implement several of the techniques presented in Chapters 3, 4, and 5, are described. In sections 6.1 to 6.4 single-core processors are discussed, some of these are multithreaded cores. Sections 6.5 to 6.7 focus on multicore architectures for hard real-time systems. 6.1. The multithreaded processor Komodo The Komodo processor core executes Java applications natively, i.e. the Java bytecode instructions are executed by the processor directly. This means that no additional software layer is required between the Java application and the processor core such as an operating system or a software Java virtual machine (JVM). This circumstance itself dramatically increases the real-time capability and predictability of a Java system. If a JVM and an operating system is applied, these systems must be analyzed together with the application and the processor, resulting in a higher inaccuracy of a static analysis. Other Java processors, especially for embedded systems, are the SHAP processor [ZAB 09] from University of Dresden, the aJile [AJI 00] from aJile Systems Inc., the PicoJava [HAN 99] from Sun Microsystems (now Oracle Corporation) and the Java Optimized Processor (JOP, see section 6.2). The decision to develop a multithreaded Java core was based on the idea of handling multiple events simultaneously. The so-called interrupt service threads are responsible for the event handling. In contrast to standard interrupt-based event handling, which is only able to process one event at a Time-Predictable Architectures Edited by Christine Rochange, Sascha Uhrig and Pascal Sainrat © ISTE Ltd . Published by ISTE Ltd . , 2014 and John Wiley & Sons, Inc

Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

  • Upload
    pascal

  • View
    216

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

6

Example Architectures

In this chapter, seven example processor architectures that implement several of the techniquespresented in Chapters 3, 4, and 5, are described. In sections 6.1 to 6.4 single-core processorsare discussed, some of these are multithreaded cores. Sections 6.5 to 6.7 focus on multicorearchitectures for hard real-time systems.

6.1. The multithreaded processor Komodo

The Komodo processor core executes Java applications natively, i.e. theJava bytecode instructions are executed by the processor directly. This meansthat no additional software layer is required between the Java application andthe processor core such as an operating system or a software Java virtualmachine (JVM). This circumstance itself dramatically increases the real-timecapability and predictability of a Java system. If a JVM and an operatingsystem is applied, these systems must be analyzed together with theapplication and the processor, resulting in a higher inaccuracy of a staticanalysis.

Other Java processors, especially for embedded systems, are the SHAPprocessor [ZAB 09] from University of Dresden, the aJile [AJI 00] from aJileSystems Inc., the PicoJava [HAN 99] from Sun Microsystems (now OracleCorporation) and the Java Optimized Processor (JOP, see section 6.2).

The decision to develop a multithreaded Java core was based on the ideaof handling multiple events simultaneously. The so-called interrupt servicethreads are responsible for the event handling. In contrast to standardinterrupt-based event handling, which is only able to process one event at a

Time-Predictable ArchitecturesEdited by Christine Rochange, Sascha Uhrig and Pascal Sainrat© ISTE Ltd . Published by ISTE Ltd .

,

2014 and John Wiley & Sons, Inc

Page 2: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

128 Time-Predictable Architectures

time, service threads are executed in an overlapped parallel way in thehardware thread slots of a multithreaded processor. Hence, multiple differentevents can be handled, each one by its own service thread in its own threadslot. Of course, the number of simultaneously handled events is restricted bythe number of hardware thread slots.

Assuming that the handled events must fulfill real-time requirements, theexecution of the hardware threads must be scheduled in a real-time capableway. Hence, one of the key features of the Komodo processor core is theintegrated real-time scheduling. The following sections describe the basicKomodo architecture as well as the integrated scheduling techniques.

In addition to the simultaneous event handling, the multithreadedarchitecture of Komodo allows the implementation of a special real-timecapable garbage collection. The garbage collection is executed within its ownhardware thread slot in parallel to the application threads. Hence, nostop-the-world behavior as known from other garbage collection techniquesoccurs. A detailed description of the parallel Komodo garbage collection ispresented by Fuhrmann and Pfeffer [FUH 01].

6.1.1. The Komodo architecture

The processor core (see Figure 6.1) contains a multithreaded five-stagepipeline (instruction fetch, instruction decode, operand fetch, execute and thestack cache) [UHR 07a]. The integrated real-time scheduler (prioritymanager) shown in the figure is responsible for a real-time capable threadschedule if the core is used in real-time applications.

Most of the Java integer as well as several long, float and double bytecodesare executed directly in hardware, mostly within a single execution cycle.Instructions with medium complexity are implemented by microcodes and thecomplex operations, such as new, athrow, monitorenter and most floatingpoint instructions, call trap routines. As operand stack, a 2k-entry stack cacheis integrated within the pipeline that is shared between the hardware threadslots. During the initialization phase, different portions of the stack cache canbe assigned to the thread slots so that one thread works entirely in the stackcache while the data of other threads have to be swapped in and out. As anexample, the garbage collection should run without swapping due to acontinuous progress without any additional and avoidable memory accesses

Page 3: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 129

for swapping. Because of the required predictability, real-time threads shouldalso run without swapping.

Figure 6.1. Block diagram of the multithreaded Komodo core

Each thread slot possesses an instruction window (IW) into which up to sixbytecodes can be prefetched. These IWs decouple the fetching and decodingof the bytecodes.

While the fetch process is driven by the fill level of the IWs, the decoding istriggered by a real-time scheduling scheme that delivers a scheduling decisionon a cycle-by-cycle basis. The backend of the pipeline is designed in a waythat allows context switches in the granularity of clock cycles. The executionof microcodes in particular requires the replication of the microcode sequencecounter. In addition, all internal pipeline status indicators such as the overflowbit of the execution unit are replicated.

Memory accesses are executed by the Komodo research prototype with ahigher clock frequency for the memory than for the pipeline. This techniqueenables the pipeline to access the memory in a single pipeline cycle leading toan exactly predictable access timing. In addition, memory accesses fromdifferent threads cannot compete for the memory. The factor of theoverclocking depends on the type of memory that is applied: if a static

Page 4: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

130 Time-Predictable Architectures

random access memory (RAM) is used, a factor of two is sufficient; applyinga dynamic RAM requires a higher factor.

Evaluations [KRE 00a] have shown that the competition of instructionfetches and data memory accesses is not an issue. Because of the data buswidth of 32 bit and an average Java bytecode size of 1.8 byte, the IWs alwayscontain enough bytecodes to provide input data for the pipeline backend.Hence, data accesses from the pipeline, which are preferred by the memoryinterface, do not disrupt the instruction flow.

6.1.2. Integrated thread scheduling

The real-time scheduler integrated in the Komodo processor core supportsfour scheduling schemes. One of the scheduling schemes can be selected forthe operation mode. The scheduling is responsible to select the thread slot/IWfrom which the next instruction is taken from. It is completely decoupled fromthe instruction fetch, which is based only on the fill level of the IWs. Of course,the fetch strategy indirectly depends on the scheduling decision because thethread that is executed most often has the least number of instructions in itsIW. The implemented scheduling schemes are as follows:

– Fixed priority pre-emptive (FPP): the FPP is the most simple schedulingwithin the Komodo. Using FPP, a fixed priority is assigned to each thread slot.The priority is in the range of 0 to #number_of_slots− 1, where 0 exhibitsthe highest priority. The currently active thread with the highest priority isselected for execution.

– Earliest deadline first (EDF): EDF is a very powerful real-timescheduling scheme. The Komodo scheduler requires a 32 bit value per threadslot representing the deadline. The deadlines are given relatively in units ofpipeline clock cycles. For execution, the currently active thread with thelowest deadline value is executed. All deadline values are decremented ineach clock cycle.

– Least laxity first (LLF): even though two values per thread are requiredfor LLF scheduling (the deadline and the worst-case execution time (WCET)of each thread), the Komodo scheduler only requires a single value per thread:the laxity, which is equal to deadline −WCET . The currently active threadwith the least laxity is selected for execution. The laxity values of all threads

Page 5: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 131

that are not executed in the actual cycle are decremented. Hereby, threads withcurrent latencies are also counted as executed.

– Guaranteed percentage (GP): the GP [KRE 00b] scheduling wasespecially developed for multithreaded processors with a zero cycle contextswitch overhead. It is described in section 6.1.3.

The presented scheduling schemes must be selected statically, i.e. beforethe Komodo processor starts operation, the scheduling type as well as theparameters must be set.

6.1.3. Guaranteed percentage scheduling

The GP scheduling scheme assigns each thread a specific percentage of theprocessor’s performance over a short period of 100 processor cycles. In case ofthree threads A, B and C, we may assign 20% of the processor performance tothread A, 30% to thread B and 50% to thread C. The scheduler takes care thateach thread gets an appropriate amount of computing performance and thatthe latency cycles of one thread are filled by the execution of another thread(see Figure 6.2). The fixed percentages of GP allow a steady progress of thethreads.

Executionunit

Execution cycles20 40 60 80

Thread C - 50%

Thread B - 30%

Thread A - 20% Free, available for thread D

Figure 6.2. Example execution of GP scheduled threadswithin an interval of 100 clock cycles

The GP scheduler of the Komodo processor offers three classes describinghow a requested percentage is assigned to a thread:

– Exact: a thread gets exactly the requested percentage of the processor’sperformance in the interval, not more and not less. This mode is very useful,if a thread has to keep a specific data rate, e.g. while reading or writing datato an interface with a low jitter. Also deadlines can be met if the percentage isselected depending on the WCET and the deadline.

– Minimum: a thread gets at least the requested percentage of theprocessor’s performance in the interval. If additional execution cycles are left

Page 6: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

132 Time-Predictable Architectures

in the interval, the thread may receive more. This mode is useful if a minimumprocessing performance is required. For example, the garbage collection canbe executed with a minimum throughput but if the processor offers more freeexecution cycles, these cycles can be used by the garbage collection.

– Maximum: if a thread is present that has to perform some minor importantwork, it can be scheduled using the maximum scheduling. In this case, thethread is executed at each free execution cycle as long as its maximum numberof execution cycles is not reached.

Threads of different classes may be mixed within a single processor theworkload. A special Java class supports the handling of the hardware threadslots and the GP scheduling policies after a GP is selected statically as thescheduling algorithm.

A workload with GP threads must not exceed the 100% processorperformance that can be statically assigned. Nevertheless, the existence oflatency cycles, which are filled by the multithreading technique, allows adynamic utilization of more than 100% used by threads of the class minimum.

In the context of very fast context switching, the quality of latencyutilization strongly depends on the number of threads waiting for execution.The processor needs a pool of these threads to switch in case of a latency. Ifthere are not enough threads active, the processor may not find an appropriatethread to execute. Standard real-time scheduling schemes such as EDF or FPPtend to lessen this pool, because they first execute the most important thread,then the second most important thread, etc. [KRE 00b]. In contrast, the GPscheduling as well as LLF tend to keep threads alive as long as possible. So,GP and LLF allow a very efficient utilization of a multithreaded processor.

6.1.4. The jamuth IP core

Starting from the multithreaded Komodo research microcontroller, an IPcore for Altera FPGAs was developed [UHR 08, UHR 07b]. The IP core iscalled Java multithreaded jamuth and can be used for any Altera FPGA byAltera’s so-called SOPC-Builder.

The IP core contains three additional units: the Evaluation unit, the Javatimer and an Interrupt controller (IRQ controller). The first unit is responsible

Page 7: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 133

for debug and observing functionalities, the timer is required for the JVM(System.currentTimeMillis) and the Sleep methods) and the IRQ controllertranslates interrupt requests from the peripheral components to wake-upsignals for the thread slots or interrupt signals, respectively, for alreadyrunning threads.

In addition, the memory interface was changed in a way that the jamuth canbe connected to any memory device by an appropriate memory controller. Theconnection between the jamuth and the memory controller is established by anAvalon interconnect, a standard interconnect for Altera FPGAs. Two master64 bit bus interfaces for memory accesses are available: one for instructionfetching and one for data accesses. Besides the memory interfaces, a 32 bitperipheral interface is also present, which is equipped with interrupt requestinputs.

Because of the changed memory interface, memory accesses can no longerbe performed in a single processor cycle. To reduce the pressure on thememory controller, instructions can now be fetched from three differentsources: external memory, instruction cache and scratchpad RAM. Threadswith hard real-time requirements as well as garbage collection should belocated inside the scratchpad. The reasons are different: while hard real-timethreads require a predictable fetch of instructions (which can be guaranteedby the scratchpad), the garbage collection should use the scratchpad to reduceits impact on the other thread. Executing the garbage collection with GPscheduling out of the external memory by using the cache would cachepollute the instruction cache continuously.

The last change concerns the internal thread scheduler. Its schedulingalgorithms are reduced to FPP and GP with the exact and minimum policies.Furthermore, it is possible to use FPP and GP in parallel and to adjust thescheduling parameters dynamically. The mixed FPP/GP scheduling firstexecutes all threads scheduled by GP within an interval of 100 clock cycles.After all GP threads have received the assigned number of execution cycles,the remaining cycles of the interval are used by FPP threads. The GPminimum scheduling class is emulated by a combination of GP and FPPscheduling: GP is activated with an exact number of execution cycles and thethread is executed with the required number of cycles during the GP phase.Afterward, the same thread is scheduled using FPP, i.e. it receives additionalexecution cycles depending on its priority compared to the other FPP threads.

Page 8: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

134 Time-Predictable Architectures

The jamuth can also be used in a multicore system [UHR 09a]. Multiplejamuth IP cores have to be connected to the identical Avalon busses whereatthe data bus can contain a shared cache. The data consistency problem of thisconfiguration is the reason why the jamuth does not contain a local datacache. A suitable garbage collection for the multicore systems is alsoavailable [UHR 09b].

6.1.5. Conclusion

The Komodo microcontroller offers a predictable timing behavior andseveral thread scheduling algorithms that are suitable for hard real-timeenvironments. The GP scheduling allows for a continuous progress of a threadthat requires a static data rate. It is also used for the garbage collection, whichcan now be executed steadily without interruption. From the application’spoint of view, the garbage collection does not require exclusive executiontime, i.e. no stop-the-world behavior is caused by the garbage collection.

The further development of Komodo, which is called jamuth, allows a veryflexible use of the Java processor in so-called System-on-Programmable-Chip(SOPC) designs with Altera FPGAs. This flexibility has to be paid for by aless strict memory interface timing behavior and, hence, a more complextiming model is required for the static WCET analysis. An internal scratchpadcompensated this drawback on the instruction path.

In the future, it will be possible to extend the processor core by someseparated data caches. Because of the nature of Java bytecodes, it is possibleto distinguish between accesses to variables with a static address and thosethat are allocated dynamically. In addition, a large number of memoryaccesses are required by the Java environment, which are mostly accesses toread-only values. If multiple caches were implemented, e.g. one cache foreach of the three types of memory accesses mentioned, a static analysis couldtake advantage of the better predictability of the caches’ state, resulting in atighter WCET analysis.

6.2. The JOP architecture

The JOP [SCH 08, SCH 09a] shown in Figure 6.3 is a small processorcore for embedded Java systems. Moreover, JOP provides a restricted Javasubsystem that is suitable for embedded hard real-time systems.

Page 9: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 135

Figure 6.3. Block diagram of the JOP processor

JOP comprises a three-staged execution pipeline capable of executingmicrocoded instructions (see core pipeline in Figure 6.3). A fourth stage isresponsible for bytecode-to-microcode translation, i.e. the instructionsexecuted by JOP are original Java bytecode instructions. These bytecodes areinternally translated to sequences of microcodes.

Java bytecode operates on a runtime stack, i.e. is no conventional registerfile is required. This stack including the stack management is implementedinside the JOP pipeline using a simple dual-ported memory with one read andone write port. Dual read access to the stack is required only for the two upperelements, which are stored in two separate registers that can be accesseddirectly by the execution stage. The simple implementation of the stackmemory allows the implementation of a large stack that is able to hold theruntime variables of multiple nested functions. In addition, administrationalinformation such as the return program counter (PC) is stored on that stack.

Bytecode instructions are fetched out of a special methodcache [SCH 04b] exclusively. This cache always holds (at least) the completeactually executed function. In addition, other functions can be availableaccording to the used eviction strategy and the actual execution path. Thistype of cache guarantees that cache misses can occur only at methodboundaries. Since JOP is designed for very small Java systems, a static RAM

Page 10: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

136 Time-Predictable Architectures

(SRAM) as main memory is sufficient and used for instructions and data.Hereby, the method cache prevents conflicts of data and instruction accessesbecause execution is stalled during the loading of a method.

6.2.1. Conclusion

JOP provides advantages regarding predictability compared to otherconventional processors. First, the stack cache avoids an additional runtimestack and the save/restore procedures of the register file at function calls andreturns. This improves performance and reduces the number of memoryaccesses significantly, including the number of cache accesses. Second, themethod cache prevents conflicts at the memory interface and focuses cachemisses (cache analysis) to method boundaries. Third, the minimum size of theexecutable memory image, caused by the high code density of Java bytecode,allows us to use a small (but expensive) SRAM with simple timing behavior.

6.3. The PRET architecture

The precision timed (PRET) machine is a multithreaded single-coresystem. The major target is to provide an exact timing of each processorinstruction, independent from dependencies to other instructions. Moreover,the PRET architecture provides special instructions supporting timing. Theseinstructions force the pipeline to stall thread execution until a given deadlineor period has passed.

6.3.1. PRET pipeline architecture

PRET provides multiple thread slots that are executed round-robin on acycle-by-cycle basis [EDW 09]. The number of slots must be equal to orgreater than the number of pipeline stages. Hence, only a single instructionper thread is available at a time. If a thread slot is empty, pipeline bubbles willbe inserted. Using this kind of multithreading, no data forwarding or branchprediction is required because there are sufficient cycles between consecutiveinstructions of the same thread. Data and control conflicts cannot occur.

To avoid resource conflicts at the memory interface, a memory withmultiple memory banks is assumed. Each thread slot can access only one of

Page 11: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 137

these banks. Accesses to other banks are not possible. This technique preventsfrom conflicts when accessing the row buffer of a dynamic memory becauseeach bank is equipped with its own buffer. Row access and precharge can bedone individually per bank without harming the row buffers of the otherbanks and threads, respectively.

6.3.2. Instruction set extension

The PRET idea introduces four instructions that bring time into thelow-level instruction execution [BRO 13]. These instructions can be used forchecking given deadlines and for artificially extending the execution time of acode snippet to a given extend.

The latter allows us to adjust the actual execution of a function or anapplication to a given schedule. Hereby, the analyzed timing behavior of acode snippet can be ensured or a desired timing can be enforced.

The proposed PRET extension brings control of timing into the purefunctional alignment of standard instruction set architectures (ISAs).Accordingly, the targeted PRET infrastructure will provide a tool-chain thatallows for the propagation of the timing behavior expressed on the modelinglevel down to the actual application execution.

6.3.3. DDR2 memory controller

Since the PRET architecture does not foresee caches, it is not required toread/write larger packets, such as cache lines, from/to the memory.Accordingly, longer burst accesses to the dynamic RAM (DRAM) are notrequired. Instead, only accesses with the width of a (processor) word areperformed resulting in short bursts, if at all.

Even though the basic idea of the PRET memory controller [REI 11] isidentical to the ideas of MERASA and T-CREST to sections 6.5 and 6.6, i.e.privatization of banks, a unique feature improves its predictability: DRAMrefresh cycles are not scheduled by the memory controller and, hence, areindependent from the processor and application. Instead, refresh commandsare issued to the banks individually in case the application is not executing amemory access. For example, each branch or jump instruction sends a refresh

Page 12: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

138 Time-Predictable Architectures

command to the private bank of the actual thread slot [EDW 09]. Thistechnique prevents unpredictable delays of memory accesses because ofrefresh commands.

6.3.4. Conclusion

The great advantage of the PRET idea is to bring timing down to programexecution. This is reached by the four additional instructions targeting timingbehavior and by the special pipeline architecture together with the DRAMmemory management.

Unfortunately, the round-robin thread scheduling decreases thesingle-threaded performance to 1

n of the overall performance where n is thenumber of hardware thread slots. Hence, from a single-threaded viewpoint,the performance of PRET is equal to that of a non-pipelined processor. On theother hand, the multithreading allows for a significant performanceimprovement of parallel applications. This parallelism can be exploited if theparallel threads do not share much data since a thread cannot access the datain the DRAM section (bank) of other threads. Instead, data exchange betweenthreads must be performed through a small and fast scratchpad RAM.

6.4. The multi-issue CarCore processor

The CarCore processor is based on the architecture of Infineon’s TriCoremicrocontroller core [INF 08], which contains three parallel executionpipelines. One of these execution pipelines is able to execute only a smallnumber of special loop instructions. The other two execution pipelinescontain their own register files of 16 registers each. Instructions are staticallyassigned to one of the two main execution pipelines (except for the mentionedloop instructions).

In contrast to the TriCore, the CarCore contains only the two mainexecution pipelines. The special loop instructions are executed by one of theother pipelines, depending on the registers that are used. The mainimprovement of the CarCore is the multithreading extension including athread scheduling that exceeds the abilities of the Komodo scheduler. Atwo-layer scheduler enables the CarCore to execute more threads in areal-time capable way than thread slots are available. No additional software

Page 13: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 139

scheduler is required. The architecture as well as the integrated threadscheduling is described in the following sections.

6.4.1. The CarCore architecture

The backend of the CarCore processor (see Figure 6.4) is similar toInfineon’s TriCore 1 processor. It features two execution pipelines: one fordata arithmetics and one for address calculations and memory accesses. Eachone consists of the three stages decode, execute and write back. A detaileddescription of the differences between the CarCore and the TriCoreprocessors is given by Mische et al. [MIS 10b].

The preceding two front-end stages, instruction fetch and schedule, areshared between both execution pipelines and deviate from the TriCore 1processor. Instructions are issued in order and two instructions from onethread can be issued in parallel, if and only if an address instruction directlyfollows an integer instruction. Otherwise, the other pipeline is filled by aninstruction of another thread. In the case where two instructions of theidentical thread are issued, these instructions can also be dependent, i.e. thesecond instruction requires the result of the first instruction. A specialforwarding and execution technique allows us to execute these twoinstructions in the same clock cycle.

The in-order issue is an important difference to other simultaneousmultithreading (SMT) implementations that use out-of-order execution,where lots of resources are shared between the threads (i.e. instruction issuequeue, reorder buffer, etc.). In the case of an SMT processor, in-orderexecution is not necessarily decreasing performance [MOO 04], but simplifiesdesign and reduces hardware costs. Moreover, the architecture of the CarCoreis free of timing anomalies due to the static assignment of the instructions tothe execution units.

Because the TriCore instruction set provides 16 and 32 bit instructions, thefetch stage is designed to fetch two to four instructions of the same thread percycle by its 64 bit wide memory port. The instructions are buffered in one ofthe IWs, each dedicated to a thread slot.

The scheduling stage implements the first scheduling layer performing asimple priority-based scheduling. It predecodes the instructions depending on

Page 14: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

140 Time-Predictable Architectures

the priorities of the thread slots and assigns them to the appropriate pipelines.In the case of latencies, instructions of the next prior thread are selected. Thepriorities of the thread slots are assigned by an external signal from the threadmanager, which implements the second scheduling layer. Each priority iswithin the range of 0 to #threadslots− 1, where 0 is the highest priority.

Figure 6.4. The CarCore processor architecture. The caches arecurrently not implemented

6.4.2. Layered thread scheduling

The hardware thread scheduling is divided into two layers. The first layeris located deep inside the processor core as the schedule stage in the pipeline.It is responsible for a high pipeline utilization.

The second layer is implemented as an independent hardware modulebesides the processor pipeline, called thread manager, to overcome thelimited number of hardware thread slots. The thread manager is responsible

Page 15: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 141

for the management of a list of virtual thread slots. This list contains anarbitrary number of threads including all context information of the threads,i.e. the number of threads is only restricted by the available memory. Eachthread is identified by its thread control block (TCB). A TCB is 256 byteslong and contains the thread context as well as scheduling informationassigned to this thread.

The thread manager autonomously swaps threads from the thread list intothe physical hardware thread slots and vice versa. Its actions depend on the(real-time) scheduling parameters of the threads and the progress of thethread execution within the CarCore pipelines. Therefore, it receivesinformation about the scheduling from the first layer scheduler within theprocessor pipeline. On the basis of this information, several (real-time)scheduling algorithms can be implemented within the thread manager.

6.4.2.1. First layer: schedule stage

As the first layer is integrated as a discrete pipeline stage, it must be smalland quick and thus only performs a simple scheduling with fixed priorities.The major task of the first layer is to issue thread slot instructions with thehighest priority as fast as possible to the execution pipelines. Emerginglatencies (because of memory accesses or branches) are filled withinstructions from other active thread slots to keep the utilization of theprocessor as high as possible.

For a scheduling decision, the first layer requires three facts about eachthread slot: if there is a valid instruction within the IW of a thread slot and ifso, its priority for scheduling. In addition, it needs information about thepreviously executed instructions and their latencies. For every pipeline, itpicks the instruction of the thread slot with the highest priority and anappropriate instruction, which is not delayed by a branch or a memory access.The decision of which thread slot instructions were assigned to whichpipeline is reported to the second layer of the scheduling. This informationallows the second layer to count the real execution time of a thread, which isrequired for some sophisticated scheduling algorithms (see section 6.4.3).

6.4.2.2. Second layer: thread manager

The second layer is the more complex of the two-layer scheduling. Itanalyzes the scheduling information (deadlines, priorities, lists, execution of

Page 16: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

142 Time-Predictable Architectures

thread slots, etc.) and reduces it to simple priorities for the first layer.Therefore, it determines the most urgent threads to be scheduled nextdepending on the appointed scheduling strategy and induces that these threadsare assigned to the thread slots of the first layer. If a thread terminates oranother thread with a higher priority occurs, the thread manager initiates asubstitution of one currently executed thread by a thread waiting in the TCBlist.

At the beginning of a substitution, the corresponding thread slot issuspended and its context is copied to its TCB in the memory (Swap Out).Afterward, the context of the new thread is read from its TCB and written intothe hardware thread slot (Swap In).

In contrast to common schedulers, this substitution is done by dedicatedhardware that works in parallel to the normal program execution and thereforedoes not block the processor pipeline. It takes 44 cycles on the CarCore andthe only impact on the processor performance is that the first layer schedulerhas to choose instructions from a decreased number of active thread slots.

6.4.3. CarCore thread scheduling algorithms

The two-layer CarCore thread scheduler provides three differentscheduling techniques in parallel. Depending on the criticality of each thread,it can be scheduled by one of the offered techniques. All three techniques arebased on so-called rounds that are similar to the intervals of the GPscheduling of the Komodo scheduler. But, in contrast to the intervals, thelength of the rounds can be defined by software and the particular value mustbe determined by the schedulability analysis. The scheduling techniques areas follows:

– Dominant time slicing (DTS): the DTS scheduling is suitable for hardreal-time tasks. At the beginning of each round, all DTS threads are executedfor the predefined number of pipeline clock cycles. The sum of the assignedclock cycles must not exceed the length of the rounds. Only a single DTSthread is executed at a time.

– Periodic instruction quantum (PIQ): threads with soft real-timerequirements can be scheduled by the PIQ scheduling. Each PIQ thread isexecuted exactly as many instructions as given by the scheduling parameter.

Page 17: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 143

After the required number of instructions are executed, the thread issubstituted by another PIQ thread. PIQ threads are executed in parallel to andafter the DTS threads. The difference between DTS and PIQ is that DTScounts the elapsed pipeline cycles whereas PIQ counts the executedinstructions.

– Round robin slicing (RRS): the RRS scheduling is used for non-real-timethreads. After all DTS and PIQ threads are executed, the threads scheduled byRRS will be swapped in. In contrast to DTS and PIQ, which reset their TCBpointers at the beginning of each round to the start of the corresponding TCBlist, the RRS scheduler selects the threads continuously out of its list. Hence,it is not guaranteed that each thread is executed in every round.

Figure 6.5 shows how the three scheduling techniques are unified in asingle multithreaded processor core. Two thread slots are required for theDTS scheduling while PIQ and RRS share the remaining slots. If the timerequired for the DTS threads is shorter than the length of the rounds, the twoslots can also be used for PIQ and RRS. The DTS and the PIQ schedulingtechniques are described in more detail by Mische et al. [MIS 10c] and aresummarized in the following sections.

Figure 6.5. Unified DTS, PIQ and RRS scheduling in one roundof length R pipeline clock cycles [MIS 10c]

6.4.3.1. Dominant time slicing

The DTS scheduling is able to execute multiple hard real-time threads onan in-order SMT processor. Especially, it is possible to execute more hardreal-time threads than physical thread slots are available. The WCET analysis(required for the schedulability analysis) can be performed for each threadseparately and context switching times need not to be taken into account. Thisis because the context switch is hidden by the switching hardware and themultithreaded execution. The DTS scheduling guarantees that each threadshows the same timing behavior as if it had been executed as single threadwith one exception. Because of the dilated execution in multiple rounds, thethread’s overall WCET is stretched according to the relationship of the roundlength and the thread’s time slice.

Page 18: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

144 Time-Predictable Architectures

Figure 6.6. Execution of DTS threads A, B and C in two physical thread slots

To guarantee the unmodified timing behavior of each hard real-time thread,only one of the DTS threads is executed at a time (see Figure 6.6). In parallel,a further thread is prepared for execution in a second thread slot but this slotis not yet activated. After the first thread has received its time quantum, i.e. itis executed the assigned number of cycles, the first slot is deactivated and thesecond slot is activated. Now, the second thread is executed according to itstime quantum. In parallel, the first thread is swapped out to its TCB and thethird thread is swapped into the same physical thread slot. This procedure isrepeated until the end of the DTS TCB list is reached. Afterward, the end ofthe round is awaited and the schedule starts again at the beginning of the list.

Unfortunately, the DTS scheduling blocks two physical thread slots all thetime, whereupon only one thread is active. But the advantages still dominatethis drawback. The timing of each hard real-time thread is kept constant withrespect to its WCET analysis and a special factor that depends on the assignedtime slice and the length of the rounds. In addition, the context switching timeis completely hidden and, hence, needs not be taken into account at theschedulability analysis. The only precondition is that the time slices of allthreads are longer than the time required for swapping out and in the threadsin the inactive slot.

The reason why only one thread is executed at a time and the second threadhas to wait until the first thread finishes is the timing behavior of the secondthread (see Mische et al. [MIS 09]). If it were executed in parallel, it wouldreceive several execution cycles in the pipelines that are currently not used bythe first thread. But it is not possible to count these execution cycles in terms ofpipeline clock cycles that would be required in the case where the thread is theonly one. Hence, the parallel execution of the second thread would not bringany advantage because it has to be assumed that the thread starts execution afterthe quantum of the first thread is fulfilled. Instead, the free execution cycles not

Page 19: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 145

used by the active DTS thread are used by the PIQ scheduling described in thenext section.

6.4.3.2. Periodic instruction quantum

In contrast to DTS, PIQ is able to guarantee a minimum number ofexecuted instructions within a given round (same as used for DTS). Thedesired number of instructions are given as scheduling parameters in thethread’s TCB. Unfortunately, it is not possible to guarantee any arbitrarynumber of instructions to be executed. Instead, the assigned number ofinstructions has to be less than or equal to the minimum instruction per cycle(IPC) count that the thread can reach if it runs in single-threaded mode.Therefore, the maximum possible instruction quantum has to be determinedin advance by executing the thread in single-threaded mode while measuringthe IPC in short periods (less than the length of the rounds). Afterward, theminimum IPC represents1 the number of instructions that can be guaranteedby the PIQ scheduling to be executed in multithreaded mode.

In contrast to the single-threaded execution, in which the thread istemporarily able to reach a higher IPC, the PIQ scheduler restricts the IPC tonearly the requested one. Hence, a WCET analysis that is done insingle-threaded mode is no more valid anymore because the execution isslowed down. But, due to the guaranteed throughput, soft real-time threadscan be scheduled using the PIQ scheduling technique.

The implementation of PIQ scheduling is very similar to DTS scheduling.The difference is that the scheduler has to count the executed instructioninstead of the elapsed execution cycles. In addition, it is possible to executemultiple PIQ threads in parallel and also in parallel to the active DTS thread.If a thread has reached its cycle quantum, it will be swapped out and anotherPIQ thread will be swapped into the same physical thread slot. If the end ofthe PIQ TCB list is reached, the PIQ scheduling is deactivated for the currentround and the RRS scheduling is activated to schedule non-real-time threads.A detailed description of the PIQ scheduling including the principles of aschedulability analysis is given by Mische et al. [MIS 09].

1 By multiplying the IPC with the length of the round.

Page 20: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

146 Time-Predictable Architectures

6.4.4. Conclusion

Besides the completely different ISA, the CarCore extends the features ofthe Komodo in two directions: first, the CarCore is a multi-issue processorwith two execution units and, thus, it is able to execute up to two instructionsin a single cycle. Second, it is able to schedule and execute a higher number ofreal-time threads than physical thread slots are available.

The first extension requires the WCET analysis tool to deal with the twoexecution units, but because of the static assignment no timing anomalies canoccur. Hence, the analysis overhead is feasible. In contrast, no additional efforthas to be spent on the higher number of supported threads. This is due to thescheduling as well as to the context switch overhead, which is transparent tothe threads and needs not to be taken into account at the analysis phase.

Currently, no caches are implemented in the CarCore processor. But, withregard to an improved performance of several threads, a cache similar to thatof the MERASA processor (see section 6.5.4) could be integrated. Herewith,each of the threads can be assigned to one or more cache banks resulting ina lower memory pressure, higher throughput and still a predictable behavior.The predictability is preserved because each thread holds its own cache portionwith its own cache state. Of course, a technique to keep the cache portionscoherent must be integrated.

6.5. The MERASA multicore processor

The MERASA multicore processor allows for the parallel execution ofmultiple threads with hard real-time requirements. In contrast to themultithreaded processor cores described in the previous sections, theMERASA multicore executes hard real-time threads really in parallel and notin an overlapped parallel manner. Static as well as measurement-based WCETanalyses are supported (see Rochange et al. [ROC 10]). The used processorcore is a modified CarCore. The number of cores is configurable in the rangeof 1 core up to 8 cores. The MERASA processor also features a central cachethat can be assigned to the cores in different ways and for differentfunctionalities.

Page 21: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 147

The following sections describe the MERASA overall architecture withsome details about the interconnection bus and the memory hierarchy. Themodifications of the processor core are also presented.

6.5.1. The MERASA architecture

Figure 6.7 shows a block diagram of the MERASA architecture. Themodified CarCore processors are connected by a shared bus system directlyto the memory interface and to a central cache that contains multiple cachebanks. The cache is also connected to the memory interface. Besides theprocessor cores, a central thread manager is responsible for the initialdistribution of the threads to the cores (not shown in the figure).

Figure 6.7. The MERASA system architecture [UNG 10]

The MERASA processor is designed to execute threads with hard real-timerequirements as well as threads with soft or non-real-time requirements. Eachcore is able to execute up to one hard real-time thread and several soft andnon-real-time threads, depending on the number of physical thread slots. Thedynamic swapping provided by the CarCore is not available in the MERASAprocessor.

Page 22: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

148 Time-Predictable Architectures

6.5.2. The MERASA processor core

The processor core that is integrated in the MERASA multicore processorcontains nearly the same pipeline as the CarCore processor. But because theMERASA core cannot access the memory directly and because of the differentscheduling policies compared to the CarCore, several modifications have beenapplied. The major changes are described in the following:

– Scheduling: due to the fixed assignment of hard and non-hard real-timethreads to the thread slots, the second scheduling layer is omitted. Instead, thepriorities of the thread slots correspond to the slot number where slot 0 has thehighest priority. In addition, a thread control interface was added that allows anexternal unit, the so-called thread manager, to initialize and activate individualthread slots.

– Instruction fetching: the memory pressure within a multicore architectureincreases with the number of cores. To avoid empty IWs inside the pipelinebecause of long memory access latencies, the MERASA core was equippedwith two local instruction memory systems: a dynamic instruction scratchpadfor the hard real-time thread and a standard instruction cache for the otherthreads.

– Data accesses: for the same reason that the fetch path was adapted, thedata path was also extended by a local static data scratchpad and a local datacache. The scratchpad is available for the hard real-time thread and should beused for the runtime stack of the thread and other private data. The data cacheis available for all other non-hard real-time threads.

– Bus interface: the bus interface combines requests from the data as wellas from the instruction path. It has to take care of the priorities of theindividual requests. In contrast to the CarCore where memory requests areimmediately processed, the MERASA core has to keep the record of therequests and their sources. This is because an active non-hard real-timerequest may not have been processed by the interconnection bus while a hardreal-time request occurs. In this case, the hard real-time request has to bepreferred and the non-hard real-time request must be postponed.

Because the MERASA project especially targets hard real-time threads,only the architectural requirements for this kind of thread are fully

Page 23: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 149

implemented in the prototype. The local cache memories for the non-hardreal-time threads are foreseen but not yet integrated.

6.5.3. Interconnection bus

The interconnect of the multicore system is a bus system. The arbitrationmechanism is a hybrid priority and time slice based algorithm. In general,each core has assigned its own time slice for accesses with hard real-timerequirements. If one core does not use its time slice for a hard real-timeaccess while a second core requests for such an access, the access of thesecond core is preferred.

The advantage of this technique is the fast progress of the hard real-timethreads. Unfortunately, the soft and non-real-time threads may starve out iftoo much hard real-time accesses are available. Because of the design of theprocessor core, which is free of timing anomalies, the variable bus access timesdo not compromise the static predictability of the architecture.

To enable the real-time bus arbiter to distinguish between hard real-timerequests and non-hard real-time requests, each bus master has to deliver thetype of the access. Hence, the processor cores must be aware of the real-timeclass of the executed threads.

6.5.4. Memory hierarchy

A highlight of the MERASA architecture is the configurable memoryhierarchy. The central cache is organized in multiple cache banks and each ofthem can be assigned to a different core. In addition, the functionality of thecache banks is not fixed: each one can be used in one of the following ways.

– First-level data cache: because of consistency problems, the hard real-time threads do not use the local cache inside each core. Instead, a configurablenumber of cache banks can be used as first-level data caches. In addition, it ispossible to define a cache bank as private to a thread or as possibly shared, i.e.the bank may be reconfigured to belong to another core. This feature allowsmultiple hard real-time threads to communicate and cooperate on shared data.

– Second-level data cache: non-hard real-time threads are allowed to usethe local data cache inside each core as first-level data cache. Hence, the central

Page 24: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

150 Time-Predictable Architectures

cache may serve as a second-level cache. It may or may not be shared betweenmultiple cores. Of course, a consistency technique must be implemented inthis case but non-hard real-time threads are beyond the scope of the MERASAproject that especially targets hard real-time applications.

– Instruction cache: a cache bank can also serve as an instruction cachefor both hard and non-hard real-time threads. In the case of a hard real-timethread, the cache acts as a second level after the local scratchpad, i.e. it reducesthe pressure on the memory interface. For non-hard real-time threads, it formsa standard second-level cache behind the local instruction cache.

A bypass connection besides the central cache is also available. Thisbypass allows direct accesses to the memory that is needed for non-cachedaccesses. These accesses are required for direct communication betweendifferent threads, in particular, lock variables that need atomicread-modify-write accesses use this link.

The memory controller itself is also designed in an analyzable way. It isbased on burst accesses that form a complete cache line (see Paolieri etal. [PAO 09b]). The arbitration technique is similar to that of the real-timeinterconnection bus. This means that the real-time class of a request is alsorequired by the memory controller. A special feature is a third type ofmemory operation (besides read and write): the read–write operation. Theread–write operation allows to perform an atomic read-and-write operationon the same address. This operation only targets a smaller data width (32 bit)but it fits completely into the time frame of a standard cache line access.

The read–write operation allows to handle lock variables in an atomic waywithout the need for bus/memory locks. Hence, it is not required that thestatic WCET analysis takes into account possible bus/memory locks fromother cores.

6.5.5. Conclusion

The MERASA architecture offers a flexible solution for systems with hardreal-time requirements as well as for mixed critical systems. A memoryhierarchy that provides local and also global caches and scratchpads allows ahigh computational throughput combined with a tight static analyzability. Thecentral cache can serve as a second-level cache for non-hard real-time threads

Page 25: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 151

and as a private first-level cache for hard real-time threads. An appropriateconfiguration can be assigned for each cache bank separately. An additionalfeature of the MERASA system is the comfortable memory controller thatallows atomic read–write operations without disturbing the analyzable timeslice based accesses of other cores.

Further developments of the MERASA architecture could focus on thesupport of non-hard real-time threads, which is not fully implemented in thecurrent prototype. In addition, cooperating parallel threads that are designedas producer/consumer pairs are very well supported by the currentarchitecture, if only one producer and one consumer are present. In the caseof multiple producers/consumer, an enhancement of the central cache has tobe developed.

6.6. The T-CREST multicore processor

The T-CREST project targets the real-time constraints of futuresafety-critical multicore and many-core systems. Therefore, a strictlytime-predictable multicore system has been developed, including a suitableprocessor core, techniques for strictly timed communication structures and amemory controller. The interconnect allows the cores to be treated asindependent systems from the timing point of view. Nevertheless, the corescan communicate with each other and with external memories using atime-predictable memory controller.

6.6.1. The Patmos processor core

The processor core applied in the T-CREST project is the dual-issue Patmosprocessor [SCH 11]. It is a pipelined core and in principle its ISA follows thereduced instruction set computer (RISC) approach. Moreover, the ISA is fullypredicated and up to two instructions can be statically bundled to be executedin parallel. Instructions are fetched out of a local method cache. So, no cachemisses can occur in the scope of functions and the core is able to execute oneor two instructions per cycle. The only exceptions are branches and memoryaccesses that can lead to pipeline stalls. The number of conditional branchesit minimized by the support of predication and a split-phase load technique isused for memory loads. Hereby, the result of the memory read access is storedin a dedicated register that can be read by a special instruction. In contrast

Page 26: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

152 Time-Predictable Architectures

to the CarCore processor, the second part of the load is formed by a separateinstruction that must be executed explicitly. Using this technique, the memoryaccess latencies can be at least partly bridged by the execution of independentinstructions.

The memory subsystem of Patmos is formed by several caches. As alreadymentioned, instructions are fetched only from the method cache. This cache isworking on the granularity of functions, which means that cache misses canoccur only on function boundaries. In addition to the method cache, a stackcache, a constant cache and a data cache are present. The applications runtimestack is cached in a special stack cache [ABB 13], while constant values anddata of the working set is cached in associative caches. Hereby, constant dataand the working set are handled by different caches with different associativity.It is encoded inside the memory access instructions which cache is used for thecorresponding access. In addition to the caches, a local scratchpad memory isalso provided to store often used data.

Compared to traditional RISC cores, software development for Patmoslooks more complex at first glance. Two instructions are required for memoryreads, cache selection for memory accesses and instructions bundling forperformance increase. But all these issues can be performed automatically bya compiler and have no (negative) effect to the software developer. Instead,greater effort is spent in programming results in a better timing predictability.There are no instructions with variable timing except for cache accesses thatcan lead to a hit or a miss (including the method cache). Here, the variouscaches improve the analyzability of cache behavior resulting in a lowerpessimism of a static WCET analysis.

6.6.2. The T-CREST interconnect

The T-CREST project is not based on a particular network-on-chip (NoC)architecture. Instead, a static scheduling technique is proposed that offers time-predictable communication. Hereby, an all-to-all communication without anyinterferences and unpredictable stalling is also possible.

The basic idea of the proposed technique is a network with routing nodeswithout dynamic routing capabilities. Instead, each router comprises ascheduling table that indicates incoming–outgoing relationships. All routersof the complete interconnect step synchronously through their individual

Page 27: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 153

tables (of equal length), which lead to connective (pipelined) paths fromsource nodes to destination nodes. Each foreseen path is availableperiodically, depending on the length of the routing tables. There are nobuffers available in the routers because transmitted data do not need to bebuffered at any time. The absence of buffers reduces the hardware complexitysignificantly, since not only the buffer memory but also the buffermanagement is avoided.

Figure 6.8. Example communication from node (0,0) to(1,1) in a 3× 3 T-CREST mesh

Figure 6.8 shows an example of a 3 × 3 mesh interconnect. The givenrouting tables allow a data transfer from node (0,0) to node (1,1) in threetransfer cycles. Each entry specifies the input–output port (N, E, S, W, L)connection in a particular cycle. Besides the single connection per clock cycleand router presented here, other connections (concerning other ports) can alsobe established in the same router in the same cycle. Moreover, all otherrouters and empty table entries can establish different data transfers inparallel. Schoeberl et al. [SCH 12] have shown that all-to-all communicationin a 4 × 4 mesh is possible with a period of only 18 cycles. Of course, if aparticular communication matrix is given, this corresponding period is muchshorter.

6.6.3. Conclusion

T-CREST provides a many-core architecture suitable for hard real-timesystems. A central element is the NoC architecture, especially the staticrouting of data. The proposed routing reduces the hardware complexity of theused routers compared to buffer-based systems with dynamic routing.Moreover, the static approach provides a tightly analyzable timing behavior.

The architecture of the Patmos processor core provides an increasedperformance compared to a single-issue pipeline by the possible parallel

Page 28: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

154 Time-Predictable Architectures

execution of two instructions. This technique is similar to the very longinstruction word (VLIW) technique and also applied by Infineon’s TriCoreprocessor and the CarCore (see section 6.4), accordingly. As extension to thetwo other mentioned architectures, Patmos supports multiple data caches thatcover different domains of data, namely the runtime stack, static variables andconstants, and the working set. Applying multiple caches reduces cross talk ofaccesses to different data domains and improves predictability of the caches’state.

6.7. The parMERASA manycore processor

The aim of the parMERASA project was to provide a platform suitablefor the execution of multiple parallelized real-time applications. Therefore, thesystem must target two major issues: separation of the different applicationsas well as tight coupling of the execution units involved in the execution of theparallel parts.

To determine the way of communication, synchronization andcoordination between parallel threads, embedded applications from threedifferent application domains have been analyzed. This analysis showed thatdata as well as control parallelism can be exploited. Synchronization ismainly based on mutexes and barriers. Communication and coordination isbased on exchanged messages as well as global variables and data structures.

6.7.1. System overview

The focus of parMERASA’s hardware architecture is on the memoryhierarchy, the interconnection network and an inter-core signaling andcommunication technique. Hence, the focus is not on the core architectureitself since every application domain has preferences on a particular core.Nevertheless, only one core architecture is used in the parMERASA projectacting as a representative for any other suitable architecture.

Since multiple parallel applications executed in parallel need to besupported, a sufficient number of cores is required. Bus-based systems do notscale very well and, hence, a NoC is used as the communicationinfrastructure. Also the interrupt system and the peripheral devices areconnected to this NoC.

Page 29: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 155

6.7.2. Memory hierarchy

Since the use of a NoC implies long latencies for accessing remote sharedmemories, a powerful memory hierarchy is required. Of course, this hierarchymust provide an analyzable timing behavior in addition to efficient memoryaccesses. To reach that goal, multiple memories are available in the system,local memories and remote memories. Frequently used data such as theruntime stack and private data are stored in local memories while largerportions of shared as well as private data are stored in remote memories.Moreover, the local memories of other cores can also be accessed by any corethat is used for message passing. A memory mapping technique allows accessto its own local memories at the same address for all cores while accesses tothe other local memories are performed using different addresses, dependingon the node that has to be accessed. Figure 6.9 shows the used memory map.

While accesses to the local memories are performed by simple accesses tothe local interconnect (e.g. a bus connecting the core and the local memories),accesses to remote memories such as the local memories of other cores aswell as external memories are translated into NoC messages. These messagesare passed through the NoC to the corresponding destination. If necessary, ananswer with the requested data is sent back to the initiator.

Obviously, this kind of access to remote data induces a high latency onmemory accesses. To efficiently deal with these latencies, local caches areimplemented. Hereby, only the data path is taken into account, forinstructions a perfect scratchpad memory is assumed. In practice, a dynamicscratchpad as described by Metzlaff and Ungerer [MET 12] can be used forinstruction fetch support.

Since the parMERASA architecture needs to support parallel applicationswith significant amounts of shared data, the memory hierarchy must providecoherent accesses to this data. This can be done by uncached accesses to theshared memory or by providing a coherency technique of local data caches.Since uncached accesses result in unacceptably long latencies, a suitablecoherence technique is required. The on-demand coherence cache (ODC2,see section 5.4.2) has been developed within the parMERASA project. Itprovides coherent accesses to shared data together with the advantages of

Page 30: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

156 Time-Predictable Architectures

caching. Moreover, ODC2 provides analyzable timing behavior together withthe previously requested properties:

– Coherent accesses to shared data: there are no data present in more thanone local cache at any time. Coherency is preserved by mutual exclusion andthe automatic write back and reload of ODC2.

Figure 6.9. Memory map of the parMERASA many-core systemwith a maximum of 30 clusters and four cores per cluster. Local code and data

as well as shared data sections are accessible at identical addressesfor all cores in all clusters

Page 31: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 157

– Isolation of cores: since there are no coherence messages exchangedbetween the cores, all cores act independently.

– Advantage of caching: ODC2 is taking advantage of temporal and spatiallocality of accesses to private data as well as to shared data within regions ofmutual exclusion.

6.7.3. Communication infrastructure

The high number of requested cores requires an efficient way ofcommunication. Hereby, communication must be possible from any activesystem (i.e. master) component to any other component. This means that thefollowing communication links must be possible:

– Core to node communication: hereby, any core should be able tocommunicate with any other network node. This is required to access remotelocal memories for passing messages from one node to an other node.

– Core to external memory: each node (i.e. each core within a node)requires access to external memories in order to read/write large amounts ofprivate as well as shared data.

– Core to input/output (I/O): cores must be able to communicate withperipheral devices. This is required for initialization as well as for exchangeof I/O data.

– I/O to memory (local and external): larger amounts of I/O data needto be transferred by direct memory access (DMA) operations. Therefore, theI/O system, including the DMA controller, must be able to communicate withexternal memories and also with local memories.

In general, a simple bus-based architecture using time division multipleaccess (TDMA) arbitration would provide all these features, including thepreviously mentioned isolation of applications. Unfortunately, busses do notscale very well and so this kind of architecture is not suitable for the targetednumber of cores.

As a result, parMERASA will investigate two different kinds of NoCs (seeFigure 6.10): a clustered bus system and a mesh supporting virtual channels.The virtual channels will be used to form virtual clusters among the nodes.

Page 32: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

158 Time-Predictable Architectures

Clustering is required to provide isolation between different applicationsrunning in parallel on the parMERASA architecture.

Figure 6.10. Investigated parMERASA topologies

The clustered bus architecture supports clusters by default. Unfortunately,it is extremely unflexible since the clusters are fixed. But, together with aTDMA-based bus arbitration, it is also possible to allow flexibility to alimited extend. This limitation is based on the bus structure and the number ofsections that must be passed if parts of an application are located in differenthardware clusters.

The mesh-based systems allow us to place the different parts of anapplication close to each other. Hence, the communication does not need to

Page 33: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 159

be shared with other applications, except for some special locations at theborder of an application area and the transit traffic. These situations will beaddressed by virtual channels that use a hardware arbitration such as TDMA.

Independent from the selected NoC architecture, parMERASAdistinguishes between intra-cluster and inter-cluster communications.Intra-cluster communication has priority over inter-cluster communicationsince it is assumed that the former occurs much more frequently than thelatter. Moreover, intra-cluster communication also carries memory accesses toand from the cluster’s memory that means that delaying these messageswould harm the performance. Inter-core communication is less frequent and alonger latency can be accepted in this case.

6.7.4. Peripheral devices and interrupt system

The parMERASA architecture targets real-world applications that areparallelized for increased performance. For these application types, input datafrom peripheral devices are required and output data are generated. Therefore,the parMERASA architecture is equipped with a flexible I/O systemincluding a signaling technique.

6.7.4.1. I/O devices

The integrated peripheral devices include a virtual controller area network(CAN) interface and a generic I/O module, which can emulate digital I/O,pulse width modulation (PWM) generation as well as analog-to-digital anddigital-to-analog converters. For both devices, the input data are provided bya trace file that specifies time-stamped input data. As output, another file isgenerated representing the output generated by the simulated application.Hence, the system can be evaluated by comparing the output trace files.Hereby, the design space can be evaluated with respect to different ways ofparallelization as well as different topologies.

All I/O devices are implemented as memory-mapped I/O and comprise asmall internal memory as well as control registers that can be accessedthrough the NoC. Additional DMA functionality is currently not integrated,instead the data have to be placed into the internal memory or read from there,respectively.

Page 34: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

160 Time-Predictable Architectures

6.7.4.2. Signaling infrastructure

The signaling technique is based on two types of components: SmartInterrupt Controller (SIC) and Tiny Interrupt Controller (TIC). One TIC isavailable in every cluster containing processor cores, i.e. all clusters containone TIC. In contrast, SICs are available only in clusters with peripheralcomponents with interrupt capabilities. Precisely, a SIC is connected tointerrupt sources while TICs establish connections to interrupt destinations.The communication between SICs and TICs is performed by the NoC and,hence, relies on the real-time capabilities of the NoC.

Each SIC comprises a pair of internal control registers per interruptchannel, i.e. per supported interrupt source. These registers specify thedestination (TIC) of the interrupt together with a magic number. In case of aninterrupt, the magic number is sent to the TIC that activates the interruptrequest of the corresponding target core. The core can identify the interruptsource by reading the magic number from the TIC. Because of the requiredconfiguration of the SICs’ control registers, the signaling system is extremelyflexible.

Moreover, the TICs can also be accessed by conventional write accessesof the cores. Hence, an inter-core signaling can also be implemented by thistechnique. Therefore, a core needs to write a magic number (different from thenumbers used by the I/O devices) to a TIC’s internal register. The destinationcore can identify the signaling by the magic number.

To improve the latency at any signaling action, the dedicated magicnumbers are not chosen artificially. Instead, the magic numbers are exactlythe pointer to the handling routine of the particular event. This techniquesignificantly simplifies the assignment of the signaling source and handlingroutine, since it is not required to enquire a mapping table. The receivedmagic number is directly used as the argument of an indirect jump.

Unfortunately, the proposed SIC/TIC infrastructure cannot be used formulti- and broadcasts. Therefore, a multicast interrupt controller (MIC) isused. A MIC combines parts of the functionalities of a TIC and a SIC withadditional multicast features. In contrast to SIC and TIC, MIC does notprovide any direct link to interrupt sources or destinations. A MIC isconnected only to the NoC (possibly within a cluster). The task of a MIC istriggered by a write access to its trigger register. Following this write access,

Page 35: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

Example Architectures 161

an internal list of accesses is executed. Each entry in this list is a triple of atarget address, a magic number and a waiting time. The first two define targetTIC and corresponding magic number while the last one defines the waitingperiod before the next access is triggered.

Figure 6.11. Block diagram of the parMERASAmulticast interrupt controller (MIC)

Figure 6.11 shows a block diagram of a MIC. The principal idea of the MICis to send a multicast signal to several cores in parallel. Moreover, the signalshould reach the destinations (more or less) simultaneously. Therefore, thewaiting periods need to be defined according to the different times required bythe messages to reach their destination. The message with the highest distanceto its destination has to be placed first in the list while the nearest target mustbe the last entry. The actual time at which the messages reach their destinationdepends on the time predictability of the NoC. Possibly, a certain jitter must beaccepted. For example, if the T-CREST NoC technology is applied, this jitterwill most probably appear since it is not possible for a core to receive messagesin any arbitrary cycle. Moreover, it is also not possible to send the messageswith the given waiting periods because the time at which a message can be sentdepends on the destination (see section 6.6.2).

6.7.5. Conclusion

The parMERASA architecture shows conceptual directions toward atime-predictable many-core architecture. Starting from simple processor

Page 36: Time-Predictable Architectures (Rochange/Time-Predictable Architectures) || Example Architectures

162 Time-Predictable Architectures

cores, techniques for a time analyzable interconnection structure arepresented. This technique distinguishes between inter-cluster and intra-clustercommunications and allows freedom from interference for inter-clustercommunication. Efficient memory accesses, also for shared data, are enabledby the ODC2, which allows for a more flexible data and memory layout thanthe proposed MERASA cache structure. Interaction between the environmentand the cores and also between the cores themselves is established by theflexible interrupt and signaling system. Its predictability is based onintra-cluster communication.