Memetic-based schedule synthesis for communication on time-triggered embedded systems

Time-triggered systems play an important role in industrial embedded systems. The time-triggered network is deployed on the time-triggered network-on-chip implementation. It ensures the safety-critical industrial communication for real-time embedded multiprocessor systems. To guarantee the safety-critical requirements for communication, each message is transmitted by a predefined static schedule. However, synthesizing a feasible schedule is a challenge because both spatial and temporal constraints should be considered. This article presents a novel memetic-based schedule synthesis algorithm to derive a feasible schedule by determining the offset of messages on the time-triggered network-on-chip. Memetic-based schedule synthesis algorithm is based on memetic algorithm, which incorporates local search in the iterations of general genetic algorithm. We compare memetic-based schedule synthesis algorithm with genetic algorithm in different scale of time-triggered network-on-chip and number of messages. The experimental results show that the memetic-based schedule synthesis algorithm is effective to synthesize a feasible schedule, and the failure schedule synthesized by memetic-based schedule synthesis algorithm is only 34.2% in average compared to the conventional genetic algorithm.


Introduction
Time-triggered systems is one of the real-time systems for industrial multiprocessor systems. 1 At present, timetriggered systems are widely deployed in various fields, such as TTEthernet in avionic networks, 2,3 Time-triggered protocol (TTP) in aerospace industry 4 and GENESYS in embedded systems. 5TTNoC integrates the time-triggered concepts into the network-on-chip (NoC) for safety-critical real-time embedded systems.Unlike the requirements for general networks, such as quality of service (QoS) 6 as well as quality of experience (QoE) 7 in wireless networks, 8 user privacy in social networks, 9 or energy consumptions and prolonged network lifetime in wireless sensor networks, [10][11][12] TTNoC provides the temporal predictability for safetycritical tasks, which ensures the tight and predictable communication latency.
There are two main architectures for a time-triggered embedded system, that is, bus-based and networkbased architecture. 13For the bus-based architecture, only one message is transmitted on the system at the same time.Therefore, each message owns its unique time slot for communication.For the network-based architecture, it allows a set of messages to be transmitted at the same time, provided that the physical links used by the messages are contention-free.Figure 1 shows the differences between bus-based and networkbased time-triggered architectures.For the bus-based architecture, the message t 0 is conflicted with t 1 and t 2 when they transmit at the same time.In other words, all the messages (t 0 , t 1 , and t 2 in Figure 1(a)) must achieve temporal separation.In a network-based architecture, the messages (t 0 , t 1 , and t 2 in Figure 1(b)) transmit at the same time because there is no spatial contention among the transmission of messages.The contention occurs at the link between PE 1 and PE 4 when t 0 and t 3 transmit at the same time.
TTNoC employs the network-based architecture.It consists of processing elements (PEs), switches, and physical links.PEs are interconnected by physical links and the switches on the TTNoC.A message for communication consists of header and data.Header includes the information for message communication on the TTNoC, for example, the addresses of source and destination.When the communication occurs on the TTNoC between two nodes, the switches forward the message based on a given route.To ensure the contention-free communication on the TTNoC, a schedule is required to determine the offset for each message.However, synthesizing such a schedule is rather complicated which is known as a nondeterministic polynomial (NP)-complete problem. 13,14In this article, we give a population-based hybrid genetic algorithm (GA) coupled with an individual learning, called memetic-based schedule synthesis algorithm (MSSA), to synthesize a feasible schedule for the communication on TTNoC.
The main contributions of this article are as follows.We formally give a system model consists of architecture, message, and routing for the schedule synthesis.The Memetic-based Schedule Synthesis Algorithm (MSSA) is proposed to synthesize the schedule.The simulation based on different architecture scale and number of messages proves that the MSSA reduces the failure rate so that synthesizing a feasible schedule effectively.
The rest of this article is organized as follows.We first review the related work consists various algorithm to synthesize schedule based on different architectures in section ''Related work.''And the problem formulation consists of system model, and constraints are given in section ''Problem formulation.''Then, the detail of MSSA is proposed in section ''Memetic-based schedule synthesis algorithm.''The experimental results are shown in section ''Evaluations.''Finally, we conclude this article in section ''Conclusion and future work.''

Related work
There are many time-triggered applications in both bus-based and network-based architecture.Despite of different architectures, the communication on the timetriggered systems follows an predefined and statically configured schedule to ensure contention-free. 1 There are sufficient studies on schedule synthesis in timetriggered bus-based architecture. 4,15,16However, in bus-based architecture, synthesizing a feasible schedule only need to consider the temporal constraints rather than spatial constraints.
For the network-based architecture, most of the studies focus on synthesizing a feasible schedule based on satisfiability modulo theories (SMT).The scheduling of the general time-triggered multi-hop networks was first considered based on SMT solver. 14However, it is unrealistic for a pure SMT approach to synthesize a schedule for a large-scale time-triggered network.To tackle the limitation of scalability based on SMT, a decomposition approach 17 and an incremental method 14 were presented.Craciunas and Oliver 1,18 gave the solution combining task and network scheduling by SMT solver for distributed time-triggered systems.The schedule employs in time-triggered traffic in a general switched Ethernet network, which can also extend to specific Ethernet protocols such as Profinet and TTEthernet.
The schedule synthesis on network-based architecture in specific domains also appears in the various literature.Craciunas et al. 19 addressed the deterministic schedule synthesis for 802.1Qbv-compliant multi-hop switched networks.Zhang et al. 20 synthesized a schedule of a mixed-integer programming (MIP) model in Ethernet-based time-triggered systems.Ro et al. 21ynthesized the schedule on wireless networks by SMT solver.In time-triggered in-Vehicle networks, the holistic scheduling in system design and integration was studied. 22The Unfixed Start Time (UST) algorithm, which schedules tasks and messages in a flexible way, was proposed.
Huang et al. 13 first studied the schedule synthesis specific to TTNoC.The problem was transformed into a special case of two-dimensional (2D) bin packing and formulated as an SMT instance.The schedule was synthesized by SMT solver with a First Fit Decreasing Height Decreasing Width (FFDHDW) algorithm to improve the algorithm performance of execution time.Scholer et al. 23 proposed an optimal scheduler based on a Boolean SAT solver for a TTNoC.Murshed et al. 24 gave a scheduling model based on mixed-integer linear programming (MILP), with both time-triggered and event-triggered messages and constraints on NoC.Freier et al. 25 proposed a heuristic algorithm for scheduling on the scalable communication NoC-like structure.The algorithm ensures that the NoC and the core are highly utilized with pseudo-polynomial time complexity.
Unlike the above studies based on SMT-like approach, we propose a meta-heuristic approach of memetic-based algorithm to synthesize a feasible schedule.

Problem formulation
In this section, we first introduce the basic notions and system model of TTNoC.And the constraints on TTNoC are given.Then, we formally state the schedule synthesis problem.

System model
Architecture model.The architecture of a TTNoC is modeled by a directed graph G = (V, L).The set of vertices V = fv 0 , . . ., v mÀ1 g represents m identical communication nodes (the PEs with switches).The edges L V 3 V comprise the communication physical links connecting the nodes.The physical links are fullduplex, allowing communication in both directions.Therefore, given v i , v j 2 V, hv i , v j i 2 L implies hv j , v i i 2 L, where hv i , v j i is a pair denoting a directed physical link connecting two adjacent nodes, from a source node v i to a sink node v j .
Message model.We denote the set of n time-triggered messages on the TTNoC by G = ft 0 , . . ., t nÀ1 g.Message t i is modeled by the tuple ht i :H, t i :S, t i :T , t i :Di, where t i :H denotes the header of the message, t i :S denotes the size of the message, t i :T is the period, and t i :D is the relative deadline of the message.Only periodic messages are discussed in this article because periodic messages are typical in communication on real-time embedded systems. 13uting model.Given two nodes v, v 0 2 V, a route from v to v 0 , denoted by r hv, v 0 i .The length n of the route is written as jr hv, v 0 i j.A route r hv i , v j i represents a forwarding path for message communication from v i to v j on the TTNoC.Hence, its length jr hv i , v j i j is the number of hops along this link.

Schedule synthesis model
The schedule s i for message t i is defined by a tuple hs i :R, s i :f, s i :T , s i :D, s i :Li, where s i :R is the route along which the message t i is forwarded, s i :f is the offset of the message, s i :T denotes the period, s i :D denotes the relative deadline, and s i :L is the communication delay, respectively.The unit of offset, period, deadline, and delay is macrotick, which is the minimal time slot of communication and scheduling.
Let MT G denote the macrotick, then we have the following formulas Let W G denote the width of physical links in the TTNoC.SD G and PD G represent the switching delay in the switches and the propagation delay between adjacent nodes, and then, we have that where MT G denotes the value of macrotick, js i :Rj equals the number of hops, and SD G + PD G is the forwarding delay of each hop.This formula is based on Duato et al. 26 with adopting macrotick as the unit.By above formulas, given s i and its route s i :R, s i :T , s i :D, and s i :L can be derived by formulas 1-3, respectively.In other words, we want to determine the offset s i :f for each message communication.
We define the whole schedule set as S = fS:R, S:F, S:T , S:D, S:Lg, where S:R is the routes of all messages, S:F is the offset of all messages, S:T is the period of all messages, S:D is the relative deadline of all messages, and S:L is the delay of all messages.Therefore, the key problem is to derive S:F = fs i :fjs i 2 Sg based on the given system model with contention-free constraints.

Contention-free constraints
The constraints for general time-triggered multi-hop network are presented in Steiner. 14The constraints on the TTNoC are similar to those on general timetriggered network that a schedule S should ensure the contention free in both temporal and spatial domains.
Offset constraints.For the schedule of a message s i 2 S, the offset s i :f must have non-negative values and we should guarantee that the message transmission is completed before the deadline of the communication.Therefore, we have Link constraints.For each communication, a message occupies links in terms of a given route until the whole message is received by the sink node.The contention will happen if messages which share the overlapped route forward simultaneously.To show the link constraints, we first give the definition of overlap.Given two schedules of messages s i , s j 2 S, we define overlap(s i , s j ) to indicate whether there are any common physical links between the routes of s i and s j .overlap(s i , s j ) is true if the routes of s i and s j share at least one hop of physical links or false otherwise overlap(s i , s j ) = true s i :R \ s j :R 6 ¼ [ false s i :R \ s j :R = [ ð4Þ where s i :R and s j :R are routes of s i and s j , respectively.Then, we define the communication time for message t i in its kth period as an interval s i (k) The schedule S should ensure that two messages are never transmitted on the identical link at the same time.
In other words, the synthesized schedule must guarantee that the links on TTNoC are contention-free.There comes our constraint for links: Constraint 2. Given any p, q 2 N, s i , s j 2 S such that i 6 ¼ j, overlap(s i , s j )s i (p) \ s j (q) = [.

Problem statement
The problem of schedule synthesis can be formulated based on the schedule synthesis description and constraints, which are given as follows: The architecture of a TTNoC G = (V, L) consisting of the set of m communicating nodes V and interconnection links L V 3 V.
The set of n time-triggered messages G with ht i :H, t i :S, t i :T , t i :Di for each t i 2 G.
The routes S:R of the schedule S corresponding to G.
We try to determine the offsets S:F for messages G on TTNoC G, which satisfies Constraints 1 and 2. To solve the problem, we present the memetic-based schedule synthesis algorithm to synthesize offset S:F which meet the contention-free constraints.

Memetic-based schedule synthesis algorithm
In this section, we first give the motivation of schedule synthesis on TTNoC, and components' representation of MSSA is also given.Then, the algorithm description is proposed, followed by discussion about the details, that is, fitness function and global and local search strategies.

Motivation
To show the schedule synthesis problem, we first give an example of messages communication on a 3 3 3 mesh TTNoC, as shown in Figure 2.
And Table 1 shows the schedule information of messages on the TTNoC.The nodes on the TTNoC is denoted as V = fv 0 , . . ., v 8 g.The set of messages for communication is G = ft 0 , t 1 , t 2 , t 3 , t 4 g.The period is a positive power of two in terms of macrotick according to the timing specification of TTNoC. 13We assume that the relative deadline equals its period for each message, and we adopt XY routing 26 as the routing strategy for simplicity.The schedule synthesis problem is to determine the offset to avoid contention among messages.In other words, for each message in this example, we try to determine the offset in its possible offset.

Components representation
The MSSA requires genetic representation which is similar with general GA.MSSA adopts the hyperperiod Hp(S) as the definition of chromosome.The value of hyperperiod is the least common multiple of the period S:T among the schedule S for messages G, for example, the hyperperiod is 8 for the schedule on Table 1.We define the macrotick as a gene, and the location of a gene on a chromosome denotes the offset of a message.A chromosome represents a possible allocation for the offset of messages S:F.It should be noted that a single gene may consist of multiple offsets of messages since several messages without contention can be transmitted at the same time on the network-based TTNoC.Note that each individual is equipped with a score, which is evaluated by some fitness function.The fitness function is discussed later.
The population with two individuals in our motivation from Table 1 is proposed in Table 2.For individual in 0 , the offset of message from s 0 , s 1 , s 2 , s 3 , s 4 is 0, 0, 2, 4, and 7, respectively.

Algorithm description
Memetic algorithm (MA) is widely used as a synergy of evolutionary or any population-based approach with separate individual learning or local improvement procedures for solution search. 27,28Based on MA, MSSA consists global search and local search.We deploy the GA as the global search strategy.And the subset of infeasible schedule is chosen as the element to join the local search.
We formally give the algorithm as in Algorithm 1.When the MSSA starts, the offset of messages is generated randomly within the possible offsets by initPop(scale) (Line 1).The best individual best among the population is selected by selectBest(pop).If no feasible schedule exists in the initial pop, we start the iteration (Lines 6-18) until a feasible scheduling is derived (Lines 14-16) or an upperbound of the iteration number N is reached.For each iteration, the GA operations of crossover(pop) and mutation(pop) are employed as global search strategies.And the local search localSearch(pop) is employed after that.After the search, the best individual will be chosen (Lines 11-13).The iteration ends when the chromosome of best individual is a feasible schedule (Lines 14-16).The new population for the next iteration is generated by selection select(pop, scale) (Line 17).The individual with

Fitness function
The fitness function is to evaluate individuals in the population.To adopt the fitness function, we first determine the scenario of overlap among messages.And we transform chromosome to represent the communication time for messages in the hyperperiod.
Then, the score of each individual can be acquired by the fitness function to evaluate the chromosome in Constraint 2. By checking the forward routing for each message by Formula 4, we denote the set of overlapped schedule O(s i ) for s i based on Formula 4, and we have O(s i ) = fs j joverlap(s i , s j ), s i , s j 2 Sg Table 3 shows the route based on XY routing and overlapped set for the messages depicted in Table 1.Since overlap(s 0 , s 1 ) and overlap(s 0 , s 3 ) are false while overlap(s 0 , s 2 ) and overlap(s 0 , s 4 ) are true, the overlapped set O(s 0 ) is fs 2 , s 4 g.
The communication time of message in the kth period s i (k) is defined by Formula 5, so we have where D Hp (s i ) denotes the communication time in a hyperperiod.We define D Hp (S) = fD Hp (s i )js i 2 Sg that denotes the set of communication time for messages in a hyperperiod.Table 4 shows communication time for messages based on given individuals in Table 2.
For s i , s j 2 S, s i 6 ¼ s j , if s i and s j are overlapped, the times of conflicts between them should be derived to evaluate the chromosome.For s i 2 S, we define C(s i ) to derive the set of schedule conflicted with s i .So, we have If there is no conflict with s i on the its duration, then C(s i ) = [.We define the total times of conflicts for s i as times(s i ).And we have where the function conflict(s i , s j ) is to count the times of conflicts between s i and s j .We define C(S) = fs i jC(s i ) 6 ¼ [g to denote the set of conflicting schedule.The fitness function is the sum of times of conflicts in C(S).Thus, for a individual in, we have times(s i ) Since the score represents the times of conflicts, the lower the score, the better the individual is, and the individual with score zero represents a feasible schedule.The score of two individuals in Table 2 is shown in Table 5.

Global search strategy
The general operation in a GA, such as crossover and mutation, 29 is used in the step of global search.For operation of crossover, we employ two of the individuals in i and in j among the population as parents to join the crossover in terms of their score.The lower score of an individual, the higher possibility for this individual to be selected as parent.The crossover generates a new individual called child, and its chromosome depends on the parents.The individual of parents with lower score owns higher possibility to determine the offset location s i :f for s i 2 S on the chromosome of child.For parents in i and in j , we define the function to represent the possibility for in i as a parent to determine the offset in the chromosome of child.Table 6 shows process of crossover.in 2 is generated by crossover based on the two individuals in Table 2 as parents.Because the score of in 0 is 4 while in 1 is 2, in 0 owns 67% while in 0 has 33% of possibility to determine the offset.A possible result of crossover is given: chromosome of in 2 with the offset of s 0 , s 2 , s 3 from in 1 and s 1 , s 4 from in 0 .
The operation of mutation randomly selects an offset and reallocate a new offset randomly in its possible offset.Table 7 is an example of mutation.It is noticed that the probability of mutation for each individual in our implement is 10%.

Local search strategy
Before the local search for each individual, the schedule s i 2 S with the maximum value of times(s i ) is selected as local search element.If there are two or more individuals with the maximum times of conflicts, the element to be searched is selected stochastically among them.Then, the offset of message to be searched is reallocated in its possible offset.Each reallocated individual with minimum score replaces the previous individual.Table 8 shows an example of local search for in 0 in Table 2. Since times(s 0 ) = times(s 2 ) = 2 in Table 5, we randomly select s 0 as the element.We locate the s 0 on its possible offsets 0 and 1.After evaluating individuals within possible offset s 0 :f, we select the individual whose score is 2 as the updated in 0 because this individual owns the minimum score.

Evaluations
The network architecture we employed for simulation is a 2D mesh network whose scale is 3 3 3, 5 3 5, 7 3 7, 9 3 9, 11 3 11, and 13 3 13, respectively.The number of message in our evaluation is from 5 to 100.Each message owns its period and delay which is randomly generated.The period is randomly synthesized in f2 n jn 2 ½1, 10, n 2 Zg, and the delay is less than its period.We compare the MSSA with the GA in various architecture and number of messages, and for each

Failure rate of schedule
The schedule of a message fails if the message communication faces contention with other messages based on this given schedule.To compare the performance of schedule synthesis of MSSA with GA, we define the failure schedule of messages as S:F fail .And the failure rate of schedule R fail as jS:F fail j=jS:Fj.Figure 3 shows R fail for variable types of test cases by MSSA and GA, denoted as R fail (MSSA) and R fail (GA), respectively.The failure rate by the GA is higher than the MSSA in each configuration, especially when the scale of architecture and the number of messages are both relatively large, for example, for the case of 90 messages in 13 3 13 TTNoC, the rate is 11.9% for the GA while only 1.8% for the MSSA.It is proposed that the local search in the MSSA is the key step to significantly improve the performance.
We define R fail (MSSA)=R fail (GA) in Table 9 to compare MSSA with GA in different scales of architecture.From the results, we can see that the R fail (MSSA) is about 34.4% of the R fail (GA).R fail decreases when the scale of TTNoC architecture increases.The reason is that the link resource increases with the growth of architecture scale, resulting in decreasing the possibility of contention among the messages' transmission on the TTNoC.The failure rate of schedule increases when the number of messages on the TTNoC increases.It is because the limited link resources have to transmit more messages when there is more messages on the TTNoC.

Feasible cases
We consider the number of feasible cases in each experiment type.The schedule for all messages on TTNoC is feasible when there is no conflict between communication of messages in both spatial and temporal domains.In other words, a case of communication is feasible if each synthesized schedule of message S:F is contention-free, otherwise it is an infeasible case.
Figure 4 presents the result of numbers of feasible cases in different scale of architecture after the schedule synthesis.For simple test cases with less than 15 messages, most of the cases are feasible.But for complex test cases of more than 60 messages, it is hard for MSSA to find a feasible schedule.

Discussion
Synthesizing a feasible schedule depends on the number of messages, the route of messages, and the scale of TTNoC.It is hard for MSSA to synthesize a feasible scheduling when the set of messages is large and/or the scale of TTNoC architecture is small.However, except two reasons above, the mapping between messages and nodes as well as routing strategy also affect generating a feasible solution.The designer can manually change the mapping allocation or the routing strategy for the failure schedule or even design a larger scale of network architecture if needed.After these changes, the feasible scheduling can be generated by the MSSA iteratively.

Conclusion and future work
This article proposes an MSSA to synthesize the schedule for message communication on the TTNoC.MSSA deploys the GA as the global search strategy, and the subset of infeasible schedule is chosen as the element to minimize its contention times.We evaluate our MSSA and general GA with various randomly generated messages on varying scales of mesh-based TTNoC.The results show that our MSSA is effective to synthesize a schedule with less infeasible message communication, which is 34.2% compared with the general GA.In our future work, the mapping between messages and nodes and routing strategy will be integrated to our consideration before scheduling of messages on the TTNoC.And the different TTNoC architecture, for example, torus and hypercube, and different local search strategies, for example, simulated annealing, will also be implemented in our evaluations for the improvement of schedule synthesis performance.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Figure 1 .
Figure 1.Two main architectures for a time-triggered embedded system: (a) bus-based architecture and (b) networkbased architecture.

Figure 2 .
Figure 2. Motivation of messages communication on the TTNoC.

Figure 4 .
Figure 4.The number of feasible cases in different scale of TTNoC and number of messages.

Table 1 .
The schedule information of messages in Figure2.

Table 2 .
The component representation of the population consists of two individuals.

Table 3 .
The route and overlapped set for schedule in Table2.

Table 4 .
The communication time in a hyperperiod for the schedule in Table2.

Table 5 .
Evaluating individuals in Table1by the fitness function.

Table 6 .
An example of the crossover between individuals in Table2.

Table 7 .
An example of the mutation for individuals in Table2.

Table 8 .
Local search for individual in 0 in Table2.configuration of simulation, we repeat 15 times.The size of population in MSSA and GA is both 100.

Table 9 .
The average failure rate of schedule in different scale of TTNoC.