FR3103595A1 - Fast simulator of an ECU and software implemented by this ECU - Google Patents

Fast simulator of an ECU and software implemented by this ECU Download PDF

Info

Publication number
FR3103595A1
FR3103595A1 FR1913321A FR1913321A FR3103595A1 FR 3103595 A1 FR3103595 A1 FR 3103595A1 FR 1913321 A FR1913321 A FR 1913321A FR 1913321 A FR1913321 A FR 1913321A FR 3103595 A1 FR3103595 A1 FR 3103595A1
Authority
FR
France
Prior art keywords
simulator
architectural
computer
epoch
functional
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.)
Granted
Application number
FR1913321A
Other languages
French (fr)
Other versions
FR3103595B1 (en
Inventor
Mohamed-El Amir Charif
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.)
Commissariat a lEnergie Atomique et aux Energies Alternatives CEA
Original Assignee
Commissariat a lEnergie Atomique CEA
Commissariat a lEnergie Atomique et aux Energies Alternatives CEA
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 Commissariat a lEnergie Atomique CEA, Commissariat a lEnergie Atomique et aux Energies Alternatives CEA filed Critical Commissariat a lEnergie Atomique CEA
Priority to FR1913321A priority Critical patent/FR3103595B1/en
Publication of FR3103595A1 publication Critical patent/FR3103595A1/en
Application granted granted Critical
Publication of FR3103595B1 publication Critical patent/FR3103595B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • 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/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Simulateur rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, le calculateur comprenant au moins un processeur, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches, des mémoires externes et un réseau d'interconnexions assurant la communication entre les mémoires caches et les mémoires externes ; le simulateur comprenant une pluralité de co-simulateurs respectivement associés à une tâche, et étant configuré pour fonctionner par quantum d'instructions, un co-simulateur dit fonctionnel (CSF) étant configuré pour faire fonctionner le logiciel simulé en faisant abstraction de l'architecture du calculateur, au moins un autre co-simulateur dit architectural (CSAi) étant configuré pour simuler, en parallèle, le comportement architectural lié à l'architecture du calculateur et déterminer les valeurs de paramètres extra-fonctionnels du calculateur, et un module de transfert (MT) configuré pour transférer un événement signalé par le co-simulateur fonctionnel (CSF) à un co-simulateur architectural (CSAi) souscrit à cet événement. Figure pour l’abrégé : Fig. 5Rapid simulator of a calculator and of software implemented by this calculator, the calculator comprising at least one processor, a memory hierarchy comprising several levels of cache memories, external memories and a network of interconnections ensuring communication between the cache memories and external memories; the simulator comprising a plurality of co-simulators respectively associated with a task, and being configured to operate by quantum of instructions, a so-called functional co-simulator (CSF) being configured to operate the simulated software while ignoring the architecture of the calculator, at least one other so-called architectural co-simulator (CSAi) being configured to simulate, in parallel, the architectural behavior linked to the architecture of the calculator and determine the values of extra-functional parameters of the calculator, and a transfer module (MT) configured to transfer an event reported by the functional co-simulator (CSF) to an architectural co-simulator (CSAi) subscribed to this event. Figure for abstract: Fig. 5

Description

Simulateur rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateurFast simulator of a computer and software implemented by this computer

L’invention porte sur un simulateur rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, et un procédé correspondant.The invention relates to a fast simulator of a computer and to software implemented by this computer, and to a corresponding method.

Un calculateur classique comprend une ou plusieurs unités de calcul ou processeurs, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches (les calculateurs à hautes performances incluent typiquement trois niveaux de mémoires caches), des mémoires externes (dites RAM pour acronyme de "Random Access Memory" en langue anglaise) et un réseau d’interconnexions (NoC pour acronyme de "Network-on-Chip" en langue anglaise), assurant la communication entre les caches et les mémoires externes. De tels calculateurs peuvent également comprendre un certain nombre de périphériques, comme des contrôleurs série, des disques durs, ou des périphériques PCI (pour acronyme de "Peripheral Component Interconnect" en langue anglaise.A conventional computer comprises one or more calculation units or processors, a memory hierarchy comprising several levels of cache memories (high-performance computers typically include three levels of cache memories), external memories (called RAM for the acronym of "Random Access Memory " in English) and an interconnection network (NoC for acronym of "Network-on-Chip" in English), ensuring communication between the caches and the external memories. Such computers can also include a certain number of peripherals, such as serial controllers, hard disks, or PCI peripherals (for acronym for "Peripheral Component Interconnect" in English.

Afin d’accélérer le développement de tels calculateurs, des prototypes virtuels rapides sont souvent réalisés dans les premières phases de conception, pouvant réduire le délai de mise sur le marché ou "time-to-market" en langue anglaise, principalement des deux manières qui suivent.In order to accelerate the development of such ECUs, rapid virtual prototypes are often made in the early design phases, which can reduce the time to market or "time-to-market" in the English language, mainly in the two ways that follow.

Il est possible de prendre des décisions architecturales : le prototype virtuel peut modéliser les parties critiques de l’architecture du calculateur, comme les mémoires caches, et d’en tester différents modes de fonctionnement et différentes capacités afin de dimensionner correctement ces éléments pour l’architecture finale.It is possible to make architectural decisions: the virtual prototype can model the critical parts of the computer's architecture, such as the cache memories, and to test different operating modes and different capacities in order to size these elements correctly for the final structure.

Il est également possible d'utiliser un développement logiciel: avec un modèle fidèle du processeur, des logiciels peuvent être développés, débuggés et testés avant même que la plateforme physique ne soit disponible, permettant de paralléliser les conceptions matérielle et logicielle.It is also possible to use software development: with a faithful model of the processor, software can be developed, debugged and tested even before the physical platform is available, making it possible to parallelize hardware and software designs.

Pour qu’un prototype virtuel soit utile, deux conditions doivent être remplies:
- Il doit être disponible tôt, et donc pouvoir être développé rapidement. Les modèles développés sont donc souvent assez abstraits et non-détaillés.
- Il doit être rapide, car le concepteur doit être capable de réaliser plusieurs itérations et tester différentes configurations rapidement.
For a virtual prototype to be useful, two conditions must be met:
- It must be available early, and therefore able to be developed quickly. The models developed are therefore often quite abstract and non-detailed.
- It must be fast, because the designer must be able to perform several iterations and test different configurations quickly.

La rapidité du prototype virtuel se caractérise par la vitesse à laquelle il est capable d’exécuter le logiciel simulé. Typiquement, les simulateurs modernes sont capables de simuler plusieurs centaines de millions d’instructions par seconde (MIPS).The speed of the virtual prototype is characterized by the speed at which it is able to run the simulated software. Typically, modern simulators are capable of simulating several hundred million instructions per second (MIPS).

Une technique très souvent adoptée pour remplir ces deux conditions, est la modélisation dite vaguement chronométrée ou "loosely-timed" en langue anglaise. Cette méthode modélise les différents composants (périphériques, mémoires) de manière assez abstraite, réduisant à la fois le temps de développement et le temps de conception.A technique very often adopted to fulfill these two conditions is so-called vaguely timed modeling or "loosely-timed" in English. This method models the various components (peripherals, memories) in a fairly abstract way, reducing both development time and design time.

La modélisation loosely-timed, illustrée schématiquement sur la figure 1, opère comme suit.The loosely-timed modeling, schematically illustrated in Figure 1, operates as follows.

Le simulateur cède le contrôle à un des processeurs du système pendant un quantum d’instructions.The simulator hands over control to one of the system's processors for a quantum of instructions.

Pendant toute la durée du quantum, le processeur exécute des instructions sans redonner la main au simulateur. Cela permet de réduire le nombre de changements de contexte du simulateur, et d'améliorer significativement les performances de simulation.Throughout the duration of the quantum, the processor executes instructions without giving control back to the simulator. This reduces the number of simulator context switches, and significantly improves simulation performance.

Le modèle du processeur interprète les instructions du logiciel simulé.The processor model interprets the simulated software instructions.

Ces instructions peuvent être des instructions arithmétiques ALU_instr() pour Arithmetic and Logic Unit instruction, qui peuvent être simulées très rapidement (typiquement en utilisant des opérateurs simples), des instructions d’accès entrées/sorties IO_access(), qui peuvent être simulées lentement (typiquement en utilisant des appels système), mais qui sont rares, et enfin des instructions d’accès mémoire RAM_access(), qui génèrent des transactions vers les modèles de mémoires caches, mémoires externes et réseau NoC pour simuler un accès mémoire.These instructions can be arithmetic instructions ALU_instr() for Arithmetic and Logic Unit instruction, which can be simulated very quickly (typically using simple operators), input/output access instructions IO_access(), which can be simulated slowly ( typically using system calls), but which are rare, and finally RAM_access() memory access instructions, which generate transactions to the cache memory, external memory and NoC network models to simulate memory access.

Chaque élément traversé pendant le quantum du processeur met à jour l’horloge locale du processeur en rajoutant sa propre latence. Par exemple, comme illustré sur la figure 1, la mémoire cache de premier niveau L1 Cache prend deux cycles, donc deux cycles sont rajoutés (T+=2) au temps local T du processeur.Each element traversed during the processor quantum updates the local processor clock by adding its own latency. For example, as shown in Figure 1, the first level cache memory L1 Cache takes two cycles, so two cycles are added (T+=2) to the local time T of the processor.

Sur l'exemple illustré, l’exécution de chaque instruction prend un cycle.In the example shown, the execution of each instruction takes one cycle.

On peut voir sur la figure 1 que le temps de simulation peut vite devenir problématique. En effet, le nombre d’accès mémoire dans un programme classique peut être très grand, et basculer constamment entre l’interprétation des instructions et la simulation de la hiérarchie mémoire a un impact sérieux sur la localité du code du simulateur. La localité du code correspond au fait d’exécuter les mêmes bouts de code plusieurs fois pendant l’exécution du simulateur.We can see in Figure 1 that the simulation time can quickly become problematic. Indeed, the number of memory accesses in a classical program can be very large, and constantly switching between interpreting instructions and simulating the memory hierarchy has a serious impact on the locality of the simulator code. The locality of the code corresponds to the fact of executing the same pieces of code several times during the execution of the simulator.

En effet, si l’interpréteur visite souvent les mêmes zones de code simples, une bonne partie des instructions exécutées peut rester en cache, ce qui est désirable pour une exécution fluide. Cependant, en faisant des transitions entre des instructions de l’interpréteur d’instructions et les modèles de mémoires caches, de réseaux de communications NoC et de mémoires externes RAM, qui peuvent être assez complexes, on obtient l'effet indésirable de réduire sévèrement cette localité.Indeed, if the interpreter often visits the same simple areas of code, a large part of the executed instructions may remain in cache, which is desirable for smooth execution. However, by making transitions between instructions of the instruction interpreter and the models of cache memories, NoC communications networks and external RAM memories, which can be quite complex, one obtains the undesirable effect of severely reducing this locality.

Etant donné la sévérité de ce problème, plusieurs solutions ont été proposées comme suit.Given the severity of this problem, several solutions have been proposed as follows.

Le document US 2018/0173825 A1 divulgue une approche consistant à paralléliser la simulation, en simulant chaque processeur dans une tâche, ou "thread" en langue anglaise, d’exécution unique. Cela permet d’avoir des accélérations significatives lorsque le nombre de cœurs simulés est grand, typiquement supérieur à 16. Cependant, cette approche ne s’attaque pas au problème de performance dû à la simulation des accès mémoires exposé précédemment. Aussi, pour la simulation d’un système embarqué classique, ayant entre quatre et huit cœurs de calculs, cette approche ne produit pas d’accélération.Document US 2018/0173825 A1 discloses an approach consisting in parallelizing the simulation, by simulating each processor in a single execution task, or "thread". This allows to have significant speedups when the number of simulated cores is large, typically greater than 16. However, this approach does not address the performance problem due to the simulation of memory accesses exposed previously. Also, for the simulation of a classic embedded system, having between four and eight calculation cores, this approach does not produce any acceleration.

Les approches des documents Mutli-threaded TCG (Tiny Code Generator)", Bellard, F. (2005, April), QEMU, a fast and portable dynamic translato, inUSENIX Annual Technical Conference, FREENIX Track(Vol. 41, p. 46), et "QEMU and SystemC in separate threads", de Delbergue, G., Burton, M., Konrad, F., Le Gal, B., & Jego, C. (2016, January), QBox: an industrial solution for virtual platform simulation using QEMU and SystemC TLM-2.0, in8th European Congress on Embedded Real Time Software and Systems (ERTS 2016), ont pour but d’accélérer au maximum les simulations en mettant l’accent sur la localité du code. Afin de ne pas interrompre l’exécution du processeur durant un quantum, les accès mémoires sont traduits par de simples accès à la mémoire RAM de la machine hôte (machine exécutant la simulation). Bien sûr, cela ne permet donc pas d’avoir un prototypage suffisamment détaillé pour pouvoir dimensionner correctement les éléments mémoires, car la hiérarchie mémoire est entièrement négligée durant la simulation. Ces approches emploient également un parallélisme spatial tel que décrit précédemment, où chaque cœur est exécuté dans le contexte d’une tâche à part.Mutli-threaded TCG (Tiny Code Generator) document approaches", Bellard, F. (2005, April), QEMU, a fast and portable dynamic translato, inUSENIX Annual Technical Conference, FREENIX Track(Vol. 41, p. 46) , and "QEMU and SystemC in separate threads", by Delbergue, G., Burton, M., Konrad, F., Le Gal, B., & Jego, C. (2016, January), QBox: an industrial solution for virtual platform simulation using QEMU and SystemC TLM-2.0, in8th European Congress on Embedded Real Time Software and Systems (ERTS 2016), aim to speed up simulations as much as possible by emphasizing code locality. not interrupt the execution of the processor during a quantum, the memory accesses are translated by simple accesses to the RAM memory of the host machine (machine executing the simulation).Of course, this does not allow to have a sufficiently detailed prototyping to be able to size the memory elements correctly, because the memory hierarchy is entirely neglected during the simulation. These approaches also employ spatial parallelism as described previously, where each core is executed in the context of a separate task.

Une autre approche est d’adopter une parallélisation non pas spatiale, mais temporelle. L’idée de base est d'effectuer la même simulation en deux couches: une couche fonctionnelle qui sert à faire avancer le simulateur, et une couche temporelle qui sert à modéliser le comportement temporel de différentes parties du système. Les documents qui suivent mettent en œuvre une telle réalisation : "Trace Driven Virtual Synchronization", de Yun, D., Kim, S., & Ha, S. (2012), A parallel simulation technique for multicore embedded systems and its performance analysis,IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems,31(1), 121-13; "Graphite: Distributed Parallel Multicore Simulator", de Miller, J. E., Kasture, H., Kurian, G., Gruenwald, C., Beckmann, N., Celio, C., ... & Agarwal, A. (2010, January), Graphite: A distributed parallel simulator for multicores, InHPCA-16 2010 The Sixteenth International Symposium on High-Performance Computer Architecture(pp. 1-12). IEEE; "TQSim: Cycle-approximate processor simulator based on QEMU", de Kang, S. H., Yoo, D., & Ha, S. (2016), "TQSIM: A fast cycle-approximate processor simulator based on QEMU".Journal of Systems Architecture,66, 33-47; et " GreenSoCs : Gathering Memory Hierarchy Statistics in QEMU" de Clement Deschamps, Frédéric Pétrot, Mark Burton, Eric Jenn, DVCon 2019.Another approach is to adopt a parallelization that is not spatial, but temporal. The basic idea is to perform the same simulation in two layers: a functional layer that serves to drive the simulator forward, and a temporal layer that serves to model the temporal behavior of different parts of the system. The following documents implement such a realization: "Trace Driven Virtual Synchronization", by Yun, D., Kim, S., & Ha, S. (2012), A parallel simulation technique for multicore embedded systems and its performance analysis ,IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems,31(1), 121-13; "Graphite: Distributed Parallel Multicore Simulator", by Miller, J. E., Kasture, H., Kurian, G., Gruenwald, C., Beckmann, N., Celio, C., ... & Agarwal, A. (2010, January), Graphite: A distributed parallel simulator for multicores, InHPCA-16 2010 The Sixteenth International Symposium on High-Performance Computer Architecture(pp. 1-12). IEEE; "TQSim: Cycle-approximate processor simulator based on QEMU", by Kang, S. H., Yoo, D., & Ha, S. (2016), "TQSIM: A fast cycle-approximate processor simulator based on QEMU".Journal of Systems Architecture,66, 33-47; and "GreenSoCs: Gathering Memory Hierarchy Statistics in QEMU" by Clement Deschamps, Frédéric Pétrot, Mark Burton, Eric Jenn, DVCon 2019.

TQSim utilise l’émulateur QEMU pour une exécution fonctionnelle du logiciel simulé, sans aucune information sur le temps dû aux différents aspects architecturaux (mémoires, processeurs). Ce temps est calculé par un simulateur séparé qui modélise plus précisément ces aspects.TQSim uses the QEMU emulator for a functional execution of the simulated software, without any information on the time due to the different architectural aspects (memories, processors). This time is calculated by a separate simulator which models these aspects more precisely.

TQSim simule la hiérarchie mémoire dans le même contexte que la simulation fonctionnelle, ce qui, dans le cas de hiérarchies complexes, peut être très problématique en termes de performances, comme expliqué précédemment.TQSim simulates the memory hierarchy in the same context as the functional simulation, which in the case of complex hierarchies can be very problematic in terms of performance, as explained before.

D’autres aspects du processeur, tels que le pipeline et le prédicteur de branchements, sont simulés dans une tâche à part, permettant de masquer leur impact sur la vitesse de simulation.Other aspects of the processor, such as pipeline and branch predictor, are simulated in a separate task, hiding their impact on simulation speed.

Comme l’approche TQSim est basée sur l’échantillonnage des instructions exécutées, i.e., seule une partie des instructions est instrumentée au début de chaque quantum, les modèles de mémoires et de processeurs doivent être des modèles analytiques représentant de manière abstraite les caractéristiques des différents composants.As the TQSim approach is based on the sampling of the executed instructions, i.e., only a part of the instructions is instrumented at the beginning of each quantum, the memory and processor models must be analytical models representing in an abstract way the characteristics of the different components.

L’approche de GreenSoCs vise à simuler la hiérarchie mémoire en parallèle d'un simulateur fonctionnel. On appelle simulateur fonctionnel, un simulateur configuré pour faire fonctionner le logiciel simulé, en faisant abstraction de l'architecture du calculateur.The GreenSoCs approach aims to simulate the memory hierarchy in parallel with a functional simulator. A functional simulator is a simulator configured to operate the simulated software, disregarding the architecture of the computer.

On entend par comportement architectural toute action du calculateur simulé visant à reproduire un comportement du calculateur réel n’impactant non pas le fonctionnement logique du logiciel simulé, mais les caractéristiques extra-fonctionnelles, telles que la performance ou la consommation énergétique. Par exemple, les mémoires caches ne changent pas le fonctionnement d’un programme, mais peuvent améliorer sa performance.Architectural behavior means any action of the simulated computer aimed at reproducing a behavior of the real computer that does not impact the logical operation of the simulated software, but the extra-functional characteristics, such as performance or energy consumption. For example, caches do not change how a program works, but can improve its performance.

Un point critique dans ces deux dernières approches TQSim et GreenSoCs est que le logiciel simulé ne perçoit jamais l’impact des différents sous-systèmes modélisés dans le contexte temporel. Ainsi, le contexte temporel est l’unique point de vérité de la simulation, contrairement à l’approche que l’on propose, où le logiciel simulé a une vue correcte du temps et de l’état d’exécution, prenant en compte les aspects extra-fonctionnels simulés dans d'autres tâches.A critical point in these last two approaches TQSim and GreenSoCs is that the simulated software never perceives the impact of the different modeled subsystems in the temporal context. Thus, the temporal context is the single point of truth of the simulation, contrary to the approach that we propose, where the simulated software has a correct view of the time and the state of execution, taking into account the extra-functional aspects simulated in other tasks.

Un but de l'invention est de pallier les problèmes précédemment cités.An object of the invention is to overcome the problems cited above.

Aussi, il est proposé, selon un aspect de l'invention, un simulateur rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, le calculateur comprenant au moins un processeur, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches, des mémoires externes et un réseau d'interconnexions assurant la communication entre les mémoires caches et les mémoires externes. Le simulateur comprend une pluralité de co-simulateurs respectivement associés à une tâche (thread), et est configuré pour fonctionner par quantum d'instructions, un co-simulateur dit fonctionnel étant configuré pour faire fonctionner le logiciel simulé en faisant abstraction de l'architecture du calculateur, au moins un autre co-simulateur dit architectural étant configuré pour simuler, en parallèle, le comportement architectural lié à l'architecture du calculateur et déterminer les valeurs de paramètres extra-fonctionnels (ou résultats de simulation) du calculateur, et un module de transfert configuré pour transférer un événement signalé par le co-simulateur fonctionnel à un co-simulateur architectural souscrit à cet événement.Also, there is proposed, according to one aspect of the invention, a fast simulator of a computer and of software implemented by this computer, the computer comprising at least one processor, a memory hierarchy comprising several levels of cache memories , external memories and an interconnection network providing communication between the cache memories and the external memories. The simulator comprises a plurality of co-simulators respectively associated with a task (thread), and is configured to operate by quantum of instructions, a so-called functional co-simulator being configured to operate the simulated software by disregarding the architecture of the computer, at least one other so-called architectural co-simulator being configured to simulate, in parallel, the architectural behavior linked to the architecture of the computer and to determine the values of extra-functional parameters (or simulation results) of the computer, and a forwarding module configured to forward an event signaled by the functional co-simulator to an architectural co-simulator subscribed to this event.

Un tel simulateur permet d’envisager des simulations comprenant à la fois une exécution fluide et fonctionnellement fidèle du logiciel simulé, et une reproduction détaillée et chronométrée de tous les composants architecturaux du calculateur simulé. Traditionnellement, seul l’un des deux modes est envisageable: simulation rapide sans détails architecturaux, ou simulation précise mais très lente. Le simulateur proposé sépare les co-simulateurs architecturaux du co-simulateur fonctionnel pour faciliter l’intégration de nouveaux co-simulateurs, modélisant de nouveaux détails architecturaux, dans un simulateur existant. Le simulateur proposé prend systématiquement en compte les états des co-simulateurs architecturaux au sein du co-simulateur fonctionnel, afin que le logiciel ait une vue à jour de l’état du calculateur.Such a simulator makes it possible to envisage simulations comprising both a fluid and functionally faithful execution of the simulated software, and a detailed and timed reproduction of all the architectural components of the simulated computer. Traditionally, only one of two modes is possible: fast simulation without architectural details, or precise but very slow simulation. The proposed simulator separates the architectural co-simulators from the functional co-simulator to facilitate the integration of new co-simulators, modeling new architectural details, into an existing simulator. The proposed simulator systematically takes into account the states of the architectural co-simulators within the functional co-simulator, so that the software has an up-to-date view of the state of the computer.

Dans un mode de réalisation, les paramètres extra-fonctionnels du calculateur comprennent les temps de cycles processeur, et/ou l'énergie, et/ou la fiabilité.In one embodiment, the extra-functional parameters of the computer include processor cycle times, and/or energy, and/or reliability.

Ainsi le simulateur peut être utilisé non seulement pour valider le fonctionnement d’un logiciel, mais aussi de l’optimiser au niveau des performances, de l’énergie ou de la fiabilité, en prenant en compte tous les aspects architecturaux.Thus the simulator can be used not only to validate the operation of software, but also to optimize it in terms of performance, energy or reliability, taking into account all architectural aspects.

Selon un mode de réalisation, le comportement architectural comprend des paramètres représentatifs de l'architecture du calculateur.According to one embodiment, the architectural behavior comprises parameters representative of the architecture of the computer.

Par exemple, les paramètres représentatifs de l'architecture du calculateur comprennent un nombre d'accès mémoires caches et externes du calculateur, et/ou les communications du réseau d'interconnexions.For example, the parameters representative of the architecture of the computer include a number of cache and external memory accesses of the computer, and/or the communications of the interconnection network.

Ainsi l’utilisateur est en mesure de comprendre les détails du comportement du calculateur suite à l’exécution du logiciel simulé.Thus the user is able to understand the details of the behavior of the computer following the execution of the simulated software.

Dans un mode de réalisation, chaque co-simulateur architectural est configuré pour simuler un unique type d'événement.In one embodiment, each architectural co-simulator is configured to simulate a unique type of event.

Ainsi il est facile de développer des co-simulateurs architecturaux simulant différents comportements architecturaux et à divers niveaux de précision de manière séparée et modulaire. De plus, tous les co-simulateurs architecturaux étant découplés du simulateur principal, différentes caractéristiques de l’architecture peuvent être évaluées simultanément sans impacter la fluidité de la simulation.Thus it is easy to develop architectural co-simulators simulating different architectural behaviors and at various levels of precision in a separate and modular way. Moreover, since all the architectural co-simulators are decoupled from the main simulator, different characteristics of the architecture can be evaluated simultaneously without impacting the fluidity of the simulation.

Selon un mode de réalisation, une simulation étant décomposée en époques numérotées à partir de 0, et une époque correspondant à au moins un quantum, le co-simulateur fonctionnel est configuré pour, au début d'une époque impaire, attendre que chaque co-simulateur architectural ait fini le traitement des événements de l'époque impaire qui précède, et au début d'une époque paire, attendre que chaque co-simulateur architectural ait fini le traitement des événements de l'époque paire qui précède.According to one embodiment, a simulation being broken down into epochs numbered starting from 0, and an epoch corresponding to at least one quantum, the functional co-simulator is configured to, at the start of an odd epoch, wait for each co- architectural simulator has finished processing the events of the preceding odd epoch, and at the start of an even epoch, wait until each architectural co-simulator has finished processing the events of the preceding even epoch.

Ainsi la simulation fonctionnelle émettant des événements lors d’une époque, est toujours effectuée en parallèle du traitement par les co-simulateurs des évènements émis lors de l’époque précédente, garantissant ainsi un usage optimal du parallélisme.Thus the functional simulation emitting events during an epoch is always carried out in parallel with the processing by the co-simulators of the events emitted during the previous epoch, thus guaranteeing an optimal use of parallelism.

Dans un mode de réalisation, le simulateur comprend deux copies de l'état d'un co-simulateur architectural, une copie dite paire S'(i) pour une époque paire et une copie dite impaire S''(i) pour une époque impaire, l'état S(i) d'un co-simulateur architectural comprenant les paramètres représentatifs de l'architecture du calculateur, dans lequel :
- un co-simulateur architectural est configuré pour écrire dans la copie paire S'(i) durant une époque paire et pour écrire dans la copie impaire S''(i) durant une époque impaire, et
- le co-simulateur fonctionnel CSF est configuré pour lire puis réinitialiser la copie paire S'(i) entre la fin d'une époque impaire et le début de l'époque paire suivante, et pour lire puis réinitialiser la copie impaire S''(i) entre la fin d'une époque paire et le début de l'époque impaire suivante.
In one embodiment, the simulator comprises two copies of the state of an architectural co-simulator, a so-called even copy S'(i) for an even epoch and a so-called odd copy S''(i) for an epoch odd, the state S(i) of an architectural co-simulator comprising the parameters representative of the architecture of the computer, in which:
- an architectural co-simulator is configured to write in the even copy S'(i) during an even epoch and to write in the odd copy S''(i) during an odd epoch, and
- the functional co-simulator CSF is configured to read then reset the even copy S'(i) between the end of an odd epoch and the start of the next even epoch, and to read then reset the odd copy S'' (i) between the end of an even epoch and the start of the next odd epoch.

Ainsi lorsque le co-simulateur fonctionnel entame une époque impaire, il peut lire et réinitialiser les états impairs S’’(i) des co-simulateurs architecturaux sans avoir à bloquer l’exécution des co-simulateurs architecturaux, qui eux écrivent en parallèle dans leur état pair S’(i).Thus when the functional co-simulator begins an odd epoch, it can read and reset the odd states S''(i) of the architectural co-simulators without having to block the execution of the architectural co-simulators, which write in parallel in their even state S'(i).

Selon un mode de réalisation, une époque correspond à un unique quantum.According to one embodiment, an epoch corresponds to a single quantum.

Il est également proposé, selon un autre aspect de l'invention, un procédé de simulation rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, le calculateur comprenant au moins un processeur, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches, des mémoires externes et un réseau d'interconnexions assurant la communication entre les mémoires caches et les mémoires externes comprenant une pluralité de co-simulateurs respectivement associés à une tâche,
le procédé fonctionnant par quantum d'instructions, et comprenant les étapes de :
- simulation du logiciel par un co-simulateur dit fonctionnel, en faisant abstraction de l'architecture du calculateur,
- simulation, en parallèle, par au moins un autre co-simulateur dit architectural du comportement architectural lié à l'architecture du calculateur et détermination des valeurs de paramètres extra-fonctionnels du calculateur, et
- transfert d'un événement signalé par le co-simulateur fonctionnel à un co-simulateur architectural souscrit à cet événement.
There is also proposed, according to another aspect of the invention, a method for rapid simulation of a computer and of software implemented by this computer, the computer comprising at least one processor, a memory hierarchy comprising several levels of cache memories, external memories and a network of interconnections providing communication between the cache memories and the external memories comprising a plurality of co-simulators respectively associated with a task,
the method operating by instruction quantum, and comprising the steps of:
- simulation of the software by a so-called functional co-simulator, disregarding the architecture of the computer,
- simulation, in parallel, by at least one other so-called architectural co-simulator of the architectural behavior linked to the architecture of the computer and determination of the values of extra-functional parameters of the computer, and
- transfer of an event signaled by the functional co-simulator to an architectural co-simulator subscribed to this event.

L'invention sera mieux comprise à l'étude de quelques modes de réalisation décrits à titre d'exemples nullement limitatifs et illustrés par les dessins annexés sur lesquels :The invention will be better understood on studying a few embodiments described by way of non-limiting examples and illustrated by the appended drawings in which:

illustre schématiquement un simulateur utilisant une modélisation loosely-timed d'un quantum d'instructions pour un processeur, selon l'état de l'art ; schematically illustrates a simulator using a loosely-timed modeling of a quantum of instructions for a processor, according to the state of the art;

illustre schématiquement un simulateur avec découplage séquentiel entre la simulation fonctionnelle et la simulation architecturale, d'un système de la figure 1, selon un aspect de l'invention ; schematically illustrates a simulator with sequential decoupling between the functional simulation and the architectural simulation, of a system of FIG. 1, according to one aspect of the invention;

illustre schématiquement un simulateur selon la figure 2, selon un aspect de l'invention ; schematically illustrates a simulator according to FIG. 2, according to one aspect of the invention;

illustre schématiquement un simulateur selon deux aspects de l'invention ; et schematically illustrates a simulator according to two aspects of the invention; And

illustre schématiquement un simulateur selon un aspect de l'invention. schematically illustrates a simulator according to one aspect of the invention.

Sur l'ensemble des figures, les éléments ayant des références identiques sont similaires.In all of the figures, the elements having identical references are similar.

Il y a deux intérêts à simuler les modèles liés à la hiérarchie mémoire comme dans le cas de la figure 1. D’une part, cela permet d’obtenir des statistiques utiles sur les différents composants, ce qui est utile pour la caractérisation de l’architecture et du logiciel. D’autre part, cela permet d’ajuster le temps du simulateur, et aussi les différentes horloges perçues par les processeurs en comptabilisant les délais dus à la simulation de ces composants. Cependant, ces deux fonctionnalités ne requièrent en aucun cas que les modèles soient simulés à l’instant où l’instruction d’accès mémoire est exécutée.There are two interests in simulating the models related to the memory hierarchy as in the case of figure 1. On the one hand, it allows to obtain useful statistics on the different components, which is useful for the characterization of the architecture and software. On the other hand, this makes it possible to adjust the time of the simulator, and also the different clocks perceived by the processors by counting the delays due to the simulation of these components. However, these two features in no way require that the models be simulated at the instant the memory access instruction is executed.

En effet, comparé à l'exemple de la figure 1 de l'état de l'art, il est possible de différer la simulation des mémoires caches, du réseau d'interconnexions NoC et des mémoires externes à la fin du quantum d'instructions, améliorant ainsi la localité au sien d’un quantum. Ceci est illustré sur la figure 2. Les temps dus aux accès mémoire seraient donc ajoutés à la fin du quantum, assurant ainsi que le temps passé à exécuter ces instructions est le même dans les deux cas. Aussi, les statistiques seront disponibles au niveau des modèles en fin de quantum.Indeed, compared to the example of FIG. 1 of the state of the art, it is possible to defer the simulation of the cache memories, of the NoC interconnection network and of the external memories at the end of the instruction quantum , thus improving the locality within a quantum. This is illustrated in Figure 2. The times due to memory accesses would therefore be added to the end of the quantum, thus ensuring that the time spent executing these instructions is the same in both cases. Also, the statistics will be available at the level of the models at the end of the quantum.

La simulation architecturale de la hiérarchie mémoire, est remplacée par un accès direct à la mémoire (direct_mem_access()).The architectural simulation of the memory hierarchy is replaced by direct memory access (direct_mem_access()).

L’invention permet d'exécuter un co-simulteur architectural des accès mémoire en parallèle de la simulation fonctionnelle du logiciel simulé par le co-simulateur fonctionnel.The invention makes it possible to execute an architectural co-simulator of memory accesses in parallel with the functional simulation of the software simulated by the functional co-simulator.

Tout d’abord, on sépare le co-simulateur mémoire (à droite comme exemple de co-simulateur architectural) du co-simulateur fonctionnel du logiciel simulé sur le processeur (gauche). Les instructions simulées, ainsi que les modèles utilisés pour simuler les éléments mémoires, sont les mêmes que sur l’exemple de la figure 2.First, we separate the memory co-simulator (on the right as an example of an architectural co-simulator) from the functional co-simulator of the software simulated on the processor (left). The simulated instructions, as well as the models used to simulate the memory elements, are the same as in the example of figure 2.

Au lieu de simuler les accès mémoire en ligne ou en continu, comme sur la partie gauche de la figure 2, les accès mémoires sont traduits en deux opérations de base:
- Accès direct à la mémoire (direct_mem_access() sur la figure 3) consistant à compléter l’accès mémoire en chargeant ou en stockant la donnée directement sur l’espace mémoire cible, sans simuler le comportement réel de la mémoire. Ceci peut être émulé à l’aide d’instructions Load/Store de la machine hôte (machine exécutant le simulateur), et est quasi-instantané.
- Notification de l’accès mémoire (notify() sur la figure 3) devant impérativement être la plus rapide possible pour ne pas perturber le flot d’exécution du processeur. Sur la figure 3, elle consiste en une simple écriture d’un événement sur une file d’attente (FIFO) lock-free. La pile FIFO lock-free ne fait pas d’appels systèmes et permet d’assurer une insertion efficace. L’événement écrit dans la file d’attente comporte des informations sur l’accès mémoire, dans cet exemple: l’instant où s’est déroulé l’accès (time), l’identifiant du processeur qui fait l’accès (cpu), l’adresse mémoire de l’accès (addr), la taille de la donnée demandée (size), et le type d’accès (lecture/écriture, rd/wr).
Instead of simulating online or continuous memory accesses, as on the left side of Figure 2, memory accesses are translated into two basic operations:
- Direct memory access (direct_mem_access() in figure 3) consisting of completing the memory access by loading or storing the data directly on the target memory space, without simulating the actual behavior of the memory. This can be emulated using Load/Store instructions from the host machine (machine running the simulator), and is nearly instantaneous.
- Notification of memory access (notify() in figure 3) which must imperatively be as fast as possible so as not to disturb the flow of execution of the processor. In figure 3, it consists of a simple writing of an event on a lock-free queue (FIFO). The lock-free FIFO stack does not make system calls and helps ensure efficient insertion. The event written to the queue contains information about the memory access, in this example: the instant when the access took place (time), the identifier of the processor making the access (cpu ), the memory address of the access (addr), the size of the requested data (size), and the type of access (read/write, rd/wr).

Le co-simulateur mémoire consomme un à un les événements présents dans la file d’attente, et parcourt les différents modèles concernés. Un délai T’ propre au simulateur mémoire est mis à jour au fur et à mesure, en temps de cycles processeur.The memory co-simulator consumes the events present in the queue one by one, and goes through the different models concerned. A delay T' specific to the memory simulator is updated progressively, in processor cycle times.

A la fin du quantum, ce temps T’ est comptabilisé sur le temps local du CPU, aboutissant ainsi au même état à la fin du quantum que sur la partie gauche de la figure 2, mais avec une réduction considérable dans le temps de simulation.At the end of the quantum, this time T' is counted on the local time of the CPU, thus leading to the same state at the end of the quantum as on the left part of figure 2, but with a considerable reduction in the simulation time.

Après cet exemple simple, on détaille maintenant la mise en œuvre générale de la présente invention pour accommoder n’importe quel co-simulateur architectural et assurer un parallélisme maximal.After this simple example, we now detail the general implementation of the present invention to accommodate any architectural co-simulator and ensure maximum parallelism.

Le simulateur de l'invention comprend un co-simulateur fonctionnel configuré pour faire fonctionner le logiciel simulé, en faisant abstraction de l'architecture du calculateur. Le co-simulateur fonctionnel a pour objectif d’exécuter correctement les instructions du logiciel simulé. Il doit assurer ce fonctionnement correct de la manière la plus simple possible, en faisant abstraction de tout aspect architectural qui ne serait pas directement visible d’un point de vue fonctionnel.The simulator of the invention comprises a functional co-simulator configured to operate the simulated software, disregarding the architecture of the computer. The purpose of the functional co-simulator is to correctly execute the instructions of the simulated software. It must ensure this correct operation in the simplest possible way, disregarding any architectural aspect that would not be directly visible from a functional point of view.

Le co-simulateur fonctionnel a la possibilité de signaler un certain nombre d’événements qui surviennent lors de l’exécution.The functional co-simulator has the ability to signal a number of events that occur during execution.

Un événement peut êtreun accès en lecture à la mémoire (instruction load), une instruction de branchement, etc.An event can be a read access to memory (load instruction), a branch instruction, etc.

La simulation doit comprendre un nombre fini E de types d’événements. Chaque événement est identifié par son type, un entier unique entre 0 et E.The simulation must include a finite number E of event types. Each event is identified by its type, a unique integer between 0 and E.

Chaque événement est accompagné d’une structure de données propre, comprenant des détails sur l’événement. Par exemple, à quel instant a eu lieu l’événement, quelle est la source de l’événement, etc. Cette structure peut être différente selon le type d’événement.Each event comes with its own data structure, including details about the event. For example, when did the event take place, what is the source of the event, etc. This structure may be different depending on the type of event.

Le simulateur comprend également, en plus du co-simulateur fonctionnel, au moins un co-simulateur architectural configuré pour simuler, en parallèle, le comportement architectural lié à l'architecture du calculateur et déterminer les valeurs de paramètres extra-fonctionnels du calculateur. On associe un identifiant unique numéroté entre 0 et N à chaque co-simulateur architectural. Le simulateur comprend également un module de transfert, ou "dispatcher" en langue anglaise, configuré pour transférer un événement signalé par le co-simulateur fonctionnel à un co-simulateur architectural souscrit à cet événement.The simulator also comprises, in addition to the functional co-simulator, at least one architectural co-simulator configured to simulate, in parallel, the architectural behavior linked to the architecture of the computer and to determine the values of extra-functional parameters of the computer. A unique identifier numbered between 0 and N is associated with each architectural co-simulator. The simulator also comprises a transfer module, or "dispatcher" in English, configured to transfer an event signaled by the functional co-simulator to an architectural co-simulator subscribed to this event.

Chaque co-simulateur architectural i comprend:
- une file d’événements associée au co-simulateur architectural i notée EQ(i), une seule file pouvant contenir plusieurs types d’événements (entre 0 et E types). Le co-simulateur architectural souscrit aux types d’événements qu’il veut gérer avant le début de la simulation. Cette souscription se fait auprès du module de transfert, détaillé plus tard. La file d’événements est accessible par le module de transfert.
- un état S(i) accessible par le co- simulateur fonctionnel, comprenant:
* un délai dT (temps additionnel passé à réaliser la fonction des composants simulés par le co-simulateur architectural i). Si les composants simulés par le co-simulateur architectural i permettent de réduire le temps d’exécution estimé par le co-simulateur fonctionnel au lieu de le pénaliser, alors dT peut être négatif. Pour un co-simulateur architectural qui n’affecte pas le temps de simulation (e.g. un simulateur de puissance), dT reste toujours à 0.
* un nombre K de compteurs C(k), k étant un entier entre 0 et K. Ces compteurs sont mis à jour lors de l’exécution du co-simulateur architectural. Comme exemple de compteurs on peut citer: le nombre d’accès à une mémoire, le nombre de succès, ou "hits" en langue anglaise, dans une mémoire cache, etc. Accéder à ces compteurs lors de l’exécution à partir du co-simulateur fonctionnel permet entre-autres de simuler correctement une unité de surveillance ou "monitoring" en langue anglaise, de performance PMU pour acronyme de "Performance Monitoring Unit" en langue anglaise, présente sur les processeurs actuels. Ainsi, le logiciel simulé peut avoir accès à des informations sur le matériel simulé en cours d’exécution.
- une procédure F(i) qui décrit le fonctionnement du ou des composants simulés par le co-simulateur architectural i. Cette fonction prend l’état S(i), ainsi que le prochain événement présent dans la file EQ(i), et met à jour l’état S(i). Une seule procédure F(i) peut modéliser plusieurs composants architecturaux (e.g. toute la hiérarchie mémoire au lieu d’une partie).
Each architectural co-simulator i includes:
- a queue of events associated with the architectural co-simulator i denoted EQ(i), a single queue being able to contain several types of events (between 0 and E types). The architectural co-simulator subscribes to the types of events it wants to handle before the simulation begins. This subscription is done with the transfer module, detailed later. The event queue is accessible by the transfer module.
- a state S(i) accessible by the functional co-simulator, comprising:
* a delay dT (additional time spent performing the function of the components simulated by the architectural co-simulator i). If the components simulated by the architectural co-simulator i make it possible to reduce the execution time estimated by the functional co-simulator instead of penalizing it, then dT can be negative. For an architectural co-simulator which does not affect the simulation time (eg a power simulator), dT always remains at 0.
* a number K of counters C(k), k being an integer between 0 and K. These counters are updated during the execution of the architectural co-simulator. Examples of counters include: the number of accesses to a memory, the number of successes, or "hits" in English, in a cache memory, etc. Accessing these counters during execution from the functional co-simulator makes it possible, among other things, to correctly simulate a monitoring unit or "monitoring" in English, of performance PMU for acronym of "Performance Monitoring Unit" in English, present on current processors. Thus, the simulated software can have access to information about the running simulated hardware.
- a procedure F(i) which describes the operation of the component or components simulated by the architectural co-simulator i. This function takes the state S(i), as well as the next event present in the queue EQ(i), and updates the state S(i). A single procedure F(i) can model several architectural components (eg the whole memory hierarchy instead of just one part).

Les événements signalés par le co-simulateur fonctionnel sont transmis à une au module de transfert.Events reported by the functional co-simulator are forwarded to a forwarding module.

Le module de transfert a pour objectif de transmettre un événement aux co-simulateurs architecturaux qui y sont souscrits. Pour ce faire, le module de transfert maintient une correspondance ("mapping" en langue anglaise) entre les différents types d’événements, et les co-simulateurs architecturaux qui y sont souscrits. Ce mapping peut être efficacement implémenté en utilisant un vecteur de vecteurs EM, EM(e) étant un vecteur contenant tous les co-simulateurs architecturaux i qui sont souscrits au type d’événement e. Plus formellement, lorsqu’un événement de type e est signalé au niveau du module de transfert, celui-ci insère l’événement dans EQ(i) pour chaque i dans EM(e).The purpose of the transfer module is to transmit an event to the architectural co-simulators that are subscribed to it. To do this, the transfer module maintains a correspondence ("mapping" in English) between the different types of events, and the architectural co-simulators that are subscribed to them. This mapping can be efficiently implemented using a vector of vectors EM, EM(e) being a vector containing all the architectural co-simulators i which are subscribed to the event type e. More formally, when an event of type e is signaled at the level of the transfer module, the latter inserts the event into EQ(i) for each i in EM(e).

Pour une efficacité maximale, on peut associer un type d’événements à chaque co-simulateur architectural, ce qui revient à tout simplement insérer chaque événement signalé de type e dans EQ(e).For maximum efficiency, an event type can be associated with each architectural co-simulator, which amounts to simply inserting each signaled event of type e into EQ(e).

Le module de transfert peut être exécuté dans le même contexte que le simulateur principal de manière synchrone.The transfer module can be executed in the same context as the main simulator synchronously.

Comme illustré sur la figure 4, sur la gauche est représentée une version de base et sur la droite une version améliorée.As shown in Figure 4, on the left is shown a basic version and on the right an improved version.

Ci-suit le principe de fonctionnement de la version de base (partie gauche de la figure 4).Below is the operating principle of the basic version (left part of figure 4).

Lors d'une initialisation, on fait une instanciation de chaque co-simulateur architectural i, responsable de l’initialisation de son état S(i). Chaque co-simulateur architectural i consomme le contenu de sa file d’événements EQ(i) dans un contexte (tâche) différent.During an initialization, we instantiate each architectural co-simulator i, responsible for initializing its state S(i). Each architectural co-simulator i consumes the content of its event queue EQ(i) in a different context (task).

Chaque co-simulateur i enregistre auprès du module de transfert, d'une part une référence vers sa file d’événements EQ(i), et d'autre part la liste de types d’événements es que le co-simulateur architectural i peut traiter. Le module de transfert ajoute donc i dans le vecteur EM(e) pour chaque événement de type e dans la liste es.Each co-simulator i registers with the transfer module, on the one hand a reference to its queue of events EQ(i), and on the other hand the list of types of events es that the architectural co-simulator i can to treat. The transfer module therefore adds i to the vector EM(e) for each event of type e in the list es.

Chaque co-simulateur architectural i enregistre auprès du co-simulateur fonctionnel une référence vers son état interne S(i).Each architectural co-simulator i registers with the functional co-simulator a reference to its internal state S(i).

Ensuite, a lieu une phase de simulation, effectuée par quantums d’instructions. Durant un quantum, le co-simulateur fonctionnel simule le nombre défini d’instructions sur un processeur de la plateforme simulée.Then, a simulation phase takes place, carried out by quantums of instructions. During a quantum, the functional co-simulator simulates the defined number of instructions on a processor of the simulated platform.

Une instruction simulée peut être accompagnée d’un signalement d’événement. Dans ce cas, le co-simulateur fonctionnel invoque le module de transfert en indiquant le type de l’événement, ainsi que les données qui y sont associées.A simulated instruction may be accompanied by an event signal. In this case, the functional co-simulator invokes the transfer module indicating the type of the event, as well as the data associated with it.

Le module de transfert, suivant le type d’événement, écrit l’événement dans la ou les files d’événements EQ(i) concernées, et redonne immédiatement le contrôle au co-simulateur fonctionnel, lui permettant de reprendre l’exécution immédiatement.The transfer module, depending on the type of event, writes the event in the relevant EQ(i) event queue(s), and immediately gives control back to the functional co-simulator, allowing it to resume execution immediately.

De manière concurrente et en parallèle de l’exécution du co-simulateur fonctionnel, chaque co-simulateur architectural lit les événements e à partir de leur file d’événements EQ(i) et appellent leur fonction interne F(i).Concurrently and in parallel with the execution of the functional co-simulator, each architectural co-simulator reads the events e from their event queue EQ(i) and calls their internal function F(i).

A la fin du quantum d’instructions, le co-simulateur fonctionnel attend que le ou les co-simulateurs architecturaux aient fini de traiter leurs événements respectifs, et utilise le contenu des états S(i) afin de mettre à jour ses registres internes (horloge, PMU etc.).At the end of the instruction quantum, the functional co-simulator waits for the architectural co-simulator(s) to have finished processing their respective events, and uses the contents of the states S(i) to update its internal registers ( clock, PMU etc.).

Les états S(i) sont réinitialisés à chaque lecture. Ainsi, les compteurs correspondent uniquement à l’exécution du quantum courant, et sont faciles à exploiter par le co-simulateur fonctionnel.The states S(i) are reinitialized on each reading. Thus, the counters correspond only to the execution of the current quantum, and are easy to exploit by the functional co-simulator.

Ci-suit le principe de fonctionnement de la version améliorée, pour maximiser le parallélisme (partie droite de la figure 4).Here follows the operating principle of the improved version, to maximize parallelism (right part of figure 4).

L’approche de base peut être très efficace pour des quantums d’un nombre élevé d’instructions, cependant, l’intérêt est vite limité pour de petits quantums, pour les raisons suivantes :
- Le simulateur fonctionnel doit attendre que le ou les co-simulateurs architecturaux aient fini de traiter tous les événements, y compris ceux signalés au sein du quantum courant. Si l’ensemble des co-simulateurs architecturaux est complexe, cela peut très vite impacter la fluidité de l’exécution fonctionnelle.
- Si des événements arrivent tard dans le quantum, des co-simulateurs architecturaux peuvent être inactifs pendant une bonne partie du quantum, ce qui ne tire pas avantage du parallélisme de la machine hôte (cf figure 3, sur laquelle le co-simulateur fonctionnel reste en attente du co-simulateur mémoire lorsqu’il a fini son quantum).
The basic approach can be very effective for quantums of a high number of instructions, however, the interest is quickly limited for small quantums, for the following reasons:
- The functional simulator must wait for the architectural co-simulator(s) to finish processing all events, including those signaled within the current quantum. If the set of architectural co-simulators is complex, this can very quickly impact the fluidity of the functional execution.
- If events arrive late in the quantum, architectural co-simulators can be inactive for a good part of the quantum, which does not take advantage of the parallelism of the host machine (see figure 3, on which the functional co-simulator remains waiting for the memory co-simulator when it has finished its quantum).

La version améliorée est illustrée sur la partie gauche de la figure 4.The improved version is shown on the left side of Figure 4.

On suppose que le ou les co-simulateurs architecturaux peuvent être lents, et donc le but est de s’assurer qu’à chaque quantum, les co-simulateurs architecturaux sont en train de traiter des événements en parallèle des instructions du co-simulateur fonctionnel.It is assumed that the architectural co-simulator(s) can be slow, and therefore the goal is to ensure that at each quantum, the architectural co-simulators are processing events in parallel to the instructions of the functional co-simulator .

On définit dans la simulation des époques, une époque correspondant à un nombre entier de quantums, supérieur ou égal à un. La simulation démarre à l’époque 0, puis passe à l’époque 1, puis 2, etc.In the simulation, epochs are defined as an epoch corresponding to an integer number of quantums, greater than or equal to one. The simulation starts at epoch 0, then goes to epoch 1, then 2, etc.

Le passage d’une époque à l’autre peut être effectué lors du passage d’un quantum à l’autre pour simplifier l’implémentation.The transition from one epoch to another can be done when switching from one quantum to another to simplify the implementation.

On distinguera alors entre les époques paires et les époques impaires (l’époque 0 est paire, 1 est impaire, etc.).We will then distinguish between even epochs and odd epochs (epoch 0 is even, 1 is odd, etc.).

A la fin d’un quantum d’instructions correspondant à une époque paire, le co-simulateur fonctionnel doit juste attendre que le ou les co-simulateurs architecturaux aient fini le traitement des événements de la dernière époque impaire. Au passage au quantum suivant, qui correspond à une époque impaire, l’exécution se fait en parallèle du traitement des événements du quantum précédent, qui était pair.At the end of a quantum of instructions corresponding to an even epoch, the functional co-simulator must just wait for the architectural co-simulator(s) to finish processing the events of the last odd epoch. On passing to the next quantum, which corresponds to an odd epoch, the execution is done in parallel with the processing of the events of the previous quantum, which was even.

De même, à la fin d’un quantum d’instructions correspondant à une époque impaire, le co-simulateur fonctionnel doit juste attendre que le ou les co-simulateurs architecturaux aient fini le traitement des événements de la dernière époque paire. Au passage au quantum suivant, qui correspond à une époque paire, l’exécution se fait en parallèle du traitement des événements du quantum précédent, qui était impair.Similarly, at the end of a quantum of instructions corresponding to an odd epoch, the functional co-simulator just has to wait for the architectural co-simulator(s) to finish processing the events of the last even epoch. On passing to the next quantum, which corresponds to an even epoch, the execution is done in parallel with the processing of the events of the previous quantum, which was odd.

L’implémentation de cette approche nécessite de dupliquer l’état S(i) d’un co-simulateur architectural i, en deux copies:
- S’(i) pour les époques paires, et
- S’’(i) pour les époques impaires.
The implementation of this approach requires duplicating the state S(i) of an architectural co-simulator i, in two copies:
- S'(i) for even epochs, and
- S''(i) for odd periods.

Un co-simulateur architecturale i écrit dans l’état S’(i) pour les époques paires, et le co-simulateur fonctionnel lit S’(i) à la fin d’une époque impaire, et écrit dans l’état S’'(i) pour les époques impaires, et le co-simulateur fonctionnel lit S’'(i) à la fin d’une époque paire.An architectural co-simulator i writes to state S'(i) for even epochs, and the functional co-simulator reads S'(i) at the end of an odd epoch, and writes to state S' '(i) for odd epochs, and the functional co-simulator reads S''(i) at the end of an even epoch.

Comme illustré sur les figures 4 et 5, la présente invention fait en sorte qu’au début d’un nouveau quantum d'instructions, le co-simulateur fonctionnel doit juste attendre que les événements de la même parité aient été traités par les co-simulateurs architecturaux. Les figures montrent que cela permet d’exécuter tout un quantum pendant que les co-simulateurs architecturaux traitent à la fois les événements du quantum précédent, et ceux nouvellement émis lors du quantum courant, ce qui réduit considérablement le temps d’exécution, comme on peut le voir sur la figure 4, où on arrive à exécuter trois quantums d’instructions au lieu de deux, avec le même temps de simulation.As illustrated in Figures 4 and 5, the present invention ensures that at the start of a new instruction quantum, the functional co-simulator just has to wait until the events of the same parity have been processed by the co-simulators. architectural simulators. The figures show that this makes it possible to execute a whole quantum while the architectural co-simulators process both the events of the previous quantum, and those newly emitted during the current quantum, which considerably reduces the execution time, as we can see it on figure 4, where one manages to execute three quantums of instructions instead of two, with the same simulation time.

La synchronisation est détaillée comme suit.Synchronization is detailed as follows.

Un facteur clé dans la performance de simulation est le mécanisme utilisé pour la synchronisation entre la tâche du simulateur fonctionnel et les tâches de co-simulation.A key factor in simulation performance is the mechanism used for synchronization between the functional simulator task and the co-simulation tasks.

Dans la présente approche, aucun mécanisme de synchronisation bloquant (mutex, sémaphore) ne doit être utilisé à l’intérieur d’un quantum. En revanche, un tel mécanisme peut être utilisé entre des quantums.In the present approach, no blocking synchronization mechanism (mutex, semaphore) should be used inside a quantum. On the other hand, such a mechanism can be used between quantums.

La duplication des états des co-simulateurs architecturaux assure une cohérence des données sans aucune synchronisation. En effet, les variables d’état écrites par la tâche du co-simulateur fonctionnel (réinitialisation de l’état) sont celles écrites par les co-simulateurs architecturaux à une époque précédente, et sont différentes que celles qui sont écrites par les co-simulateurs architecturaux à l’époque courante.The duplication of the states of the architectural co-simulators ensures data consistency without any synchronization. Indeed, the state variables written by the functional co-simulator task (state reset) are those written by the architectural co-simulators at a previous epoch, and are different than those written by the co-simulators. architectural simulators in the current era.

Les files d’événements EQ(i) sont des files dites lock-free. C’est-à-dire qu’aucun mutex n’est acquis avant d’insérer ou d’extraire un élément dans la file.The EQ(i) event queues are so-called lock-free queues. That is, no mutex is acquired before inserting or extracting an item from the queue.

Claims (9)

Simulateur rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, le calculateur comprenant au moins un processeur, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches, des mémoires externes et un réseau d'interconnexions assurant la communication entre les mémoires caches et les mémoires externes ;
le simulateur comprenant une pluralité de co-simulateurs respectivement associés à une tâche, et étant configuré pour fonctionner par quantum d'instructions, un co-simulateur dit fonctionnel (CSF) étant configuré pour faire fonctionner le logiciel simulé en faisant abstraction de l'architecture du calculateur, au moins un autre co-simulateur dit architectural (CSAi) étant configuré pour simuler, en parallèle, le comportement architectural lié à l'architecture du calculateur et déterminer les valeurs de paramètres extra-fonctionnels du calculateur, et un module de transfert (MT) configuré pour transférer un événement (e) signalé par le co-simulateur fonctionnel (CSF) à un co-simulateur architectural (CSAi) souscrit à cet événement.
Fast simulator of a computer and of software implemented by this computer, the computer comprising at least one processor, a memory hierarchy comprising several levels of cache memories, external memories and an interconnection network providing communication between the cache memories and external memories;
the simulator comprising a plurality of co-simulators respectively associated with a task, and being configured to operate by quantum of instructions, a so-called functional co-simulator (CSF) being configured to operate the simulated software by disregarding the architecture of the computer, at least one other so-called architectural co-simulator (CSAi) being configured to simulate, in parallel, the architectural behavior linked to the architecture of the computer and to determine the values of extra-functional parameters of the computer, and a transfer module (MT) configured to transfer an event (e) signaled by the functional co-simulator (CSF) to an architectural co-simulator (CSAi) subscribed to this event.
Simulateur selon la revendication 1, dans lequel les paramètres extra-fonctionnels du calculateur comprennent les temps de cycles processeur, et/ou l'énergie, et/ou la fiabilité.A simulator according to claim 1, wherein the extra-functional parameters of the computer include processor cycle times, and/or power, and/or reliability. Simulateur selon l'une des revendications précédentes, dans lequel le comportement architectural comprend des paramètres représentatifs de l'architecture du calculateur.Simulator according to one of the preceding claims, in which the architectural behavior comprises parameters representative of the architecture of the computer. Simulateur selon la revendication 3, dans lequel les paramètres représentatifs de l'architecture du calculateur comprennent un nombre d'accès mémoires caches et externes du calculateur, et/ou les communications du réseau d'interconnexions.Simulator according to claim 3, in which the parameters representative of the architecture of the computer comprise a number of cache and external memory accesses of the computer, and/or the communications of the interconnection network. Simulateur selon l'une des revendications précédentes, dans lequel chaque co-simulateur architectural est configuré pour simuler un unique type d'événement.Simulator according to one of the preceding claims, in which each architectural co-simulator is configured to simulate a unique type of event. Simulateur selon l'une des revendications précédentes, dans lequel, une simulation étant décomposée en époques numérotées à partir de 0, et une époque correspondant à au moins un quantum, le co-simulateur fonctionnel (CSF) est configuré pour, au début d'une époque impaire, attendre que chaque co-simulateur architectural (CSAi) ait fini le traitement des événements de l'époque impaire qui précède, et au début d'une époque paire, attendre que chaque co-simulateur architectural (CSAi) ait fini le traitement des événements de l'époque paire qui précède.Simulator according to one of the preceding claims, in which, a simulation being broken down into epochs numbered starting from 0, and an epoch corresponding to at least one quantum, the functional co-simulator (CSF) is configured for, at the start of an odd epoch, wait until each architectural co-simulator (CSAi) has finished processing the events of the preceding odd epoch, and at the beginning of an even epoch, wait until each architectural co-simulator (CSAi) has finished processing the treatment of the events of the preceding even epoch. Simulateur selon la revendication 6, comprenant deux copies de l'état (S(i)) d'un co-simulateur architectural (CSAi), une copie dite paire (S'(i)) pour une époque paire et une copie dite impaire (S''(i)) pour une époque impaire, l'état (S(i)) d'un co-simulateur architectural (CSAi) comprenant les paramètres représentatifs de l'architecture du calculateur, dans lequel :
  • un co-simulateur architectural (CSAi) est configuré pour écrire dans la copie paire (S'(i)) durant une époque paire et pour écrire dans la copie impaire (S''(i) durant une époque impaire, et
  • le co-simulateur fonctionnel (CSF) est configuré pour lire puis réinitialiser la copie paire (S'(i)) entre la fin d'une époque impaire et le début de l'époque paire suivante, et pour lire puis réinitialiser la copie impaire (S''(i) entre la fin d'une époque paire et le début de l'époque impaire suivante.
Simulator according to claim 6, comprising two copies of the state (S(i)) of an architectural co-simulator (CSAi), a so-called even copy (S'(i)) for an even epoch and a so-called odd copy (S''(i)) for an odd epoch, the state (S(i)) of an architectural co-simulator (CSAi) comprising the parameters representative of the architecture of the computer, in which:
  • an architectural co-simulator (CSAi) is configured to write to the even copy (S'(i)) during an even epoch and to write to the odd copy (S''(i) during an odd epoch, and
  • the functional co-simulator (CSF) is configured to read then reset the even copy (S'(i)) between the end of an odd epoch and the start of the next even epoch, and to read then reset the odd copy (S''(i) between the end of an even epoch and the start of the next odd epoch.
Simulateur selon la revendication 1, dans lequel, une époque correspond à un unique quantum.A simulator according to claim 1, wherein an epoch corresponds to a single quantum. Procédé de simulation rapide d'un calculateur et d'un logiciel mis en œuvre par ce calculateur, le calculateur comprenant au moins un processeur, une hiérarchie mémoire comprenant plusieurs niveaux de mémoires caches, des mémoires externes et un réseau d'interconnexions assurant la communication entre les mémoires caches et les mémoires externes comprenant une pluralité de co-simulateurs respectivement associés à une tâche,
le procédé fonctionnant par quantum d'instructions, et comprenant les étapes de :
  • simulation du logiciel par un co-simulateur dit fonctionnel (CSF), en faisant abstraction de l'architecture du calculateur,
  • simulation, en parallèle, par au moins un autre co-simulateur dit architectural (CSA) du comportement architectural lié à l'architecture du calculateur et détermination des valeurs de paramètres extra-fonctionnels du calculateur, et
  • transfert (MT) d'un événement signalé par le co-simulateur fonctionnel à un co-simulateur architectural souscrit à cet événement.
Method for rapid simulation of a computer and of software implemented by this computer, the computer comprising at least one processor, a memory hierarchy comprising several levels of cache memories, external memories and an interconnection network providing communication between the cache memories and the external memories comprising a plurality of co-simulators respectively associated with a task,
the method operating by instruction quantum, and comprising the steps of:
  • simulation of the software by a so-called functional co-simulator (CSF), disregarding the architecture of the computer,
  • simulation, in parallel, by at least one other so-called architectural co-simulator (CSA) of the architectural behavior linked to the architecture of the computer and determination of the values of extra-functional parameters of the computer, and
  • transfer (MT) of an event signaled by the functional co-simulator to an architectural co-simulator subscribed to this event.
FR1913321A 2019-11-27 2019-11-27 Quick simulator of a calculator and software implemented by this calculator Active FR3103595B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
FR1913321A FR3103595B1 (en) 2019-11-27 2019-11-27 Quick simulator of a calculator and software implemented by this calculator

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FR1913321 2019-11-27
FR1913321A FR3103595B1 (en) 2019-11-27 2019-11-27 Quick simulator of a calculator and software implemented by this calculator

Publications (2)

Publication Number Publication Date
FR3103595A1 true FR3103595A1 (en) 2021-05-28
FR3103595B1 FR3103595B1 (en) 2023-10-27

Family

ID=70008671

Family Applications (1)

Application Number Title Priority Date Filing Date
FR1913321A Active FR3103595B1 (en) 2019-11-27 2019-11-27 Quick simulator of a calculator and software implemented by this calculator

Country Status (1)

Country Link
FR (1) FR3103595B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090222250A1 (en) * 2008-02-28 2009-09-03 Oki Electric Industry Co., Ltd. Hard/Soft Cooperative Verifying Simulator
US20180173825A1 (en) 2015-06-25 2018-06-21 Commissariat A L'energie Atomique Et Aux Energies Alternatives Computer-implemented method of performing parallelized electronic-system level simulations

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090222250A1 (en) * 2008-02-28 2009-09-03 Oki Electric Industry Co., Ltd. Hard/Soft Cooperative Verifying Simulator
US20180173825A1 (en) 2015-06-25 2018-06-21 Commissariat A L'energie Atomique Et Aux Energies Alternatives Computer-implemented method of performing parallelized electronic-system level simulations

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
BELLARD, F.: "QEMU, a fast and portable dynamic translato", USENIX ANNUAL TECHNICAL CONFÉRENCE, FREENIX TRACK, vol. 41, April 2005 (2005-04-01), pages 46
BOUHADIBA TAYEB ET AL: "Co-simulation of Functional SystemC TLM Models with Power/Thermal Solvers", 2013 IEEE INTERNATIONAL SYMPOSIUM ON PARALLEL & DISTRIBUTED PROCESSING, WORKSHOPS AND PHD FORUM, IEEE, 20 May 2013 (2013-05-20), pages 2176 - 2181, XP032517722, DOI: 10.1109/IPDPSW.2013.206 *
CLEMENT DESCHAMPSFRÉDÉRIC PÉTROTMARK BURTONERIC JENN: "GreenSoCs : Gathering Memory Hierarchy Statistics in QEMU", DVCON, 2019
DELBERGUE, G.BURTON, M.KONRAD, F.LE GAI, B.JEGO, C.: "QEMU and SystemC in separate threads", QBOX: AN INDUSTRIAL SOLUTION FOR VIRTUAL PLATFORM SIMULATION USING QEMU AND SYSTEMC TLM-2.0, IN 8TH EUROPEAN CONGRESS ON EMBEDDED REAL TIME SOFTWARE AND SYSTEMS (ERTS 2016, January 2016 (2016-01-01)
DUKYOUNG YUN ET AL: "A Parallel Simulation Technique for Multicore Embedded Systems and Its Performance Analysis", IEEE TRANSACTIONS ON COMPUTER AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, IEEE SERVICE CENTER, PISCATAWAY, NJ, US, vol. 31, no. 1, 1 January 2012 (2012-01-01), pages 121 - 131, XP011390025, ISSN: 0278-0070, DOI: 10.1109/TCAD.2011.2167329 *
KANG, S. H.YOO, D.HA, S.: "TQSIM: A fast cycle-ap proximate processor simulator based on QEMU", JOURNAL OF SYSTEMS ARCHITECTURE, vol. 66, 2016, pages 33 - 47, XP029556257, DOI: 10.1016/j.sysarc.2016.04.012
MILLER, J. E.KASTURE, H.KURIAN, G.GRUENWALD, C.BECKMANN, N.CELIO, C.AGARWAL, A.: "HPCA-16 2010 The Sixteenth International Symposium on High-Performance Computer Architecture", January 2010, IEEE, article "Graphite: A distributed parallel simulator for multicores", pages: 1 - 12
YUN, D.KIM, S.HA, S.: "A parallel simulation technique for multicore embedded systems and its performance analysis", IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, vol. 31, no. 1, 2012, pages 121 - 13, XP011390025, DOI: 10.1109/TCAD.2011.2167329

Also Published As

Publication number Publication date
FR3103595B1 (en) 2023-10-27

Similar Documents

Publication Publication Date Title
Shao et al. Co-designing accelerators and SoC interfaces using gem5-Aladdin
Patel et al. MARSS: A full system simulator for multicore x86 CPUs
Bortolotti et al. Virtualsoc: A full-system simulation environment for massively parallel heterogeneous system-on-chip
WO2021069626A1 (en) Method for reproducible parallel simulation at electronic system level implemented by means of a multi-core discrete-event simulation computer system
Ottlik et al. Context-sensitive timing simulation of binary embedded software
EP4006730A1 (en) Method for reproducible parallel simulation of electronic system level implemented by means of a multi-core computer system for discrete event simulation
EP2956874B1 (en) Device and method for accelerating the update phase of a simulation kernel
Perez et al. Coyote: an open source simulation tool to enable RISC-V in HPC
Ma et al. MCMG simulator: A unified simulation framework for CPU and graphic GPU
FR3103595A1 (en) Fast simulator of an ECU and software implemented by this ECU
Forlin et al. Sim2PIM: A complete simulation framework for Processing-in-Memory
Lenormand et al. A combined fast/cycle accurate simulation tool for reconfigurable accelerator evaluation: application to distributed data management
Park et al. Coprocessor computing with FPGA and GPU
Kreku et al. Workload simulation method for evaluation of application feasibility in a mobile multiprocessor platform
Bhatia et al. Leveraging semi-formal and sequential equivalence techniques for multimedia SoC performance validation
Zhong et al. Towards Fast and Lightweight Checkpointing for Mobile Virtualization Using NVRAM
van der Wijst An Accelerator based on the ρ-VEX Processor: an Exploration using OpenCL
Richie et al. Architecture emulation and simulation of future many-core epiphany RISC array processors
Chenard Hardware-based temporal logic checkers for the debugging of digital integrated circuits
Edwards et al. Linking parallel algorithmic thinking to many-core memory systems and speedups for boosted decision trees
Mohapatra Development Of A Heterogeneous Architecture Simulation Framework
JP2994280B2 (en) Computer system performance evaluation method
Gavoille A performance projection approach for design-space exploration on Arm HPC environment
Ho-Von Characterizing and Modelling the I/O Patterns of Deep Learning Training Workloads
Putigny Benchmark-driven approaches to performance modeling of multi-core architectures

Legal Events

Date Code Title Description
PLFP Fee payment

Year of fee payment: 2

PLSC Publication of the preliminary search report

Effective date: 20210528

PLFP Fee payment

Year of fee payment: 3

PLFP Fee payment

Year of fee payment: 4

PLFP Fee payment

Year of fee payment: 5