12.07.2015 Views

Approche Syst`eme de la Conception - Free

Approche Syst`eme de la Conception - Free

Approche Syst`eme de la Conception - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong>ENSEAETIS / ENSEAMel : Bertrand.Granado@ensea.frPrintemps 2012ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 1 / 124


1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 2 / 124


PrésentationSommaire1 Présentation2 UML3 Composant Matériel4 VHDL5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 3 / 124


PrésentationIntroductionComment le réaliser ?ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 4 / 124


PrésentationDes idées ?ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 5 / 124


PrésentationSystèmes Sur Puce (SoC)ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 6 / 124


PrésentationSystèmes Sur Puce (SoC)ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 7 / 124


PrésentationSystèmes Sur Puce (SoC)ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 8 / 124


PrésentationSystèmes Sur Puce (SoC)ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 9 / 124


PrésentationSystèmes Sur Puce (SoC)ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 10 / 124


PrésentationSystèmes Sur Puce (SoC)Gain <strong>de</strong> productivitéTransistors / ChipTransistors / Equipe - Mois100M"Faille" <strong>de</strong>productivité10M1M10K100Loi <strong>de</strong> MooreProductivité (ingénieur)Limite à <strong>la</strong> productivité (équipe)100K1K101981 2009Copyright : L. Loiseau - MirandaENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 11 / 124


UMLSommaire1 Présentation2 UML3 Composant Matériel4 VHDL5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 12 / 124


UMLUML• Un cadre <strong>de</strong> travailENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 13 / 124


UMLUML• Un cadre <strong>de</strong> travail• Support d’une métho<strong>de</strong> <strong>de</strong> conception dirigée par les modèlesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 13 / 124


BertrandLE GALMaître <strong>de</strong> conférencesENSEIRBbertrand.legal@enseirb.frhttp://uuu.enseirb.fr/~legal/“Introduction au<strong>la</strong>ngage UML ”Laboratoire IMSbertrand.legal@ims-bor<strong>de</strong>aux.frUniversité <strong>de</strong> Bor<strong>de</strong>aux 1351, cours <strong>de</strong> <strong>la</strong> Libération33405 Talence - FranceFilière Electronique2 ème année2009 / 2010


1“ Retour sur leflot <strong>de</strong><strong>Conception</strong> ”


I. Retour sur le flot <strong>de</strong> conceptionLes causes courantes <strong>de</strong>s échecs <strong>de</strong> projetsMauvaise compréhension <strong>de</strong>s besoins <strong>de</strong>s utilisateurs finaux.Incapacité à gérer les modifications <strong>de</strong>s exigences <strong>de</strong>s clientsau cours du développement.Les modules composant le projet ne fonctionnent pasensemble (mauvaises interfaces)Co<strong>de</strong> source du logiciel difficile à maintenir ou à faire évoluerLogiciel <strong>de</strong> mauvaise qualité (beaucoup d’anomalies <strong>de</strong>conception / exécution)Bertrand LE GAL - ENSEIRB / Laboratoire IXL3Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conceptionL’idéal pour <strong>la</strong> gestion d’un projet !1. Bien comprendre les besoins, les <strong>de</strong>man<strong>de</strong>s et les exigences <strong>de</strong>sutilisateurs finaux.2. Bonne communication avec le client pour vali<strong>de</strong>r certains choix etvérification <strong>de</strong> l’étape (1).3. Tester et vali<strong>de</strong>r chaque phase <strong>de</strong> <strong>la</strong> conception pour ne pasdécouvrir <strong>de</strong>s problèmes plus tard.4. Traiter au plus tôt les problèmes.5. Maîtriser <strong>la</strong> complexité et augmenter <strong>la</strong> réutilisation.6. Définir une architecture robuste.7. Faciliter le travail en équipe.Bertrand LE GAL - ENSEIRB / Laboratoire IXL4Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conceptionLes 7 bonnes pratiques1. Développement itératif,2. Développement à base <strong>de</strong> composants centré surl’architecture,3. Pilotage du développement par les risques,4. Gestion <strong>de</strong>s exigences,5. Maîtrise <strong>de</strong>s modifications,6. Evaluation continue <strong>de</strong> <strong>la</strong> qualité,7. Modélisation visuelles.Bertrand LE GAL - ENSEIRB / Laboratoire IXL5Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception1 - Le développement itératif Cette métho<strong>de</strong> est basée sur <strong>de</strong>petites étapes (élémentaires) Chaque étape produit <strong>de</strong>s retourset <strong>de</strong>s adaptations si nécessaire Autres dénominations✦ Développement en spiral✦ Développement évolutifABCDEFBertrand LE GAL - ENSEIRB / Laboratoire IXL6Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception2. Développement basé sur les composants Validation <strong>de</strong> l’architecturelogicielle lors <strong>de</strong>s premièresitérations :✦ Développement basé sur <strong>de</strong>s IP ducommerce,✦ Réutilisation préférée auredéveloppement, Tester l’architecture au plus tôtmême si elle n’est pasfonctionnellement complète.Méthodologie va<strong>la</strong>ble dans lecadre du développement <strong>de</strong>systèmes logiciels et matérielsBertrand LE GAL - ENSEIRB / Laboratoire IXL7Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception3. Pilotage par les risques Analyser les risques potentiels au plus tôt (début <strong>de</strong> <strong>la</strong> conception) :✦ Les regrouper et les hiérarchiser,✦ Travailler en priorité sur les risques critiques, Ce<strong>la</strong> concerne les risques techniques, ainsi que :✦ Les risques liés aux clients,✦ Les risques liés au domaine applicatif,✦ Les risques liés à l’organisation du projet, Sémantique✦ Un risque est un événement redouté dont l'occurrence est plus ou moinsprévisible et qui aura <strong>de</strong>s répercussions sur le projet.✦ Un problème est un risque qui s’est révélé.Bertrand LE GAL - ENSEIRB / Laboratoire IXL8Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception4. Les exigences du clientSémantique✦ Une exigence est une condition à <strong>la</strong>quelle le système doit satisfaire ou unecapacité dont il doit faire preuve.Les exigences peuvent être :✦ Fonctionnelles➡ Elles décrivent ce que le système doit savoir faire,✦ Non fonctionnelles➡ Qualité <strong>de</strong>s services,➡ Temps <strong>de</strong> réponse, temps <strong>de</strong> traitement,➡ Sécurité au fonctionnement,➡ IHM adaptée aux utilisateurs.Bertrand LE GAL - ENSEIRB / Laboratoire IXL9Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception5. Les <strong>de</strong>man<strong>de</strong>s <strong>de</strong> changementSémantique✦ Une <strong>de</strong>man<strong>de</strong> <strong>de</strong> changement est une requête visant à modifier unartefact ou un processus.Il faut dans ce cas indiquer dans <strong>la</strong> documentation, <strong>la</strong> naturedu changement, sa cause et ses impacts sur <strong>la</strong> solutionproposée.Il existe 2 types <strong>de</strong> changements :1. La <strong>de</strong>man<strong>de</strong> d’évolution➡ Nouvelle caractéristique du système ou modifications d’une existante2. Le rapport d’anomalieBertrand LE GAL - ENSEIRB / Laboratoire IXL10Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conception6. Evaluation constante <strong>de</strong> <strong>la</strong> qualitéIl a été prouvé que l’i<strong>de</strong>ntification <strong>de</strong>s erreurs <strong>de</strong> conception auplus tôt permet <strong>de</strong> “gagner” <strong>de</strong> l’argent (ou d’en perdre moins)✦ Ratio 10 à 100 !Les problèmes <strong>de</strong> qualité sont souvent les causes principales <strong>de</strong>sdépassements <strong>de</strong> dé<strong>la</strong>is,Les phases <strong>de</strong> test, <strong>de</strong> vérification et <strong>de</strong> correction consommentenviron 70% du temps total d’un projet !60% <strong>de</strong>s problèmes existent déjà lors <strong>de</strong> <strong>la</strong> conception <strong>de</strong>l’application.Bertrand LE GAL - ENSEIRB / Laboratoire IXL11Introduction au <strong>la</strong>ngage UML


I. Retour sur le flot <strong>de</strong> conceptionPourquoi utiliser <strong>la</strong> modélisation visuelle ?On doit pouvoir mémoriser nos pensées et les communiqueren utilisant <strong>de</strong>s <strong>la</strong>ngages visuels et schématiques.✦ Réseaux <strong>de</strong> Pétri, Grafcet,✦ Schémas blocs (décomposition fonctionnelle),✦ UML, etc.Avantages <strong>de</strong> ces approches✦ Les <strong>la</strong>ngages visuels sont naturels et faciles à comprendre (non re<strong>la</strong>tifs à un <strong>la</strong>ngage<strong>de</strong> communication),✦ On estime que 50% du cerveau est impliqué dans le processus visuel.Bertrand LE GAL - ENSEIRB / Laboratoire IXL12Introduction au <strong>la</strong>ngage UML


2“ Introduction àUML ”


II. Introduction à UMLIntroduction à UMLUML est un <strong>la</strong>ngage standard conçu pour permettre auxconcepteurs d’é<strong>la</strong>borer les p<strong>la</strong>ns <strong>de</strong>s logiciels qu’ils doiventdévelopper.On se sert du <strong>la</strong>ngage UML pour:✦ Visualiser✦ Spécifier✦ Construire=> Schématiser le travail à réaliser,=> Exprimer formellement les contraintes,=> Commencer à développer une solution,✦ Documenter => Expliquer les choix réalisés (voir les problèmes),✦ Communiquer (travailler en équipe),Bertrand LE GAL - ENSEIRB / Laboratoire IXL14Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLUML est un <strong>la</strong>ngage Ce <strong>la</strong>ngage possè<strong>de</strong> un vocabu<strong>la</strong>ire et <strong>de</strong>s règles qui permettent <strong>de</strong>combiner les mots afin <strong>de</strong> communiquer. La modélisation permet <strong>de</strong> comprendre le système à concevoir <strong>de</strong>manière formelle,✦ Tous les modèles sont liés les uns avec les autres afin <strong>de</strong> représenter lesystème et les interactions entre les blocs élémentaires. Le vocabu<strong>la</strong>ire et les règles d’écriture régissent <strong>la</strong> manière <strong>de</strong> construireet <strong>de</strong> lire les modèles correctement mis en forme.✦ Aucune décision d’implémentation n’est prise lors <strong>de</strong> <strong>la</strong> phase <strong>de</strong> spécification etd’analyse du cahier <strong>de</strong>s charges.Bertrand LE GAL - ENSEIRB / Laboratoire IXL15Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLUML, un <strong>la</strong>ngage pour visualiser Pour certains développeurs, il y existe un lien direct entre une idéeet son co<strong>de</strong> d’implémentation.✦ Utilisation d’un modèle <strong>de</strong> représentation mental, Problème dans le partage <strong>de</strong> ces modèles avec d’autres personnes,✦ Risques d’incompréhension, d’incertitu<strong>de</strong>s...✦ Chaque organisation et/ou personne possè<strong>de</strong> son propre <strong>la</strong>ngage (difficultéd’intégration),✦ Risque d’oubli <strong>de</strong>s décisions prises avec le temps ! UML permet <strong>de</strong> résoudre les problématiques du partage et <strong>de</strong>mémorisation <strong>de</strong> l’information <strong>de</strong> manière visuelle.Bertrand LE GAL - ENSEIRB / Laboratoire IXL16Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLUML, un <strong>la</strong>ngage pour visualiser UML est bien plus qu’un assemb<strong>la</strong>ge <strong>de</strong> symboles graphiques !✦ Chaque symbole graphique possè<strong>de</strong> sa sémantique propre (signification universelle),✦ Un modèle peut être écrit par un concepteur et compris pas un autre sans ambiguïté à<strong>la</strong> lecture,✦ Une automatisation par outil peut ainsi être mise en p<strong>la</strong>ce pour traiter certainesinformations => Génération <strong>de</strong> co<strong>de</strong> source, UML est un méta-<strong>la</strong>ngage <strong>de</strong> modélisation permettant d’unifier lesmodèles utilisés dans les métho<strong>de</strong>s <strong>de</strong> développement (raffinement).Bertrand LE GAL - ENSEIRB / Laboratoire IXL17Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLUML, un <strong>la</strong>ngage pour spécifier Dans le cadre d’UML, spécifier signifie construire sans ambiguïté, UML offre <strong>la</strong> possibilité <strong>de</strong> spécifier le comportement <strong>de</strong> l’application <strong>de</strong>manière formelle,✦ Réflexion sur <strong>de</strong>s modèles formels,✦ <strong>Approche</strong> indépendante du <strong>la</strong>ngage objet d'implémentation (C++, Java, etc.),✦ Raffinement progressif <strong>de</strong>s modèles (on construit une solution <strong>de</strong> manière itérative enplusieurs passes successives), UML n’est pas une métho<strong>de</strong> mais une notation qui <strong>la</strong>isse <strong>la</strong> liberté <strong>de</strong>conception (choix dans les solutions à mettre en oeuvre).Bertrand LE GAL - ENSEIRB / Laboratoire IXL18Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLUML, un <strong>la</strong>ngage pour documenterLors du développement d’un produit, on réalise <strong>de</strong>s choix lors<strong>de</strong> l’é<strong>la</strong>boration <strong>de</strong> <strong>la</strong> solution :✦ Architecture d’implémentation,✦ Besoins i<strong>de</strong>ntifiés,✦ Co<strong>de</strong> source du projet,✦ P<strong>la</strong>nning <strong>de</strong> développement,✦ Les p<strong>la</strong>ns et les jeux <strong>de</strong> test, etc.UML permet <strong>de</strong> réaliser <strong>la</strong> définition et <strong>la</strong> documentation <strong>de</strong>ces taches en fonction <strong>de</strong>s contraintes.Bertrand LE GAL - ENSEIRB / Laboratoire IXL19Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes domaines d’utilisation <strong>de</strong> UMLUML est employé dans l’ensemble <strong>de</strong>s secteurs dudéveloppement informatique et électronique :✦ Systèmes d’information,✦ Télécommunication, défense,✦ Transport, aéronautique, aérospatial,✦ Domaines scientifiques,Mais pas seulement : on peut modéliser <strong>de</strong>s comportementmécaniques, humain, etc.✦ Structure d’un système <strong>de</strong> santé / judiciaire, etc.Bertrand LE GAL - ENSEIRB / Laboratoire IXL20Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes briques <strong>de</strong> base d’UMLDans le <strong>la</strong>ngage UML, il existe 3 types <strong>de</strong> briques <strong>de</strong> basepour modéliser tous systèmes :1. Les éléments✓Ce sont les abstractions essentielles au modèle.2. Les re<strong>la</strong>tions✓Les re<strong>la</strong>tions expriment les liens existants entre les différentséléments.3. Les diagrammes✓Les diagrammes comprennent <strong>de</strong>s ensembles d’éléments dignesd'intérêt.Bertrand LE GAL - ENSEIRB / Laboratoire IXL21Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLIl existe 4 types d’éléments dans UMLCe sont les éléments <strong>de</strong> base qui vont permettre <strong>la</strong> définitionpar <strong>la</strong> suite <strong>de</strong>s modèles,Nous allons avoir différents types <strong>de</strong> modèles pourreprésenter les différentes caractéristiques du système,1. Les éléments structurels,2. Les éléments comportementaux,3. Les éléments <strong>de</strong> regroupement,4. Les éléments d’annotation.Bertrand LE GAL - ENSEIRB / Laboratoire IXL22Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes éléments structurels Les éléments structurels sont les éléments les plus statiquesd’UML, il en existe 7 types distincts :1. Les c<strong>la</strong>sses,2. Les interfaces,3. Les col<strong>la</strong>borations,4. Les cas d’utilisation,5. Les c<strong>la</strong>sses actives,6. Les composants,7. Les noeuds, A partir <strong>de</strong> là, on peut exprimer visuellement les re<strong>la</strong>tionsstructurelles <strong>de</strong> tous types <strong>de</strong> systèmes .Bertrand LE GAL - ENSEIRB / Laboratoire IXL23Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes éléments comportementaux Les éléments comportementaux représentent les parties dynamiques <strong>de</strong>smodèles, Ils permettent <strong>de</strong> définir le comportement du modèle dans le temps etl’espace, Il en existe 2 types fondamentaux <strong>de</strong> diagrammes pour exprimer lesre<strong>la</strong>tions comportementales :1. Les interactions,2. Les automates à états finis.Bertrand LE GAL - ENSEIRB / Laboratoire IXL24Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes éléments <strong>de</strong> regroupement Les éléments <strong>de</strong> regroupement représentent les partiesorganisationnelles <strong>de</strong>s modèles UML, Ce sont les boites dans lesquelles un modèle peut être décomposé, Il existe un seul type d’élément <strong>de</strong> regroupement : “le package”Bertrand LE GAL - ENSEIRB / Laboratoire IXL25Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes éléments d’annotation Les modèles d’annotation représentent les parties explicatives <strong>de</strong>smodèles UML. Ce sont les commentaires qui vont être ajoutés aux modèles afin :✦ D’expliquer un choix <strong>de</strong> conception,✦ Décrire le fonctionnement du système ou d’une sous-partie,✦ Faire une remarque sur un élément du système,✦ Détailler une hypothèse d’utilisation,✦ Spécifier une contrainte d’implémentation (temps d'exécution maximum,consommation en énergie, etc.).Bertrand LE GAL - ENSEIRB / Laboratoire IXL26Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes re<strong>la</strong>tions dans UMLAfin d’exprimer les liens interconnectant les différentséléments <strong>de</strong>s modèles, 4 re<strong>la</strong>tions <strong>de</strong> base ont été définies :1. La dépendance,2. La généralisation,3. L’association,4. La réalisation,Bertrand LE GAL - ENSEIRB / Laboratoire IXL27Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes en UMLUn système est un ensemble <strong>de</strong> sous-systèmes organisés pour atteindreun objectif et décrit à l’ai<strong>de</strong> <strong>de</strong> modèles.Un sous-système est un regroupement d’éléments , dont certainsspécifient le comportement proposé par les autres éléments contenus.Un modèle est une abstraction complète et cohérente d’un systèmepermettant d’en faciliter <strong>la</strong> compréhension.- Modélisation <strong>de</strong>s parties structurelles (statique)- Modélisation du comportement (dynamique)Bertrand LE GAL - ENSEIRB / Laboratoire IXL28Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> décomposition hiérarchiqueVoitureRouesCarosserieMoteur ... ... ... ... ...PompeRadiateurBloc Moteur... ... ... ... ...Bertrand LE GAL - ENSEIRB / Laboratoire IXL29Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes avec UML Un diagramme est une représentation visuelle <strong>de</strong> l’ensemble <strong>de</strong>séléments qui constituent le système.✦ Ils servent à visualiser un système sous différents angles (utilisateur, administrateurpar ex.) Dans les systèmes complexes, un diagramme ne fourni qu’une vuepartielle du système.✦ L’ensemble <strong>de</strong>s diagrammes aboutés permet d’obtenir une vue globale du système àconcevoir.✦ Chaque diagramme va permettre <strong>de</strong> modéliser ou spécifier une vue (spécificité) dusystème à concevoir.Bertrand LE GAL - ENSEIRB / Laboratoire IXL30Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes dans UML : 9 typesLes diagrammes “statiques”1. Diagramme <strong>de</strong> c<strong>la</strong>sses,2. Diagramme d’objets,3. Diagramme <strong>de</strong> composants,4. Diagramme <strong>de</strong> déploiement,Les diagrammes “dynamiques”5. Diagramme <strong>de</strong> cas d’utilisation,6. Diagramme <strong>de</strong> séquences,7. Diagramme <strong>de</strong> col<strong>la</strong>boration,8. Diagramme d’états-transitions,9. Diagramme d’activités.Bertrand LE GAL - ENSEIRB / Laboratoire IXL31Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes structurelsLes diagrammes <strong>de</strong> c<strong>la</strong>sses✦ Ils représentent l’ensemble <strong>de</strong>s c<strong>la</strong>sses, <strong>de</strong>s interfaces et <strong>de</strong>scol<strong>la</strong>borations ainsi que leurs re<strong>la</strong>tions.✦ Les diagrammes les plus utilisés dans une approche <strong>de</strong> développementobjets.Les diagrammes d’objets✦ Ils représentent un ensemble d’objets (instances <strong>de</strong> c<strong>la</strong>sses) avec leursre<strong>la</strong>tions,✦ Simi<strong>la</strong>ire aux diagrammes <strong>de</strong> c<strong>la</strong>sses, mais avec <strong>de</strong>s détails réels et <strong>de</strong>sprototypes.Bertrand LE GAL - ENSEIRB / Laboratoire IXL32Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes structurelsLes diagrammes <strong>de</strong> composants✦ Ils sont apparentés aux diagrammes <strong>de</strong> c<strong>la</strong>sses.✦ Un composant correspond généralement à une ou plusieurs c<strong>la</strong>sse,interfaces ou col<strong>la</strong>boration.Les diagrammes <strong>de</strong> déploiements✦ Ils sont apparentés aux diagrammes <strong>de</strong> composants.✦ Un noeud englobe généralement un ou plusieurs composants.Bertrand LE GAL - ENSEIRB / Laboratoire IXL33Introduction au <strong>la</strong>ngage UML


II. Introduction à UMLLes diagrammes comportementauxLes diagrammes <strong>de</strong> cas d’utilisation✦ Organisent les comportements du système.✦ Représentation <strong>de</strong>s acteurs et <strong>de</strong> leurs re<strong>la</strong>tions avec l’application.Les diagrammes <strong>de</strong> séquences✦ Centrés sur l’ordre chronologique <strong>de</strong>s messages.✦ Il modélisent chronologiquement les messages échangés par les objetsdu système (sous-système).✓ Ce sont les 2 modèles les plus employés (modélisationdynamique)Bertrand LE GAL - ENSEIRB / Laboratoire IXL34Introduction au <strong>la</strong>ngage UML


Les diagrammes comportementauxLes diagrammes <strong>de</strong> col<strong>la</strong>boration✦ Centrés sur l’organisation structurelle <strong>de</strong>s objets qui communiquent(envoie & réception <strong>de</strong>s messages),✦ Mise en évi<strong>de</strong>nce <strong>de</strong>s liens existants entre les objets,Les diagrammes états-transitions✦ Centré sur le changement d’état du système en fonction <strong>de</strong>sévénements,✦ Modélisation sous forme d’un automate à états-finis (état, action,transition),Les diagrammes d’activités✦ Centrés sur le flot <strong>de</strong> contrôle d’une activité sur une autre.Bertrand LE GAL - ENSEIRB / Laboratoire IXL35Introduction au <strong>la</strong>ngage UML


3“ Diagramme <strong>de</strong>cas d’utilisation ”


III. Diagramme <strong>de</strong> cas d’utilisationIntroduction aux cas d’utilisation Les cas d’utilisation servent à modéliser le comportement dynamiqued’un système (sous système). Les comportements différents d’un système sont représenté sous forme<strong>de</strong> cas d’utilisation,✦ On ne se préoccupe pas <strong>de</strong> l’implémentation du système, juste <strong>de</strong>sservices qu’il doit rendre aux utilisateurs,✦ Données directement extraites du cahier <strong>de</strong>s charges, Un cas d’utilisation décrit un ensemble <strong>de</strong> séquences dans lequel chaqueséquence représente les interactions entre l'extérieur du système(acteurs) et le système lui même.Bertrand LE GAL - ENSEIRB / Laboratoire IXL37Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationIntroductionL’expression <strong>de</strong>s cas d’utilisation permet <strong>de</strong> déterminer lespoints suivants :✦ Quels sont les services que doit implémenter le système ?✦ A qui ces services doivent être rendus ?Les cas d’utilisation se composent :✦ D’acteurs externes au système (personnes, capteurs, autresapplications ... ),✦ Du système en lui même et <strong>de</strong>s services qu’il doit rendre,✦ Des re<strong>la</strong>tions qui relient les acteurs aux services qui leurs sont rendus,Bertrand LE GAL - ENSEIRB / Laboratoire IXL38Introduction au <strong>la</strong>ngage UML


Cas d’utilisation, les acteurs“ Un acteur est une personne ou une chosequi va rentrer en interaction avec lesystème à concevoir ! “Détecteur<strong>de</strong> fuméSystème <strong>de</strong>gestion <strong>de</strong>sbadgesSecrétaireEnseignantEtudiantAdministrateurBertrand LE GAL - ENSEIRB / Laboratoire IXL39Introduction au <strong>la</strong>ngage UML


Cas d’utilisation, re<strong>la</strong>tions entre acteursSecretaireFontionnaireEnseignantMaître <strong>de</strong>conférencesacteursgénéralisation(héritage)ChercheurnomUne secrétaire est une fonctionnaire, tout comme les enseignants etles chercheurs. Un maître <strong>de</strong> conférence est un fonctionnaire qui faitun travail d’enseignant et <strong>de</strong> chercheur à <strong>la</strong> fois.Bertrand LE GAL - ENSEIRB / Laboratoire IXL40Introduction au <strong>la</strong>ngage UML


Cas d’utilisation, les actionsnom <strong>de</strong>l'actionEnregistrer<strong>la</strong>comman<strong>de</strong>Système à étudierI<strong>de</strong>ntifierl'utilisateurEnsembledu systèmeEnvoyer <strong>la</strong>comman<strong>de</strong>Gérer lescomman<strong>de</strong>sCol<strong>la</strong>borationUn cas d’utilisation saisit lecomportement attendu dusystème sans que l’on précisecomment ce<strong>la</strong> est réalisé.RéalisationLa col<strong>la</strong>boration permet <strong>de</strong> raffiner<strong>la</strong> vue implémentation du système enfactorisant les points communs.Bertrand LE GAL - ENSEIRB / Laboratoire IXL41Introduction au <strong>la</strong>ngage UML


Cas d’utilisation, Re<strong>la</strong>tions entre actionsPassercomman<strong>de</strong>urgente(fixer priorité)re<strong>la</strong>tion d'extensionLa re<strong>la</strong>tion d’extension permet<strong>de</strong> modifier légèrement lecomportement <strong>de</strong> base.Passercomman<strong>de</strong>Vali<strong>de</strong>rl'utilisateurScannerrétinienRe<strong>la</strong>tion d'inclusionSuivre <strong>la</strong>comman<strong>de</strong>La re<strong>la</strong>tion d’inclusion est faite pouréviter <strong>la</strong> répétition <strong>de</strong>s actions enfactorisant les services rendus. Ce<strong>la</strong>revient à déléguer une partie <strong>de</strong>s actions.Vérifier lemot <strong>de</strong>passegénéralisationLa re<strong>la</strong>tion <strong>de</strong> généralisation modéliseun héritage du comportement <strong>de</strong>base afin <strong>de</strong> l’affiner.Bertrand LE GAL - ENSEIRB / Laboratoire IXL42Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationAfin <strong>de</strong> <strong>de</strong>ssiner un cas d’utilisation...I<strong>de</strong>ntifier l’ensemble <strong>de</strong>s acteurs possibles qui vont interagiravec l’application,✦ I<strong>de</strong>ntifier tous les acteurs,✦ Les factoriser sous forme <strong>de</strong> groupes,Prendre en considération les besoins <strong>de</strong> tous les utilisateurs✦ I<strong>de</strong>ntifier tous les services que doit rendre le système,✦ Le regrouper les besoins communs à l’ai<strong>de</strong> <strong>de</strong>s re<strong>la</strong>tions d’inclusion, <strong>de</strong>généralisation et d’extension,Bertrand LE GAL - ENSEIRB / Laboratoire IXL43Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationExemple pédagogique : l’ENSEIRBL’ENSEIRB désire automatiser le processus d'inscription <strong>de</strong>sétudiants, en voici le cahier <strong>de</strong>s charges :✦ Le responsable <strong>de</strong>s filières établit au début <strong>de</strong> chaque semestre leprogramme <strong>de</strong>s cours✦ Chaque étudiant doit sélectionner 4 cours obligatoires et 2 coursoptionnels par semestre.✦ Lorsqu’un étudiant s’inscrit, le système <strong>de</strong> facturation est averti et génèreimmédiatement <strong>la</strong> facture.✦ Les enseignants utilisent ces informations pour consulter leur service.✦ Les étudiants peuvent consulter leur emploi du temps en fonction <strong>de</strong>scours qu’ils ont choisis.Bertrand LE GAL - ENSEIRB / Laboratoire IXL44Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationExemple, I<strong>de</strong>ntification <strong>de</strong>s acteurs4 acteurs existent dans notrecahier <strong>de</strong>s charges :1. L'étudiant,2. L’enseignant,3. Le système <strong>de</strong> facturation,4. Le directeur <strong>de</strong>s filières,EtudiantEnseignant Ce sont les seules personnes quiinteragissent avec le système(selon le cahier <strong>de</strong>s charges).Service <strong>de</strong>facturationDirecteurBertrand LE GAL - ENSEIRB / Laboratoire IXL45Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationExemple, I<strong>de</strong>ntification <strong>de</strong>s fonctionsUn cas d’utilisation est un motif <strong>de</strong> comportement intrinsèqueau système,✦ Chaque cas d’utilisation est une séquence <strong>de</strong> transactions connectées,effectuées par un dialogue entre un acteur et le système.I<strong>de</strong>ntification <strong>de</strong>s besoins propres au acteurs✦ Chef <strong>de</strong> service - maintenir le programme <strong>de</strong>s étu<strong>de</strong>s.✦ Enseignant - <strong>de</strong>man<strong>de</strong>r un tableau <strong>de</strong> service.✦ Etudiant - établir un emploi du temps.✦ Système <strong>de</strong> facturation - recevoir les informations <strong>de</strong> facturation dusystème d’inscription.Bertrand LE GAL - ENSEIRB / Laboratoire IXL46Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationLes cas d’utilisations, solutionSystèmeEtablir unemploi dutempsEtudiantS'inscrireEnseignantDeman<strong>de</strong>run tableau<strong>de</strong> serviceDirecteurGérer lesfilièreService <strong>de</strong>facturationBertrand LE GAL - ENSEIRB / Laboratoire IXL47Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationBien i<strong>de</strong>ntifier les cas d’utilisationDéfinition d’un cas d’utilisation✦ Ensemble d’actions produisant un résultat observable pour un acteurparticulier,Vérifier que chaque cas d’utilisation candidat,✦ Fournit une valeur ajoutée à <strong>la</strong> <strong>de</strong>scription,✦ Qu’il existe un événement externe le produisant,✦ On peut le décrire succinctement pour l’expliquer,Attention au niveau <strong>de</strong> granu<strong>la</strong>rité du modèle !✦ Ne pas <strong>de</strong>scendre trop bas,✦ Limiter le nombre <strong>de</strong> niveau (


III. Diagramme <strong>de</strong> cas d’utilisationDocumenter les cas d’utilisationPour chaque cas d’utilisation, il faut :✦ Exprimer ce que fourni l’utilisateur au système,✦ Ce que l’utilisateur reçoit en retour après exécution,✦ Il faut aussi penser à détailler les hypothèses réalisées lors <strong>de</strong> <strong>la</strong> <strong>de</strong>scription du casd’utilisation (pré-requis et les post-conditions)L’expression <strong>de</strong>s transactions entre le système et l'utilisateursera détaillé par d’autres modèles plus adaptés :✦ Diagrammes <strong>de</strong> séquences,✦ Diagrammes d’activité, etc.Bertrand LE GAL - ENSEIRB / Laboratoire IXL49Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationScénario d’un cas d’utilisationDeman<strong>de</strong> d’un tableau <strong>de</strong> service (enseignant)1. L’enseignant se présente <strong>de</strong>vant un terminal,2. Le système affiche un message d'accueil,3. L’enseignant <strong>de</strong>man<strong>de</strong> un relevé d’heures,Descriptionsimplifiée4. Le système lui <strong>de</strong>man<strong>de</strong> <strong>de</strong> s'authentifier,5. L’enseignant s'authentifie (login et mot <strong>de</strong> passe),6. Le système affiche les informations à l’écran,7. L’enseignant précise qu’il a terminé sa consultation et qu’il désire sedéconnecter,8. Le système effectue <strong>la</strong> requête et retourne à l’écran d’accueil.Bertrand LE GAL - ENSEIRB / Laboratoire IXL50Introduction au <strong>la</strong>ngage UML


III. Diagramme <strong>de</strong> cas d’utilisationExemple <strong>de</strong> scénario d’un cas d’utilisationDeman<strong>de</strong> d’un tableau <strong>de</strong> service (enseignant)✦Pré-conditions(avant que l’opération ne puisse avoir lieu)➡ L’enseignant doit être inscrit à l’université,➡ L’enseignant doit connaître ses i<strong>de</strong>ntifiants,✦Post-condition(si l’opération s’est bien déroulée)➡ L’enseignant a pris connaissance <strong>de</strong>s heures <strong>de</strong> cours qu’il adonnées.Bertrand LE GAL - ENSEIRB / Laboratoire IXL51Introduction au <strong>la</strong>ngage UML


4“ Diagrammes <strong>de</strong>c<strong>la</strong>sses ”


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes diagrammes <strong>de</strong> c<strong>la</strong>ssesUn diagramme <strong>de</strong> c<strong>la</strong>sse se compose <strong>de</strong>s éléments suivants,✦ Des c<strong>la</strong>sses,✦ Des interfaces (c<strong>la</strong>sses virtuelles),✦ Des col<strong>la</strong>borations,✦ Des re<strong>la</strong>tions (dépendances, associations, généralisation),Le diagramme <strong>de</strong> c<strong>la</strong>sses peut être défini à différents niveauxd’abstraction✦ Point <strong>de</strong> vue conceptuel (entités fournissant <strong>de</strong>s services),✦ Point <strong>de</strong> vue <strong>de</strong>s spécifications (raffinement fonctionnel <strong>de</strong>s entités),✦ Point <strong>de</strong> vue implémentation (les c<strong>la</strong>sses que l’on doit mettre en oeuvre).Bertrand LE GAL - ENSEIRB / Laboratoire IXL53Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesDéfinition d’une c<strong>la</strong>sse Une c<strong>la</strong>sse est <strong>la</strong> <strong>de</strong>scription élémentaire d’un ensemble d’objetsqui partagent <strong>de</strong>s attributs et <strong>de</strong>s métho<strong>de</strong>s en communs. La définition <strong>de</strong>s attributs et <strong>de</strong>s métho<strong>de</strong>s n’est pas obligatoire :✦ Les attributs et les métho<strong>de</strong>s sont trop nombreux pour être représentés dans <strong>la</strong>majorité <strong>de</strong>s cas...✦ On indique alors les responsabilités <strong>de</strong> <strong>la</strong> c<strong>la</strong>sse sous forme <strong>de</strong> texte (ce qu’elle doitimplémenter comme service).✦ On peut dès <strong>la</strong> définition d’une c<strong>la</strong>sse préciser les droits d’accès aux métho<strong>de</strong>s et auxattributs (+, -, #)Bertrand LE GAL - ENSEIRB / Laboratoire IXL54Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesExemple <strong>de</strong> modélisation d’une c<strong>la</strong>sseNom <strong>de</strong> <strong>la</strong>c<strong>la</strong>sseVecteurtaille : int;nb_éléments : int = 0tableau : int*Vecteur()add(donnée : int)remove(position : int)get(position : int) : intset(position, valeur : int)..................AttributsMétho<strong>de</strong>sBertrand LE GAL - ENSEIRB / Laboratoire IXL55Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesIntroduction aux re<strong>la</strong>tions En UML, <strong>la</strong> manière dont les éléments sont interconnectés entre eux(logiquement ou structurellement) est modélisé sous forme <strong>de</strong> re<strong>la</strong>tion,✦ Les roues, le moteur, les portes, <strong>la</strong> carrosserie font partie du vocabu<strong>la</strong>ire <strong>de</strong>construction d’une voiture mais ils n’existent pas <strong>de</strong> manière indépendantes. Il existe différents types <strong>de</strong> re<strong>la</strong>tion entre les éléments :✦ La dépendance,✦ L’utilisation,✦ La généralisation,✦ L’association,✦ L’agrégation.Bertrand LE GAL - ENSEIRB / Laboratoire IXL56Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : <strong>la</strong> dépendanceLa dépendance établit une re<strong>la</strong>tion d’utilisation entre 2entités d’un même diagramme.La plus part du temps il s’agit d’une dépendance d’utilisation,✦ Argument d’une métho<strong>de</strong> par exemple,✦ On parle alors <strong>de</strong> “re<strong>la</strong>tion d’utilisation”,Ce<strong>la</strong> permet d’i<strong>de</strong>ntifier implications possibles <strong>de</strong>smodifications à apporter dans une entité✦ Changement du comportement d’une <strong>de</strong>s c<strong>la</strong>sse par exemple.Bertrand LE GAL - ENSEIRB / Laboratoire IXL57Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : <strong>la</strong> dépendanceVoituretaille : int;type : stringaccélérer()freiner(position : int)démarrer(c : Clef)DépendanceLa c<strong>la</strong>sse “Voiture” dépend pour sonutilisation <strong>de</strong> <strong>la</strong> c<strong>la</strong>sse “Clef ”ClefBertrand LE GAL - ENSEIRB / Laboratoire IXL58Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : <strong>la</strong> généralisation La généralisation modélise <strong>la</strong> notion d’héritage qui existe dans les<strong>la</strong>ngages objets✦ La généralisation correspond à <strong>la</strong> notion “est une sorte <strong>de</strong>”,✦ Modélisation <strong>de</strong>s re<strong>la</strong>tions parents / enfants, Ce<strong>la</strong> implique que les entités issues d’une généralisation sont utilisablespartout ou leur c<strong>la</strong>sse mère peut l'être (mais pas l’inverse)✦ Généralisation (c<strong>la</strong>sse, c<strong>la</strong>sse) ou (c<strong>la</strong>sse, interface), Cette re<strong>la</strong>tion est modélisée par une flèche pointant sur <strong>la</strong> c<strong>la</strong>sse mère,Bertrand LE GAL - ENSEIRB / Laboratoire IXL59Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : <strong>la</strong> généralisationFormeoriginemove()resize()show()Rectanglecoin : PointCerclecoin : PointPolygonepoint : Listshow()CarréLes entités (c<strong>la</strong>sses) Rectangle, Cercle etPolygone sont <strong>de</strong>s c<strong>la</strong>sse filles qui héritent <strong>de</strong><strong>la</strong> c<strong>la</strong>sse mère Forme. De <strong>la</strong> même manière,l’entité Carré hérite <strong>de</strong> l’entité Rectangle.Bertrand LE GAL - ENSEIRB / Laboratoire IXL60Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : l’association Les re<strong>la</strong>tions d'association permettent <strong>de</strong> modéliser un lien structurelentre 2 éléments du modèle.✦ Si le lien joint 2 c<strong>la</strong>sses alors ce<strong>la</strong> signifie qu’il existe une re<strong>la</strong>tion <strong>de</strong> navigabilité entreces 2 c<strong>la</strong>sses, 4 décorations permettent <strong>de</strong> spécifier plus finement le lien entre lesobjets :✦ Le nom : décrire <strong>la</strong> nature <strong>de</strong> <strong>la</strong> re<strong>la</strong>tion entre les objets,✦ La direction : lever l'ambiguïté sur le nom,✦ Les rôles : indiquer le rôle spécifique <strong>de</strong> chacune <strong>de</strong>s c<strong>la</strong>sses dans l’association,✦ La cardinalité : spécifie le nombre d’éléments affectés.Bertrand LE GAL - ENSEIRB / Laboratoire IXL61Introduction au <strong>la</strong>ngage UML


Les re<strong>la</strong>tions : l’associationAssociationPersonneEntrepriseNomDirectionPersonneTravaille pourEntreprisePersonneEmployéTravaille pourEmployeurEntrepriseRolesBertrand LE GAL - ENSEIRB / Laboratoire IXL62Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : l’agrégationDans l’association, les entités se trouvent au même niveauhiérarchique.Dans l'agrégation, il existe une re<strong>la</strong>tion hiérarchique entre lesentités,L’agrégation répond à <strong>la</strong> question “se compose <strong>de</strong>” et modéliseune notion <strong>de</strong> possession,✦ Notion <strong>de</strong> “tout” et <strong>de</strong> “parties”,Se note comme une association avec un losange du coté du tout.Bertrand LE GAL - ENSEIRB / Laboratoire IXL63Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesLes re<strong>la</strong>tions : l’agrégationToutVoiture4AgrégationPartie1RoueBertrand LE GAL - ENSEIRB / Laboratoire IXL64Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesConclusion sur les re<strong>la</strong>tionsLes re<strong>la</strong>tions doivent être spécifiées pour toutes les c<strong>la</strong>sses quiinteragissent entre elles,Les re<strong>la</strong>tions sont <strong>de</strong>s liens statiques entre les différentes entités(c<strong>la</strong>sses),✦ Les re<strong>la</strong>tions apparaissent quasi-exclusivement dans les diagrammes <strong>de</strong>c<strong>la</strong>sses,Il existe 2 autres types <strong>de</strong> re<strong>la</strong>tions utilisés dans <strong>la</strong> modélisationdynamique :✦ Les “liens” : flux permettant le transfert <strong>de</strong> messages entre objets.✦ Les “transitions” : utilisés dans <strong>la</strong> modélisation <strong>de</strong>s machines à états finis.Bertrand LE GAL - ENSEIRB / Laboratoire IXL65Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesSpécification <strong>de</strong>s commentaires (Notes)Lors <strong>de</strong>s phases <strong>de</strong> modélisation et <strong>de</strong> spécification, il estnécessaire <strong>de</strong> documenter ses modèles :✦ Contraintes matérielles,✦ Contraintes <strong>de</strong> performance,✦ Choix techniques réalisés,✦ Références à d’autres documents,✦ Explications techniques, etc.Dans le <strong>la</strong>ngage UML, il existe une sémantique pour lescommentaires.Bertrand LE GAL - ENSEIRB / Laboratoire IXL66Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesModélisation <strong>de</strong>s commentairesVoiture4Ne pas oublierd'intégrer <strong>la</strong> roue<strong>de</strong> secours.1RoueRegar<strong>de</strong>r le fichierréparation.doc pourl'implémentation <strong>de</strong> <strong>la</strong>réparation <strong>de</strong> <strong>la</strong> roueaprès crevaison.Bertrand LE GAL - ENSEIRB / Laboratoire IXL67Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesDiagramme <strong>de</strong> c<strong>la</strong>sses, exempleNous allons maintenant essayer <strong>de</strong> modéliser uneentreprise à l’ai<strong>de</strong> d’un diagramme <strong>de</strong> c<strong>la</strong>sses :✦ Une entreprise est composée <strong>de</strong> plusieurs services, dans cesservices officie un certain nombre <strong>de</strong> personnes.✦ Dans les locaux <strong>de</strong> l’entreprise se trouvent <strong>de</strong>s bureaux utiliséspar les employés, chaque bureau porte un numéro et possè<strong>de</strong> unnuméro <strong>de</strong> téléphone.✦ Les employés sont reconnus à l’ai<strong>de</strong> <strong>de</strong> leur nom et <strong>de</strong> leurnuméro personnel. Chaque employé possè<strong>de</strong> un statut dansl’entreprise.Bertrand LE GAL - ENSEIRB / Laboratoire IXL68Introduction au <strong>la</strong>ngage UML


Diagramme <strong>de</strong> c<strong>la</strong>sses - Exemple (1)généralisation(est composé <strong>de</strong>)Entreprise1Namechaine : stringgetName():stringsetName(string)11Servicenom : Nameshow()1**Personneleffectif : intgetNombre() : intBureauadresse : stringtelephone : intshow()*Agrégation(emploie)1...*Personnenom : NameID : inttitre : stringemail: stringObtenirPhoto()ObtenirEMail()1...*1généralisation(contient)SiègeBertrand LE GAL - ENSEIRB / Laboratoire IXL69Introduction au <strong>la</strong>ngage UML


IV. Diagrammes <strong>de</strong> c<strong>la</strong>ssesDiagramme <strong>de</strong> c<strong>la</strong>sses - Exemple (2)Nous allons maintenant nous attacher à essayer <strong>de</strong>modéliser une université :✦ L’université est composée d’étudiants qui suivent <strong>de</strong>s cours dans lesfilières <strong>de</strong> leur choix.✦ Ces cours sont dispensés par <strong>de</strong>s enseignants qui peuvent êtreresponsable <strong>de</strong>s filières.✦ Les cours sont dispensés dans au moins une filière et peuvent êtremutualisés avec d’autres.A partir <strong>de</strong> là, réalisez le diagrammes <strong>de</strong> c<strong>la</strong>ssesmodélisant l’université.Bertrand LE GAL - ENSEIRB / Laboratoire IXL70Introduction au <strong>la</strong>ngage UML


Correction <strong>de</strong> l’exemple (1)UniversitéFilièreétudiantsCoursEnseignantVoici les 5 entités <strong>de</strong> base qui constituentl’université que nous <strong>de</strong>vons modéliserBertrand LE GAL - ENSEIRB / Laboratoire IXL71Introduction au <strong>la</strong>ngage UML


Correction <strong>de</strong> l’exemple (2)possè<strong>de</strong>agrégationUniversité1 1...*Filière0...1(responsable)111affecter àest membre1...*1...*1...*1...*10...1étudiantsCoursEnseignant1...*1assiste àprodigueBertrand LE GAL - ENSEIRB / Laboratoire IXL72Introduction au <strong>la</strong>ngage UML


Correction <strong>de</strong> l’exemple (3)Universiténom : stringadresse : stringtelephone : intajouterEtudiant()supprEtudiant()listeEtudiants()ajouterFilière()supprFilière()listeFilières()possè<strong>de</strong>Université1 1...* nom : stringAjouterEnseignant()supprEnseignant()listeEnseignant()110...1agrégation(responsable)est membre11...*Etudiantnom : stringi<strong>de</strong>ntifiant : int1...*1assiste à1...*Coursnom : stringi<strong>de</strong>ntifiant : intaffecter à1...*prodigue1...*0...1Enseignantnom : string1 prénom : stringlireNom() 0...1Bertrand LE GAL - ENSEIRB / Laboratoire IXL73Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> travail itératif sur le modèle (1)PermanentnuméroBureauspécialiténombreCoursnomnuméroSécuVacatairenombreVacationnombreCoursspécialiténomnuméroSécuBertrand LE GAL - ENSEIRB / Laboratoire IXL74Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> travail itératif sur le modèle (2)EnseignantspécialiténombreCoursnomnuméroSécuPermanentnuméroBureauVacatairenombreVacationBertrand LE GAL - ENSEIRB / Laboratoire IXL75Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> travail itératif sur le modèle (3)Bou<strong>la</strong>ngernombreClientadresseMagasinnomnuméroSécuVen<strong>de</strong>urancienneténomStandnomnuméroSécuEnseignantspécialiténombreCoursnomnuméroSécuPermanentnuméroBureauVacatairenombreVacationBertrand LE GAL - ENSEIRB / Laboratoire IXL76Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> travail itératif sur le modèle (4)PersonnenomnuméroSécuBou<strong>la</strong>ngernombreClientadresseMagasinVen<strong>de</strong>urancienneténomStandEnseignantspécialiténombreCoursPermanentnuméroBureauVacatairenombreVacationBertrand LE GAL - ENSEIRB / Laboratoire IXL77Introduction au <strong>la</strong>ngage UML


5“ Implémentation<strong>de</strong>s diagrammes<strong>de</strong> c<strong>la</strong>sses ”


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesEt après les modèles que fait’on ?Les diagrammes permettent <strong>de</strong> spécifier <strong>de</strong> manière c<strong>la</strong>ire,les c<strong>la</strong>sses et les re<strong>la</strong>tions existantes entre elles.✦ Génération <strong>de</strong> co<strong>de</strong> source à partir du modèle,✦ Les modèles ne sont pas spécifiques à un <strong>la</strong>ngage (choix à <strong>la</strong> génération =>1 modèle plusieurs implémentations possibles suivant les contraintes),A partir <strong>de</strong> tout diagramme UML, il est possible <strong>de</strong>remonter vers le cahier <strong>de</strong>s charges✦ Les éléments du modèle ont une sémantique propre et unique.Bertrand LE GAL - ENSEIRB / Laboratoire IXL79Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesEt après les modèles que fait’on ? Une fois que l’on a réalisé l’ensemble <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>sse, on vatraduire les modèles dans un <strong>la</strong>ngage objet :✦ Indépendance du modèle vis-à-vis du <strong>la</strong>ngage utilisé pour l'implémentation.➡ Nous utiliserons ici du C++ Chaque type d’entité et <strong>de</strong> re<strong>la</strong>tion possè<strong>de</strong> une implémentationparticulière,✦ Pas d'ambiguïté possible.Bertrand LE GAL - ENSEIRB / Laboratoire IXL80Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesTransformation du modèle au co<strong>de</strong> sourceCataloguec<strong>la</strong>ss Catalogue{// ... ... ...};Personnec<strong>la</strong>ss Personne {// ... ... ...};Bertrand LE GAL - ENSEIRB / Laboratoire IXL81Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesTransformation du modèle au co<strong>de</strong> sourceCataloguenamespace Catalogue{// ... ... ...};Bertrand LE GAL - ENSEIRB / Laboratoire IXL82Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesTransformation du modèle au co<strong>de</strong> sourceCataloguenom : NamedateCréation : DatePersonnenom : stringprénom : stringdateNaissance : stringageMajorité: string : int = 18;c<strong>la</strong>ss Catalogue {private:string nom;DateTime dateCreation;// ... ... ...}c<strong>la</strong>ss Personne {private:string nom;string prénom;protected:DateTime dateNaissance;private:static int ageMajorite = 18;}Bertrand LE GAL - ENSEIRB / Laboratoire IXL83Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesTransformation du modèle au co<strong>de</strong> sourcePersonne- nom : string- prénom : string# dateNaissance : string- ageMajorité: string : int = 18;+ calculDuréePret() : int+ setAgeMajorité( int )+ getAge(): intc<strong>la</strong>ss Personne {private:string nom;string prénom;static int ageMajorite = 18;protected:DateTime dateNaissance;public:int CalculerDureePret();static void SetAgeMajorite(intaMaj) {// ... ... ...}public int GetAge() {// ... ... ...}}Bertrand LE GAL - ENSEIRB / Laboratoire IXL84Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesImplémentation d’une généralisation (héritage)Personne- nom : string- prénom : string- age : intAdhérent- ID : intc<strong>la</strong>ss Personne {// ... ... ...}c<strong>la</strong>ss Adhèrent : Personne {private int iD;}Bertrand LE GAL - ENSEIRB / Laboratoire IXL85Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesImplémentation d’un héritage multipleEmpruntableEmprunter()Retourner()Livretitre : stringauteur : stringisbn : ISBNEmprunter()Retourner()Imprimer()ImprimableImprimer()c<strong>la</strong>ss Livre : public Imprimable :public Empruntable {private:string titre;string auteur;ISBN isbn;public:void Imprimer(){// ... ... ...}void Emprunter(){// ... ... ...}void Retourner(){// ... ... ...}}Bertrand LE GAL - ENSEIRB / Laboratoire IXL86Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesImplémentation <strong>de</strong> <strong>la</strong> composition (agrégation)C<strong>la</strong>sseA1C<strong>la</strong>sseBpublic c<strong>la</strong>ss A1 {private:C<strong>la</strong>sseB leB;// ... ... ...}C<strong>la</strong>sseA*C<strong>la</strong>sseBpublic c<strong>la</strong>ss A2 {private:C<strong>la</strong>sseB[] lesB;// ... ... ...}C<strong>la</strong>sseA* {or<strong>de</strong>r}C<strong>la</strong>sseBpublic c<strong>la</strong>ss A3 {private:ArrayList lesB;// ... ... ...lesB = = new ArrayList();}Bertrand LE GAL - ENSEIRB / Laboratoire IXL87Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesImplémentation <strong>de</strong> <strong>la</strong> composition (agrégation)Homme0...1 mari0...1épouxFemmec<strong>la</strong>ss Homme {private:Femme épouse;// ... ... ...}c<strong>la</strong>ss Femme {private:Homme mari;// ... ... ...}Bertrand LE GAL - ENSEIRB / Laboratoire IXL88Introduction au <strong>la</strong>ngage UML


V. Implémentation <strong>de</strong>s diagrammes <strong>de</strong> c<strong>la</strong>ssesImplémentation d’une association entre c<strong>la</strong>ssesPersonne0...* employé0...*employeurSociétéEmploititre : stringsa<strong>la</strong>ire : doublec<strong>la</strong>ss Emploi {private:string titre;double sa<strong>la</strong>ire;Personne employé;Société employeur ;// ... ... ...}Bertrand LE GAL - ENSEIRB / Laboratoire IXL89Introduction au <strong>la</strong>ngage UML


6“ Les diagrammes<strong>de</strong> séquence et<strong>de</strong> col<strong>la</strong>boration ”


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationLes diagrammes <strong>de</strong> séquenceMise en évi<strong>de</strong>nce <strong>de</strong> l’aspect temporel <strong>de</strong>s traitements (ordrechronologique <strong>de</strong> réalisation),Mise en évi<strong>de</strong>nce <strong>de</strong>s objets et <strong>de</strong>s messages échangés par lesentités interagissant avec et/ou dans le système,La modélisation est basée sur l’affichage <strong>de</strong>s objetsparticipant à <strong>la</strong> séquence et à l’ordre <strong>de</strong>s messages et <strong>de</strong>sactions associées.Bertrand LE GAL - ENSEIRB / Laboratoire IXL91Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationDéfinition <strong>de</strong> <strong>la</strong> sémantique du diagrammeLes diagrammes <strong>de</strong> séquence permettent <strong>de</strong> modéliserles interactions entre les objets :✦ Communications synchrones (flèches pleines),✦ Communications asynchrones (flèches pointillés),✦ Les données transmises entre les objets (annotation <strong>de</strong>s flèches),Ils permettent aussi <strong>de</strong> connaître pour chaque objet :✦ Ses dates <strong>de</strong> création et <strong>de</strong> <strong>de</strong>struction,✦ Sa durée <strong>de</strong> vie, si <strong>la</strong> création est externe au diagramme (ligne verticaleen pointillés).Bertrand LE GAL - ENSEIRB / Laboratoire IXL92Introduction au <strong>la</strong>ngage UML


Diagramme <strong>de</strong> séquence - Ex. <strong>de</strong> l’ascenseurObjetsanonymesUsager Assenceur PorteAppel extérieur(n° étage)Dép<strong>la</strong>cementMessageDeman<strong>de</strong> ouverture<strong>de</strong>s portesStimulisPortes ouvertesBertrand LE GAL - ENSEIRB / Laboratoire IXL93Introduction au <strong>la</strong>ngage UML


Diagramme <strong>de</strong> séquence - Ex. <strong>de</strong> client e-mailObjets / EntitésClientE-MailCréationSocketServeurSMTPévolutiondu tempssetServeur(name)ConnexionOKSend(email)ConnexionConnexionOKSendData(data)Pério<strong>de</strong>sd'activitéDataSendOKClose()DestroyLignes <strong>de</strong> vieBertrand LE GAL - ENSEIRB / Laboratoire IXL94Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationLe diagramme <strong>de</strong> col<strong>la</strong>borationMise en évi<strong>de</strong>nce <strong>de</strong> l’organisation <strong>de</strong>s objets qui vontcol<strong>la</strong>borer pour effectuer une interaction.✦ On représente les objets qui vont intervenir (les sommets),✦ On modélise les liens qui vont modéliser les communications entre lesobjets (les arcs),✦ On annote les liens à l’ai<strong>de</strong> <strong>de</strong>s informations qui vont être échangéesentre les entités,Visualisation c<strong>la</strong>ire du flot <strong>de</strong> contrôle dans le contexte <strong>de</strong>l'organisation structurelle.Bertrand LE GAL - ENSEIRB / Laboratoire IXL95Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationLe diagramme <strong>de</strong> col<strong>la</strong>boration2 niveaux <strong>de</strong> représentation (d’abstraction)✦ Le niveau spécification➡Définition <strong>de</strong>s c<strong>la</strong>sses et <strong>de</strong> leurs rôles,✦ Le niveau instance➡Définition <strong>de</strong>s objets et <strong>de</strong>s messages échangés,Bertrand LE GAL - ENSEIRB / Laboratoire IXL96Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationModélisation d’un graphe <strong>de</strong> rôle/Locataire :PersonneObjet+ Habitant/Maison :Logement+ Habitation+ Loueur/Propriétaire :Personne+ Adresse:LieuBertrand LE GAL - ENSEIRB / Laboratoire IXL97Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationLe diagramme <strong>de</strong> col<strong>la</strong>borationLa modélisation temporelle est en partie masquée,✦ Utilisation <strong>de</strong> <strong>la</strong> numérotation <strong>de</strong>s séquences pour ordonner lestraitements réalisés,Contrairement au diagramme <strong>de</strong> séquence, certainesinformations ne sont pas représentées :✦ On ne modélise pas le ligne <strong>de</strong> vie <strong>de</strong>s objets,✦ On ne modélise pas les temps d’activité <strong>de</strong>s objets,Par contre on modélise explicitement les liens qui existententre les différents objets.Bertrand LE GAL - ENSEIRB / Laboratoire IXL98Introduction au <strong>la</strong>ngage UML


Exemple <strong>de</strong> diagramme <strong>de</strong> col<strong>la</strong>borationClient E-MailSéquenceObjet3. ConnexionOK5. DataSendOK1. Création2. setServeur(name)4. SendMail(email)6. Destruction2.1. Connexion4.1. SendData5. CloseSocketServeur2.2. ConnexionOKLienMessageBertrand LE GAL - ENSEIRB / Laboratoire IXL99Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationUtilisation <strong>de</strong> ces diagrammesCes diagrammes sont utilisés pour modéliser lescomportements dynamiques d’un système,✦ Modéliser le fonctionnement d’un sous système,✦ Possibilité <strong>de</strong> joindre ces diagrammes aux cas d’utilisation afin <strong>de</strong>spécifier un scénario.Il est possible <strong>de</strong> rajouter <strong>de</strong>s contraintes sur lesdiagrammes :✦ Contraintes temporelles (durée d'exécution),✦ Formaliser le flot <strong>de</strong> contrôle : ajouter <strong>de</strong>s pré/post-conditions.Bertrand LE GAL - ENSEIRB / Laboratoire IXL100Introduction au <strong>la</strong>ngage UML


VI. Les diagrammes <strong>de</strong> séquence et <strong>de</strong> col<strong>la</strong>borationEquivalence entre les diagrammesX Y ZXACBY1.1 - A1.2 - C1.1.1 - BZLa transition d’un modèle <strong>de</strong> représentation à l’autreest une tache aisée pour le concepteur. Ces 2 modèlesexpriment <strong>de</strong>s informations différentes !Bertrand LE GAL - ENSEIRB / Laboratoire IXL101Introduction au <strong>la</strong>ngage UML


7“ Diagrammesd’étatstransitions”


VII. Diagrammes d’états-transitionsLa recherche <strong>de</strong>s états L’état d’un objet est lié auxvaleurs <strong>de</strong> ses attributs et <strong>de</strong> sesinteractions avec les autresobjets,LivreestPrétéestRéservé Il est nécessaire <strong>de</strong> conserver lesétats significatifs, La réponse d’un événement à unstimuli dépend :✦ Du stimuli reçu par l’objet,✦ De l’état dans lequel se trouve l’objet.LivrepretéLivrelibreLivreréservéBertrand LE GAL - ENSEIRB / Laboratoire IXL103Introduction au <strong>la</strong>ngage UML


VII. Diagrammes d’états-transitionsRègles liées au diagramme d’étatsChaque transition (passage d’un état à un autre) estprovoqué par un événement,Une transition n’a pas <strong>de</strong> durée (utilisation possible d’états<strong>de</strong> temporisation),La durée d’un état est l’intervalle qui s’écoule entrel'événement d’entrée et celui <strong>de</strong> départ.Bertrand LE GAL - ENSEIRB / Laboratoire IXL104Introduction au <strong>la</strong>ngage UML


Diagramme d’états d’un livreEtat initialAchatDestruction(poubelle)Etat finalLivrelibreEvénements(condition)EmpruntRestitutionRéservationLibérationLivrepretéEmpruntLivreréservéEtatsBertrand LE GAL - ENSEIRB / Laboratoire IXL105Introduction au <strong>la</strong>ngage UML


VII. Diagrammes d’états-transitionsSémantique liée à <strong>la</strong> représentationEtat n-1Nom <strong>de</strong> l'étatentrer / actions a réaliser en rentrant dans l'étatfaire / activités à faire durant l'état... ... ... ... ... ... ... ... ... ... ... ... ... ...sortir / / actions a réaliser en sortant <strong>de</strong> l'étatEtat n+1Bertrand LE GAL - ENSEIRB / Laboratoire IXL106Introduction au <strong>la</strong>ngage UML


8“ Et <strong>la</strong> conceptiondans tout ce<strong>la</strong> ... ”


VIII. Et <strong>la</strong> conception dans tout ce<strong>la</strong> ...Et <strong>la</strong> conception du système ... La phase <strong>de</strong> conception a pour objectif <strong>de</strong> chercher comment estimplémenté le système,✦ L’analyse vise quant à elle à i<strong>de</strong>ntifier ce qui doit être fait (et non comment). L’approche est hiérarchique s’attachant d’abord au gran<strong>de</strong>s parties dusystème et à leurs interactions, puis raffinement progressif, Prise en compte <strong>de</strong>s contraintes intrinsèques et explicites exprimées à <strong>la</strong>conception (<strong>la</strong>ngage, BDD, temps d'exécution, processeurs,périphériques, etc.). C’est une étape ou on va faire intervenir <strong>de</strong>s spécialistes <strong>de</strong> chaquediscipline en fonction <strong>de</strong>s technologies mises en oeuvre.Bertrand LE GAL - ENSEIRB / Laboratoire IXL108Introduction au <strong>la</strong>ngage UML


9“ Diagrammes <strong>de</strong>déploiement ”


IX. Diagrammes <strong>de</strong> déploiementLe diagramme <strong>de</strong> déploiementCe modèle définit le diagramme <strong>de</strong> l’architecture matérielle dusystème ou <strong>de</strong> l’application,Il représente les différentes ressources matérielles à dispositiondu concepteur pur : processeurs et périphériques et <strong>la</strong>répartition <strong>de</strong> l’application sur le système hétérogène,Il précise aussi les liens <strong>de</strong> communication existants entre cesdifférentes ressources avec leurs caractéristiques.Bertrand LE GAL - ENSEIRB / Laboratoire IXL110Introduction au <strong>la</strong>ngage UML


IX. Diagrammes <strong>de</strong> déploiementLe diagramme <strong>de</strong> déploiementSystèmed'acquisitionBluetoothEcranProcesseurdistributeurRéseau 100MoSupercalcu<strong>la</strong>teurUSBFireWireRéseau 1GoImprimanteSystèmed'acquisitionServeur <strong>de</strong>donnéesBertrand LE GAL - ENSEIRB / Laboratoire IXL111Introduction au <strong>la</strong>ngage UML


10“ Et <strong>la</strong> conceptiondans tout ce<strong>la</strong> ... ”


X. ConclusionConclusions sur UML Langage permettant d'appréhen<strong>de</strong>r <strong>la</strong> réalisation d’un systèmeinformatique complexe, Diagrammes qui permettent d’ai<strong>de</strong>r <strong>la</strong> réflexion, <strong>de</strong> permettre <strong>la</strong>discussion sur <strong>de</strong>s bases normalisées et formalisées (clients,développeurs), Pas <strong>de</strong> solution unique mais un ensemble <strong>de</strong> solutions plus ou moinsacceptables,✦ Contraintes clients (performances et fonctionnalités),✦ Architectures logicielles et matérielles à disposition, Des itérations successives du flot permettent d’aboutir à une solution.Bertrand LE GAL - ENSEIRB / Laboratoire IXL113Introduction au <strong>la</strong>ngage UML


X. ConclusionBibliographie Modélisation avec UML, Robert Ogor, ENST Bretagne, Mai 2003. UML : Unified Mo<strong>de</strong>ling Language, Mireille B<strong>la</strong>y-Fornarino, ESSI,Sophia Antipolis UML, Martin Fowler, Collection “Le tout en poche”, CampusPress Le Gui<strong>de</strong> <strong>de</strong> l’utilisateur UML, Grady Booch and al., EditionEyrolles.Bertrand LE GAL - ENSEIRB / Laboratoire IXL114Introduction au <strong>la</strong>ngage UML


Composant MatérielSommaire1 Présentation2 UML3 Composant Matériel4 VHDL5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 14 / 124


Composant MatérielNotion d’IP : intellectual propertyComposants sur carteROMCISCglueglueCANRAMglueUARTCNAFonctions spécifiques ASICROMRAMRISCFPGAEvolution vers l'intégrationCopyright : E. Martin - Lester - UBSDSPASICATMCANCNAComposants virtuels IPCoeurDSPCoeurRISCRomBuff. E/SRamRamBuff. E/SMPEGAnalog.ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 15 / 124


Composant MatérielNotion d’IP : intellectual propertyUn algorithme<strong>Conception</strong> d'un IPSélection d'un IPAchatIntégration d'un IPENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 16 / 124


Composant MatérielNotion d’IP : intellectual propertyFlot <strong>de</strong>conceptionReprésentationLibrairies Technologie PortabilitéLogiciel (soft)Non prédictibleTrès flexibleFirmFlexiblePrédictible<strong>Conception</strong>système<strong>Conception</strong>RTLSynthèse <strong>de</strong>p<strong>la</strong>n <strong>de</strong> masseP<strong>la</strong>cementComportementalRTLRTL & blocsNetlist- IndépendanttechnologieDe référence• Temps• DessinTechnologiegénériqueIllimitéePortable surlibrairiesMatÈriel(hard)Pas flexibleTrès prédictibleRoutageVérificationPolygÙnesDonnéesSpécifiqueprocessRègles <strong>de</strong><strong>de</strong>ssinTechnologiefixeDépendantdu processENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 17 / 124


Composant MatérielNotion d’IP : intellectual property• IP = RéutisabilitéENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 18 / 124


Composant MatérielNotion d’IP : intellectual property• IP = Réutisabilité• Définir un composant virtuel pouvant être utilisé dans plusieurssystèmes électroniquesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 18 / 124


Composant MatérielNotion d’IP : intellectual property• IP = Réutisabilité• Définir un composant virtuel pouvant être utilisé dans plusieurssystèmes électroniques• Exemples <strong>de</strong> ce type <strong>de</strong> composants : registres, Compteur,Additionneurs, etc ...ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 18 / 124


Composant MatérielNotion d’IP : intellectual property• Nécessité <strong>de</strong> règles permettantENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 19 / 124


Composant MatérielNotion d’IP : intellectual property• Nécessité <strong>de</strong> règles permettant• La réutilisationENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 19 / 124


Composant MatérielNotion d’IP : intellectual property• Nécessité <strong>de</strong> règles permettant• La réutilisation• La fiabilitéENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 19 / 124


Composant MatérielNotion d’IP : intellectual property• Nécessité <strong>de</strong> règles permettant• La réutilisation• La fiabilité• Nécessité d’une bonne documentationENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 19 / 124


Composant MatérielNotion d’IP : intellectual propertyEconomies parrapport au <strong>de</strong>signinitial8642RéutilisationRe-utilisationUtilisation0Pas <strong>de</strong> reuse0 1 2 3 4 5 6 7 8 9 10Nombre <strong>de</strong> réutilisationsENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 20 / 124


VHDL4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et FonctionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 21 / 124Sommaire1 Présentation2 UML3 Composant Matériel


VHDLBibliographie• The <strong>de</strong>signer’s gui<strong>de</strong> to VHDL - Peter Ashen<strong>de</strong>n, Morgan Kaufman(http://www.ashen<strong>de</strong>n.com.au/<strong>de</strong>signers-gui<strong>de</strong>/DG.html)• A<strong>la</strong>in Vachoux : Digital System Mo<strong>de</strong>ling -http://lsmwww.epfl.ch/<strong>de</strong>sign <strong>la</strong>nguages/• Cours Master SdI - Patrick Garda (patrick.garda@upmc.fr)• Ressources• Hamburg VHDL archive :• http://tech-www.informatik.uni-hamburg.<strong>de</strong>/vhdl/vhdl.htm• http://www.geocities.com/SiliconValley/Heights/8831/websrc.htmlENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 22 / 124


VHDLOutils• <strong>Free</strong> Mo<strong>de</strong>l Foundation - http://www.freemo<strong>de</strong>lfoundry.com/• Opencores - http://www.opencores.org• XILINX : ISE - http://www.xilinx.com/• ALTERA : Quartus - http://www.altera.com/• Mentor Graphics : HDL Designer, Mo<strong>de</strong>lSim, Precision -http://www.mentor.com/ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 23 / 124


VHDLHistorique• VHDL : VHSIC Hardware Description Language Historique• Langage introduit dans le cadre du projet DARPA VHSIC : Very HighSpeed Integrated Circuits• IBM, Texas Instruments et Intermetrics ont obtenu le contrat en 1983et produit VHDL ”7.2” en 1985• Proposé à IEEE pour normalisation en 1986• Norme en 1987 : IEEE Std 1076-1987, dit VHDL-87• Norme révisée en 1992 : IEEE Std 1076-1993, dit VHDL-93• Normalisation simultanée <strong>de</strong> IEEE 1164-1993, dit std logic 1164• Norme révisée en 2002 IEEE Std 1076-2002, VHDL - 2002ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 24 / 124


VHDLFlot <strong>de</strong> conception VHDLENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 25 / 124


VHDLVHDL - RTL• RTL : Register Transfert Level• Description Synthétisable• Utilisable pour configurer un circuit logique programmable• Sous ensemble <strong>de</strong> constructions VHDLENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 26 / 124


VHDLVHDL - BaseBlocs <strong>de</strong> base1 Les bibliothèques (ou librairies)2 L’entité : Décrit l’interfaçage du composant3 L’architecture : Décrit le fonctionnement du composantENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 27 / 124


VHDLVHDL - BaseENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 28 / 124


VHDLVHDL - BaseENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 29 / 124


VHDLVHDL - BaseENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 30 / 124


VHDLVHDL - Bibliothèquelibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 31 / 124


VHDLtype, subtype,constant, signal,subprogramconcurrent procedurecall, assertion,passive processcontext-c<strong>la</strong>useentity entity-name is[ generic ( parameter-list ) ][ port ( port-list ) ; ][ local-<strong>de</strong>c<strong>la</strong>rations ][ beginVHDL - Entitépassive-concurrent-statement ]end [ entity ] [ entity-name ] ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 32 / 124


VHDLVHDL - Entitégeneric(parametre-name ,...: parametre-type [:=<strong>de</strong>fault-value];...parametre-name ,...: parametre-type [:=<strong>de</strong>fault-value]);ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 33 / 124


VHDLVHDL - Entitéport([signal] signal-name ,... : mo<strong>de</strong> signal-type;...[signal] signal-name ,... : mo<strong>de</strong> signal-type);ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 34 / 124


VHDLVHDL - Entitéentity MON-ET isgeneric (tp: time := 2ns);port( A : in std_logic;B : in std_logic;S : out std_logic);end entity MON-ET;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 35 / 124


VHDLVHDL - Architectureconcurrent procedurecall, assertion,passive processarchitecture archi-name of entity-name is[ local-<strong>de</strong>c<strong>la</strong>ration ]beginconcurrent-statementend [ architecture ] [ archi-name ] ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 36 / 124


VHDLVHDL - L’architectureS = A et Barchitecture FLOT of MON-ET isbegins


VHDLVHDL - L’architecture• Une architecture décrit le fonctionnement d’une entité <strong>de</strong> conception• C’est-à-dire <strong>la</strong> détermination <strong>de</strong>s sorties en fonction <strong>de</strong>s entrées• Une architecture peut être décrite <strong>de</strong> différentes manières :• Flot <strong>de</strong> données• Structurelle• Comportementale• RTL : Register Transfer LevelENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 38 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scription1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 39 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Flot <strong>de</strong> données• Une architecture ”flot <strong>de</strong> données” (dataflow) décrit un circuit auniveau <strong>de</strong>s portes logiques• Elle représente le flot <strong>de</strong>s informations <strong>de</strong>s entrées (binaires) vers lessorties à l’ai<strong>de</strong> d’opérateurs combinatoires :• not, and, nand, or, nor, xor, xnor• Les signaux se propagent <strong>de</strong> façon asynchrone• La détermination <strong>de</strong>s valeurs est faite par l’instruction d’affectation<strong>de</strong>s signaux


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Flot <strong>de</strong> donnéesarchitecture flot of addc isbeginsum


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Structurelle• Utilise <strong>de</strong>s composants déjà définis• L’architecture structurelle définit alors <strong>la</strong> structure comme unassemb<strong>la</strong>ge d’instances <strong>de</strong> composants reliées par <strong>de</strong>s signaux• Elle correspond à <strong>la</strong> <strong>de</strong>scription textuelle d’un schéma utilisant <strong>de</strong>scellules <strong>de</strong> bibliothèqueENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 42 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Structurelleentity add4 is port (a, b : in std_logic_vector (3 downto 0) ;s : out std_logic_vector (4 downto 0) )end entity add4 ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 43 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Structurellearchitecture struct of add4 issignal c : std_logic_vector (3 downto 1) ;beginaddc_i0 : entity work.addc(flot)port map ( a(0), b(0), ’0’, s(0), c(1)) ;addc_i1 : entity work.addc(flot)port map ( a(1), b(1), c(1), s(1), c(2)) ;addc_i2 : entity work.addc(flo)tport map ( a(2), b(2), c(2), s(2), c(3)) ;addc_i3 : entity work.addc(flot)port map ( a(3), b(3), c(3), s(3), s(4)) ;end architecture struct ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 44 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Structurellearchitecture struct of add4 issignal c : std_logic_vector (3 downto 1) ;beginaddc_i0 : entity work.addc(flot)port map (a => a(0), b => b(0), cin => ’0’, sum => s(0), cout => c(1)) ;addc_i1 : entity work.addc(flot)port map (a => a(1), b => b(1), cin => c(1), sum => s(1), cout => c(2)) ;addc_i2 : entity work.addc(flo)tport map (a => a(2), b => b(2), cin => c(2), sum => s(2), cout => c(3)) ;addc_i3 : entity work.addc(flot)port map (a => a(3), b => b(3), cin => c(3), sum => s(3), cout => s(4)) ;end architecture struct ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 45 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionL’instantiation <strong>de</strong> composants PORTMAPlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity <strong>de</strong>miadd isport( a, b : in std_logic;c, s : out std_logic);end entity <strong>de</strong>miadd;architecture flot of <strong>de</strong>miadd isbegins


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionL’instantiation <strong>de</strong> composants PORTMAPlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity add isport( a, b, cin : in std_logic;cout, s : out std_logic);end entity add;architecture struct of add issignal stmp, ctmp1,ctmp2 : std_logic;begin<strong>de</strong>miadd1 : entity work.<strong>de</strong>miadd(flot)port map(a,b,stmp,ctmp1);<strong>de</strong>miadd2 : entity work.<strong>de</strong>miadd(flot)port map(cin,stmp,s,ctmp2);cout


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionArchitecture Comportementale• L’architecture est représentée par un ensemble <strong>de</strong> processusséquentiels qui s’exécutent simultanément• Chaque processus est en attente jusqu’à ce que l’une <strong>de</strong> ses entréeschange <strong>de</strong> valeur• Lorsque ce<strong>la</strong> se produit le co<strong>de</strong> du processus est exécutéséquentiellement• Lorsqu’on arrive à <strong>la</strong> fin d’un processus on recommence son exécutionau début• La réalisation électronique <strong>de</strong> l’architecture n’est pas décriteENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 48 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLe Process• Permet <strong>de</strong> réaliser <strong>de</strong>s parties séquentielles• Introduit un niveau d’abstraction proche <strong>de</strong> l’informatiqueENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 49 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLe Processlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity reg isport( d : in std_logic_vector(7 downto 0);hor : in std_logic;q : out std_logic_vector(7 downto 0);end entity reg;architecture comport of reg isbeginclocked: process(d,hor) isbeginif (hor’event and hor = ’1’) thenq


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes variables• Niveau d’abstraction niveau algorithmique• Pas assimi<strong>la</strong>ble à un filENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 51 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionL’affectation <strong>de</strong> variableslibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity reg isport( d : in std_logic_vector(7 downto 0);hor : in std_logic;q : out std_logic_vector(7 downto 0);end entity reg;architecture comport of reg isbeginclocked: process(d,hor) isvariable q_int : std_logic_vector(7 downto 0);beginif (hor’event and hor = ’1’) thenq_int :=d;end if;q


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes structures <strong>de</strong> contrÙle• Les structures Conditionnelles• La structure IF• La structure CASE• Les structure <strong>de</strong> Répétitions LOOP• La structure FORENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 53 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionConditionnelle IFif condition1 theninstructions séquentielles 1elsif condition2 theninstructions séquentielles 2elsif condition3 theninstructions séquentielles 3elseinstructions séquentielles nend if ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 54 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionConditionnelle IFlibrary ieee;use ieee.std_logic_1164.all;entity <strong>de</strong>co<strong>de</strong>ur isport ( choix : in std_logic_vector(1 downto 0);<strong>de</strong>co<strong>de</strong> : out std_logic_vector(3 downto 0));end entity <strong>de</strong>co<strong>de</strong>ur;architecture comport of <strong>de</strong>co<strong>de</strong>ur<strong>de</strong>codage : process(choix) isbeginIF (choix= "00") THEN <strong>de</strong>co<strong>de</strong>


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionConditionnelle IFarchitecture behaviour of addc isbegincalc_sum : process (a, b, cin) isbeginif ( ((a + b + cin) rem 2) = 0) then sum


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionConditionnelle CASEcase expression iswhen VALUE-1 =>instructions séquentielles 1when VALUE-2 — VALUE-3 =>instructions séquentielles 2when VALUE-M to VALUE-N =>instructions séquentielles 3when others =>instructions séquentielles nend case ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 57 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionConditionnelle CASElibrary ieee;use ieee.std_logic_1164.all;entity <strong>de</strong>co<strong>de</strong>ur isport ( choix : in std_logic_vector(1 downto 0);<strong>de</strong>co<strong>de</strong> : out std_logic_vector(3 downto 0));end entity <strong>de</strong>co<strong>de</strong>ur;architecture comport of <strong>de</strong>co<strong>de</strong>ur<strong>de</strong>codage : process(choix) isbeginCASE choixWHEN "00" => <strong>de</strong>co<strong>de</strong> <strong>de</strong>co<strong>de</strong> <strong>de</strong>co<strong>de</strong> <strong>de</strong>co<strong>de</strong> NULL;END CASE;end process <strong>de</strong>codage;end architecture comport;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 58 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionBoucle FOR[loop <strong>la</strong>bel]for i<strong>de</strong>ntifier in discrete range loopinstructions du corps <strong>de</strong> boucleend loop [loop <strong>la</strong>bel] ;• La variable i<strong>de</strong>ntifier est• auto-déc<strong>la</strong>rée• elle n’est visible que dans le corps <strong>de</strong> <strong>la</strong> boucleENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 59 / 124


VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionBoucle FORentity additionneur isgeneric (N : natural := 8);port (a, b : in std_logic_vector(N-1 downto 0);s : out std_logic_vector(N-1 downto 0));end additionneur;architecture flot of additionneur isbegin-- flotadd : process(a,b)variable sum,btemp : std_logic_vector(N-1 downto 0);variable retenue : std_logic_vector(N downto 0);begin -- process addbtemps := b;retenue(0):=’0’;calcul : for i in 0 to N-1 loopsum(i):= a(i) xor btemp(i) xor retenue(i);retenue(i+1) := (a(i) and btemp(i)) or (a(i) and retenue(i)) or (btemp(i) and retenue(i));end loop calcul;end process add;end flot;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 60 / 124


VHDLLes types en VHDL1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 61 / 124


VHDLLes types en VHDLLes différents Type VHDL• Les types originaux• Bit is (’0’, ’1’);• Bit vector is array (Natural range ) of Bit;• Boolean is (false, true);• Character• Integer• Natural is Integer range 0 to Integer’high• Positive is Integer range 1 to Integer’high• Real• String is array (Positive range ) of Character• Timeunitsfs; -- femtosecon<strong>de</strong>ps = 1000 fs; -- picosecon<strong>de</strong>ns = 1000 ps; -- nanosecon<strong>de</strong>us = 1000 ns; -- microsecon<strong>de</strong>ms = 1000 us; -- millisecon<strong>de</strong>sec = 1000 ms; -- secon<strong>de</strong>min = 60 sec; -- minutehr = 60 min; -- heureend units;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 62 / 124


VHDLLes types en VHDLLes différents Type VHDL• Les types ajoutés par ieee (paquetage 1164)• std ulogic is (’U’, -- Non Initialisé - Non synthétisé’X’, -- Forçage Indéterminé - Non synthétisé’0’, -- Forçage à 0 - Synthèse = 0’1’, -- Forçage à 1 - Synthèse = 1’Z’, -- Haute Impedance - Synthèse = Z’W’, -- Faible Indéterminé - Non synthétisé’L’, -- Faible à 0 - Synthèse = 0’H’, -- Faible à 1 - Synthèse = 1’-’ -- Peu Importe - Non synthétisé• std ulogic vector is array ( natural range ) ofstd ulogic;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 63 / 124


VHDLLes types en VHDLStd logic type résolu <strong>de</strong> std ulogic’U’ ’X’ ’0’ ’1’ ’Z’ ’W’ ’L’ ’H’ ’-’’U’ ’U’ ’U’ ’U’ ’U’ ’U’ ’U’ ’U’ ’U’ ’U’’X’ ’U’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’’0’ ’U’ ’X’ ’0’ ’X’ ’0’ ’0’ ’0’ ’0’ ’X’’1’ ’U’ ’X’ ’X’ ’1’ ’1’ ’1’ ’1’ ’1’ ’X’’Z’ ’U’ ’X’ ’0’ ’1’ ’Z’ ’W’ ’L’ ’H’ ’X’’W’ ’U’ ’X’ ’0’ ’1’ ’W’ ’W’ ’W’ ’W’ ’X’’L’ ’U’ ’X’ ’0’ ’1’ ’L’ ’W’ ’L’ ’W’ ’X’’H’ ’U’ ’X’ ’0’ ’1’ ’H’ ’W’ ’W’ ’H’ ’X’’-’ ’U’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’ ’X’ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 64 / 124


VHDLSignaux et Variables en VHDL1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 65 / 124


VHDLSignaux et Variables en VHDLLes variables• Les variables sont utilisées dans les instructions séquentielles• Elles ne correspon<strong>de</strong>nt à aucune réalité électronique• Elles jouent le rôle <strong>de</strong>s variables dans un <strong>la</strong>ngage <strong>de</strong> programmation• Elles ont une portée limitée au processus dans lequel elles sontdéc<strong>la</strong>rées• Elles sont typéesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 66 / 124


VHDLSignaux et Variables en VHDLLes variables• Affectation• Symbole d’affectation <strong>de</strong> variables :=• L’affectation d’une variable est instantanée• Utilisation• Affectation d’un signal à une variable• Exécution d’un algorithme séquentiel• Affectation d’une variable à un signal• Autre utilisation : i<strong>de</strong>ntificateur <strong>de</strong> boucleENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 67 / 124


VHDLSignaux et Variables en VHDLLes signaux• Les signaux représentent les données physiques échangées entre lesmodules (ang<strong>la</strong>is data signal)• Chaque signal sera matérialisé dans le circuit final par uneéquipotentielle• Exemples :• ports d’entrées et <strong>de</strong> sorties d’une entité• signaux internes à une architectureENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 68 / 124


VHDLSignaux et Variables en VHDLLes signaux• Instruction d’affectation <strong>de</strong> signaux :• s


VHDLSignaux et Variables en VHDLLes signaux• Chaque signal a un type, comme dans un <strong>la</strong>ngage structuré• Le type définit l’ensemble <strong>de</strong>s valeurs que peut prendre le signal.• Les signaux <strong>de</strong> type synthétisable sont synthétisables.• VHDL est fortement typé, pas <strong>de</strong> conversion automatique• Nécessité d’avoir recours à <strong>de</strong>s fonctions <strong>de</strong> conversionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 70 / 124


VHDLSignaux et Variables en VHDLLes signaux• Types énumérés• type boolean is (false, true) ;• type character is (liste <strong>de</strong>s caractères)• Tous les caractères ISO 8 bits• Une constante caractère est notée ’A’• type bit is (’0’, ’1’) ;• type severity level is (note, warning, error, failure) ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 71 / 124


VHDLSignaux et Variables en VHDLLes signaux• Entiers :• type integer is range -2147483 to 2147482 ;• subtype positive is integer range 1 to integer’high ;• subtype natural is integer range 0 to integer’high ;• Remarques sur entiers :• Valeurs négatives codées en complément à 2• Entiers synthétisés comme bus 32 bits par défaut• Intervalles :• Subtype byte is integer range -128 to 127 – codé 8 bits C2• Réels :• type real is range $- to $+• Réels pas synthétisablesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 72 / 124


VHDLSignaux et Variables en VHDLLes signauxlibrary ieee;use ieee.std_logic_1164.all;entity aff isport( a : in std_logic;d : out std_logic_vector(3 downto 0));end entity aff;architecture flot of aff issignal aint : std_logic;beginaint


VHDLSignaux et Variables en VHDLLes opérateurs Logiques• Les opérateurs logiques :andorxornotet bit à bitou bit à bitou-exclusif bit à bitnon bit à bit• Les opérateurs arithmétiques+ Addition- Soustraction* Multiplication/ Division Peu Synthétisablemod Modulo Pas Synthétisableexp Exponentitation Pas synthétisableENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 74 / 124


VHDLLes tableaux1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 75 / 124


VHDLLes tableauxLes Tableaux• Déc<strong>la</strong>ration• type nom is array (intervalle) of type <strong>de</strong> base• Utilisation• Modélisation <strong>de</strong> bus.• Modélisation <strong>de</strong> mémoires.• Synthèse• Tableaux à 1 dimension• Indices entiers ou sous-type entiers• Eléments du tableau synthétisablesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 76 / 124


VHDLLes tableauxLes Tableaux• Types tableaux prédéfinis• type bit vector is array (natural range ) of bit ;• type string is array (positive range ) of character ;• type std ulogic vector is array (natural range ) of std ulogic ;• type std logic vector is array (natural range ) of std logic ;• Exemples <strong>de</strong> modélisation <strong>de</strong> bus• Subtype byte is std logic vector (7 downto 0) ;• Subtype word is std logic vector (15 downto 0) ;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 77 / 124


VHDLGénérique1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 78 / 124


VHDLGénériqueGeneric• Les paramètres génériques sont définis dans l’entité, avant les portsd’entrées-sorties• Ils peuvent être utilisés :• Dans l’entité après leur déc<strong>la</strong>ration• Dans le corps <strong>de</strong> toute architecture associée à l’entitéentity MON-ET isgeneric (tp: time := 2ns);port( A : in std_logic;B : in std_logic;S : out std_logic);end entity MON-ET;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 79 / 124


VHDLGénériqueGeneric• La valeur du paramètre générique est précisée lors <strong>de</strong> l’instanciation<strong>de</strong> l’entité• Des instances différentes peuvent utiliser <strong>de</strong>s valeurs différentesentity doubleor isport (in1, in2 : in std_logic;out2 : out std_logic);end entity doubleor;architecture struct of doubleor issignal out1 : std_logic;beginGate1 : entity work.or2(behaviour)Generic map (2 ns) ;Port map (in1, in2, out1) ;Gate2 : entity work.or2(behaviour)Generic map (T_pd => 3 ns) ;Port map (a => out1, b => in2, y => out2) ;end architecture struct;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 80 / 124


VHDLGénériqueGeneric• Une valeur par défaut du paramètre générique peut être indiquée lors<strong>de</strong> sa déc<strong>la</strong>ration• Lors <strong>de</strong> l’instanciation, cette valeur peut être :• Utilisée telle quelle• Remp<strong>la</strong>cée par une autre valeurentity dff isGeneric (T_pd, T_su : time := 2 ns ; T_h : time := 0 ns) ;Port (clock, d : in std_logic ;q : out std_logic)end entity dff;architecture struct of reg is.......Request_dff : entity work.dff (behaviour)Generic map (4 ns, 3 ns, open) ;Port map (system_clock, request, prending_request).......end ENSEA architecture (ETIS / ENSEA) struct; <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 81 / 124


VHDLGénériqueGenerate• L’instruction concurrente generate permet <strong>de</strong> dupliquer <strong>de</strong>sinstructions concurrentes <strong>de</strong> manière itérative ou conditionnelle.ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 82 / 124


VHDLGénériqueGenerateentity shiftreg isgeneric (nbits: positive := 8);port (clk, rst, d: in std_logic;q: out std_logic);end entity shiftreg;architecture structure of shiftreg iscomponent dff isport (clk, rst, d: in std_logic;q: out std_logic);end component dff;signal qint: std_logic _vector(1 to nbits-1);Begincell_array: for i in 1 to nbits generatefirst_cell: if i = 1 generatedff1: dff port map (clk, rst, d, qint(1));end generate first_cell;int_cell: if i > 1 and i < nbits generatedffi: dff port map (clk, rst, qint(i-1), qint(i));end generate int_cell;<strong>la</strong>st_cell: if i = nbits generatedffn: dff port map (clk, rst, qint(nbits-1), q);end generate <strong>la</strong>st_cell;end generate cell_array;end architecture structure;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 83 / 124


VHDLLes Machines à Etats en VHDL1 Présentation2 UML3 Composant Matériel4 VHDLDifférents types <strong>de</strong> <strong>de</strong>scriptionLes types en VHDLSignaux et Variables en VHDLLes tableauxGénériqueLes Machines à Etats en VHDLC<strong>la</strong>use WaitTest BenchSimu<strong>la</strong>tionPaquetage, Procédure et Fonction5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 84 / 124


VHDLLes Machines à Etats en VHDLLes machines à états en VHDL• Moore ou Mealy• Utilisation d’au moins 2 process• Un process <strong>de</strong> transition <strong>de</strong> l’état futur à l’état présent• Un process <strong>de</strong> détermination <strong>de</strong>s sorties et <strong>de</strong> l’état futur• Utilisation <strong>de</strong> type énuméréENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 85 / 124


VHDLLes Machines à Etats en VHDLMachines <strong>de</strong> Moore - 2 process - EntitéLIBRARY ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_unsigned.ALL;USE ieee.std_logic_arith.ALL;ENTITY mae ISPORT(a : IN std_logic;hor : IN std_logic;raz : IN std_logic;);END mae ;b : OUT std_logicENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 86 / 124


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Moore - 2 process -ArchitectureARCHITECTURE diagram OF mae ISTYPE STATE_TYPE IS (Etat0,Etat1,Etat2);SIGNAL EtatPresent : STATE_TYPE ;SIGNAL EtatFutur : STATE_TYPE ;BEGINclocked : PROCESS(hor,raz)BEGIN...END PROCESS clocked;nextstate : PROCESS (EtatPresent,a)BEGIN...END PROCESS nextstate;END diagram;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 87 / 124


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Moore - 2 process -Architectureclocked : PROCESS(hor,raz)BEGINIF (raz = ’0’) THENEtatPresent


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Moore - 2 process -Architecturenextstate : PROCESS (EtatPresent,a)BEGINCASE EtatPresent ISWHEN Etat0 =>b


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Mealy - 2 process - EntitéLIBRARY ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_unsigned.ALL;USE ieee.std_logic_arith.ALL;ENTITY mae ISPORT(a : IN std_logic;hor : IN std_logic;raz : IN std_logic;);END mae ;b : OUT std_logicENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 90 / 124


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Mealy - 2 process -ArchitectureARCHITECTURE diagram OF mae ISTYPE STATE_TYPE IS (Etat0,Etat1,Etat2);BEGINSIGNAL EtatPresent : STATE_TYPE ;SIGNAL EtatFutur : STATE_TYPE ;clocked : PROCESS(hor,raz)BEGIN...END PROCESS clocked;nextstate : PROCESS (EtatPresent,a)BEGIN...END PROCESS nextstate;END diagram;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 91 / 124


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Mealy - 2 process -Architectureclocked : PROCESS(hor,raz)BEGINIF (raz = ’0’) THENEtatPresent


VHDLLes Machines à Etats en VHDLMachine <strong>de</strong> Mealy - 2 process -Architecturenextstate : PROCESS (EtatPresent,a)BEGINCASE EtatPresent ISWHEN Etat0 =>b


VHDLC<strong>la</strong>use WaitLa c<strong>la</strong>use Wait• wait on liste <strong>de</strong> signaux• un évènement sur l’un <strong>de</strong>s signaux <strong>de</strong> <strong>la</strong> liste <strong>de</strong> signaux provoquel’exécution du processushalf_ad<strong>de</strong>r : process isbeginsum


VHDLC<strong>la</strong>use WaitLa c<strong>la</strong>use Wait• wait until condition• condition est une condition booléenne• Ce qui se passe :• Le processus est suspendu lorsqu’il arrive à l’instruction wait• Le processus est re<strong>la</strong>ncé lorsque condition est testée et vraie• Liste <strong>de</strong> sensibilité <strong>de</strong> wait until• condition est testée lorsqu’un évènement se produit sur l’un <strong>de</strong>ssignaux qui y apparaissent• <strong>la</strong> liste <strong>de</strong> sensibilité est <strong>la</strong> liste <strong>de</strong>s signaux qui apparaissent danscondition• wait until condition• équivaut à : wait on liste <strong>de</strong>s signaux <strong>de</strong> condition untilconditionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 95 / 124


VHDLC<strong>la</strong>use WaitLa c<strong>la</strong>use Wait• wait for duree• Ce qui se passe :• Le processus est suspendu lorsqu’il arrive à l’instruction wait• Le processus est re<strong>la</strong>ncé après une temporisation dureeclock_gen : process isbeginclock


VHDLC<strong>la</strong>use WaitLa c<strong>la</strong>use Wait• Wait• Ce qui se passe :• Le processus est suspendu lorsqu’il arrive à l’instruction wait• Il reste suspendu jusqu’à <strong>la</strong> fin <strong>de</strong> <strong>la</strong> simu<strong>la</strong>tion• Exemple d’application : test bench• VHDL permet <strong>de</strong> décrire dans le même <strong>la</strong>ngage :• Le circuit à tester• La génération <strong>de</strong>s signaux d’entrée.• La vérification <strong>de</strong>s signaux <strong>de</strong> sortie.ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 97 / 124


VHDLTest BenchTest Bench• Génération <strong>de</strong> Stimuli• Analyse <strong>de</strong>s résultats• Utilisation <strong>de</strong> c<strong>la</strong>use AssertENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 98 / 124


VHDLTest BenchAssert• ASSERT conditionREPORT string SEVERITY severity level;check_setup: PROCESS (clk, d)BEGINIF (clk’EVENT AND clk=’1’) THEN -- test si front mASSERT d’STABLE(setup_time) -- regar<strong>de</strong> si dREPORT "Setup Vio<strong>la</strong>tion..." -- afficheSEVERITY WARNING;END IF;END PROCESS check_setup;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 99 / 124


VHDLTest BenchAssert• Niveaux <strong>de</strong> sévérité :• Note : utilisé pour information seulement”Note : Chargement <strong>de</strong> données d’un fichier”• Warning : utilisé pour fournir une information sur une erreur eninstance”Warning : Détection d’un pic”• Error : utilisé pour information seulement”Error : Vio<strong>la</strong>tion du temps d’initialisation”• Failure : raporte une grosse erreur”Failure : Ligne RESET instable”ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 100 / 124


VHDLSimu<strong>la</strong>tionInitialisation1 Assign initial values to signals and variables.2 T c = 0ns, δ = 03 Execute all processes until they suspend.4 Determine next time T n according to 4.Simu<strong>la</strong>tion EvénementielleCycle1 Tc = Tn.2 Update signals.3 Execute all processes sensitive to updated signals.4 Determine next time Tn:• if pending transactions at current time: δ = δ + 1 then 2• if no more pending transactions or Tn = time’high then STOP• else T n = time of next earliest pending transaction, δ = 05 Execute postponed processes.ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 101 / 124


VHDLPaquetage, Procédure et FonctionPaquetagepackage proc_pkg issubtype data is integer range 0 to 3;type darray is array (1 to 3) of data;end package proc_pkg;use work.proc_pkg.all;entity procstmt isport (inar : in darray;outar: out darray);end entity procstmt;ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 102 / 124


VHDLPaquetage, Procédure et FonctionProcédurearchitecture a of procstmt isbeginprocess (inar)procedure swap (d: inout darray; l, h: in postitive) isvariable tmp: data;beginif d(l) > d(h) thentmp := d(l);d(l) := d(h);d(h) := tmp;end if;end swap;variable tmpar: darray;begintmpar := inar;swap(tmpar,1,2);swap(tmpar,2,3);swap(tmpar,1,2);outar


VHDLPaquetage, Procédure et FonctionFonctionentity parity_check isgeneric (NBITS: positive := 8);port (data: in bit_vector(NBITS-1 downto 0);prty: out bit);end entity parity_check;architecture func of parity_check isbeginprocess (data)function parity (bv: bit_vector) return bit isvariable result: bit;beginresult := ’0’;for i in bv’range loopresult := result xor bv(i); -- odd parityend loop;return result;end function parity;beginprty


VHDLPaquetage, Procédure et FonctionFonction <strong>de</strong> conversionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 105 / 124


FPGASommaire1 Présentation2 UML3 Composant Matériel4 VHDL5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 106 / 124


FPGAF.P.G.A et SRAM• Utilisation <strong>de</strong> cellule <strong>de</strong> mémoire statiqueVddSelectDonnéeT2T4T3T6T5T1Interconnexion• Vo<strong>la</strong>tile• ReprogrammableENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 107 / 124


FPGAStructure d’un F.P.G.AENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 108 / 124


FPGAStructure d’un F.P.G.ACellCellCellCellCellCellCellCellCellCellCellCellCellCellCellCellCellCellCellCellENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 108 / 124


FPGAStructure d’un F.P.G.AE/S E/S E/S E/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/S E/S E/S E/SENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 108 / 124


FPGAStructure d’un F.P.G.AE/S E/S E/S E/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/SE/SCellCellCellCellCellE/S E/S E/S E/SENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 108 / 124


FPGAStructure d’un F.P.G.AE/S E/S E/S E/SCellCellCellCellCellE/SIntConnIntConnIntConnIntConnE/SCellCellCellCellCellE/SIntConnIntConnIntConnIntConnE/SCellCellCellCellCellE/SIntConnIntConnIntConnIntConnE/SCellCellCellCellCellE/S E/S E/S E/SENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 108 / 124


FPGAQu’y a t’il dans un F.P.G.A ?• Des Cellules <strong>de</strong> BaseENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 109 / 124


FPGAQu’y a t’il dans un F.P.G.A ?• Des Cellules <strong>de</strong> Base• LUT (LookUp Table)- Codage <strong>de</strong>s fonctions - CombinatoireENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 109 / 124


FPGAQu’y a t’il dans un F.P.G.A ?• Des Cellules <strong>de</strong> Base• LUT (LookUp Table)- Codage <strong>de</strong>s fonctions - Combinatoire• Bascules - Synchronisation - SéquentielENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 109 / 124


FPGAQu’y a t’il dans un F.P.G.A ?• Des Cellules <strong>de</strong> Base• LUT (LookUp Table)- Codage <strong>de</strong>s fonctions - Combinatoire• Bascules - Synchronisation - Séquentiel• Des Entrées-SortiesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 109 / 124


FPGAQu’y a t’il dans un F.P.G.A ?• Des Cellules <strong>de</strong> Base• LUT (LookUp Table)- Codage <strong>de</strong>s fonctions - Combinatoire• Bascules - Synchronisation - Séquentiel• Des Entrées-Sorties• De <strong>la</strong> logique <strong>de</strong> routageENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 109 / 124


FPGAStructure d’une Cellule <strong>de</strong> BasePoint MémoireE1E2E3E4L.U.TLook Up TableDQSHORENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 110 / 124


FPGAStructure <strong>de</strong> l’interconnexionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 111 / 124


FPGAStructure <strong>de</strong> l’interconnexionENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 112 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera• jusqu’à 114 140 CellulesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 113 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera• jusqu’à 114 140 Cellules• jusqu’à 1 Moctet <strong>de</strong> mémoire embarquéeENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 113 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera• jusqu’à 114 140 Cellules• jusqu’à 1 Moctet <strong>de</strong> mémoire embarquée• mise en oeuvre <strong>de</strong> multiplieurs ca<strong>de</strong>ncé jusqu’à 250 MHzENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 113 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera• jusqu’à 114 140 Cellules• jusqu’à 1 Moctet <strong>de</strong> mémoire embarquée• mise en oeuvre <strong>de</strong> multiplieurs ca<strong>de</strong>ncé jusqu’à 250 MHz• 16 horloges globales différentesENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 113 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera• jusqu’à 114 140 Cellules• jusqu’à 1 Moctet <strong>de</strong> mémoire embarquée• mise en oeuvre <strong>de</strong> multiplieurs ca<strong>de</strong>ncé jusqu’à 250 MHz• 16 horloges globales différentes• 12 PLLENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 113 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Mémoire• 3 différents BlocsENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 114 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Mémoire• 3 différents Blocs• M512 : 512 bits organisés en 32x18 bitsENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 114 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Mémoire• 3 différents Blocs• M512 : 512 bits organisés en 32x18 bits• M4K : 4Kbits organisés en 128X36 bitsENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 114 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Mémoire• 3 différents Blocs• M512 : 512 bits organisés en 32x18 bits• M4K : 4Kbits organisés en 128X36 bits• M-RAM : 576Kbits organisée en 4KX144 bitsENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 114 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Multiplieurs• 1 bloc DSP : 3 mo<strong>de</strong>sENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 115 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Multiplieurs• 1 bloc DSP : 3 mo<strong>de</strong>s• 8 Multiplieurs 9x9ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 115 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Multiplieurs• 1 bloc DSP : 3 mo<strong>de</strong>s• 8 Multiplieurs 9x9• 4 Multiplieurs 18x18ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 115 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’Altera- Multiplieurs• 1 bloc DSP : 3 mo<strong>de</strong>s• 8 Multiplieurs 9x9• 4 Multiplieurs 18x18• 1 Multiplieur 36x36ENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 115 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 116 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 117 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 118 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 119 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 120 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 121 / 124


FPGAExemple <strong>de</strong> F.P.G.A : Le Stratix d’AlteraENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 122 / 124


FPGAFPGAENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 123 / 124


Overview• All Xilinx FPGAs contain the same basic resources– Slices grouped into Configurable Logic Blocks (CLBs)• Contain combinatorial logic and register resources– IOBs• Interface between the FPGA and the outsi<strong>de</strong> world– Programmable interconnect– Other resources• Memory• Multipliers• Global clock buffers• Boundary scan logicFPGA Introduction 9© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-II ArchitectureFirst family with Embed<strong>de</strong>d Multipliers to enable high-performance DSPBlock SelectRAMresourceI/O Blocks (IOBs)Embed<strong>de</strong>dmultipliersProgrammableinterconnectConfigurableLogic Blocks(CLBs)Clock Management(DCMs, BUFGMUXes)Refer to <strong>de</strong>vice data sheet at xilinx.com for <strong>de</strong>tailed technical informationFPGA Introduction 10© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


CLBs and SlicesCombinatorial and sequential logic implemented here• Each Virtex -II CLBcontains four slices– Local routing provi<strong>de</strong>sfeedback between slices inthe same CLB, and itprovi<strong>de</strong>s routing toneighboring CLBs– A switch matrix provi<strong>de</strong>saccessto general routing resourcesSwitchMatrixCOUTBUFTBUF TSHIFTSlice S1Slice S0COUTSlice S3Slice S2Local RoutingCINCINFPGA Introduction 11© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Slice ResourcesLUTFRAM16SRL16LUTGCYMUXFxArithmetic LogicCY RegisterMUXF5Register• Each slice contains two:— Four inputs lookup tables— 16-bit distributed SelectRAM— 16-bit shift register• Each register:— D flip-flop— Latch• Dedicated logic:— Muxes— Arithmetic logic— MULT_AND— Carry ChainFPGA Introduction 12© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Look-Up Tables• Combinatorial logic is stored in Look-Up Tables(LUTs)– Also called Function Generators (FGs)– Capacity is limited by the number of inputs, not by thecomplexity• De<strong>la</strong>y through the LUT is constantABCDCombinatorial LogicZA B C D Z0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 10 1 0 0 10 1 0 1 1. . .1 1 0 0 01 1 0 1 01 1 1 0 01 1 1 1 1FPGA Introduction 13© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Distributed RAM• LUTs used as memory insi<strong>de</strong> the fabric• Flexible, can be used as RAM, ROM, orshift register• Distributed memory with fast accesstime• Cascadable with built-in CLB routing• Applications– Linear feedback shift register– Distributed arithmetic– Time-shared registers– Small FIFO– Digital <strong>de</strong><strong>la</strong>y lines (Z -1 )FPGA Introduction 14© 2009 Xilinx, Inc. All Rights ReservedRAM16SRL16LUT16b64b16b128bFor Aca<strong>de</strong>mic Use OnlyDual PortRAM1 CLBSingle PortRAM1 CLBShift register128b1 CLB


The SRL16E• The 16 SRAM cells have been organized into a shift register– The ‘CE’ is used, in conjunction with the clock, to write data into the first flip-flopand for all other data to move right by one position– Because this is a predictable operation, no address is required for writing• The SRL16E is excellent in implementing efficient DSP Functions– A very efficient way to <strong>de</strong><strong>la</strong>y data samples– Shifting samples and scanning at faster rateCEDCED QCED QCED QCED QCED QCED QCED QCED QCED QCED QD Q15CEAQCED QCED QD QCED QCED QSRLC16ECascadableCED QCEQ15D QA[3:0]0000 1111QFPGA Introduction 15© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Enabling high-performance DSPVirtex-II introduced the embed<strong>de</strong>d 18x18 multiplierB18REGCED Q36PA18BCIN• Situated between the Block RAMs and CLB array to enable high-performancemultiply-accumu<strong>la</strong>te operations• This dramatically increased multiplier speed and <strong>de</strong>nsity compared to LUT basedmultipliers and enabled FPGA based DSPFPGA Introduction 16© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Outline• Power of Parallelism• Basic FPGA Architecture• Virtex -II Pro• Virtex-4• Virtex-5• Spartan-3 Family• Latest Families− Virtex-6 Family− Spartan-6 Family• Why should I use FPGAs for DSP?• The DSP48 Slice AdvantageFPGA Introduction 17© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-II Pro FPGAsRefer to <strong>de</strong>vice data sheet on web for <strong>de</strong>tailed technical informationHigh performance TrueDual-port RAM – 2.4 Mbin xc2vp30SelectIO- UltraTechnology - 556 I/O inxc2vp30Advanced FPGA Logic –30k logic cells in xc2vp30Embed<strong>de</strong>d XtremeDSPFunctionality - 136 multiplierson xc2vp30DCM Digital ClockManagement – 8 inxc2vp30XCITE Digitally ControlledImpedance - Any I/ORocketIO High-speed SerialTransceivers 622 Mbps to 3.125Gbps- 8 in xc2vp30 (4 brought outto connectors on XUP Board)PowerPC Processors 400+ MHzClock Rate – 2 in xc2vp30FPGA Introduction 18© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Multiplier Unit• Embed<strong>de</strong>d 18-bit x 18-bit multiplier• The XUP Virtex-II Pro inclu<strong>de</strong>s aVirtex-II Pro xc2vp30 <strong>de</strong>vice with136 Multipliers• 2s complement signed operation• 4- to 18-bit operands• Combinational & pipelined options• Operates with block RAM andfabric to implement MAC function18 Bit36 Bit18 Bit300 MHz Performance in Virtex-II ProPipelined multiplier with registered inputs and outputsFPGA Introduction 19© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-4 FamilyAdvanced Silicon Modu<strong>la</strong>r BLock (ASMBL) ArchitectureOptimized for logic, Embed<strong>de</strong>d, and Signal ProcessingLXFXSXResourceLogic14K–200K LCs12K–140K LCs23K–55K LCsMemory0.9–6 Mb0.6–10 Mb2.3–5.7 MbDCMs4–124–204–8DSP Slices32–9632–192128–512SelectIO240–960240–896320–640RocketION/A0–24 ChannelsN/APowerPCN/A1 or 2 CoresN/AEthernet MACN/A2 or 4 CoresN/AFPGA Basic Architecture Introduction 21© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-4 FeaturesRefer to <strong>de</strong>vice data sheet on web for <strong>de</strong>tailed technical information200,000Logic Cells6.5 Gbps0.6-6.5 GbpsRocketIOTransceivers500 MHz XesiumDifferential ClockingAES Secure ChipDesign SecurityBRAM with FIFO& ECCVirtex-4PowerPC®Processor with APUVirtex-4Virtex-410/100/1000Ethernet MACXtremeDSPSlice1 Gbps SelectIOwith ChipSyncFPGA Introduction 22© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-4 ArchitectureRocketIOMulti-GigabitTransceivers622 Mbps–10.3 GbpsAdvanced CLBs200K Logic CellsSmart RAMNew block RAM/FIFOXesium ClockingTechnology500 MHzXtremeDSPTechnology Slices256 18x18 GMACsPowerPC 405with APU Interface450 MHz, 680 DMIPSTri-Mo<strong>de</strong>Ethernet MAC10/100/1000 Mbps1 Gbps SelectIOChipSync Source synch,XCITE Active TerminationFPGA Introduction 23© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


The Virtex-4 SX p<strong>la</strong>tform• Virtex-4 introduced a new DSP block that had both multiply andaccumu<strong>la</strong>te functionality• For the first time a true “MAC” unit was offered in a Xilinx FPGA.This block was called the DSP48 due to it’s 48-bit output precision• Additional mo<strong>de</strong>s of the ad<strong>de</strong>r allowed subtract and shift functionsto support scaling of results• Integral registers guarantee high-speed pipelined data-paths formaximum clock frequencyFPGA Introduction 24© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


BCOUTDSP48 BlockInclu<strong>de</strong>s a high performance arithmetic unit and a multiplierPCOUTBA01CEB18CEABREGCED Q2-DeepRSTBAREGCED Q2-DeepRSTA1818A:B 36CEMMREGCED QRSTM72 36 0360017-bit shift17-bit shiftXYZSubtract48CEPPREGCED QRSTP480148PCarryInC487OpMo<strong>de</strong>4848BCINPCINFPGA Introduction 25© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


DSP48 BlockDynamically Programmable DSP Op Mo<strong>de</strong>sZ Y XOpMo<strong>de</strong> 6 5 4 3 2 1 0 OutputZero0 0 0 0 0 0 0 +/- CinHold P0 0 0 0 0 1 0 +/- (P + Cin)A:B Select0 0 0 0 0 1 1 +/- (A:B + Cin)Multiply0 0 0 0 1 0 1 +/- (A * B + Cin)C Select0 0 0 1 1 0 0 +/- (C + Cin)Feedback Add0 0 0 1 1 1 0 +/- (C + P + Cin)36-Bit Ad<strong>de</strong>r0 0 0 1 1 1 1 +/- (A:B + C + Cin)P Casca<strong>de</strong> Select0 0 1 0 0 0 0 PCIN +/- CinP Casca<strong>de</strong> Feedback Add 0 0 1 0 0 1 0 PCIN +/- (P + Cin)P Casca<strong>de</strong> Add0 0 1 0 0 1 1 PCIN +/- (A:B + Cin)P Casca<strong>de</strong> Multiply Add 0 0 1 0 1 0 1 PCIN +/- (A * B + Cin)P Casca<strong>de</strong> Add0 0 1 1 1 0 0 PCIN +/- (C + Cin)P Casca<strong>de</strong> Feedback Add Add0 0 1 1 1 1 0 PCIN +/- (C + P + Cin)P Casca<strong>de</strong> Add Add 0 0 1 1 1 1 1 PCIN +/- (A:B + C + Cin)Hold P0 1 0 0 0 0 0 P +/- CinDouble Feedback Add 0 1 0 0 0 1 0 P +/- (P + Cin)Feedback Add0 1 0 0 0 1 1 P +/- (A:B + Cin)Multiply-Accumu<strong>la</strong>te 0 1 0 0 1 0 1 P +/- (A * B + Cin)Feedback Add0 1 0 1 1 0 0 P +/- (C + Cin)Double Feedback Add 0 1 0 1 1 1 0 P +/- (C + P + Cin)Feedback Add Add0 1 0 1 1 1 1 P +/- (A:B + C + Cin)C Select0 1 1 0 0 0 0 C +/- CinFeedback Add0 1 1 0 0 1 0 C +/- (P + Cin)36-Bit Ad<strong>de</strong>r0 1 1 0 0 1 1 C +/- (A:B + Cin)Multiply-Add0 1 1 0 1 0 1 C +/- (A * B + Cin)Double0 1 1 1 1 0 0 C +/- (C + Cin)Double Add Feedback Add 0 1 1 1 1 1 0 C +/- (C + P + Cin)Double Add0 1 1 1 1 1 1 C +/- (A:B + C + Cin)• Enables time-divisionmultiplexing for DSP• Over 40 different mo<strong>de</strong>s• Each XtremeDSP Sliceindividually control<strong>la</strong>ble• Change operation in a singleclock cycle• Control functionality fromlogic, memory or processorFPGA Introduction 26© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


DSP48 BlockUseful For More Than DSP• 6:1 high-speed, 36-bit Multiplexer– Use four XtremeDSP Slice and op-mo<strong>de</strong>s– 500 MHz performance using no programmable logic• Save 1584 LCs to build equivalent function in logic• Dynamic 18-bit Barrel Shifter– Use two XtremeDSP slices– Use <strong>de</strong>dicated casca<strong>de</strong> routing and integrated 17-bit shift• Save 1449 LCs to build equivalent function in logic• 36-bit Loadable Counter– Use a single XtremeDSP slice, achieve 500 MHz performance• Save 540 LCs to build equivalent function in logicFPGA Introduction 27© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-5 FamilyOptimized for logic, Embed<strong>de</strong>d, Signal Processing, and High-Speed ConnectivityVirtex -5 P<strong>la</strong>tformsLX LXT SXT FXTLogic Logic/Serial DSP/Serial Emb./SerialLogicOn-chip RAMDSP CapabilitiesParallel I/OsSerial I/OsPowerPC ® ProcessorsFPGA Introduction 29© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Multiple P<strong>la</strong>tforms• Easy to create sub-families– LX : High-performance logicand parallel IO– LXT: High-performance logicwith serial connectivity– SXT: Extensive signal processingwith serial connectivity– FXT: Extensive processor oriented• Embed<strong>de</strong>d-oriented with HighestPerformance Serial Capabilities• Users can choose the best mixof resources to optimize costand performanceLXP<strong>la</strong>tformSXTP<strong>la</strong>tformLXTP<strong>la</strong>tformFXTP<strong>la</strong>tformFPGA Introduction 30© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Virtex-5 ArchitectureEnhanced36Kbit Dual-Port Block RAM /FIFO with Integrated ECC550 MHz Clock Management Tilewith DCM and PLLSelectIO with ChipSyncTechnology and XCITE DCINewMost Advanced High-PerformanceReal 6LUT Logic FabricPCI Express ® Endpoint BlockSystem Monitor Function withBuilt-in ADCAdvanced Configuration OptionsNext Generation PowerPC ®Embed<strong>de</strong>d Processor25x18 DSP Slice with IntegratedALURocketIO Transceiver OptionsLow-Power GTP: Up to 3.75 GbpsTri-Mo<strong>de</strong> 10/100/1000 MbpsHigh-Performance GTX: Up to 6.5 GbpsEthernet MACsFPGA Basic Architecture Introduction 31© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Advanced Logic Structure• True 6-input LUTs• Exclusive 64-bit distributedRAM option per LUT• Exclusive 32-bit or16-bit x 2 shift registerRAM64SRL32LUT6RAM64SRL32LUT6RAM64SRL32LUT6RAM64SRL32LUT6Register/LatchRegister/LatchRegister/LatchRegister/LatchFPGA Introduction 32© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


DSP48E• Virtex-5SX introduced a few new improvements in the DSP48E“enhanced” DSP block• The ad<strong>de</strong>r block was modified to become a mulifunctional ALU. Apattern compare was ad<strong>de</strong>d to support the <strong>de</strong>tection of saturation,overflow and un<strong>de</strong>rflow conditions• A 48-bit carry chain supports the propagation of partial sum andproduct carry’s so multiple DSP48E blocks can be chained to givehigher bit precision• ALU opco<strong>de</strong>s are dynamically controlled allowing functionalchanges on a clock cycle basisFPGA Introduction 33© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


BCOUTACOUTDSP48E BlockInclu<strong>de</strong>s a high performance ALU, pattern compare, and a multiplierPCOUTBAC1825480101B REGCED Q2-DeepA REGCED Q2-DeepC REGCED Q182548A:BM REGCED Q72 36 036 01017-bit shift17-bit shiftXYZ7OpMo<strong>de</strong>ALUMo<strong>de</strong>4CarryIn48P REGCED Q=C or MC4848PPATTERNDETECT48BCINACIN450 MHz operation in the slowest speed gra<strong>de</strong>PCINFPGA Introduction 34© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Spartan-3Designed for low-cost, high-volume applications18x18 bit Embed<strong>de</strong>dPipelined Multipliersfor efficient DSPSpartan-3B a n k3Bank 0 B a n k1Bank 24 I/O Banks,Support forUp to eight on-chipall I/O StandardsDigital Clock Managersincludingto support multiplePCI, DDR333,system clocksGuaranteed Density MigrationRSDS, mini-LVDSNumerous parts in the same packagePCI, PCIe, PCI-X and PCI EXPRESS are registered tra<strong>de</strong>marks and/or service marks of PCI-SIG.FPGA Introduction 36© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Modified SlicesSLICEM and SLICEL• Each Spartan-3 CLBcontains four slices– Simi<strong>la</strong>r to Virtex-II <strong>de</strong>vice• Slices are grouped in pairs– Left-hand SLICEM (Memory)• LUTs can be configured asmemory or SRL16– Right-hand SLICEL (Logic)• LUT can be used as logiconlySwitchMatrixLeft-Hand SLICEMCOUTSHIFTINSlice X0Y1Slice X0Y0Right-Hand SLICELCOUTSlice X1Y1Slice X1Y0Fast ConnectsSHIFTOUTCINCINFPGA Introduction 37© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Multiple Domain-optimized P<strong>la</strong>tformsFPGA Introduction 38© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Spartan-3ASpartan-3A DSP is a superset of Spartan-3ATrue 3.3vPPDS_25PPDS_33TMDS_33DDR 2Hot SwappingMinimized Power Rails• Power Management– Hibernate and Suspendmo<strong>de</strong>s• Minimized power rails• New I/O Standards• BRAM with Byte writeenable• SPI/BPI F<strong>la</strong>sh Interface• Hot swapping18K Block RAMsByte Write EnableImproved Bus AccessPowerManagementBank 2Bank 0Hibernate Mo<strong>de</strong>Suspend Mo<strong>de</strong>FPGA Introduction 39© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Spartan-3A DSP• Incorporates the primary features from earlier Virtexfamily DSP48 blocks• The DSP48A block supports full MAC support with a pread<strong>de</strong>rstage, multiplier, and add/accumu<strong>la</strong>te state• Dedicated DSP block offer the lowest cost/MAC in aFPGAFPGA Introduction 40© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


DSP48A BlockIncorporates primary features from V4 DSP48 and inclu<strong>de</strong>s a pre-ad<strong>de</strong>r stage• IntegratedXtremeDSP Slice– Application optimizedcapacity• 3400A – 126 DSP48As• 1800A – 84 DSP48As– Integrated pre-ad<strong>de</strong>roptimized for filters– 250 MHz operation, standardspeed gra<strong>de</strong>– Compatible with Virtex-DSP• Increased memory capacity and performance– Also important for embed<strong>de</strong>d processing, complex IP, etcFPGA Introduction 41© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Architecture AlignmentVirtex-6 FPGAsSpartan-6 FPGAsFIFO Logic760KLogic CellDeviceTri-mo<strong>de</strong> EMACSystem MonitorCommon ResourcesLUT-6 CLBBlockRAMDSP SlicesHigh-performance ClockingParallel I/OHSS Transceivers*PCIe ® Interface150KLogic CellDeviceHar<strong>de</strong>ned Memory Controllers3.3 Volt compatible I/O*Optimized for target application in each familyEnables IP Portability, Protects Design InvestmentsFPGA Introduction 43© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Addressing the Broad Range of TechnicalRequirementsSpartan-6 LXSpartan-6 LXTVirtex-6 LXTMarket SizeLowest costlogic + DSPLowest logic +high-speed serialVirtex-6 HXTVirtex-6 SXTHigh logic <strong>de</strong>nsity +serial connectivityUltra high-speed serialconnectivity + logicDSP + logic +serial connectivityApplication Market Segments+ 100s MoreFPGA Introduction 44© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Higher DSP Performance• Most advanced DSP architecture– New optional pre-ad<strong>de</strong>r for symmetric filters– 25x18 multiplier• High resolution filters• Efficient floating point support– ALU-like second stage enables mapping of advancedoperations• Programmable op-co<strong>de</strong>• SIMD support• Addition / Subtraction / Logic functions– Pattern <strong>de</strong>tector• Lowest power consumption• Highest DSP slice capacity– Up to 2K DSP SlicesFPGA Introduction 45© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


RegRegRegRegReason 1: FPGAs handle high computational workloadsSpeed up FIR Filters by implementing with parallel architectureProgrammable DSP - SequentialCoefficients256 clockcyclesnee<strong>de</strong>dData InX+RegData Out1 GHz256 clock cyclesMAC Unit= 4 MSPSData InC0FPGA - Fully Parallel ImplementationXC1C0 X256 operationsin 1 clock cycleC2500 MHzX+1 clock cycleC3Data OutX… C255= 500 MSPSXExample 256 TAP Filter ImplementationFPGA Introduction 47© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Reason 2: FPGAs are i<strong>de</strong>al for multi-channel DSP DesignsCan implement multiple channels running in parallel or time multiplex channels into one filter20MHzSamplesLPFLPFLPFLPFch1ch2ch3ch480MHzSamplesLPFMulti ChannelFilter• Many low sample rate channels can be multiplexed (e.g.TDM) and processed in the FPGA, at a high rate• Interpo<strong>la</strong>tion (using zeros) can also drive sample rates higherFPGA Introduction 48© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Reason 3: Customize Architectures to Suit your GoalsFPGAs allow Cost/Performance tra<strong>de</strong>offsParallel Semi-Parallel Serial× +××++++××++++D Q×++D Q×+SpeedOptimized for?CostFPGA Introduction 49© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


Reason 4: Lower System Cost through IntegrationImplement Interface Logic within FPGA to connect DSP functions to I/O and Memory DevicesAFEA/DA/DDDCDDCD/AD/ADDCDDCDUCDUCSDRAMMACsControlDUCDUCDSPProcs.FPGAMACsControlDSPCardHundreds ofTermination ResistorsQuadTRxSDRAMPowerPCFPGASSTL3Trans<strong>la</strong>torsQuadTRxASSPNetworkCardA/DA/DSDRAMControlPL4PowerPC PowerPC3.125 GbpsASSPD/AD/AMACs, DUCs,DDCs, LogicPowerPC PowerPCControl CORBASDRAMFPGA Introduction 50© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


RegRegRegRegRegRegRegRegRegThe XtremeDSP Slice AdvantageWithout XtremeDSP Slice, Parallel Ad<strong>de</strong>r Tree Consumes Logic ResourcesData InParallel Ad<strong>de</strong>r Tree ImplementationC0XC1+C0XC2+XC3Consumes Logic toImplement Ad<strong>de</strong>rs• 32 TAP filter implementation willconsume 1,461 logic cells toimplement ad<strong>de</strong>rs in fabric+XC4+XC5XC0C6XC7XC30Fabric and Routing MayReduce PerformanceXC31+ + +++Data OutVariableLatencyXFPGA Introduction 52© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


The XtremeDSP Slice AdvantageRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegRegWith XtremeDSP Slice, Parallel Ad<strong>de</strong>r Tree Consumes Zero Logic ResourcesParallel Ad<strong>de</strong>r Casca<strong>de</strong> ImplementationData InC0XC1XC2XC3XC4XC5XC6XC7XC30XC31X++++++++++Data Out32 TAP filter implementation implemented entirely with XtremeDSP SlicesFPGA Introduction 53© 2009 Xilinx, Inc. All Rights ReservedFor Aca<strong>de</strong>mic Use Only


SoftCoreSommaire1 Présentation2 UML3 Composant Matériel4 VHDL5 FPGA6 SoftCoreENSEA (ETIS / ENSEA) <strong>Approche</strong> Système <strong>de</strong> <strong>la</strong> <strong>Conception</strong> Printemps 2012 124 / 124


Embed<strong>de</strong>d Design with theMicroB<strong>la</strong>ze Soft Processor CoreFPGA and ASIC TechnologyComparison - 1© 2009 Xilinx, Inc. All Rights Reserved


Xilinx Embed<strong>de</strong>d Processor InnovationPerformanceIntegrationFlexibilityFeaturesPowerPC PowerPC 405405Hard Hard CoreCorein in Virtex-4 Virtex-4 FXFXFPGAPowerPC® PowerPC® 405FPGA405Hard Hard CoreCorein in Virtex®-IIVirtex®-IIPRO PRO FPGAFPGA32-bit 32-bit RISCRISCProcessorProcessorSoft Soft CoreCorePLB46 Embed<strong>de</strong>d Development Kit IPPowerPC 440 440Embed<strong>de</strong>d Block Block with withIntegratedInterconnectFPGA and 2000 ASIC Technology 2002 © 2007 2009 Xilinx, Inc. 2004 All Rights Reserved 20062008Comparison - 5


Supported FPGAsFPGA families– Spartan-3/3A/3AN/3A DSP/3E FPGA (MicroB<strong>la</strong>ze processor)– Spartan-6 (MicroB<strong>la</strong>ze Processor)– Virtex-4 FX (MicroB<strong>la</strong>ze and PowerPC 405 processors) and LX/SX FPGA(MicroB<strong>la</strong>ze processor)– Virtex-5 FXT (MicroB<strong>la</strong>ze and PowerPC 440 processor) LX/LXT FPGA(MicroB<strong>la</strong>ze)– Virtex-6 (MicroB<strong>la</strong>ze processor)FPGA and ASIC TechnologyComparison - 6© 2007 2009 Xilinx, Inc. All Rights Reserved


Embed<strong>de</strong>d Design in an FPGAEmbed<strong>de</strong>d <strong>de</strong>sign in an FPGA can consist of the following– FPGA hardware <strong>de</strong>sign• Processor system– MicroB<strong>la</strong>ze processor (soft core)– PowerPC processor (PPC440 hard core)– PLB or PLB v46 bus– PLB bus components• Other FPGA hardware– Peripherals can either be custom ma<strong>de</strong> by the user with a Xilinx bus interfaceor a library of pre-optimized peripherals are avai<strong>la</strong>bleFPGA and ASIC TechnologyComparison - 7© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor-Based Embed<strong>de</strong>d DesignBlockRAMFast SimplexLink0,1….15CustomFunctionsLocal MemoryBusCustomFunctionsMicroB<strong>la</strong>ze32-Bit RISC CoreUARTI-CacheBlockRAMD-CacheBlockRAMMemoryControllerPLB v46Off-ChipDDR2Possible inVirtex-5 FPGA FXTCacheLinkHi-SpeedPeripheralSPLBDedicated Hard IPPowerPC405 440 CorePLB v46MPLBEMACFPGA and ASIC TechnologyComparison - 8FLASH/SRAM/DDR2© 2007 2009 Xilinx, Inc. All Rights ReservedOff-ChipMemory


IP PeripheralsAll are inclu<strong>de</strong>d FREE!Bus infrastructure and bridge coresMemory and memory controller coresDebugPeripheralsArithmeticTimersInter-processor communicationExternal peripheral controllerDMA controllerPCIUser core temp<strong>la</strong>te…and Other coresFPGA and ASIC Technology© 2007 2009 Xilinx, Inc. All Rights ReservedComparison - 9


MicroB<strong>la</strong>ze Processor Block DiagramFPGA and ASIC TechnologyComparison - 11© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor Basic ArchitectureEmbed<strong>de</strong>d soft RISC processor– 32-bit address and data buses– 32-bit instruction word (three operands and two addressing mo<strong>de</strong>s)– 32 registers (32-bit wi<strong>de</strong>)– Three or five pipeline stages (three stages if area optimization is selected)– Big-endian formatBuses– Full Harvard architecture– PLB v46 (CoreConnect bus architecture standard), instruction, and data (user selectable)– LMB for connecting to local block RAM (faster), instruction, and data (user selectable)– Fast Simplex Links: <strong>de</strong>dicated, unidirectional point-to-point data streaming interfaces;support for up to 16 FSLs– Dedicated CacheLink ports for instruction and data caching with four-word cache linesize and critical word-first access capabilityFPGA and ASIC TechnologyComparison - 12© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor FeaturesALU– Hardware multipliers/DSP48– Barrel shifterFloating Point Unit (FPU)– Implements IEEE 754 single-precision, floating-point standards– Supports addition, subtraction, multiplication, division, and comparisonProgram counterInstruction <strong>de</strong>co<strong>de</strong>Instruction cache– Direct mapped– Configurable caching with CacheLink– Configurable size: 2 kB, 4 kB, 8 kB, 16 kB, 32 kB, 64 kBFPGA and ASIC TechnologyComparison - 13© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor PerformanceAll instructions take one clock cycle, except the following– Load and store (two clock cycles)– Multiply (two clock cycles)– Branches (three clock cycles, can be one clock cycle)Operating frequency – fast speed gra<strong>de</strong>, 5-stage pipeline– 307 MHz on Virtex-6 FPGA (-3)– 245 MHz on Virtex-5 FPGA (-3)– 154 MHz on Spartan®-6 FPGA (-3)– 119 MHz on Spartan-3 FPGA (-5)Performance of 1.15 DMIPS/MHzFabric utilization – in LUT’s, size optimized/speed optimized– 779/1,134 LUTs in Virtex-6 FPGA– 240/330 LUTs in Virtex-5 FPGA– 770/1,154 LUTs in Spartan-6 FPGA– 1,258/1,821 LUTs in Spartan-3 FPGAFPGA and ASIC TechnologyComparison - 14© 2007 2009 Xilinx, Inc. All Rights Reserved


New MicroB<strong>la</strong>ze Processor v7 Features New features and improvements– High-performance PLB v46 interface and PLB v46 peripherals– Memory Management Unit (MMU) implements virtual memory management• Virtual memory management provi<strong>de</strong>s greater control over memory protection,which is especially useful with applications that can use an RTOS• Note…the MicroB<strong>la</strong>ze processor MMU is compatible but does not have the samefunctionality as the PPC405 processor MMU– Processing improvements• New float-integer conversion and float-square root instructions• Speeds up– FP > Int conversion– Int > FP conversion– FP square rootFPGA and ASIC TechnologyComparison - 15© 2007 2009 Xilinx, Inc. All Rights Reserved


Buses 101Bus masters have the ability to initiate a bus transactionBus s<strong>la</strong>ves can only respond to a requestBus arbitration is a three-step process– A <strong>de</strong>vice requesting to become a bus master asserts a bus request signal– The arbiter continuously monitors the request and outputs an individual grantsignal to each master according to the master’s priority scheme and the state ofthe other master requests at that time– The requesting master samples its grant line until granted access. When thecurrent bus master releases the bus, the master then drives the address andcontrol lines to initiate a data transaction to a s<strong>la</strong>ve bus agent.Arbitration mechanisms– Fixed priority, round-robin, or hybridFPGA and ASIC TechnologyComparison - 16© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor Bus ExampleInstruction CacheLinkIPLB BusIICILMB BusIXCLILMB IPLBBRAMMicroB<strong>la</strong>zeDLMB DPLBDXCLDLMB BusData CacheLinkExt MemControllerExt MemDPLB BusUARTGPIOEthernetLCDBRAMINTCAll buses are 32 bitsPLBv46ARBFPGA and ASIC TechnologyComparison - 17© 2007 2009 Xilinx, Inc. All Rights Reserved


Local Memory Bus (LMB)The Local Memory Bus (LMB) provi<strong>de</strong>s single-cycle access to on-chip dualportblock RAM for MicroB<strong>la</strong>ze processorsThe LMB provi<strong>de</strong>s a simple synchronous protocol for efficient block RAMtransfersThe LMB provi<strong>de</strong>s a maximum guaranteed performance of 307 MHz inVirtex-6 FPGAs, for the local memory subsystemHarvard processor architecture– DLMB: data interface, local memory bus (block RAM only)– ILMB: instruction interface, local memory bus (block RAM only)FPGA and ASIC TechnologyComparison - 18© 2007 2009 Xilinx, Inc. All Rights Reserved


LMB TimingRules for generating an LMB clock– The MB, LMB, PLBv46 clock must be the same clockUse a timing period constraint on the processor clock line to insure p<strong>la</strong>ceand route timing closure– This is done for you in Base System Buil<strong>de</strong>r– If the period constraint is p<strong>la</strong>ced on an external FPGA clock pin it will be pushedthrough any DCMs and global buffers that drive the MicroB<strong>la</strong>ze processor clocklineFPGA and ASIC TechnologyComparison - 19© 2007 2009 Xilinx, Inc. All Rights Reserved


Bus SummaryCoreConnect BusesOther BusesFeaturePLB v46 DCR OCM LMBProcessor family PPC440, MicroB<strong>la</strong>ze PPC405 PPC405 MicroB<strong>la</strong>zeData bus width 32, 64, or 128 32 32 32Address bus width 32 10 32 32Clock rate, MHz (max) 1 100 125 375 125Masters (max/typical) 16/2-8 1/1 1/1 1/1S<strong>la</strong>ves (max/typical) 8/2-8 1/1 1/1 1/1Data rate (peak) 2 1600 MB/s 500 MB/s 500 MB/s 500 MB/sData rate (typical) 3 533 MB/s 4 100 MB/s 5 333 MB/s 6,7 333 MB/sConcurrent read/write Yes No No NoAddress pipelining Yes No No NoBus locking Yes No No NoRetry Yes No No NoTimeout Yes No No NoFixed/Variable Burst Yes No No NoCache Fill Yes No No NoTarget Word First Yes No No NoFPGA Resource Usage High Low Low LowFPGA and ASIC TechnologyComparison - 20© 2007 2009 Xilinx, Inc. All Rights Reserved


MicroB<strong>la</strong>ze Processor-Based Embed<strong>de</strong>d DesignBRAMFast SimplexLink0,1….15CustomFunctionsLocal MemoryBusCustomFunctionsMicroB<strong>la</strong>ze32-Bit RISC CoreUARTI-CacheBRAMD-CacheBRAMMemoryControllerPLB v46Off-ChipDDR2Possible inVirtex-5 FXTCacheLinkSPLBHi-SpeedPeripheralDedicated Hard IPPowerPC440 405 CorePLB v46MPLBEMACFSL ChannelsFPGA and ASIC TechnologyComparison - 21FLASH/SRAM/DDR2© 2007 2009 Xilinx, Inc. All Rights ReservedOff-ChipMemory


Fast Simplex Links (FSL)Unidirectional point-to-point FIFO-based communicationDedicated (unshared) and non-arbitrated architectureDedicated MicroB<strong>la</strong>ze processor C and ASM instructions for easy accessHigh-speed access in as little as two clocks on the processor si<strong>de</strong>; 600 MHzat the hardware interfaceAvai<strong>la</strong>ble in Xilinx P<strong>la</strong>tform Studio (XPS) as a bus interface library core fromHardware > Create or Import PeripheralFSL_M_ClkFSL_M_Data [0:31]FSL_M_ControlFSL_M_WriteFSL_M_FullFIFO32-bit dataFSL_S_ClkFSL_S_Data [0:31]FSL_S_ControlFSL_S_ReadFSL_S_ExistsFPGA and ASIC TechnologyComparison - 22FIFO Depth© 2007 2009 Xilinx, Inc. All Rights Reserved


FSL AdvantagesSimple, fast, and easy to useClock speed is not slowed down by new hardwareFSL is faster than a bus interface– Saves clock cyclesNo arbitration/address <strong>de</strong>co<strong>de</strong>/acknowledge cyclesDecoupled data clock from CPU allows for asynchronous operationMinimal FPGA fabric overheadMicroB<strong>la</strong>ze processor v7 allows for up to 16 parallel FSL channelsFPGA and ASIC TechnologyComparison - 23© 2007 2009 Xilinx, Inc. All Rights Reserved


Starting a Processor DesignMany vendors support evaluation and <strong>de</strong>moboards with Xilinx FPGAs– Xilinx– Avnet– NuHorizons– DigilentSpartan®-6SP605 FPGABase System Buil<strong>de</strong>r (BSB) is a wizard tofacilitate a fast processor-based system<strong>de</strong>sign by high abstraction, level-specificationentryVirtex®-5 FPGA ML507FPGA and ASIC TechnologyComparison - 26© 2007 2009 Xilinx, Inc. All Rights ReservedSpartan-3E FPGA 1600E


Create a New Project Using the BSBBSB enables fast <strong>de</strong>sign construction– Creates a completed p<strong>la</strong>tform andtest application that is ready todownload– Creates this system faster than youcould by editing the MHS directly– Automatically matches the pinout ofthe <strong>de</strong>sign to the boardThe Set Project Peripheral Repositoryoption is used for storing customperipherals and drivers in a reservedlocationFPGA and ASIC TechnologyComparison - 27© 2007 2009 Xilinx, Inc. All Rights Reserved


Selecting a BoardXilinx and its distributionpartners sell <strong>de</strong>mo boardswith a wi<strong>de</strong> range of ad<strong>de</strong>dcomponents– This dialog box allows you toquickly learn more about al<strong>la</strong>vai<strong>la</strong>ble <strong>de</strong>mo boards– It also allows you to installthe necessary BSB files ifyou want to target a <strong>de</strong>mofrom another vendor– Note that you can alsocreate your own BSB file fora custom boardFPGA and ASIC TechnologyComparison - 28© 2007 2009 Xilinx, Inc. All Rights Reserved


Selecting a ProcessorThe Base SystemBuil<strong>de</strong>r (BSB)supports theconstruction ofsingle- and dualprocessorsystemsFPGA and ASIC TechnologyComparison - 29© 2007 2009 Xilinx, Inc. All Rights Reserved


Configuring the ProcessorProcessor clock frequency isthe clock rate connecteddirectly to the processorBus clock frequency is theclock rate of all busperipherals in the systemThese selections wil<strong>la</strong>utomatically customize theclock generator moduleThe appropriate <strong>de</strong>buginterface is ad<strong>de</strong>dautomaticallyFPGA and ASIC TechnologyComparison - 30© 2007 2009 Xilinx, Inc. All Rights Reserved


Configuring the I/O InterfacesChoose the peripherals youneed from those avai<strong>la</strong>ble foryour <strong>de</strong>mo boardPeripherals can be ad<strong>de</strong>d orremovedMost peripherals arecustomizable via drop-downlists when selectedMost peripherals supportthe use of interruptsInternal peripherals existfor all board hardwareconfigurationsFPGA and ASIC TechnologyComparison - 31© 2007 2009 Xilinx, Inc. All Rights Reserved


A Good Start on a Processor DesignBasic PowerPCprocessor systemBasicMicroB<strong>la</strong>zeprocessorsystemFPGA and ASIC TechnologyComparison - 32© 2007 2009 Xilinx, Inc. All Rights Reserved


How to Convert a PLB-basedEmbed<strong>de</strong>d System to an AXIbasedSystemFPGA and ASIC TechnologyComparison - 1© 2009 Xilinx, Inc. All Rights Reserved


AXI is Part of AMBAAdvanced Microcontroller Bus ArchitecturePerformanceFPGA and ASIC TechnologyComparison - 3© 2007 2009 Xilinx, Inc. All Rights Reserved


The ARM AXIIs an interface and protocol <strong>de</strong>finition and is not a bus standard– Preproduction in the EDK 12.3 release– Currently, only targets the MicroB<strong>la</strong>ze soft processor core• Only for Spartan-6 and Virtex-6 <strong>de</strong>vices• Most EDK peripherals will support AXI with the EDK 13.1 releaseWho should migrate their <strong>de</strong>sign?– Anyone that believes the features are beneficial (AXI advantages are comingup)– Anyone building an embed<strong>de</strong>d <strong>de</strong>sign that will target the next generation ofproduct families (after Spartan-6 and Virtex-6)FPGA and ASIC TechnologyComparison - 4© 2007 2009 Xilinx, Inc. All Rights Reserved


Pre-Production AXIISE Design Suite 12.3 is a pre-production release for <strong>de</strong>signs that use AXI IP– The AXI IP peripherals in this release have not yet completed qualification foruse in production <strong>de</strong>signs– Some wizard functionality in Xilinx P<strong>la</strong>tform Studio does not yet fully supportAXI-based <strong>de</strong>signsFor ISE Design Suite 12.3, pre-production status applies only to <strong>de</strong>signsmaking use of AXI IP peripherals– If you <strong>de</strong>sign does not use these peripherals then your okFPGA and ASIC TechnologyComparison - 5© 2007 2009 Xilinx, Inc. All Rights Reserved


AXI is an InterfaceSpecificationProcessorPLBPLB46“Shared Access” BusAXI MastersInterconnectAXI S<strong>la</strong>vesPeripheralsPLBPLBPLBAXI AXI Interconnect IP IPImplementation is is not not<strong>de</strong>scribed in in the the spec specSeveral companies build build and andsell sell “AXI “AXI interconnect IP” IP”Xilinx is is building its its own ownAXIAXIAXI AXIAXI AXIAXIAXIAXIAXIArbiterFPGA and ASIC TechnologyComparison - 6AXI is an interfacespecification, not a busspecification© 2007 2009 Xilinx, Inc. All Rights ReservedArrows indicate master/s<strong>la</strong>ve re<strong>la</strong>tionship,not direction of dataflowMasterS<strong>la</strong>ve


Why use AXI?Higher performance– AXI allows systems to be optimized for highest Fmax, maximum throughput, lower<strong>la</strong>tency or some combination of those attributes. This flexibility enables you to build themost optimized products for your marketsEasier to use– By consolidating a broad array of interfaces into AXI, you only need to know one familyof interfaces, regardless of whether they are embed<strong>de</strong>d, DSP or logic users. Thismakes it easier to integrate IP from different domains, as well as <strong>de</strong>veloping your ownIPEnable ecosystem– Partners are embracing the move to AXI: an open, wi<strong>de</strong>ly adopted interface standard.Many of them are already creating IP targeting AXI and other AMBA® interfaces. Thisgives you a greater catalog of IP, ultimately leading to faster time to marketFPGA and ASIC TechnologyComparison - 7© 2007 2009 Xilinx, Inc. All Rights Reserved


AXI is Part of AMBAEnhancements for FPGAsAMBA 3.0(2003)Same SpecAMBA 4.0(Just Announced)Interface Features Simi<strong>la</strong>r toMemory Map /FullFPGA and ASIC TechnologyComparison - 8Traditional Address/Data Burst(single address, multiple data)© 2007 2009 Xilinx, Inc. All Rights ReservedPLBv46, PCIStreaming Data-Only, Burst Local Link / DSPInterfaces / FIFO / FSLLiteTraditional Address/Data—No Burst(single address, single data)PLBv46-singleOPB


Design ConversionRe-building the Embed<strong>de</strong>d System is usually best– This is NOT difficult• Adding processors, busses, and IP is literally “drag-and-drop”• Custom IP…has some challengesIf the IP was built with the IP Wizard, the IP can be migrated using temp<strong>la</strong>tesprovi<strong>de</strong>d in the following solution record– http://www.xilinx.com/support/answers/37425.htmIf the IP cannot be altered to AXI, just add the AXI-to-PLB bridge component– This is <strong>de</strong>scribed in the Xilinx AXI Reference Gui<strong>de</strong>If the IP was built from scratch, refer to the “Memory Mapped IP FeatureAdoption and Support,” in the Xilinx AXI Reference Gui<strong>de</strong>FPGA and ASIC TechnologyComparison - 9© 2007 2009 Xilinx, Inc. All Rights Reserved

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!