Modélisation des interfaces matériel/logiciel Présenté par Frédéric Pétrot Patrice Gerin Alexandre Chureau Hao Shen Aimen Bouchhima Ahmed Jerraya 1/28 TIMA Laboratory SLS Group 46 Avenue Félix VIALLET 38031 Grenoble Cedex France
Définition : Interface Matériel/Logiciel pour les MPSoC 2/28 MPSoC composé de: Nœuds Matériels Nœuds Logiciels Réseau de communication Nœud Logiciel : Sous système CPU spécifique GPP, DSP, ASIP I/O, architecture mémoire Architecture logicielle en couche Code applicatif haut niveau. Hardware Dependent Software (HDS) Interfaces HW/SW pour la conception des SOC Abstraire le HDS et le matériel spécifique Fournir une API logicielle applicative Disponible à différents niveaux d abstraction Hardware node Interface Software node Interface Communication Network Operating System CPU bridge Multi-Thread application SW interface Specific I/O HW/SW HAL Interface MEM Model Network interface DMA Hardware Co-processor HW PROTOCOL
Interfaces Matériel/Logiciel classiques Modèles d abstraction : le grand écart Software Sub-System Software Thread 1 System Level Functional specification Software Thread 2 Fully implicit HW/SW Interface Hardware Partition ning Software Sub-System Software Thread 1 GAP Software Thread 1 Abstract HW/SW Interface Hardware Software design Hardware/Software Early HW/SW integration discontinuity Binary SW Appli OS HAL Integration ISS IT Ctrl Fully explicit HW/SW Interface MEM FIFO HW Virtual Prototype ISA/RTL 3/28 Hardware design Correction cycle
Interface Matériel/Logiciel abstraite État de l art Modélisation des interfaces Matériel/Logiciel Approches logicielles: matériel complètement implicite Validation de l OS sans interaction avec le matériel Pas d estimation de performances précise Approches matérielles : Logiciel binaire Debug de l OS fastidieux Temps de simulation exagérément long Méthodes de conception au niveau système Modèle d architecture fixe Application/architecture restreinte (TTL, DSOC,...) Besoins : Modèle d interface Matériel/Logiciel permettant le debug de l OS tôt et l estimation de performance précise 4/28
Sommaire Introduction Modélisation des interfaces Matériel/Logiciel Transaction Accurate Level Modèles exécutables en SystemC Expérimentations Perspectives 5/28
Sommaire Introduction Modélisation des interfaces Matériel/Logiciel Transaction Accurate Level Modèles exécutables en SystemC Expérimentations Perspectives 6/28
Modélisation de l interface au niveau «Transaction Accurate» Abstraire La couche logicielle HAL Détails du sous système CPU Interface Logicielle : API HAL Context switch Spin lock IO Read/Write Interface Matériel: protocole VCI, AMBA, Interface matérielle spécifique (FIFO) Operating System bridge Multi-Thread application HAL HAL API Network interface Hardware Specific I/O HW/SW Interface CPU MEM DMA At Transaction Accurate Level Hardware Co-processor HW PROTOCOL 7/28
Modélisation de l interface au niveau «Transaction Accurate» 8/28 Execution Unit : modélisation du parallélisme au niveau processeur Access Unit : modélisation des communication dans le sous système CPU Data Unit : encapsulation des périphériques Synchronization Unit : modélisation du mécanisme de gestion et de contrôle d interruptions Cet ensemble d éléments implémente l adaptation entre l interface logicielle et matérielle Execution Unit bridge HAL_API Multi-Thread application Operating System Access Unit Device HAL HAL API Network interface Specific I/O HW/SW Interface CPU MEM DMA At Transaction Accurate Level Device Hardware Co-processor Data Unit HW PROTOCOL HW PROTOCOL Hardware Synchro Unit
Software Sub-System Services pour l adaptation d interfaces Matériel/Logiciel Software Thread 1 Software Thread 2 Les interfaces matérielle et logicielle sont modélisées par un ensemble de services (fournis/requis) Adaptation d interface par composants Éléments logiciels Éléments matériels Éléments Hybrides SW Hyb HW 9/28 Hardware
Implémentation de l interface SW interface Concept d élément d interface Les éléments requièrent et/ou fournissent des services Un service représente une fonctionnalité S1 S3 Une interface Matériel/Logiciel consiste en un assemblage d élément logiciels, hybrides et matériels Process S1 Approche déjà utilisée en modélisation logicielle et matérielle Process Process 10/28 HW interface
Sommaire Introduction Modélisation des interfaces Matériel/Logiciel Transaction Accurate Level Modèles exécutables en SystemC Expérimentations Personnels 11/28
Services logiciels en SystemC Mécanisme des «sc_interface» en SystemC Équivalence entre objets SystemC et concept de service sc_interface sc_export sc_port sc_module Service Service fournis Service requis Élément Module 1 Module 2 sc_port sc_export 12/28 Process fct Appel de fonction Implémentation
Élément logiciels LOCK SEM class LOCK : public sc_interface { virtual int lock() = 0; }; 13/28 UNLOCK lock Mutex unlock Seulement des méthodes C++ exportées pour implémenter des services logiciels Pas de SC_THREAD, SC_CTHREAD ou SC_METHOD Pas de wait() SystemC SC_MODULE(Mutex), public LOCK, public UNLOCK { sc_export<lock> plock; sc_export<unlock> punlock; sc_port<sem> psem; int lock(){...}; int unlock(){...}; SC_CTOR(Mutex) : plock("plock"), punlock("punlock"), psem("psem") { plock(*this); punlock(*this); } };
Élément matériel Service matériel Les services sont implémentés par les SC_THREAD et accessible à travers les ports SystemC Pas de méthode C++ exportés Implémentation SystemC Standard S1 S2 Process Process S3 14/28
Éléments Hybrides Combine éléments logiciels et matériels : Méthodes C++ exportées pour l implémentation des services logiciels Thread(s) SystemC pour l implémentation des services matériels Appels à la fonction wait() pour introduire le temps dans le modèle S1 S1 Process S3 S2 15/28
Éléments hybrides et modèle d exécution logiciel Les éléments hybrides sont les éléments clé pour modéliser l exécution séquentielle du logiciel Utilisés pour implémenter l unité d exécution(cpu) Un thread SystemC représente un processeur Ce thread implémente les initialisations bas niveau Un appel au service logiciel OS_INIT fourni par l application permet de «booter» l OS Tout le logiciel est alors exécuté séquentiellement Software Application (Appli + OS + COM) Le temps d exécution du logiciel est introduit par annotation de l application Des appels au service consume modélisent le temps consommé par le software dans le contexte du processeur CONSUME OS_INIT hw_thread 16/28 EXEC_UNIT
Détails : simulation logicielle L élément EXEC_UNIT modélise les initialisations bas niveau et boote l OS L OS et l application sont exécutés séquentiellement Des appels à CONSUME permettent à SystemC de gérer la simulation concurrente du matériel Des appels a CONSUME peuvent se faire à partir des élément du modèle TA afin d augmenter la précision Simulation start EXEC_UNIT OS Appli 17/28
Sommaire Introduction Modélisation des interfaces Matériel/Logiciel Transaction Accurate Level Modèles exécutables en SystemC Expérimentations Perspectives 18/28
Application Motion JPEG : Modèle au niveau Système 6 tâches logicielles et 2 matérielles Modèle d exécution synchronisé par les communications SOFTWARE VLD IQ ZZ DEMUX LIBU IDCT 19/28 Vitesse de simulation élevée Validation fonctionnelle simple Pas de détails sur l OS Pas de détails sur les communications TRAFFIC GENERATOR HARDWARE Communication channel VIDEO OUT thread
Application Motion JPEG : Modèle Prototype Virtuel 20/28 Les tâches logicielles sont exécutées sur un OS POSIX : MUTEK Le binaire est interprété par le simulateur du processeur cible Le reste du système est au niveau RTL Communications détaillées Précision des performances Validation fastidieuse du système d exploitation Simulation très lente Binary SW Appli Mutek OS HAL ISS MEM HAL API TG IT Ctrl HW/SW Interface At Transaction VCI Cross bar Accurate Level FIFO HW PROTOCOL VIDEO
Simulation de l application 3 simulations Utilisation du même code logiciel pour les 3 niveaux Utilisation du même code de l OS au niveau TA et VP MJpeg Appli POSIX API Host OS (LINUX) MJpeg Appli POSIX API MUTEK OS HAL API T.A. Model MJpeg Appli POSIX API MUTEK OS HAL API HAL (sparc) ISS + Sub-System POSIX API SW view of HW HW PROTOCOL Hardware HW PROTOCOL Hardware 21/28 System Level 0.017s/image (No CPU) Transaction Accurate 1.2s/image (2 Execution Unit) Virtual Prototype 235s/image (2 Sparc ISS)
Application Motion JPEG : Modèle Transaction Accurate 22/28 Éléments logiciels CONTEXT INTERRUPT Éléments matériels VCI FIFO Éléments hybrides CROSSBAR VCI WRAPPER EXEC_UNIT HAL API SPIN SPIN LOCK UNLOCK MEM HW PROTOCOL CXT INIT SWITCH CONTEXT XBAR DIAGNOSTIC CONSUME VCI_WRAPPER FIFO OS INIT HS_READ REQ ACK DATA SMP THIS COUNT EXEC_UNIT IO_ACCESS READ WRITE REQ ACK DATA IT MASK UNMASK INTERRUPT IT_CTRL HS_WRITE
Résultats de simulation au niveau Transaction Accurate Traces de simulation plus détaillées qu au niveau Système Debug de l OS (synchronisations, comportement temporel, debugger standard) gain en vitesse de 200 par rapport au niveau prototype virtuel pour cette implémentation blocking communication 23/28
Modification du modèle de l interface Matériel/Logiciel Ajout d un élément DMA Hybride Modification de l application pour l utilisation du DMA Paralléliser communications et traitement HAL API SPIN SPIN LOCK UNLOCK MEM CXT INIT SWITCH CONTEXT XBAR DIAGNOSTIC CONSUME VCI_WRAPPER OS INIT SMP THIS COUNT EXEC_UNIT DMA IO_ACCESS READ WRITE IT MASK UNMASK INTERRUPT IT_CTRL FIFO 24/28 HW PROTOCOL HS_READ REQ ACK DATA REQ ACK DATA HS_WRITE
Modification du modèle de l interface Matériel/Logiciel La simulation permet de valider les communication DMA et de vérifier l effet sur l exécution des threads de l application. 25/28
Sommaire Introduction Modélisation des interfaces Matériel/Logiciel Transaction Accurate Level Modèles exécutables en SystemC Expérimentations Perspectives 26/28
Perspectives Appliquer l approche proposée à d autres niveaux d abstraction : Architecture Virtuelle, permettant d abstraire le Système d Exploitation et les communication spécifiques Automatiser la conception des interface Matériel/Logiciel pour permettre : L exploration d architecture. Le raffinement Operating System bridge Multi-Thread application SW interface Network interface Hardware Specific I/O HW/SW interface HAL Interface At Virtual HW/SW Interface CPU Architecture MEM DMA At Transaction Level Accurate Level HW interface Hardware Co-processor 27/28
Résumé Modèle exécutable de l interface Matériel/Logiciel Résultats : Intégration du matériel et du logiciel anticipé Simulation rapide et précise de l'application Motion-JPEG Modèle exécutable dans un environnement standard (SystemC) Bénéfices : Validation du Système d exploitation Estimation de performance 28/28
Merci Questions? 29/28