matlab中的latency,Kernel Latency

Kernel Latency

In a deployed application, switching between threads requires a finite amount of time

depending on the current state of the thread, embedded processor, and OS. Kernel

latency defines the time required for the operating system to respond to a

trigger signal, stop execution of any running threads, and start the execution of the thread

responsible for the trigger signal.

SoC Blockset™ models simulate Kernel latency as a delay at the start of

execution of a task the first time the task moves from the waiting to running state. The

following diagram shows the execution timing of a high-priority and low-priority task on a

system that simulates a single processor core.

e0a596e4110b7f3030913f4c1064b408.png

Other factors affecting kernel latency, such as context switch times, can be considered

negligible compared to other effects and are not modeled in simulation.

Note

Kernel latency requires advanced knowledge of the processor specifications and can be

generally set to 0 without impact to the simulation.Effect Kernel Latency on Task Execution

This example shows the effect of kernel latency on the behavior and timing of two timer driven tasks in an SoC application.

The following model simulates a software application with two timer driven tasks. The task characteristics, specified in the Task Manager block, are as follows:

09ee2bba31abd1a8dec7849f91e0cb4b.png

With these timing conditions, the high priority task preempts the low priority task. In the model Configuration Parameters dialog box, the Hardware Implementation > Operating system/scheduler > Kernel latency is set to 0.002.

83487a258af8d7107fb15849e2bd9800.png

Run the model and open the Simulation Data Inspector. Selecting the two task signal produces the following display.

4bb57f2cff8b32987acc4209fab15946.png

Inspecting the Simulation Data Inspector, a change in task state from Waiting to Running shows a latency of 0.002 seconds. However, when the task changes from Preempted to Running, no latency occurs. This timing matches with the expected behavior of task, experiencing a latency in startup of that task execution instance, but not when the task instance already exists.

See Also

Related Topics

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值