Embedded Systems

Scenario-Aware Program Specialization for Timing Predictability

by Joscha Benz and Oliver Bring­mann
In ACM Trans. Ar­chit. Code Optim. 18(4). As­so­ci­a­tion for Com­put­ing Ma­chin­ery, 2021.

Key­words: an­a­lyz­abil­ity, worst-case ex­e­cu­tion time, Pre­dictabil­ity, tim­ing analy­sis

Ab­stract

The suc­cess­ful ap­pli­ca­tion of sta­tic pro­gram analy­sis strongly de­pends on flow facts of a pro­gram such as loop bounds, con­trol-flow con­straints, and op­er­at­ing modes. This prob­lem heav­ily af­fects the de­sign of real-time sys­tems, since sta­tic pro­gram analy­ses are a pre­req­ui­site to de­ter­mine the tim­ing be­hav­ior of a pro­gram. For ex­am­ple, this be­comes ob­vi­ous in worst-case ex­e­cu­tion time (WCET) analy­sis, which is often in­fea­si­ble with­out user-an­no­tated flow facts. More­over, many tim­ing sim­u­la­tion ap­proaches use sta­t­i­cally de­rived tim­ings of par­tial pro­gram paths to re­duce sim­u­la­tion over­head. An­no­tat­ing flow facts on bi­nary or source level is ei­ther er­ror-prone and te­dious, or re­quires spe­cial­ized com­pil­ers that can trans­form source-level an­no­ta­tions along with the pro­gram dur­ing op­ti­miza­tion. To over­come these ob­sta­cles, so-called sce­nar­ios can be used. Sce­nar­ios are a de­sign-time method­ol­ogy that de­scribe a set of pos­si­ble sys­tem pa­ra­me­ters, such as image res­o­lu­tions, op­er­at­ing modes, or ap­pli­ca­tion-de­pen­dent flow facts. The in­for­ma­tion de­scribed by a sce­nario is un­known in gen­eral but known and con­stant for a spe­cific sys­tem. In this ar­ti­cle,1 we pre­sent a method­ol­ogy for sce­nario-aware pro­gram spe­cial­iza­tion to im­prove tim­ing pre­dictabil­ity. More­over, we pro­vide an im­ple­men­ta­tion of this method­ol­ogy for em­bed­ded soft­ware writ­ten in C/C++. We show the ef­fec­tive­ness of our ap­proach by eval­u­at­ing its im­pact on WCET analy­sis using al­most all of TACLeBench–achiev­ing an av­er­age re­duc­tion of WCET of 31%. In ad­di­tion, we pro­vide a thor­ough qual­i­ta­tive and eval­u­a­tion-based com­par­i­son to closely re­lated work, as well as two case stud­ies.