TAILIEUCHUNG - Model-Based Design for Embedded Systems- P15

Model-Based Design for Embedded Systems- P15: This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. | 106 Model-Based Design for Embedded Systems Listing Function to determine clock rate of the x clock of a given task. 1 int 0 1 isRunning return buffer resource . element 0 id 1 0 Each task uses two clock variables called time and x where time represents the time since the beginning of the current period and x represents how long the task has executed in the current period. The variable x is a local variable whereas time is global and thus indexed by the task id. As we are using stopwatch automata note that the progress rate of x is set to zero in all but the Ready location. In Ready the rate determines whether the task is currently executing on the given resource. This is checked using the local function isRunning defined in Listing . On the other hand time is always running and is reset at every period so that when time exceeds the deadline the task can move to Error. Upon entering Ready the task updates the variable ready_task with the task id to indicate which task has signaled to the given resource. The resource utilizes this id when inserting the task in the queue for execution. We return to this in Section . To allow for problem-specific requirements such as individual taskconstraints the task template includes the following three functions new_period dependencies_met and completed. These functions can be used for a variety of problem-specific purposes the most obvious of which is the task graph dependency definition. How to model task graphs is illustrated as follows new_period is executed on the edges leading to Waiting and used for updating data structures indicating that the task is beginning a new period dependencies_met is tested in the guard leading from WaitingDependency to Ready and completed is executed on the edge exiting Ready toward either Done location. Modeling Task Graphs To model task graphs using the customizable functions described above we first need a global data structure to hold the task graph itself. In Listing

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.