EP2761436A1 - Method for operating a processor - Google Patents

Method for operating a processor

Info

Publication number
EP2761436A1
EP2761436A1 EP12702491.7A EP12702491A EP2761436A1 EP 2761436 A1 EP2761436 A1 EP 2761436A1 EP 12702491 A EP12702491 A EP 12702491A EP 2761436 A1 EP2761436 A1 EP 2761436A1
Authority
EP
European Patent Office
Prior art keywords
program
processor
time
critical
interrupt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
EP12702491.7A
Other languages
German (de)
French (fr)
Inventor
Rene Graf
Wolfgang Hartmann
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Siemens AG
Original Assignee
Siemens AG
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Siemens AG filed Critical Siemens AG
Publication of EP2761436A1 publication Critical patent/EP2761436A1/en
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30087Synchronisation or serialisation instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3851Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3867Concurrent instruction execution, e.g. pipeline or look ahead using instruction pipelines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Definitions

  • a method of operating a processor the present invention relates to a method for Operator Op ben ⁇ a processor. Moreover, the present invention relates to an ⁇ processor. Finally, the present invention relates to an automation device with a processor.
  • Modern processors today have more than one core and are referred to as multi-core processors (MC) because they can run multiple programs in real parallel.
  • MC multi-core processors
  • Each Pro ⁇ program runs on a separate processor core (core) and has to this with all its subunits as Fretekom- maarithmetik unit (floating point unit, FPU) shared with any other program while it is running.
  • Hyper-Threading there is a processor core Einhei ⁇ th, the process different tasks. Examples are z.
  • LSU Load Storage Unit
  • ALU Arithmetic Logical Unit
  • the ALU may operate on values in certain registers while the LSU is loading or transferring other registers.
  • the processor has a so-called pipeline in which the individual instructions are processed in succession, whereby the individual stages of the pipeline map the various units in the processor. Most of the time, however, the units have to wait for each other, so the pipeline can only be partially filled and the theoretically possible computing power is not exploited. This limitation is largely removed by the HT processors by playing two or more processors to the operating system, even though they only have parts of the additional processors available internally.
  • two quasi-parallel programs run on a processor with a per ⁇ zessorkern (single-core processor).
  • Each program contains a list of instructions (instruction queue), which must be processed one after the other.
  • instruction queue In a single-core processor, the order is unique and the runtime of the command chain is always the same even after any number of passes.
  • the programs run deterministically in this case.
  • the processor In a HT-processor, however, the processor internally mixes the commands from the two available command lists to fill the pipeline as optimally as possible and to reach the theoretically possible overall ⁇ computing power. This works quite well for many programs, and due to the fact that not all units are redundant, does not reach the double or n-times the performance ⁇ the can.
  • HT processors Especially complex units like the FPU are usually only available once for HT processors. If two programs are running in parallel, both of which use floating-point arithmetic, the HT processor is no faster than a normal single-core processor. However, since this is rarely the case, an HT processor basically enables an increase in computing power.
  • the HT processors offer a cost-effective alternative to true multi-core processors to get more computing power, at least for non-real-time applications, but can not be used because of the massive time constraints on the runtime of the real-time application.
  • Even true MultiCore computers still have certain limitations, as well as the processor, in which all units are multiple, other components such as memory or peripherals are used, which are only once in the entire system and thus lead to mutual blockage of each program can.
  • the method according to the invention for operating a processor comprises providing a first program with a first sequence of commands, providing at least one second program with a second sequence of commands, wherein the first program comprises a time-critical section with time-critical commands, processing the commands the first and second program in a processor pipeline, the detection of a start time of a time-critical Ab ⁇ section in the first program and the insertion of a predetermined interrupt program in the at least one second program, as soon as the start time of the time-critical section is detected in the first program ,
  • command is to be understood in particular as a machine command of the processor.
  • the commands can be assigned to the respective units of the processor.
  • portion denotes in particular a plurality of hanging together ⁇ commands.
  • a program is understood to be a list of instructions which is executed by the processor in order to achieve a specific functionality.
  • the commands can be assigned to corresponding sections.
  • the processor comprises at least two logical Ker ⁇ ne, wherein each of the logical cores is associated with a program.
  • the processor is designed as a hyper-threading processor (HT processor).
  • HT processor hyper-threading processor
  • the processor or an operating system executing on a storage device of the processor is adapted to recognize ei ⁇ NEN start time of the time-critical process in the first program.
  • a predetermined interrupt program is inserted into the at least one second program.
  • the section currently provided or processed on the at least second program is replaced by a corresponding one Interrupt program interrupted or stopped.
  • This interruption program may include a sequence of commands previously known.
  • the interrupt program preferably knows exactly which commands are executed and which parts of the processor are accessed.
  • a processor on which time-critical commands or sections can be processed can also be made accessible for non-time-critical parts of a system without adversely affecting the time-critical processes.
  • the essential aspect of why the mixing of the sections or commands in a conventional HT processor leads to a non-deterministic execution of a command list is the unpredictability of which command is in the other program.
  • This problem is inventively solved in that the commands or Abschnit ⁇ te the other programs are defined, which may be processed in the case of a time-critical process sequence yet.
  • an interrupt signal is sent to the second program for inserting the interrupt program.
  • the time-critical section or the time-critical sequence can generally be started by an interrupt, since the time-critical processor must react to an event. Such an event can occur either cyclically, for example controlled by a timer.
  • the start of the time-critical section or the time-critical sequence in the first program now transmits an interrupt signal or an interrupt to the at least second program of the processor, wherein the second program is seen from the point of view of the operating ⁇ system as an independent and complete core.
  • the inset in the second program interruption program that can also be used as interrupt service routine (ISR) ⁇ be distinguished, has launched the second processor core in a defined state.
  • ISR interrupt service routine
  • a time-critical section is form-machining ⁇ tet along with the interruption program in a predictable sequence in the processor pipeline. If a time-critical section is detected in the first program, a previously defined interrupt program is inserted in the at least second program. Since this interrupt program, which may also be referred to as an idle task, consists of known instructions, mixing with the unknown instructions of the time-critical section in the processor pipeline nevertheless becomes clear. As a result, the same run times always result, especially with several runs of the time-critical program.
  • the decommissioning of the second or more logical KER ne or programs using the interrupt program allowed ⁇ light is to keep the time-critical section the necessary determinism.
  • a higher throughput compared to a single-processor solution can be achieved because the non-time-critical programs can use more than one logical processor core, if no time-critical section is currently being processed. If the time-critical section is not active, the non-time-critical programs can use the at least two logical cores of the HT processor.
  • the non-deterministic Vermi ⁇ research is irrelevant here because the non-time-critical pro ⁇ programs are valued at their data throughput rising by the parallel processing. Thus, the performance of the entire processor or device can be increased without affecting the reliability.
  • the non-time critical Program interrupted or shut down by the interrupt program only for such a period of time that requires the time-critical section for editing.
  • a non-time critical program can be processed on both logical processor cores again.
  • the processing of non time-critical programs or commands can be accelerated on the processor.
  • the interrupt program comprises reading a value from a memory, comparing the read value with a predetermined value, and restarting the interrupted program, if the ge ⁇ read value and the predetermined value are different.
  • a value or a date is first read from a previously defined memory cell. It then compares whether this value matches a predefined value. If it is not the case, the value in the memory is read again and thus the routine is restarted.
  • These commands also define which units of the processor will be used. In this case, in particular those units are used which are multiply present in the processor or which belong to the second program or the second logical core alone. Such units may be, for example, a load storage unit that can load corresponding values from a memory.
  • a so-called compare unit can be used, which can compare corresponding values.
  • an internal memory cell of the processor can be used in particular. Thus, that is accessed during the interrup ⁇ monitoring program to the physical main memory can be prevented.
  • the units of the processor be ⁇ known to be used by the interrupt routine. The other units are fully available to the program or logical core that processes the time-critical section. As a result, the runtime of the time-critical section or command list is not adversely affected.
  • the interrupt program is terminated by writing to memory a value that corresponds to the predetermined value.
  • a value can be read from an internal memory of the processor and compared to a predetermined value. As long as the time-critical section is not completed or processed, the previously set value is not written to memory. Only after the processing of the time-critical section is in the
  • the routine of the interruption program is also ended. It is advantageous to select a memory cell located within ⁇ half of the processor and not in physical main memory, so that the interrupt program and the idle task can occupy no singular resources such as memory access, or even bus systems. Thus, the interrupt program can be terminated in a simple manner and the non-time critical commands can be processed accordingly on the at least two programs or logical cores.
  • the processor comprises a first processor ⁇ unit for standing by a first program with a first sequence of instructions, at least one second processor wherein the first Pro ⁇ program includes unit for providing at least a second program with a second sequence of commands, a time-critical section a processor pipeline for processing the commands from the first and two ⁇ th program and a memory device with an operating system, wherein the processor is adapted to perform the loading ⁇ operating system and wherein the processor or the operating system is adapted to to recognize start time of the time-critical section in the first program and a predetermined interrupt program in the to-least a second program to insert as soon as the start ⁇ date on which the time-critical section in the first Pro ⁇ program is detected.
  • the processor includes a data exchange unit and a comparison unit, wherein said data exchange unit is adapted to read ei ⁇ NEN value from a memory during the interruption program, and wherein the comparison unit is configured to, during the interrup ⁇ monitoring program the read value with a previously compare festgeleg ⁇ th value.
  • ⁇ A units of the processor are used during the interruption program.
  • Such units are preferably used which are available to the respective logical processor core or program alone.
  • an internal memory of the processor can be used.
  • the processor comprises at least two processor cores.
  • the method described above for operating a processor can be used not only for HT processors but also for true multi-core processors in which all cores have all the necessary units.
  • common MultiCore processors even the strict division of time-critical and time-uncritical programs assigned to the respective processor cores can lead to non-deterministic behavior, since both subapplications access other system components such as memory or peripherals. Especially the latter causes problems, even if the different applications use different peripherals, since the connection of processor with multiple cores to the multiple peripherals on individual bus systems (usually PCI or PCIe) is built. The resulting possible mutual blockages can be excluded by the method described.
  • processors share several cores the cache. If one of the programs or commands in a kernel can not access the cache but must access the main memory, slows down the entire execution time considerably. If a defined interrupt program is run when executing a time-critical section on the at least one further program or core, the real-time application can not be influenced by its cache behavior.
  • the automation device comprises a processor described above.
  • Automation devices usually include two essential functions, the physical control of a physical process and the
  • the communication can be either through a user interface or via a
  • Control function which is usually a time-critical section, usually takes up only a small part of the processing power of the processor.
  • Control tasks should be able to be executed at any time.
  • the communication programs take
  • FIG. 2 shows a schematic representation of the command arrangement of two programs, wherein the first program comprises a time-critical section;
  • FIG. 3 shows a schematic representation of the instruction arrangement of two programs and a processor pipeline
  • FIG. 5 shows a schematic representation of another test arrangement.
  • FIG. 1 shows a schematic representation of the execution of the programs on a processor according to the prior art.
  • a processor is called a HyperThreading processor.
  • the processor comprises a processor core, on which, for example two processor units are vorgese ⁇ hen. Each processor unit is assigned to a program.
  • a first Pro ⁇ program 10 and a second program 12 is run on the processor.
  • the first program 10 comprises a first sequence of instructions 14 and the second program 12 comprises the second series of instructions 16.
  • the order of the instructions 14 in the first program 10 and the instructions 16 and the second program 12 are clearly ⁇ ordered.
  • time-critical and non-time critical sections can be processed.
  • the instructions 14 from the first program 10 and the instructions 16 from the second program 12 are processed in the processor pipeline 18.
  • the commands 14 and 16 are sorted accordingly and worked from ⁇ . This results in the processor pipeline ei ⁇ ne non-deterministic and disordered order of the first instructions 14 and the second commands 16th
  • the first program 10 and the second program 12 can be considered as a logical processor cores, wherein the Prozes ⁇ sor only includes a processor core.
  • different units of the processor may be present once or several times. Usually, the units performing simple arithmetic operations are multiple, with more complex units being simply present.
  • FIG. 2 shows a schematic representation of two programs 10 and 12, the first program 10 comprising a time-critical section 52. Such a time-critical section 52 is usually started by an interrupt, since this must respond to an event. Such an event may, for example, occur cyclically or only sporadically.
  • an event may, for example, occur cyclically or only sporadically.
  • Start time of the time-critical portion 52 is indicated by the arrow 22.
  • the second program 12 includes a non-time-critical portion 52.
  • the processor or an operating system executed on a memory device of the processor is configured to recognize the start time of the time-critical portion 52 in the first program. Once the start time of the time critical portion 52 is recognized in the first program 10, a predetermined interrupt program 26 is inserted in the second program 12.
  • the interruption program which may also be referred to as an idletask, may include the following steps:
  • This command sequence also defines which units of the processor will be used. In the present case, only the load storage unit and the compare unit are used. In addition, it is preferred resorting to an internal memory of the processor to ⁇ . With the end of the time-critical section 52 is also the
  • Interruption program 26 ended.
  • a write command writes the previously determined value into the memory cell, which is permanently read by the interrupt program 26. This is exemplified in FIG 2 by the arrow 30 Darge ⁇ represents.
  • FIG. 3 shows a schematic representation of the processing of the commands in the first program 10, in the second program 12 and in the processor pipeline 18.
  • the first program 10 comprises time-critical sections 56 or commands 32 as well as time-critical sections 52 or commands 20. If it is detected in the first program 10, the start time of a zeitkriti ⁇ rule section 20, as in the second program 12 is a previously defined program interruption 26 is inserted. In this case, the time-critical section 24 currently being operated on the second program is interrupted or shut down.
  • the sections or instructions 20, 24, 26, 32 from the programs 10 and 12 are processed in the processor pipeline 18.
  • a first program comprises a time-critical section 52.
  • a second program 12 comprises a non-time-critical or a non-time-critical section 54.
  • the first program 10 and the second program 12 are each assigned a logical core of a hyper-threading process be.
  • the first program 10 and the second program 12 may each be assigned a processor core of a multi-core processor (MultiCore processor).
  • MultiCore processor multi-core processor
  • a floating point unit (FPU) is used for calculations.
  • FPU floating point unit
  • Such a floating-point unit is used in an HT processor with two logarithms. see cores only once available.
  • the following test scenario is implemented below:
  • the non-time-critical section 54 carries out permanent calculations which the FPU require.
  • the time critical portion 52 is triggered accordingly and also performs calculations on the FPU.
  • the time-critical section 52 measures the time for the calculation ⁇ calculations on the FPU.
  • the sections 52, 54 are thereby ver ⁇ divides targeted to the nuclei of a rule two logi ⁇ HT-MC processor and a processor, so that they fill the parallel programs 10, 12th
  • the following table shows the measurement values for the runtime of the time-critical section 52 in different test cases where no measures were taken in the operating system or the operating system. At each measurement were
  • the method according to the invention functions and contributes significantly to improving the deterministic of the time-critical sections. In the times when the time critical section 52 is not running, the previous power is available for the other cores.
  • a multi-core processor comprised four cores 40, 42, 44 and 46, the time-critical program 10 including the ISR run in the first core 40 of the multi-core processor, while on the other ⁇ three core 42, 44, 46 each have a corresponding Appli ⁇ cation permanently read via a PCI bus 48 accesses a PCI card 50.
  • the following table shows the measured values that occur when the system is running as described. A total of 60,000 cycles were run to get statistical information.
  • the measured values are given in the following table. Here also 60,000 cycles were gone through.
  • ISR latency times improve on average by 30% due to a reduced bus load.
  • the PCI read accesses become significantly more stable and are subject to fluctuations by the method according to the invention, while previously the worst times were about 100% above the best.
  • the PCI write accesses do not extend at all, since they are always written in one buffer only.
  • the time that this value takes until it has arrived in the register of the PCI card should also be significantly improved or stabilized, but this has not been proven.
  • the total duration of the ISR also declined by more than 30%. lg

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Debugging And Monitoring (AREA)
  • Multi Processors (AREA)
  • Advance Control (AREA)

Abstract

The invention relates to a method for operating a processor, in which a first program (10) is provided comprising a first sequence of commands (32), at least one second program (12) is provided comprising a second sequence of commands (24), said first program (10) comprising a time-critical section (52) with time-critical commands (20), the commands (20, 24, 32) from said first and second programs (10, 12) are processed in a processor pipeline (18), a start time is identified for said time-critical section (52) in the first program (10), and a predefined interrupt program (26) is incorporated into said at least one second program (12) once the start time of the time-critical section (52) in the first program (10) has been identified.

Description

Beschreibung description
Verfahren zum Betreiben eines Prozessors Die vorliegende Erfindung betrifft ein Verfahren zum Betrei¬ ben eines Prozessors. Überdies betrifft die vorliegende Er¬ findung einen Prozessor. Schließlich betrifft die vorliegende Erfindung ein Automatisierungsgerät mit einem Prozessor. Moderne Prozessoren haben heute mehr als einen Rechenkern und werden als MultiCore-Prozessoren (MC) bezeichnet, weil sie mehrere Programme echt parallel ausführen können. Jedes Pro¬ gramm läuft dabei auf einem eigenen Prozessorkern (Core) und muss sich diesen mit all seinen Untereinheiten wie Fließkom- maarithmetik-Einheit (Floating point unit, FPU) mit keinem anderen Programm teilen, solange es läuft. A method of operating a processor, the present invention relates to a method for Operator Op ben ¬ a processor. Moreover, the present invention relates to an ¬ processor. Finally, the present invention relates to an automation device with a processor. Modern processors today have more than one core and are referred to as multi-core processors (MC) because they can run multiple programs in real parallel. Each Pro ¬ program runs on a separate processor core (core) and has to this with all its subunits as Fließkom- maarithmetik unit (floating point unit, FPU) shared with any other program while it is running.
Bereits vor den ersten MultiCore-Prozessoren gab es Ansätze, eine gewisse Parallelität dennoch herzustellen, ohne gleich einen zusätzlichen vollständigen Rechenkern neben dem bereits vorhandenen vorzusehen. Diese Technik ist als Hyper-Threading (HT) bekannt. Hierbei besteht ein Prozessorkern aus Einhei¬ ten, die verschiedene Aufgaben bearbeiten. Beispiele hierfür sind z. B. die Load-Storage-Unit (LSU) , die Daten zwischen Prozessorregistern und Speicher austauscht oder die Arithme- tic-Logical-Unit (ALU) , die für Ganzzahlberechnungen zuständig ist. Even before the first MultiCore processors, there were attempts to create a certain degree of parallelism without having to provide an additional complete processor core in addition to the already existing one. This technique is known as Hyper-Threading (HT). Here, there is a processor core Einhei ¬ th, the process different tasks. Examples are z. For example, the Load Storage Unit (LSU), which exchanges data between processor registers and memory, or the Arithmetic Logical Unit (ALU), which handles integer calculations.
Diese Einheiten können selbst in einem Prozessor mit einem Prozessorkern bereits teilweise parallel arbeiten, sofern die Daten vorhanden sind. So kann die ALU mit Werten in bestimmten Registern arbeiten, während die LSU andere Register lädt oder in den Speicher überträgt. Der Prozessor besitzt intern eine sogenannte Pipeline in der die einzelnen Befehle hinter- einander abgearbeitet werden, wobei die einzelnen Stufen der Pipeline die verschiedenen Einheiten im Prozessor abbilden. Meistens müssen die Einheiten jedoch auf einander warten, sodass die Pipeline nur teilweise gefüllt werden kann und die theoretisch mögliche Rechenleistung nicht ausgenutzt wird. Diese Einschränkung wird von den HT-Prozessoren weitgehend aufgehoben, indem sie dem Betriebssystem zwei oder mehr Prozessoren vorspielen, obwohl sie intern nur Teile der zusätz- liehen Prozessoren mehrfach verfügbar haben. These units can already partially work in parallel even in a processor with a processor core, as long as the data is available. Thus, the ALU may operate on values in certain registers while the LSU is loading or transferring other registers. Internally, the processor has a so-called pipeline in which the individual instructions are processed in succession, whereby the individual stages of the pipeline map the various units in the processor. Most of the time, however, the units have to wait for each other, so the pipeline can only be partially filled and the theoretically possible computing power is not exploited. This limitation is largely removed by the HT processors by playing two or more processors to the operating system, even though they only have parts of the additional processors available internally.
So können beispielsweise auf einem Prozessor mit einem Pro¬ zessorkern (Single-Core-Prozessor) zwei Programme quasi parallel laufen. Jedes Programm umfasst dabei eine Liste an Be- fehlen ( Instruction-Queue ) , die nacheinander abgearbeitet werden müssen. In einem Single-Core-Prozessor ist die Reihenfolge eindeutig und die Laufzeit der Befehlskette auch nach beliebig vielen Durchläufen immer gleich. Die Programme laufen in diesem Fall deterministisch. In einem HT-Prozessor hingegen mischt der Prozessor intern die Befehle aus den zwei zur Verfügung stehenden Befehlslisten, um die Pipeline möglichst optimal zu füllen und die theoretisch mögliche Gesamt¬ rechenleistung zu erreichen. Dies gelingt bei vielen Programmen recht gut, wobei aufgrund der Tatsache, dass nicht alle Einheiten mehrfach vorhanden sind, nicht die doppelte oder n-fache Leistung erreicht wer¬ den kann. Vor allem komplexe Einheiten wie die FPU sind bei HT-Prozessoren normalerweise nur einmal verfügbar. Laufen zwei Programme parallel, die beide eine Fließkomma-Arithmetik betreiben, ist der HT-Prozessor nicht schneller als ein normaler Single-Core-Prozessor. Da dies aber üblicherweise selten der Fall ist, ermöglicht ein HT-Prozessor grundsätzlich eine Steigerung der Rechenleistung. For example, two quasi-parallel programs run on a processor with a per ¬ zessorkern (single-core processor). Each program contains a list of instructions (instruction queue), which must be processed one after the other. In a single-core processor, the order is unique and the runtime of the command chain is always the same even after any number of passes. The programs run deterministically in this case. In a HT-processor, however, the processor internally mixes the commands from the two available command lists to fill the pipeline as optimally as possible and to reach the theoretically possible overall ¬ computing power. This works quite well for many programs, and due to the fact that not all units are redundant, does not reach the double or n-times the performance ¬ the can. Especially complex units like the FPU are usually only available once for HT processors. If two programs are running in parallel, both of which use floating-point arithmetic, the HT processor is no faster than a normal single-core processor. However, since this is rarely the case, an HT processor basically enables an increase in computing power.
Ein Nachteil dabei ist jedoch, dass die Laufzeit des einen Programms nicht mehr vorhersagbar ist, da sie in erheblichem Maß von den Befehlen des zweiten Programms abhängt. Bei vie¬ len Durchläufen werden sich daher viele unterschiedliche Laufzeiten ergeben. Der Determinismus spielt bei Standard- Betriebssystemen (General-Purpose-Operating-Systems, GPOS) keine Rolle, da hier die Programme nicht von einer bestimmten Zeit ihre Aufgabe erledigen müssen. Im Bereich der Echtzeit- Systeme, bei denen auch Echtzeit-Betriebssysteme (Real-Time- Operating-System, RTOS) eingesetzt werden, ist die vorhersag¬ bare Laufzeit aber essentieller Bestandteil der Applikation. Der oben genannte Umstand hat die Nutzung von HT-Prozessoren für Echtzeit-Systeme verhindert. In vielen Konfigurationen läuft neben der Echtzeit-Anwendung noch eine Nicht-Echtzeit- Applikation, wie z. B. eine Bedienoberfläche. Die HT- Prozessoren böten eine kostengünstige Alternative gegenüber echten MultiCore-Prozessoren, um höhere Rechenleistungen zumindest für Nicht-Echtzeit-Applikationen zu bekommen, können aber wegen der massiven zeitlichen Einflüsse auf die Laufzeit der Echtzeit-Anwendung nicht verwendet werden. Selbst echte MultiCore-Rechner weisen noch gewisse Einschränkungen auf, sobald neben dem Prozessor, in dem alle Einheiten mehrfach vorhanden sind, weitere Komponenten wie Speicher oder Peripherie verwendet werden, die nur einmal im gesamten System vorhanden sind und somit zu gegenseitigen Blockaden der einzelnen Programme führen können. However, one drawback is that the runtime of one program is no longer predictable, as it depends to a significant degree on the instructions of the second program. In vie ¬ len runs therefore many different terms will result. The determinism plays no role in standard operating systems (GPOS), since the programs do not have to do their job of a certain time here. In the field of real-time Systems in which also real-time operating system (Real-Time Operating System, RTOS) are used which vorhersag ¬ bare term but is an essential part of the application. The above circumstance has prevented the use of HT processors for real-time systems. In many configurations, in addition to the real-time application, there is a non-real-time application, such as: B. a user interface. The HT processors offer a cost-effective alternative to true multi-core processors to get more computing power, at least for non-real-time applications, but can not be used because of the massive time constraints on the runtime of the real-time application. Even true MultiCore computers still have certain limitations, as well as the processor, in which all units are multiple, other components such as memory or peripherals are used, which are only once in the entire system and thus lead to mutual blockage of each program can.
Daher ist es Aufgabe der vorliegenden Erfindung, einen Weg aufzuzeigen, wie die Leistung und die Zuverlässigkeit eines Prozessors gesteigert werden können. Therefore, it is an object of the present invention to provide a way to increase the performance and reliability of a processor.
Diese Aufgabe wird erfindungsgemäß durch ein Verfahren zum Betreiben eines Prozessors gemäß Patentanspruch 1 gelöst. In gleicher Weise wird diese Aufgabe durch einen Prozessor gemäß Patentanspruch 7 und durch ein Automatisierungsgerät gemäß Patentanspruch 10 gelöst. Vorteilhafte Weiterbildungen der vorliegenden Erfindung sind in den Unteransprüchen angegeben. This object is achieved by a method for operating a processor according to claim 1. In the same way, this object is achieved by a processor according to claim 7 and by an automation device according to claim 10. Advantageous developments of the present invention are specified in the subclaims.
Das erfindungsgemäße Verfahren zum Betreiben eines Prozessors umfasst das Bereitstellen eines ersten Programms mit einer ersten Folge von Befehlen, das Bereitstellen zumindest eines zweiten Programms mit einer zweiten Folge von Befehlen, wobei das erste Programm einen zeitkritischen Abschnitt mit zeitkritischen Befehlen umfasst, das Bearbeiten der Befehle aus dem ersten und zweiten Programm in einer Prozessor-Pipeline, das Erkennen eines StartZeitpunkts eines zeitkritischen Ab¬ schnitts in dem ersten Programm und das Einfügen eines zuvor festgelegten Unterbrechungsprogramms in das zumindest eine zweite Programm, sobald der StartZeitpunkt des zeitkritischen Abschnitts in dem ersten Programm erkannt wird. The method according to the invention for operating a processor comprises providing a first program with a first sequence of commands, providing at least one second program with a second sequence of commands, wherein the first program comprises a time-critical section with time-critical commands, processing the commands the first and second program in a processor pipeline, the detection of a start time of a time-critical Ab ¬ section in the first program and the insertion of a predetermined interrupt program in the at least one second program, as soon as the start time of the time-critical section is detected in the first program ,
Unter dem Begriff Befehl ist insbesondere ein Maschinenbefehl des Prozessors zu verstehen. Die Befehle können den jeweili- gen Einheiten des Prozessors zugeordnet sein. Der Begriff Abschnitt bezeichnet insbesondere eine Mehrzahl von zusammen¬ hängenden Befehlen. Als Programm ist insbesondere eine Liste von Befehlen zu verstehen, die von dem Prozessor abgearbeitet wird, um ein bestimmte Funktionalität zu erreichen. Dabei können die Befehle entsprechenden Abschnitten zugeordnet sein . The term command is to be understood in particular as a machine command of the processor. The commands can be assigned to the respective units of the processor. The term portion denotes in particular a plurality of hanging together ¬ commands. In particular, a program is understood to be a list of instructions which is executed by the processor in order to achieve a specific functionality. The commands can be assigned to corresponding sections.
Vorliegend werden auf einem Prozessor zumindest zwei Programme bereitgestellt, die jeweils eine Folge von Befehlen umfas- sen. Diese Programme werden auch als Instruction-Queues be¬ zeichnet. Der Prozessor umfasst zumindest zwei logische Ker¬ ne, wobei jedem der logischen Kerne ein Programm zugeordnet ist. Somit ist der Prozessor wie ein Hyper-Threading- Prozessor (HT-Prozessor ) ausgebildet. Vorliegend kann das erste Programm auf dem Prozessor einen zeitkritischen Abschnitt bzw. zeitkritische Befehle oder Befehlsfolgen umfas¬ sen. Das erste Programm kann also zeitunkritische Abschnitte und zeitkritische Abschnitte umfassen. Der Prozessor oder ein auf einer Speichereinrichtung des Prozessors ausgeführtes Betriebssystem ist dazu ausgebildet, ei¬ nen StartZeitpunkt des zeitkritischen Prozesses in dem ersten Programm zu erkennen. Sobald der StartZeitpunkt des zeitkritischen Prozesses in dem ersten Programm erkannt wird, wird ein zuvor festgelegtes Unterbrechungsprogramm in das zumindest eine zweite Programm eingefügt. Mit anderen Worten wird der momentan auf dem zumindest zweiten Programm bereitgestellte oder bearbeitete Abschnitt durch ein entsprechendes Unterbrechungsprogramm unterbrochen bzw. angehalten. Dieses Unterbrechungsprogramm kann eine Abfolge von Befehlen beinhalten, die zuvor bekannt bzw. festgelegt sind. Somit ist das Unterbrechungsprogramm genau vorhersagbar. In dem Unterbre- chungsprogramm ist bevorzugt genau bekannt, welche Befehle durchgeführt werden und auf welche Teile des Prozessors dabei zugegriffen wird. Somit kann ein Prozessor auf dem zeitkritische Befehle bzw. Abschnitte bearbeitet werden auch für nicht zeitkritische Teile eines Systems zugänglich gemacht werden, ohne dass dabei die zeitkritischen Prozesse negativ beein- flusst werden. Der wesentliche Aspekt, warum die Vermischung der Abschnitte bzw. Befehlen in einem üblichen HT-Prozessor zu einer nicht-deterministischen Abarbeitung einer Befehlsliste führt, ist die Unvorhersagbarkeit , welcher Befehl je- weils in dem anderen Programm steht. Dieses Problem wird erfindungsgemäß dadurch gelöst, dass die Befehle bzw. Abschnit¬ te der anderen Programme definiert werden, die im Falle einer zeitkritischen Prozessfolge noch bearbeitet werden dürfen. Bevorzugt wird mit dem Start des zeitkritischen Abschnitts in dem ersten Programm ein Unterbrechungssignal an das zweite Programm zum Einfügen des Unterbrechungsprogramms gesendet. Der zeitkritische Abschnitt bzw. die zeitkritische Sequenz kann generell durch einen Interrupt gestartet werden, da der zeitkritische Prozessor auf ein Ereignis reagieren muss. Ein solches Ereignis kann entweder zyklisch, beispielsweise von einem Timer gesteuert, auftreten. Ebenso kann ein solches Ereignis sporadisch in Folge eines Alarms auftreten. Der Start des zeitkritischen Abschnitts bzw. der zeitkritischen Sequenz in dem ersten Programm überträgt nun ein Unterbrechungssignal bzw. einen Interrupt an das zumindest zweite Programm des Prozessors, wobei das zweite Programm aus Sicht des Betriebs¬ systems als eigenständiger und vollständiger Kern gesehen wird. Das in dem zweiten Programm eingefügte Unterbrechungs- programm, das auch als Interrupt-Service-Routine (ISR) be¬ zeichnet werden kann, bringt nun den zweiten Prozessorkern in einem definierten Zustand. Somit kann bei einem Prozessor mit zumindest zwei logischen Kernen der zumindest zweite logische Kern in einem definierten Zustand gebracht werden, wenn dem ersten logischen Kern ein zeitkritischer Abschnitt erkannt wird . In einer bevorzugten Aus führungs form wird der zeitkritische Abschnitt zusammen mit dem Unterbrechungsprogramm in einer vorhersagbaren Reihenfolge in der Prozessor-Pipeline bearbei¬ tet. Wenn in dem ersten Programm ein zeitkritischer Abschnitt erkannt wird, wird in dem zumindest zweiten Programm ein zu- vor definiertes bzw. festgelegtes Unterbrechungsprogramm eingefügt. Da dieses Unterbrechungsprogramm, das auch als Idle- task bezeichnet werden kann, aus bekannten Befehlen besteht, wird die Vermischung mit den nicht bekannten Befehlen des zeitkritischen Abschnitts in der Prozessor-Pipeline dennoch eindeutig. Dies hat zur Folge, dass sich insbesondere bei mehreren Durchläufen des zeitkritischen Programms immer die gleichen Laufzeiten ergeben. In the present case, at least two programs are provided on a processor, each comprising a sequence of commands. These programs will be distinguished ¬ as instruction queues. The processor comprises at least two logical Ker ¬ ne, wherein each of the logical cores is associated with a program. Thus, the processor is designed as a hyper-threading processor (HT processor). Herein may be a time-critical section or time-critical commands or command sequences umfas ¬ sen the first program on the processor. The first program may therefore include non-time critical sections and time-critical sections. The processor or an operating system executing on a storage device of the processor is adapted to recognize ei ¬ NEN start time of the time-critical process in the first program. Once the start time of the time-critical process in the first program is detected, a predetermined interrupt program is inserted into the at least one second program. In other words, the section currently provided or processed on the at least second program is replaced by a corresponding one Interrupt program interrupted or stopped. This interruption program may include a sequence of commands previously known. Thus, the interruption program is exactly predictable. The interrupt program preferably knows exactly which commands are executed and which parts of the processor are accessed. Thus, a processor on which time-critical commands or sections can be processed can also be made accessible for non-time-critical parts of a system without adversely affecting the time-critical processes. The essential aspect of why the mixing of the sections or commands in a conventional HT processor leads to a non-deterministic execution of a command list is the unpredictability of which command is in the other program. This problem is inventively solved in that the commands or Abschnit ¬ te the other programs are defined, which may be processed in the case of a time-critical process sequence yet. Preferably, with the start of the time-critical portion in the first program, an interrupt signal is sent to the second program for inserting the interrupt program. The time-critical section or the time-critical sequence can generally be started by an interrupt, since the time-critical processor must react to an event. Such an event can occur either cyclically, for example controlled by a timer. Likewise, such an event may occur sporadically as a result of an alarm. The start of the time-critical section or the time-critical sequence in the first program now transmits an interrupt signal or an interrupt to the at least second program of the processor, wherein the second program is seen from the point of view of the operating ¬ system as an independent and complete core. The inset in the second program interruption program that can also be used as interrupt service routine (ISR) ¬ be distinguished, has launched the second processor core in a defined state. Thus, in a processor having at least two logical cores, the at least second logical Core are brought in a defined state, when the first logical core a time-critical section is detected. In a preferred guide of the time-critical section is form-machining ¬ tet along with the interruption program in a predictable sequence in the processor pipeline. If a time-critical section is detected in the first program, a previously defined interrupt program is inserted in the at least second program. Since this interrupt program, which may also be referred to as an idle task, consists of known instructions, mixing with the unknown instructions of the time-critical section in the processor pipeline nevertheless becomes clear. As a result, the same run times always result, especially with several runs of the time-critical program.
Die Stilllegung des zweiten oder auch mehrerer logischer Ker- ne bzw. Programme mittels des Unterbrechungsprogramms ermög¬ licht es dem zeitkritischen Abschnitt den notwendigen Determinismus zu behalten. Zudem kann mit dem beschriebenen Verfahren bei der Bearbeitung von nicht zeitkritischen Programmen ein höherer Durchsatz gegenüber einer Ein-Prozessor- Lösung erreicht werden, da die nicht zeitkritischen Programme mehr als einen logischen Prozessorkern nutzen können, wenn momentan kein zeitkritischer Abschnitt bearbeitet wird. Wenn der zeitkritische Abschnitt nicht aktiv ist, können die nicht zeitkritischen Programme die zumindest zwei logischen Kerne des HT-Prozessors nutzen. Die nicht deterministische Vermi¬ schung ist dabei irrelevant, da die nicht zeitkritischen Pro¬ gramme nach ihrem Datendurchsatz bewertet werden, der durch die parallele Verarbeitung steigt. Somit kann die Leistung des gesamten Prozessors bzw. Geräts gesteigert werden, ohne dass die Zuverlässigkeit dabei beeinflusst wird. The decommissioning of the second or more logical KER ne or programs using the interrupt program allowed ¬ light is to keep the time-critical section the necessary determinism. In addition, with the described method in the processing of non-time-critical programs, a higher throughput compared to a single-processor solution can be achieved because the non-time-critical programs can use more than one logical processor core, if no time-critical section is currently being processed. If the time-critical section is not active, the non-time-critical programs can use the at least two logical cores of the HT processor. The non-deterministic Vermi ¬ research is irrelevant here because the non-time-critical pro ¬ programs are valued at their data throughput rising by the parallel processing. Thus, the performance of the entire processor or device can be increased without affecting the reliability.
Bevorzugt wird mit dem zeitkritischen Abschnitt auch das Un¬ terbrechungsprogramm beendet. Somit wird das zeitunkritische Programm durch das Unterbrechungsprogramm nur für eine solche Zeitdauer unterbrochen bzw. stillgelegt, die der zeitkritische Abschnitt zur Bearbeitung benötigt. Im Anschluss daran kann auf beiden logischen Prozessorkernen wieder jeweils ein zeitunkritisches Programm bearbeitet werden. Somit kann die Bearbeitung der nicht zeitkritischen Programme bzw. Befehle auf dem Prozessor beschleunigt werden. Preference is terminated with the time-critical section and the Un ¬ terbrechungsprogramm. Thus, the non-time critical Program interrupted or shut down by the interrupt program only for such a period of time that requires the time-critical section for editing. Following this, a non-time critical program can be processed on both logical processor cores again. Thus, the processing of non time-critical programs or commands can be accelerated on the processor.
In einer Ausgestaltung umfasst das Unterbrechungsprogramm das Lesen eines Werts aus einem Speicher, das Vergleichen des gelesenen Werts mit einem zuvor festgelegten Wert und das erneute Starten des Unterbrechungsprogramms, falls sich der ge¬ lesenen Wert und der festgelegte Wert unterscheiden. In dem Unterbrechungsprogramm bzw. der Idletask wird zunächst ein Wert bzw. ein Datum aus einer zuvor festgelegten Speicherzelle gelesen. Im Anschluss wird verglichen, ob dieser Wert mit einem zuvor festgelegten Wert übereinstimmt. Ist es nicht der Fall, wird der Wert in dem Speicher erneut gelesen und somit die Routine von neuem gestartet. Mit diesen Befehlen ist ebenfalls definiert welche Einheiten des Prozessors verwendet werden. Hierbei werden insbesondere solche Einheiten verwendet, die in dem Prozessor mehrfach vorhanden sind bzw. die dem zweiten Programm bzw. dem zweiten logischen Kern alleine zustehen. Solche Einheiten können beispielsweise eine Load- Storage-Unit sein, die entsprechende Werte aus einem Speicher laden kann. Zudem kann eine sogenannte Compare-Unit verwendet werden, die entsprechende Werte vergleichen kann. Als Spei¬ cherzelle, aus der der Wert gelesen wird, kann insbesondere eine interne Speicherzelle des Prozessors verwendet werden. Somit kann verhindert werden, dass während des Unterbre¬ chungsprogramms auf den physikalischen Hauptspeicher zugegriffen wird. Somit sind die Einheiten des Prozessors be¬ kannt, die von dem Unterbrechungsprogramm verwendet werden. Die anderen Einheiten stehen uneingeschränkt dem Programm bzw. logischen Kern zur Verfügung, mit dem der zeitkritische Abschnitt bearbeitet wird. Dadurch wird die Laufzeit des zeitkritischen Abschnitts bzw. der Befehlsliste nicht negativ beeinflusst . In einer Ausgestaltung wird das Unterbrechungsprogramm dadurch beendet, dass in den Speicher ein Wert geschrieben wird, der dem zuvor festgelegten Wert entspricht. Während des Unterbrechungsprogramms kann aus einem internen Speicher des Prozessors ein Wert gelesen werden und mit einem zuvor festgelegten Wert verglichen werden. Solange der zeitkritische Abschnitt nicht beendet bzw. abgearbeitet ist, wird der zuvor festgelegt Wert nicht in den Speicher geschrieben. Erst nach der Abarbeitung des zeitkritischen Abschnitts wird in denIn one embodiment, the interrupt program comprises reading a value from a memory, comparing the read value with a predetermined value, and restarting the interrupted program, if the ge ¬ read value and the predetermined value are different. In the interrupt program or the Idletask, a value or a date is first read from a previously defined memory cell. It then compares whether this value matches a predefined value. If it is not the case, the value in the memory is read again and thus the routine is restarted. These commands also define which units of the processor will be used. In this case, in particular those units are used which are multiply present in the processor or which belong to the second program or the second logical core alone. Such units may be, for example, a load storage unit that can load corresponding values from a memory. In addition, a so-called compare unit can be used, which can compare corresponding values. As SpeI ¬ cherzelle, from which the value is read, an internal memory cell of the processor can be used in particular. Thus, that is accessed during the interrup ¬ monitoring program to the physical main memory can be prevented. Thus, the units of the processor be ¬ known to be used by the interrupt routine. The other units are fully available to the program or logical core that processes the time-critical section. As a result, the runtime of the time-critical section or command list is not adversely affected. In one embodiment, the interrupt program is terminated by writing to memory a value that corresponds to the predetermined value. During the interrupt routine, a value can be read from an internal memory of the processor and compared to a predetermined value. As long as the time-critical section is not completed or processed, the previously set value is not written to memory. Only after the processing of the time-critical section is in the
Speicher der zuvor festgelegte Wert geschrieben. Somit wird auch die Routine des Unterbrechungsprogramms beendet. Dabei ist es vorteilhaft, eine Speicherzelle zu wählen, die inner¬ halb des Prozessors liegt und nicht im physikalischen Haupt- Speicher, so dass das Unterbrechungsprogramm bzw. die Idle- task keine singulären Ressourcen wie Speicheranbindung oder gar Bus-Systeme belegen kann. Somit kann auf einfache Weise das Unterbrechungsprogramm beendet werden und die zeitunkritischen Befehle können entsprechend auf den zumindest zwei Programmen bzw. logischen Kernen bearbeitet werden. Memory the previously set value written. Thus, the routine of the interruption program is also ended. It is advantageous to select a memory cell located within ¬ half of the processor and not in physical main memory, so that the interrupt program and the idle task can occupy no singular resources such as memory access, or even bus systems. Thus, the interrupt program can be terminated in a simple manner and the non-time critical commands can be processed accordingly on the at least two programs or logical cores.
Der erfindungsgemäße Prozessor umfasst eine erste Prozessor¬ einheit zum Bereitstehen eines ersten Programms mit einer ersten Folge von Befehlen, zumindest eine zweite Prozessor- einheit zum Bereitstellen zumindest eines zweiten Programms mit einer zweiten Folge von Befehlen, wobei das erste Pro¬ gramm einen zeitkritischen Abschnitt umfasst, eine Prozessor- Pipeline zum Bearbeiten der Befehle aus dem ersten und zwei¬ ten Programm und eine Speichereinrichtung mit einem Betriebs- system, wobei der Prozessor dazu ausgebildet ist, das Be¬ triebssystem auszuführen und wobei der Prozessor oder das Betriebssystem dazu ausgebildet ist, den StartZeitpunkt des zeitkritischen Abschnitts in dem ersten Programm zu erkennen und ein zuvor festgelegten Unterbrechungsprogramm in das zu- mindest eine zweite Programm einzufügen, sobald der Start¬ zeitpunkt des zeitkritischen Abschnitts in dem ersten Pro¬ gramm erkannt ist. Bevorzugt umfasst der Prozessor eine Datenaustauscheinheit und eine Vergleichseinheit, wobei die Datenaustauscheinheit dazu ausgebildet ist, während des Unterbrechungsprogramms ei¬ nen Wert aus einem Speicher zu lesen und wobei die Ver- gleichseinheit dazu ausgebildet ist, während des Unterbre¬ chungsprogramms den gelesenen Wert mit einem zuvor festgeleg¬ ten Wert zu vergleichen. Somit kann sichergestellt werden, dass während des Unterbrechungsprogramms nur bestimmte Ein¬ heiten des Prozessors verwendet werden. Bevorzugt werden sol- che Einheiten verwendet, die den jeweiligen logischen Prozessorkern bzw. Programm alleine zur Verfügung stehen. Ebenso kann bevorzugt ein interner Speicher des Prozessors verwendet werden . In einer weiteren Ausgestaltung umfasst der Prozessor zumindest zwei Prozessorkerne. Das zuvor beschriebene Verfahren zum Betreiben eines Prozessors kann neben HT-Prozessoren auch für echte MultiCore-Prozessoren verwendet werden, bei denen alle Kerne alle notwendigen Einheiten besitzen. Bei üblichen MultiCore-Prozessoren kann es selbst bei der strikten Aufteilung von zeitkritischen und zeitunkritischen Programmen, die den jeweiligen Prozessorkernen zugeordnet sind, zu einem nicht-deterministischen Verhalten führen, da beide Teilapplikationen auf andere Systemkomponenten wie Speicher oder Peri- pherie zugreifen. Vor allem letztere sorgt für Probleme, auch wenn die unterschiedlichen Applikationen verschiedene Peripherien verwenden, da die Verbindung von Prozessor mit mehreren Kernen zu den mehrfachen Peripherien über einzelne Bus- Systeme (meist PCI oder PCIe) aufgebaut wird. Die dadurch be- dingten möglichen gegenseitigen Blockaden können durch das beschriebene Verfahren ausgeschlossen werden. The processor according to the invention comprises a first processor ¬ unit for standing by a first program with a first sequence of instructions, at least one second processor wherein the first Pro ¬ program includes unit for providing at least a second program with a second sequence of commands, a time-critical section a processor pipeline for processing the commands from the first and two ¬ th program and a memory device with an operating system, wherein the processor is adapted to perform the loading ¬ operating system and wherein the processor or the operating system is adapted to to recognize start time of the time-critical section in the first program and a predetermined interrupt program in the to-least a second program to insert as soon as the start ¬ date on which the time-critical section in the first Pro ¬ program is detected. Preferably, the processor includes a data exchange unit and a comparison unit, wherein said data exchange unit is adapted to read ei ¬ NEN value from a memory during the interruption program, and wherein the comparison unit is configured to, during the interrup ¬ monitoring program the read value with a previously compare festgeleg ¬ th value. Thus it can be ensured that only certain ¬ A units of the processor are used during the interruption program. Such units are preferably used which are available to the respective logical processor core or program alone. Likewise, preferably, an internal memory of the processor can be used. In a further embodiment, the processor comprises at least two processor cores. The method described above for operating a processor can be used not only for HT processors but also for true multi-core processors in which all cores have all the necessary units. In the case of common MultiCore processors, even the strict division of time-critical and time-uncritical programs assigned to the respective processor cores can lead to non-deterministic behavior, since both subapplications access other system components such as memory or peripherals. Especially the latter causes problems, even if the different applications use different peripherals, since the connection of processor with multiple cores to the multiple peripherals on individual bus systems (usually PCI or PCIe) is built. The resulting possible mutual blockages can be excluded by the method described.
Ein weiterer Vorteil ist das deterministische Cache- Verhalten, das durch das Verfahren ebenfalls ermöglicht wird. Sowohl in vielen MultiCore- als auch in HyperThreading-Another advantage is the deterministic cache behavior also enabled by the method. Both in many MultiCore and HyperThreading
Prozessoren teilen sich mehrere Kerne den Cache. Wenn eines der Programme oder Befehle in einem Kern nicht auf den Cache zugreifen kann, sondern auf den Hauptspeicher zugreifen muss, verlangsamt sich die gesamte Ausführungszeit erheblich. Wenn bei der Ausführung eines zeitkritischen Abschnitts auf den zumindest einen weiteren Programm bzw. Kern ein definiertes Unterbrechungsprogramm betrieben wird, kann die Echtzeit- Applikation nicht durch ihr Cache-Verhalten beeinflusst werden . Processors share several cores the cache. If one of the programs or commands in a kernel can not access the cache but must access the main memory, slows down the entire execution time considerably. If a defined interrupt program is run when executing a time-critical section on the at least one further program or core, the real-time application can not be influenced by its cache behavior.
Das erfindungsgemäße Automatisierungsgerät umfasst einen zu¬ vor beschriebenen Prozessor. Automatisierungsgeräte umfassen üblicherweise zwei wesentliche Funktionen, die eingentliche Steuerung eines physikalischen Prozesses und die The automation device according to the invention comprises a processor described above. Automation devices usually include two essential functions, the physical control of a physical process and the
Kommunikation mit der Außenwelt. Die Kommunikation kann entweder durch eine Bedienoberfläche oder über eine Communication with the outside world. The communication can be either through a user interface or via a
Netzwerkverbindung zu einem externen Bediengerät erfolgen. Die Steuerung der physikalischen Prozesse erfordert in der Regel die Einhaltung definierter Zeitbedingungen, während bei der Kommunikation schon durch die Trägkeit des Benutzers entsprechende Wartezeiten vorgesehen werden müssen. Die Network connection to an external HMI device. The control of the physical processes usually requires compliance with defined time conditions, while in the communication already by the inertia of the user corresponding waiting times must be provided. The
Steuerungsfunktion, die üblicherweise einen zeitkritischen Abschnitt darstellt, nimmt meist nur einen geringen Teil der Rechenleistung des Prozessors in Anspruch. Die Control function, which is usually a time-critical section, usually takes up only a small part of the processing power of the processor. The
Steuerungsaufgaben sollten aber zu jeder Zeit ausgeführt werden können. Die Kommunikationsprogramme nehmen Control tasks should be able to be executed at any time. The communication programs take
üblicherweise einen deutlich größeren Anteil der usually a significantly larger proportion of
Rechenleistung für die Visualisierung von Zuständen oder den Datenaustausch mit anderen Geräten in Anspruch. Durch die Verwendung des erfindungsgemäßen Prozessors können den Computing power for the visualization of states or the data exchange with other devices to complete. By using the processor according to the invention can the
Kommunikationsprogrammen deutlich mehr Rechenleistung zur Verfügung gestellt werden. Zudem können durch den Prozessor Kosten eingespart werden. Communication programs are provided significantly more computing power. In addition, costs can be saved by the processor.
Die zuvor im Zusammenhang mit dem erfindungsgemäßen Verfahre genannten Vorteile und Weiterbildungen können in gleicher Weise auf den erfindungsgemäßen Prozessor und das erfindungs gemäße Automatisierungsgerät übertragen werden. The advantages and developments mentioned above in connection with the method according to the invention can be transmitted in the same way to the processor according to the invention and the automation device according to the invention.
Vorliegende Erfindung wird nun anhand der beigefügten Zeichnungen näher erläutert. Dabei zeigen: FIG 1 eine schematische Darstellung der Programmabläufe in einem HyperThreading-Prozessor ; The present invention will now be explained in more detail with reference to the accompanying drawings. Showing: 1 shows a schematic representation of the program sequences in a HyperThreading processor;
FIG 2 eine schematische Darstellung der Befehlsanordnung von zwei Programmen, wobei das erste Programm einen zeitkritischen Abschnitt umfasst; 2 shows a schematic representation of the command arrangement of two programs, wherein the first program comprises a time-critical section;
FIG 3 eine schematische Darstellung der Befehlsanordnung von zwei Programmen und einer Prozessor-Pipeline; 3 shows a schematic representation of the instruction arrangement of two programs and a processor pipeline;
FIG 4 eine schematische Darstellung einer Testanordnung; 4 shows a schematic representation of a test arrangement;
und  and
FIG 5 eine schematische Darstellung einer weiteren Testanordnung . 5 shows a schematic representation of another test arrangement.
Nachfolgend näher geschilderte Ausführungsbeispiele stellen bevorzugte Aus führungs formen der vorliegenden Erfindung dar. Below detailed embodiments illustrate preferred embodiments of the present invention.
FIG 1 zeigt in einer schematischen Darstellung die Abarbeitung der Programme auf einem Prozessor gemäß dem Stand der Technik. Ein solcher Prozessor wird als HyperThreading- Prozessor bezeichnet. Der Prozessor umfasst einen Prozessor- kern, auf dem beispielsweise zwei Prozessoreinheiten vorgese¬ hen sind. Jede Prozessoreinheit ist hierbei einem Programm zugeordnet. Vorliegend wird auf dem Prozessor ein erstes Pro¬ gramm 10 und ein zweites Programm 12 betrieben. Das erste Programm 10 umfasst eine erste Folge von Befehlen 14 und das zweite Programm 12 umfasst die zweite Folge von Befehlen 16. 1 shows a schematic representation of the execution of the programs on a processor according to the prior art. Such a processor is called a HyperThreading processor. The processor comprises a processor core, on which, for example two processor units are vorgese ¬ hen. Each processor unit is assigned to a program. In the present case a first Pro ¬ program 10 and a second program 12 is run on the processor. The first program 10 comprises a first sequence of instructions 14 and the second program 12 comprises the second series of instructions 16.
Die Reihenfolge der Befehle 14 in dem ersten Programm 10 und der Befehle 16 und dem zweiten Programm 12 sind eindeutig zu¬ geordnet. In dem ersten Programm 10 und in dem zweiten Pro- gramm 12 können zeitkritische und zeitunkritische Abschnitte bearbeitet werden. Die Befehle 14 aus dem ersten Programm 10 und die Befehle 16 aus dem zweiten Programm 12 werden in der Prozessor-Pipeline 18 bearbeitet. In der Prozessor-Pipeline 18 werden die Befehle 14 und 16 entsprechend sortiert und ab¬ gearbeitet. Hierbei ergibt sich in der Prozessor-Pipeline ei¬ ne nicht deterministische und ungeordnete Reihenfolge der ersten Befehle 14 und der zweiten Befehle 16. The order of the instructions 14 in the first program 10 and the instructions 16 and the second program 12 are clearly ¬ ordered. In the first program 10 and in the second program 12 time-critical and non-time critical sections can be processed. The instructions 14 from the first program 10 and the instructions 16 from the second program 12 are processed in the processor pipeline 18. In the processor pipeline 18, the commands 14 and 16 are sorted accordingly and worked from ¬ . This results in the processor pipeline ei ¬ ne non-deterministic and disordered order of the first instructions 14 and the second commands 16th
Das erste Programm 10 und das zweite Programm 12 können als logische Prozessorkerne aufgefasst werden, wobei der Prozes¬ sor nur einen Prozessorkern umfasst. Hierbei können je nach Prozessorhersteller verschiedene Einheiten des Prozessors einfach oder mehrfach vorhanden sein. Üblicherweise liegen die Einheiten, die einfache Rechenaufgaben durchführen, mehrfach vor, wobei komplexere Einheiten nur einfach vorhanden sind . FIG 2 zeigt eine schematische Darstellung von zwei Programmen 10 und 12, wobei das erste Programm 10 einen zeitkritischen Abschnitt 52 umfasst. Ein solcher zeitkritischer Abschnitt 52 wird üblicherweise durch einen Interrupt gestartet, da dieser auf ein Ereignis reagieren muss. Ein solches Ereignis kann beispielsweise zyklisch auftreten oder nur sporadisch. DerThe first program 10 and the second program 12 can be considered as a logical processor cores, wherein the Prozes ¬ sor only includes a processor core. Depending on the processor manufacturer, different units of the processor may be present once or several times. Usually, the units performing simple arithmetic operations are multiple, with more complex units being simply present. FIG. 2 shows a schematic representation of two programs 10 and 12, the first program 10 comprising a time-critical section 52. Such a time-critical section 52 is usually started by an interrupt, since this must respond to an event. Such an event may, for example, occur cyclically or only sporadically. Of the
StartZeitpunkt des zeitkritischen Abschnitts 52 ist durch den Pfeil 22 gekennzeichnet. Das zweite Programm 12 umfasst einen zeitunkritischen Abschnitt 52. Der Prozessor oder ein auf einer Speichereinrichtung des Prozessors ausgeführtes Betriebssystem ist dazu ausgebildet, den Start bzw. den StartZeitpunkt des zeitkritischen Abschnitts 52 in dem ersten Programm zu erkennen. Sobald der Startzeitpunkt des zeitkritischen Abschnitts 52 in dem ersten Programm 10 erkannt wird, wird in das zweite Programm 12 ein zuvor festgelegtes Unterbrechungsprogramm 26 eingefügt. Start time of the time-critical portion 52 is indicated by the arrow 22. The second program 12 includes a non-time-critical portion 52. The processor or an operating system executed on a memory device of the processor is configured to recognize the start time of the time-critical portion 52 in the first program. Once the start time of the time critical portion 52 is recognized in the first program 10, a predetermined interrupt program 26 is inserted in the second program 12.
Mit dem Start des zeitkritischen Abschnitts 52 wird ein ent¬ sprechendes Unterbrechungssignal bzw. einen Interrupt an das zweite Programm 12 gesendet. Dies hat zur Folge, dass der auf dem zweiten Programm 12 durchgeführte zeitunkritische Ab¬ schnitt 54 unterbrochen wird bzw. in dem zeitunkritischen Abschnitt 54 ein Unterbrechungsprogramm 26 eingefügt wird. Der Interrupt der von dem ersten Programm 10 in das zweite Pro¬ gramm 12 übertragen wird, ist in der FIG 2 durch den Pfeil 28 gekennzeichnet . Das Unterbrechungsprogramm, das auch als Idletask bezeichnet werden kann, kann die folgenden Schritte umfassen: With the start of the time-critical section 52 a ent ¬ speaking interrupt signal or an interrupt to the second program 12 is sent. As a result, the process performed on the second program 12 uncritical From ¬ section 54 is interrupted and an interrupt program is inserted 26 in the non-critical section 54th Of the Interrupt which is transmitted from the first program 10 in the second ¬ Pro program 12 is characterized in FIG 2 by the arrow 28th The interruption program, which may also be referred to as an idletask, may include the following steps:
- Lesen eines Werts aus einem Speicher, Reading a value from a memory,
- Vergleichen des gelesenen Werts mit einem zuvor festgeleg- ten und  - Compare the read value with a previously defined and
- Erneutes Starten des Unterbrechungsprogramms, falls sich der gelesene Wert und der festgelegte Wert unterscheiden.  - restarting the interruption program if the read value and the specified value differ.
Mit dieser Befehlsfolge ist ebenfalls definiert, welche Ein- heiten des Prozessors verwendet werden. Vorliegend werden nur die Load-Storage-Unit und die Compare-Unit verwendet. Zudem wird bevorzugt auf einen internen Speicher des Prozessors zu¬ gegriffen . Mit dem Ende des zeitkritischen Abschnitts 52 wird auch dasThis command sequence also defines which units of the processor will be used. In the present case, only the load storage unit and the compare unit are used. In addition, it is preferred resorting to an internal memory of the processor to ¬. With the end of the time-critical section 52 is also the
Unterbrechungsprogramm 26 beendet. Wenn der zeitkritische Abschnitt 52 beendet ist, wird durch einen Schreibbefehl der zuvor bestimmte Wert in die Speicherzelle geschrieben, die von dem Unterbrechungsprogramm 26 permanent gelesen wird. Dies ist in FIG 2 beispielhaft durch den Pfeil 30 darge¬ stellt . Interruption program 26 ended. When the time-critical portion 52 is completed, a write command writes the previously determined value into the memory cell, which is permanently read by the interrupt program 26. This is exemplified in FIG 2 by the arrow 30 Darge ¬ represents.
FIG 3 zeigt eine schematische Darstellung der Bearbeitung der Befehle in dem ersten Programm 10, in dem zweiten Programm 12 und in der Prozessor-Pipeline 18. Das erste Programm 10 um- fasst sowohl zeitunkritische Abschnitte 56 bzw. Befehle 32 sowie zeitkritische Abschnitte 52 bzw. Befehle 20. Wird in dem ersten Programm 10 der StartZeitpunkt eines zeitkriti¬ schen Abschnitts 20 erkannt, so wird in dem zweiten Programm 12 ein zuvor definiertes Unterbrechungsprogramm 26 eingefügt. Dabei wird der momentan auf dem zweiten Programm betriebene zeitunkritische Abschnitt 24 unterbrochen bzw. stillgelegt. Die Abschnitte bzw. Befehle 20, 24, 26, 32 aus den Programmen 10 und 12 werden in der Prozessor-Pipeline 18 bearbeitet. FIG. 3 shows a schematic representation of the processing of the commands in the first program 10, in the second program 12 and in the processor pipeline 18. The first program 10 comprises time-critical sections 56 or commands 32 as well as time-critical sections 52 or commands 20. If it is detected in the first program 10, the start time of a zeitkriti ¬ rule section 20, as in the second program 12 is a previously defined program interruption 26 is inserted. In this case, the time-critical section 24 currently being operated on the second program is interrupted or shut down. The sections or instructions 20, 24, 26, 32 from the programs 10 and 12 are processed in the processor pipeline 18.
Bevor ein zeitkritischer Abschnitt 52 erkannt wurde, werden die Befehle 24, 32 des ersten Programms 10 und des zweitenBefore a time-critical portion 52 has been detected, the instructions 24, 32 of the first program 10 and the second
Programms 12 in einer unvorhersagbaren Reihenfolge abgearbei¬ tet und diese Befehlsabfolge ist in dem Bereich 38 in der Prozess-Pipeline 18 dargestellt. Sobald der Startpunkt eines zeitkritischen Abschnitts 52 erkannt wird, wird in das zweite Programm das Unterbrechungsprogramm 26 eingefügt. Das Unterbrechungsprogramm 26 umfasst die zuvor definierten Schritte. Durch die gemeinsame Abarbeitung des zeitkritischen Abschnitts 52 aus dem ersten Programm und des Unterbrechungs¬ programms 26 aus dem zweiten Programm 12 ergibt sich eine de- terministische und vorhersagbare Reihenfolge der Befehle 20, 26. Dies ist im Bereich 36 in der Prozessor-Pipeline darge¬ stellt. Nachdem der zeitkritische Abschnitt 52 beendet ist, wird auch das Unterbrechungsprogramm 26 beendet. Im Anschluss daran werden die zeitunkritischen Abschnitte 54, 56 aus dem ersten Programm 10 und dem zweiten Programm 12 bearbeitet. Dies ist durch den Bereich 34 in der Prozessor-Pipeline 18 dargestellt . Program 12 in an unpredictable order abgearbei ¬ tet and this command sequence is illustrated in the region 38 in the process pipeline 18th As soon as the starting point of a time-critical section 52 is detected, the interrupt program 26 is inserted into the second program. The interrupt program 26 includes the previously defined steps. By jointly processing the time-critical portion 52 of the first program and the interrupt ¬ program 26 from the second program 12 results in a de- terministic and predictable order of the instructions 20, 26. This is Darge ¬ in the field 36 in the processor pipeline provides. After the time-critical portion 52 is finished, the interrupt program 26 is also ended. Following this, the non-time-critical sections 54, 56 from the first program 10 and the second program 12 are processed. This is illustrated by region 34 in the processor pipeline 18.
FIG 4 zeigt die schematische Darstellung einer Testanordnung zur quantitativen Auswertung des erfindungsgemäßen Verfahrens. Dabei umfasst ein erstes Programm einen zeitkritischen Abschnitt 52. Ein zweites Programm 12 umfasst einen nicht zeitkritischen bzw. einen zeitunkritischen Abschnitt 54. In einer ersten Testbedingung in das erste Programm 10 und das zweite Programm 12 jeweils einen logischen Kern eines Hy- perThreading-Prozesses zugeordnet sein. In einer weiteren Testbedingung können das erste Programm 10 und das zweite Programm 12 jeweils einen Prozessorkern eines Mehrkernprozessors (MultiCore-Prozessors ) zugeordnet sein. 4 shows the schematic representation of a test arrangement for the quantitative evaluation of the method according to the invention. In this case, a first program comprises a time-critical section 52. A second program 12 comprises a non-time-critical or a non-time-critical section 54. In a first test condition, the first program 10 and the second program 12 are each assigned a logical core of a hyper-threading process be. In a further test condition, the first program 10 and the second program 12 may each be assigned a processor core of a multi-core processor (MultiCore processor).
In diesem Testszenario wird eine Fließkommaeinheit (Floating point Unit, FPU) für Berechnungen verwendet. Eine solche Fließkommaeinheit ist bei einem HT-Prozessor mit zwei logi- sehen Kernen nur einmal vorhanden. Nachfolgend wird folgendes Testszenario realisiert: Der zeitunkritische Abschnitt 54 führt Permanentberechnungen durch, die die FPU benötigen. Der zeitkritische Abschnitt 52 wird entsprechend getriggert und führt ebenfalls Berechnungen auf der FPU durch. Dabei misst der zeitkritische Abschnitt 52 die Laufzeit für die Berech¬ nungen auf der FPU. In this test scenario, a floating point unit (FPU) is used for calculations. Such a floating-point unit is used in an HT processor with two logarithms. see cores only once available. The following test scenario is implemented below: The non-time-critical section 54 carries out permanent calculations which the FPU require. The time critical portion 52 is triggered accordingly and also performs calculations on the FPU. Here, the time-critical section 52 measures the time for the calculation ¬ calculations on the FPU.
Die Abschnitte 52, 54 werden dabei gezielt auf die zwei logi¬ schen Kerne eines HT-Prozessors bzw. eines MC-Prozessors ver¬ teilt, sodass sie parallel die Programme 10, 12 füllen. Die nachfolgende Tabelle zeigt die Messwerte für die Laufzeit des zeitkritischen Abschnitts 52 in verschiedenen Testfällen, bei denen keine Maßnahmen in dem Betriebssystem oder dem Betriebssystem getroffen wurden. Bei jeder Messung wurden The sections 52, 54 are thereby ver ¬ divides targeted to the nuclei of a rule two logi ¬ HT-MC processor and a processor, so that they fill the parallel programs 10, 12th The following table shows the measurement values for the runtime of the time-critical section 52 in different test cases where no measures were taken in the operating system or the operating system. At each measurement were
60.000 Durchläufe vorgenommen.  60,000 runs made.
Die Zeiten in der Zeile 2 zeigen sehr deutlich den Effekt bei dem HT-Prozessor, dass sich die Ausführungszeiten auf dem logischen Kern des Prozessors, auf dem der zeitkritische Ab¬ schnitt 52 läuft deutlich erhöht, wenn auf dem anderen Kern ebenfalls eine FPU-Applikation läuft. Im schlechtesten Fall wird sogar die doppelte Zeit benötigt, was der Fall ist, wenn beide logischen Kerne des HT-Prozessors parallel auf die FPU angewiesen sind. Auf einem echten MultiCore-Prozessor hingegen beeinflussen sich die beiden Abschnitte 52, 54 auf den beiden logischen Kernen überhaupt nicht, was ebenfalls zu er¬ warten war. The times in line 2 show very clearly the effect in the HT processor that the execution times on the logical core of the processor, on which the time-critical Ab ¬ section 52 runs significantly increased, if on the other core also an FPU application running. In the worst case, even twice the time is needed, which is the case when both logical cores of the HT processor rely on the FPU in parallel. On the other hand, on a true multi-core processor, the two sections 52, 54 on the two logical cores do not influence each other at all, which was also to be expected .
In der nachfolgenden Tabelle ist das erfindungsgemäße Verfah¬ ren umgesetzt, bei dem der zweite Kern bzw. logische Kern per Interrupt ein Unterbrechungsprogramm bzw. ein Idletask geschickt wird, sodass es nicht zu Kollisionen kommen sollte. The following table shows inventive procedural ¬ ren is implemented, in which the second core or logical core is sent an interrupt program or IdleTask per interrupt, so it should not be collisions.
Wie die Messwerte deutlich zeigen, bleiben die Zeiten in die sem Fall sehr konstant. Sie sind gegenüber den obigen Werten leicht erhöht, bedingt durch den zusätzlichen Mechanismus, bei dem zusätzlich ein Unterbrechungsprogramm 26 bearbeitet wird. Dafür sind in der ersten Zeile sogar die schlechtesten Zeiten besser als in der oben dargestellten Tabelle, da jegliche Beeinflussung durch Programme auf einem anderen logi- sehen Kern verhindert wird. As the measured values clearly show, the times in this case remain very constant. They are slightly higher than the above values due to the additional mechanism in which an interrupt program 26 is additionally processed. In the first line, even the worst times are better than in the table above, since any influence by programs on another logical core is prevented.
Zusammenfassend lässt sich feststellen, dass das erfindungs¬ gemäße Verfahren funktioniert und deutlich zur Verbesserung der Deterministik der zeitkritischen Abschnitte beiträgt. In den Zeiten, in denen der zeitkritische Abschnitt 52 nicht läuft, steht die vorherige Leistung für die anderen Kerne zur Verfügung . In summary, it can be stated that the method according to the invention functions and contributes significantly to improving the deterministic of the time-critical sections. In the times when the time critical section 52 is not running, the previous power is available for the other cores.
Ein weiterer wichtiger Aspekt neben der gegenseitigen Beein- flussung der logischen Kerne eines HT-Prozessors sind auch die Zugriffe auf die Peripherie, da diese die zeitkritischen Abschnitte bzw. Applikationen empfindlich stören können, da Kollisionen auf einen Bus-System ebenfalls zu unvorhersagba- ren Verzögerungen führen können. In einem weiteren Testszena- rio wurde eine PCI-Karte in einem Rechner vorgesehen, die zyklisch in Abständen von einer Millisekunde Interrupts erzeugt. Die entsprechende Interrupt-Service-Routine (ISR) führt verschiedene Zeitmessungen durch und sendet ein Signal an die Applikation, die damit fortgesetzt wird. Die ISR nimmt dabei einen Schreibbefehl auf die PC-Karte vor. Another important aspect in addition to the mutual interference of the logical cores of an HT processor are the accesses to the peripherals, since these can severely disrupt the time-critical sections or applications since collisions on a bus system also lead to unpredictable delays being able to lead. In another test scenario, a PCI card was provided in a computer which cyclically generates interrupts at intervals of one millisecond. The corresponding interrupt service routine (ISR) performs various time measurements and sends a signal to the application, which is continued with it. The ISR makes a write command to the PC card.
Das Testszenario ist schematisch in FIG 5 dargestellt. Dabei umfasste ein MultiCore-Prozessor vier Kerne 40, 42, 44 und 46, das zeitkritische Programm 10 inklusive der ISR laufen im ersten Kern 40 des MultiCore-Prozessors , während auf dem an¬ deren drei Kern 42, 44, 46 jeweils eine entsprechende Appli¬ kation permanent lesend über einen PCI-Bus 48 auf eine PCI- Karte 50 zugreift. Die nachfolgende Tabelle zeigt die Messwerte, die auftreten, wenn das System wie beschrieben läuft. Insgesamt wurden 60. 000 Zyklen durchlaufen, um statistische Aussagen zu bekommen. Minimale Zeit Mittlere Zeit Maximale Zeit (ns) (ns) (ns) The test scenario is shown schematically in FIG. In this case, a multi-core processor comprised four cores 40, 42, 44 and 46, the time-critical program 10 including the ISR run in the first core 40 of the multi-core processor, while on the other ¬ three core 42, 44, 46 each have a corresponding Appli ¬ cation permanently read via a PCI bus 48 accesses a PCI card 50. The following table shows the measured values that occur when the system is running as described. A total of 60,000 cycles were run to get statistical information. Minimum Time Average Time Maximum Time (ns) (ns) (ns)
ISR-Latenz 6960 9210 10580  ISR latency 6960 9210 10580
PCI-Lese-Befehl 1040 2007 2147  PCI read command 1040 2007 2147
PCI-Schreib- 12 14 18  PCI write 12 14 18
Befehl  command
Dauer ISR ins3910 6010 6533  Duration ISR ins3910 6010 6533
gesamt  total
Durch die Verwendung des erfindungsgemäßen Verfahrens ergeben sich die Messwerte in der nachfolgenden Tabelle. Hier wurden ebenfalls 60.000 Zyklen durchlaufen. By using the method according to the invention, the measured values are given in the following table. Here also 60,000 cycles were gone through.
Die Zeiten der ISR-Latenz verbessern sich im Mittel um 30% was auf eine reduzierte Busbelastung zurückzuführen ist. Die PCI-Lese-Zugriffe werden deutlich stabiler und unterliegen durch das erfindungsgemäße Verfahren kaum noch Schwankungen, während zuvor die schlechtesten Zeiten um ca. 100% über den besten lagen. Die PCI-Schreib-Zugriffe verlängern sich erwartungsgemäß gar nicht, da hier immer nur in einem Puffer geschrieben wird. Die Zeit, die dieser Wert braucht, bis er im Register der PCI-Karte angekommen ist, dürfte sich aber ebenfalls erheblich verbessern bzw. stabilisieren, was aber nicht nachgewiesen wurde. Die Laufzeit der ISR insgesamt geht im Mittel ebenfalls um über 30% zurück. l g ISR latency times improve on average by 30% due to a reduced bus load. The PCI read accesses become significantly more stable and are subject to fluctuations by the method according to the invention, while previously the worst times were about 100% above the best. As expected, the PCI write accesses do not extend at all, since they are always written in one buffer only. However, the time that this value takes until it has arrived in the register of the PCI card should also be significantly improved or stabilized, but this has not been proven. The total duration of the ISR also declined by more than 30%. lg
Bezugs zeichenliste Reference sign list
10 Programm 10 program
12 Programm  12 program
14 Befehl  14 command
16 Befehl  16 command
18 Prozessor-Pipeline 18 processor pipeline
20 Befehl 20 command
22 Pfeil  22 arrow
24 Abschnitt  24 section
26 Unterbrechungsprozess 26 interruption process
28 Pfeil 28 arrow
30 Pfeil  30 arrow
32 Abschnitt  32 section
34 Bereich  34 area
36 Bereich  36 area
38 Bereich  38 area
40 Prozessorkern  40 processor cores
42 Prozessorkern  42 processor core
44 Prozessorkern  44 processor core
46 Prozessorkern  46 processor core
48 PCI-Bus  48 PCI bus
50 PCI-Karte  50 PCI card
52 Abschnitt  52 section
54 Abschnitt  54 section
56 Abschnitt  56 section

Claims

Patentansprüche claims
1. Verfahren zum Betreiben eines Prozessors durch 1. A method for operating a processor by
- Bereitstellen eines ersten Programms (10) mit einer ersten Folge von Befehlen (32),  Providing a first program (10) with a first sequence of instructions (32),
- Bereitstellen zumindest eines zweiten Programms (12) mit einer zweiten Folge von Befehlen (24), wobei  Providing at least one second program (12) with a second sequence of instructions (24), wherein
- das erste Programm (10) einen zeitkritischen Abschnitt (52) mit zeitkritischen Befehlen (20) umfasst, und  the first program (10) comprises a time-critical section (52) with time-critical commands (20), and
- Bearbeiten der Befehle (20, 24, 32) aus dem ersten und zweiten Programm (10, 12) in einer Prozessor-Pipeline (18), gekennzeichnet durch - editing the instructions (20, 24, 32) from the first and second programs (10, 12) in a processor pipeline (18), characterized by
- Erkennen eines StartZeitpunkts des zeitkritischen Ab¬ schnitts (52) in dem ersten Programm (10), und - detecting a start time of the time-critical from ¬-section (52) in the first program (10), and
- Einfügen eines zuvor festgelegten Unterbrechungsprogramms (26) in das zumindest eine zweite Programm (12), sobald der StartZeitpunkt des zeitkritischen Abschnitts (52) in dem ers¬ ten Programm (10) erkannt wird. - Inserting a predetermined interrupt program (26) in the at least one second program (12) as soon as the start time of the time-critical section (52) in the ers ¬ th program (10) is detected.
2. Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass mit dem Start des zeitkritischen Abschnitts (52) in dem ersten Programm ein Unterbrechungssignal an das zweite Programm (12) zum Einfügen des Unterbrechungsprogramms (26) gesendet wird . 2. The method according to claim 1, characterized in that with the start of the time-critical section (52) in the first program an interrupt signal to the second program (12) for inserting the interrupt program (26) is sent.
3. Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass der zeitkritische Abschnitt (52) zusammen mit dem Unter¬ brechungsprogramm (26) in einer vorhersagbaren Reihenfolge in der Prozessor-Pipeline (18) bearbeitet wird. 3. The method according to claim 1 or 2, characterized in that the time-critical section (52) is processed together with the bottom refraction ¬ program (26) in a predictable sequence in the processor pipeline (18).
4. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass mit dem zeitkritischen Abschnitt (52) auch das Unterbrechungsprogramm (26) beendet wird. 4. The method according to any one of the preceding claims, characterized in that with the time-critical portion (52) and the interrupt program (26) is terminated.
5. Verfahren nach einem der vorhergehenden Ansprüche, wobei das Unterbrechungsprogramm (26) die folgenden Schritte umfasst : A method according to any one of the preceding claims, wherein the interruption program (26) comprises the following steps:
- Lesen eines Werts aus einem Speicher, - Vergleichen des gelesenen Werts mit einem zuvor festgelegten Wert, und Reading a value from a memory, - comparing the read value with a predetermined value, and
- Erneutes Starten des Unterbrechungsprogramms (26), falls sich der gelesene Wert und der festgelegte Wert unterschei- den .  - restarting the interrupt program (26) if the read value and the specified value differ.
6. Verfahren nach Anspruch 4 oder 5, wobei das Unterbrechungsprogramm (26) dadurch beendet wird, dass in den Speicher ein Wert geschrieben wird, der dem zuvor festgelegten Wert entspricht. A method according to claim 4 or 5, wherein the interrupt program (26) is terminated by writing to the memory a value corresponding to the predetermined value.
7. Prozessor mit 7. Processor with
- einer ersten Prozessoreinheit zum Bereitstellen eines ersten Programms (10) mit einer ersten Folge von Befehlen (32), - zumindest einer zweiten Prozessoreinheit zum Bereitstellen zumindest eines zweiten Programms (12) mit einer zweiten Fol¬ ge von Befehlen (24), wobei a first processor unit for providing a first program (10) with a first sequence of instructions (32), at least one second processor unit for providing at least one second program (12) with a second sequence of instructions (24)
- das erste Programm einen zeitkritischen Abschnitt (52) mit zeitkritischen Befehlen (20) umfasst,  the first program comprises a time-critical section (52) with time-critical commands (20),
- einer Prozessors-Pipeline (18) zum Bearbeiten der Befehle (20, 24, 32) aus dem ersten und zweiten Programm (10, 12), und a processor pipeline (18) for processing the instructions (20, 24, 32) from the first and second programs (10, 12), and
- einer Speichereinrichtung mit einem Betriebssystem, wobei der Prozessor dazu ausgebildet ist, das Betriebssystem auszu- führen,  a memory device with an operating system, wherein the processor is designed to execute the operating system,
dadurch gekennzeichnet, dass characterized in that
- der Prozessor oder das Betriebssystem dazu ausgebildet ist, einen StartZeitpunkts des zeitkritischen Abschnitts (52) in dem ersten Programm (10) zu erkennen und einen zuvor festge- legtes Unterbrechungsprogramm (26) in das zumindest eine zweite Programm (12) einzufügen, sobald der StartZeitpunkt des zeitkritischen Abschnitts (52) in dem ersten Programm (10) erkannt ist.  - The processor or the operating system is adapted to detect a start time of the time-critical portion (52) in the first program (10) and insert a previously defined interrupt program (26) in the at least one second program (12) as soon as the Start time of the time-critical portion (52) in the first program (10) is detected.
8. Prozessor nach Anspruch 7, dadurch gekennzeichnet, dass der Prozessor eine Datenaustauscheinheit und eine Vergleichs¬ einheit umfasst, wobei die Datenaustauscheinheit dazu ausge¬ bildet ist, während des Unterbrechungsprogramms (26) einen Wert aus einem Speicher zu lesen und wobei die Vergleichsein heit dazu ausgebildet ist, während des Unterbrechungspro¬ gramms (26) den gelesenen Wert mit einem zuvor festgelegten Wert zu vergleichen. 8. Processor according to claim 7, characterized in that the processor comprises a data exchange unit and a comparison ¬ unit, wherein the data exchange unit is to ¬ forms, during the interruption program (26) a To read value from a memory and wherein the Vergleichsein unit is adapted to compare the read value during the interrupt program ¬ program (26) with a predetermined value.
9. Prozessor nach Anspruch 7 oder 8, dadurch gekennzeichnet, dass der Prozessor zumindest zwei Prozessorkerne umfasst. 9. Processor according to claim 7 or 8, characterized in that the processor comprises at least two processor cores.
10. Automatisierungsgerät mit einem Prozessor nach einem der vorhergehenden Ansprüche. 10. Automation device with a processor according to one of the preceding claims.
EP12702491.7A 2012-01-31 2012-01-31 Method for operating a processor Ceased EP2761436A1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/EP2012/051483 WO2013113366A1 (en) 2012-01-31 2012-01-31 Method for operating a processor

Publications (1)

Publication Number Publication Date
EP2761436A1 true EP2761436A1 (en) 2014-08-06

Family

ID=45563007

Family Applications (1)

Application Number Title Priority Date Filing Date
EP12702491.7A Ceased EP2761436A1 (en) 2012-01-31 2012-01-31 Method for operating a processor

Country Status (4)

Country Link
US (1) US20140325185A1 (en)
EP (1) EP2761436A1 (en)
CN (1) CN104081344B (en)
WO (1) WO2013113366A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020062435A1 (en) * 1998-12-16 2002-05-23 Mario D. Nemirovsky Prioritized instruction scheduling for multi-streaming processors
US6785887B2 (en) * 2000-12-27 2004-08-31 International Business Machines Corporation Technique for using shared resources on a multi-threaded processor

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7308686B1 (en) * 1999-12-22 2007-12-11 Ubicom Inc. Software input/output using hard real time threads
JP4740851B2 (en) * 2003-08-28 2011-08-03 ミップス テクノロジーズ インコーポレイテッド Mechanism for dynamic configuration of virtual processor resources
US7516313B2 (en) * 2004-12-29 2009-04-07 Intel Corporation Predicting contention in a processor
EP1814001B1 (en) * 2006-01-11 2015-09-16 Siemens Aktiengesellschaft Automation device and method for operating an automation device
US7769955B2 (en) * 2007-04-27 2010-08-03 Arm Limited Multiple thread instruction fetch from different cache levels
EP2120143B1 (en) * 2008-05-13 2011-08-31 dspace digital signal processing and control engineering GmbH Method to perform tasks for calculating a signal to be simulated in real time
US20090300629A1 (en) * 2008-06-02 2009-12-03 Mois Navon Scheduling of Multiple Tasks in a System Including Multiple Computing Elements
CN101324852A (en) * 2008-07-22 2008-12-17 北京航空航天大学 Real-time operating system and real-time method thereof
US7979642B2 (en) * 2008-09-11 2011-07-12 Arm Limited Managing the storage of high-priority storage items in storage units in multi-core and multi-threaded systems using history storage and control circuitry
US8695002B2 (en) * 2009-10-20 2014-04-08 Lantiq Deutschland Gmbh Multi-threaded processors and multi-processor systems comprising shared resources
WO2011104812A1 (en) * 2010-02-23 2011-09-01 富士通株式会社 Multi-core processor system, interrupt program, and interrupt method
CN101887378A (en) * 2010-06-18 2010-11-17 阳坚 Semi-physical real-time simulator and semi-physical real-time simulation system
US9286137B2 (en) * 2012-09-14 2016-03-15 Intel Corporation Achieving deterministic execution of time critical code sections in multi-core systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020062435A1 (en) * 1998-12-16 2002-05-23 Mario D. Nemirovsky Prioritized instruction scheduling for multi-streaming processors
US6785887B2 (en) * 2000-12-27 2004-08-31 International Business Machines Corporation Technique for using shared resources on a multi-threaded processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of WO2013113366A1 *

Also Published As

Publication number Publication date
CN104081344B (en) 2017-10-31
US20140325185A1 (en) 2014-10-30
CN104081344A (en) 2014-10-01
WO2013113366A1 (en) 2013-08-08

Similar Documents

Publication Publication Date Title
DE112011105298B4 (en) Reduce energy consumption from uncore circuits of a processor
DE60210633T2 (en) METHOD AND DEVICES FOR IMPROVING THE THROUGHPUT OF EMBEDDED CACHE-BASED PROCESSORS BY SWITCHING TASKS AS A RESPONSE TO CACHE MISCONDUCT
DE69824688T2 (en) System and method for optimizing the performance of a computer system
DE69819849T2 (en) Arrangement for arbitrary sampling of instructions in a processor pipeline
DE69933515T2 (en) peripheral processor
EP2575002B1 (en) Method and virtualisation software for producing independent time sources for virtual runtime environments
DE102017125180A1 (en) Synchronous hardware event collection
DE112004001133T5 (en) Queue locks with monitor memory wait
DE102013214756A1 (en) METHOD AND DEVICE FOR IMPROVING THE PROCESSING CAPACITY OF A MULTI-CORE PROCESSOR
EP2513796B1 (en) Method for operating a processor
EP2962205B1 (en) Multi-core processor system having an error analysis function
DE112012004728T5 (en) Method, program and system for simulation execution
DE112013000904T5 (en) Performing updates to source code that runs on a variety of compute nodes
DE102006041444B4 (en) Circuit arrangement and method for detecting an execution time of a command in a computer system
DE102020103521A1 (en) Minimizing the use of hardware counters in triggered operations for collective communication
DE112017003323T5 (en) Processors, methods and systems for identifying memories that cause external transactional execution aborts
DE112011100168B4 (en) Capturing diagnostic data in a data processing environment
DE102011110151B4 (en) A semiconductor device and method for operating a pipeline equalizer in a semiconductor device
DE102005001679B4 (en) Microprocessor device, and method for branch prediction for conditional branch instructions in a microprocessor device
WO2011047901A1 (en) Method and device for testing a system comprising at least a plurality of software units that can be executed simultaneously
DE102020214951A1 (en) Method for dynamically allocating memory bandwidth
DE102020118022A1 (en) GENERATE DIFFERENT TRACES FOR GRAPHIC PROCESSOR CODE
DE112019000189T5 (en) PROGRAM EXECUTION CONTROL METHOD AND VEHICLE CONTROL DEVICE
DE102004059972B4 (en) Thread scheduling method, and thread list scheduler device
DE3700800A1 (en) DEVICE FOR GENERATING A FIXED POINT IN A MICROPROCESSOR

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20140429

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

DAX Request for extension of the european patent (deleted)
17Q First examination report despatched

Effective date: 20160926

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: SIEMENS AKTIENGESELLSCHAFT

REG Reference to a national code

Ref country code: DE

Ref legal event code: R003

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION HAS BEEN REFUSED

18R Application refused

Effective date: 20200214