# US 7,613,595 B2 · Execution and real-time implementation of a temporary overrun scheduler

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 7,613,595 B2
- Document ID: US7613595B2
- Status: Granted
- Kind: B2
- Application number: 11/070,326
- Filed: 2005-03-01
- Published: 2006-09-07
- Granted: 2009-11-03
- Earliest claimed: 2005-03-01
- Assignees: The Math Works, Inc.
- Inventors: David MacLay
- Web page: https://patentgrep.com/patent/US7613595B2

## CPC

- G06F 9/455: Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F 9/4887: {involving deadlines, e.g. rate based, periodic}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The automatic generation of a real-time scheduler for scheduling the execution of tasks on a real-time system is disclosed. The scheduler may allow task overruns in the execution of the tasks on the real-time system. The task overruns may occur when the execution of a task for a current sample hit is not completed before a next sample hit. When the task overruns occur, the scheduler may delay the execution of the task for the next sample hit until the execution of the task for the current sample hit is completed. The execution of the task for the next sample hit is performed after the execution of the task for the current sample hit is completed. The present invention may enable users to input information relating to the behavior in real-time execution of the graphical programs or models. The present invention may simulate the graphical programs or models using the information on the behavior of the graphical programs or models executed in the real-time execution.

## Claims

### Claim 1

In a computational device that provides a modeling environment, a method for executing a model in a real-time system, the method comprising:
providing a model in the modeling environment;
providing a user interface for receiving an instruction for configuring code generation from the model, the user interface including at least one task overrun option for executing code generated from the model in the real-time system;
receiving a selection via the user interface that includes one or more of the task overrun options;
automatically generating code for the model based on the instruction received via the user interface, the instruction including the selection, the generated code including a scheduler;
scheduling execution of the generated code using the scheduler, the scheduling allowing overruns during the execution; and
executing the generated code in the real-time system.

### Claim 2 (depends on 1)

The method of claim 1, wherein the overruns in the execution of the code occur when the execution of the code is not completed within a given time interval.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
when the overruns occur in the execution of the code, delaying the execution of the code for a new time interval until the execution of the code for the given time interval is completed.

### Claim 4 (depends on 2)

The method of claim 2, further comprising:
canceling the execution of the code for a new time interval.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
executing a first portion of the code in the real-time system regularly; and
executing a second portion of the code in the real-time system regularly, the code allowing the overruns in the execution of at least one of the first and second portions of the code in the real-time system.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
when the overruns occur in the execution of the first portion of the code, delaying the execution of the second portion of the code for a new time interval until the execution of the first portion of the code for a current time interval is completed.

### Claim 7 (depends on 5)

The method of claim 5, further comprising periodically executing the first portion of the code at a first rate, which is a base rate, and periodically executing the second portion of the code at a second rate, which is a sub-rate.

### Claim 8 (depends on 5)

The method of claim 5, further comprising preempting the execution of the second portion of the code by the execution of the first portion of the code.

### Claim 9 (depends on 5)

The method of claim 5, wherein the overruns in the execution of at least one of the first and second portions of the code change an execution order of the code.

### Claim 10 (depends on 5)

The method of claim 5, further comprising:
when the overruns occur in an execution of the first portion of the code, canceling the execution of the second portion of the code for a new time interval.

### Claim 11

A system for executing a model in a real-time target, the system comprising:
a storage for storing the model;
a user interface for receiving an instruction for configuring code generation from the model, the user interface including at least one task overrun option for executing code generated from the model in a real-time target;
a processor configured to:
generate code for the model based on the instruction received via the user interface, the instruction including the selection of the at least one task overrun option, and
implement a scheduler in the generated code; and
a real-time target for executing the generated code for the model, the scheduler scheduling an execution of the code and allowing overruns in the execution of a first portion of the code in the real-time target.

### Claim 12 (depends on 11)

The system of claim 11, wherein the first portion of the code is executed in the real-time target periodically at a first rate.

### Claim 13 (depends on 11)

The system of claim 11, wherein the overruns in the execution of the first portion of the code occur when the execution of the first portion of the code is not completed at a scheduled time of another execution of the first portion of the code.

### Claim 14 (depends on 12)

The system of claim 12, wherein when the overruns occur in the execution of the first portion of the code, the scheduler delays an execution of the first portion of the code for a new time period of the first rate until the execution of the first portion of the code for a current time period is completed.

### Claim 15 (depends on 11)

The system of claim 11, wherein a second portion of the code is executed in the real-time target regularly, wherein the scheduler allows overruns in the execution of the second portion of the code in the real-time target.

### Claim 16 (depends on 15)

The system of claim 15, wherein the overruns in the execution of the second portion of the code occur when the execution of the second portion of the code is not completed at a scheduled time.

### Claim 17 (depends on 15)

The system of claim 15, wherein when the overruns occur in the execution of the second portion of the code, the scheduler delays an execution of the second portion of the code for a new scheduled time until the execution of the second portion of the code for a current scheduled execution time is completed.

### Claim 18 (depends on 15)

The system of claim 15, wherein connections between components of the model include interface attributes that allow the overruns in the execution of the first and second portions of the code.

### Claim 19 (depends on 18)

The system of claim 18, wherein the interface attributes comprise properties that specify a number of overruns.

### Claim 20 (depends on 18)

The system of claim 18, wherein the interface attributes comprise properties that specify a frequency with which overruns occur.

### Claim 21 (depends on 18)

The system of claim 18, wherein values assigned to the interface attributes are indicated in a graphical model.

### Claim 22 (depends on 18)

The system of claim 18, wherein values assigned to the interface attributes are indicated by one of line style, drop-back shading and coloring.

### Claim 23

A computer-readable storage medium holding instructions to execute a model in a real-time system, the instructions when executed causing a computing device to:
provide a model in a modeling environment;
provide a user interface for receiving an instruction for configuring code generation from the model, the user interface including at least one task overrun option for executing code generated from the model in the real-time system;
receive a selection via the user interface that includes one or more of the task overrun options;
generate automatically code for the model based on instructions received via the user interface, the instructions including a selection of the at least one task overrun option, the generated code including a scheduler;
schedule execution of the generated code using the scheduler, the scheduling allowing overruns during the execution; and
execute the generated code in the real-time system.

### Claim 24 (depends on 23)

The medium of claim 23, wherein the overruns in the execution of the code occur when the execution of the code is not completed within a given time interval.

### Claim 25 (depends on 24)

The medium of claim 24, wherein the instructions when executed further cause the computing device to:
delay, when the overruns occur in the execution of the code, an execution of the code for a new time interval until the execution of the code for the given time interval is completed.

### Claim 26 (depends on 23)

The medium of claim 23 wherein the instructions when executed further cause the computing device to:
cancel the execution of the code for a new time interval.

### Claim 27 (depends on 23)

The medium of claim 23 wherein the instructions when executed further cause the computing device to:
execute a first portion of the code in the real-time system regularly; and
execute a second portion of the code in the real-time system regularly, the code allowing overruns in the execution of the first and second portions of the code in the real-time system.

### Claim 28 (depends on 27)

The medium of claim 27, wherein the instructions when executed further cause the computing device to:
delay, when the overruns occur in an execution of the second portion of the code, the execution of the second portion of the code for a new time interval until the execution of the second portion of the code for a current time interval is completed.

### Claim 29 (depends on 27)

The medium of claim 27 wherein the instructions when executed further cause the computing device to:
execute periodically the first portion of the code at a first rate, which is a base rate, and execute periodically the second portion of the code at a second rate, which is a sub-rate.

### Claim 30 (depends on 27)

The medium of claim 27, wherein the instructions when executed further cause the computing device to:
preempt the execution of the second portion of the code by the execution of the first portion of the code.

### Claim 31 (depends on 27)

The medium of claim 27, wherein the overruns in the execution of the first and second portions of the code change the execution order of the code.

### Claim 32 (depends on 27)

The medium of claim 27 wherein the instructions when executed further cause the computing device to:
cancel, when the overruns occur in an execution of the first portion of the code, the execution of the second portion of the code for a new time interval.
