Changeset 98 for trunk/IPs/systemC/processor/Morpheo/Documentation
- Timestamp:
- Dec 31, 2008, 11:18:08 AM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Documentation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Documentation/doc/document-morpheo-vhdl_generation/document-morpheo-vhdl_generation-fr.tex
r93 r98 32 32 33 33 %Table des matières et des figures 34 %\tableofcontents35 %\newpage34 \tableofcontents 35 \newpage 36 36 %\listoffigures 37 37 -
trunk/IPs/systemC/processor/Morpheo/Documentation/doc/document-morpheo-vhdl_generation/tex/document-morpheo-vhdl_generation-fr.tex
r95 r98 62 62 63 63 Par exemple pour la 2 ème interface de lecture d'un banc de registre : 64 \begin{verbatim} 64 \lstparam{VHDL} 65 \begin{lstlisting} 65 66 in_READ_1_VAL : in std_logic; 66 67 out_READ_1_ACK : out std_logic; 67 68 in_READ_1_ADDRESS : in std_logic_vector(8 downto 0); 68 69 out_READ_1_DATA : out std_logic_vector(31 downto 0); 69 \end{ verbatim}70 \end{lstlisting} 70 71 71 72 Chaque composent (aussi bien combinatoire que séquentielle) possède un signal d'horloge et un signal de reset. (Ce dernier est actif à l'état bas). Ils ont tout les deux le même nom quelque soit le composant. 72 \begin{verbatim} 73 \lstparam{VHDL} 74 \begin{lstlisting} 73 75 in_CLOCK : in std_logic; 74 76 in_NRESET : in std_logic; 75 \end{ verbatim}77 \end{lstlisting} 76 78 77 79 \subSection{Types} … … 79 81 Le type de base utilisé est le {\it std\_logic\_vector} (ou std\_logic si le vecteur est sur un seul bit). Pour cela on utilise la fonction suivante : 80 82 81 \begin{verbatim} 83 \lstparam{C++} 84 \begin{lstlisting} 82 85 std::string std_logic (uint32_t size); 83 \end{ verbatim}86 \end{lstlisting} 84 87 85 88 Pour accéder à une partie du vecteur on utilise la fonction {\it std\_logic\_range}. Elle a les prototypes suivant : 86 \begin{verbatim} 87 std::string std_logic_range (uint32_t size, 88 uint32_t max , 89 uint32_t min , 90 bool force=false); 91 std::string std_logic_range (uint32_t max , 92 uint32_t min , 93 bool force=false); 94 std::string std_logic_range (uint32_t size, 95 bool force=false); 96 \end{verbatim} 89 \lstparam{C++} 90 \begin{lstlisting} 91 std::string std_logic_range (uint32_t size, 92 uint32_t max , 93 uint32_t min); 94 std::string std_logic_range (uint32_t max , 95 uint32_t min); 96 std::string std_logic_range (uint32_t size); 97 std::string _std_logic_range (uint32_t size, 98 uint32_t max , 99 uint32_t min); 100 std::string _std_logic_range (uint32_t max , 101 uint32_t min); 102 std::string _std_logic_range (uint32_t size); 103 \end{lstlisting} 97 104 98 105 La première fonction fais un test sur la taille que la seconde ne fait pas. 99 106 L'argument de la troisième définit la taille (ce qui implique que la borne minimum est 0 et la borne maximum est size-1). 100 Toute les surcharges ont le bolléen optionnel {\it force}. S'il est à faux, alors des tests seront effectués sur les bornes et la taille, sinon aucun test n'est effectué.107 Toute les fonctions avec préfixé par un underscore n'effectue pas de test sur les bornes. 101 108 102 109 Par exemple : 103 110 \begin{verbatim} 104 std_logic_range(4,false) renvoie "(3 downto 0)".105 std_logic_range(1,false) renvoie "(0)".106 std_logic_range(1,true) renvoie "(0 downto 0)".111 std_logic_range(4) renvoie "(3 downto 0)". 112 std_logic_range(1) renvoie "(0)". 113 _std_logic_range(1) renvoie "(0 downto 0)". 107 114 \end{verbatim} 108 115 109 116 Pour les types plus complexe, la classe {\it Vhdl} possède une méthode générique. Le premier argument est le nom du type le second est le type. 110 117 111 \begin{verbatim} 118 \lstparam{C++} 119 \begin{lstlisting} 112 120 void set_type (std::string name, 113 121 std::string type); 114 \end{ verbatim}122 \end{lstlisting} 115 123 116 124 L'exemple suivant définit un type représentat un tableau de {\it nb\_word} mots de {\it size\_word} bit chacun : 117 \begin{verbatim} 125 \lstparam{C++} 126 \begin{lstlisting} 118 127 vhdl->set_type ("Tregfile", 119 128 "array "+std_logic_range(nb_word)+" of "+std_logic(size_word)); 120 \end{ verbatim}129 \end{lstlisting} 121 130 122 131 \subSection{Constantes} … … 124 133 La déclaration de constante, ce fait avec la méthode {\it set\_constant} de la classe {\it Vhdl}. Les différentes surcharges de cette méthode est le type des arguments {\it type} et {\it init}. 125 134 126 \begin{verbatim} 135 \lstparam{C++} 136 \begin{lstlisting} 127 137 void set_constant (std::string name, 128 138 std::string type, … … 134 144 uint32_t size, 135 145 uint32_t init); 136 \end{ verbatim}146 \end{lstlisting} 137 147 138 148 Par exemple pour coder les états d'un automate à 5 états en One Hot : 139 \begin{verbatim} 149 \lstparam{C++} 150 \begin{lstlisting} 140 151 vhdl->set_constant ("State_idle",5,1); 141 \end{ verbatim}152 \end{lstlisting} 142 153 143 154 Dans le cas de signaux de type {\it std\_logic}, au lieu de déclarer des constantes, il existe deux fonctions permettant d'utiliser des constantes directement dans le corps du composant. 144 155 La première est {\it std\_logic\_others}. Elle permet de définir des constantes dont soit les bits sont à pleins un soit à plein zéro. 145 156 146 \begin{verbatim} 157 \lstparam{C++} 158 \begin{lstlisting} 147 159 std::string std_logic_others (uint32_t size, 148 160 bool cst ); 149 \end{ verbatim}161 \end{lstlisting} 150 162 151 163 Pour toute les autres constantes, la méthode {\it std\_logic\_conv} transforme un entier en {\it std\_logic\_vector}. 152 164 153 \begin{verbatim} 165 \lstparam{C++} 166 \begin{lstlisting} 154 167 std::string std_logic_conv (uint32_t size, 155 168 std::string value); 156 169 std::string std_logic_conv (uint32_t size, 157 170 uint32_t value); 158 \end{ verbatim}171 \end{lstlisting} 159 172 160 173 … … 162 175 163 176 Les signaux internes sont définit grâce au méthode {\it set\_signal}. Le premier argument est le nom du signal. Le second est soit un type soit une taille (dans le cas où le type est un {\it std\_logic\_vector}). 164 \begin{verbatim} 177 \lstparam{C++} 178 \begin{lstlisting} 165 179 void set_signal (std::string name, 166 180 std::string type); 167 181 void set_signal (std::string name, 168 182 uint32_t size); 169 \end{ verbatim}183 \end{lstlisting} 170 184 171 185 La méthode est également surchargé si le signal à besoin d'une initialisation. 172 186 173 \begin{verbatim} 187 \lstparam{C++} 188 \begin{lstlisting} 174 189 void set_signal (std::string name, 175 190 std::string type, … … 181 196 uint32_t size, 182 197 uint32_t init); 183 \end{ verbatim}198 \end{lstlisting} 184 199 185 200 En vhdl il est possible de renommer une champ d'un signal. Ceci ce fait à l'aide de la fonction {\it set\_alias}. Elle prend 4 arguments. Le premier étant le nom du signal après le renommage. le second est soit le type, soit la taille du {\it std\_logic\_vector} du signal rénommé. Les deux derniers conserné le signal à renommé : le nom de ce dernier ainsi que l'intervalle. Pour le dernier paramètre il est recommandé d'utilisé la fonction {\it std\_logic\_range}. 186 201 187 \begin{verbatim} 202 \lstparam{C++} 203 \begin{lstlisting} 188 204 void set_alias (std::string name1 , 189 205 std::string type1 , … … 194 210 std::string name2 , 195 211 std::string range2); 196 \end{verbatim} 197 212 \end{lstlisting} 198 213 199 214 \Section{VHDL : comportement}\label{vhdl_body} … … 203 218 Il n'y a pas de fonction aidant à l'écriture du Vhdl. 204 219 La méthode {\it set\_body} permet de définir une ligne de code VHDL. Un retour à la ligne est automatiquement inséré. Le premier argument est pour l'indentation. 205 \begin{verbatim} 220 \lstparam{C++} 221 \begin{lstlisting} 206 222 void set_body (uint32_t depth, 207 223 std::string text ); 208 224 void set_body (std::string text ); 209 \end{ verbatim}225 \end{lstlisting} 210 226 211 227 Pour les commentaires, il y a la fonction {\it set\_comment}. 212 \begin{verbatim} 228 \lstparam{C++} 229 \begin{lstlisting} 213 230 void set_comment (uint32_t depth, 214 231 std::string text ); 215 232 void set_comment (std::string text ); 216 \end{verbatim} 217 218 233 \end{lstlisting} 219 234 220 235 \Section{VHDL : structurelle}\label{vhdl_structural} 221 236 237 \subSection{Description du fichier {\it Component\_vhdl.cpp}} 238 Les modèles systemC structurelle sont des modèles qui instancie d'autre modèle. Il n'y a pas de description comportementale. Ces modèles sont générés automatiquement. 239 Par contre les modèles systemC comportementales peuvent être décrit par un modèle VHDL mixte (incluant une description comportementale et des instances d'autre composant). 240 241 Les modèles génériques sont dans le répertoire {\it IPs/systemC/processor/Morpheo/Behavioural/Generic}. 242 243 \lstparam{C++} 244 \begin{lstlisting}[caption={Component\_vhdl.cpp}, label=component_vhdl.cpp] 245 void component::vhdl (void) 246 { 247 Vhdl * vhdl = new Vhdl (_name); 248 249 _interfaces->set_port(vhdl); 250 _component->vhdl_instance(vhdl); 251 252 vhdl_declaration (vhdl); 253 vhdl_body (vhdl); 254 255 vhdl->generate_file(); 256 257 delete vhdl; 258 }; 259 \end{lstlisting} 260 261 262 La première étape est d'éditer le fichier {\it Component\_vhdl.cpp}. Le listing \ref{component_vhdl.cpp} représente le contenu de ce fichier. 263 \begin{itemize} 264 \item Ligne 3 : Déclaration et construction de la variable {\it vhdl} qui est du type {\it Vhdl}. 265 \item Ligne 5 : Ajout dans le modèle VHDL des interfaces présentes dans le modèle SystemC. (cf fichiers Component.h). 266 \item Ligne 6 : Ajout dans le modèle VHDL des composants internes dans le modèle SystemC. (cf fichiers Component.h et Component\_allocation.cpp). 267 \item Ligne 8 : Ajout dans le modèle VHDL des déclarations définit dans le fichiers Component\_vhdl\_declaration.cpp (cf section \ref{vhdl_declaration}). 268 \item Ligne 9 : Ajout dans le modèle VHDL de la description comportemental définit dans le fichiers Component\_vhdl\_body.cpp (cf section \ref{vhdl_body}). 269 \item Ligne 11 : Génération des fichiers VHDL. Le nom du fichier est construit à partir du nom fournit lors de la construction de la variable {\it vhdl}. 270 \item Ligne 13 : Destruction de l'objet. 271 \end{itemize} 272 273 Pour la suite, nous allons supposer l'instanciation d'une FIFO. 274 275 \subSection{Ajout d'une instance} 276 277 Dans le fichier Component\_vhdl.cpp : 278 \begin{enumerate} 279 \item Inclure la définition de la classe désirée. 280 \lstparam{C++} 281 \begin{lstlisting} 282 #include "Behavioural/Generic/Queue/include/Queue.h" 283 \end{lstlisting} 284 \item Creer les paramètres du modèles. 285 \lstparam{C++} 286 \begin{lstlisting} 287 morpheo::behavioural::generic::queue::Parameters * param_queue; 288 param_queue = new morpheo::behavioural::generic::queue::Parameters 289 (16, //size_queue 290 32);//size_data 291 \end{lstlisting} 292 \item Creer le modèle 293 \lstparam{C++} 294 \begin{lstlisting} 295 morpheo::behavioural::generic::queue::Queue * queue; 296 std::string queue_name = _name + "_queue"; 297 298 queue = new morpheo::behavioural::generic::queue::Queue 299 (queue_name.c_str() // nom du modèle 300 #ifdef STATISTICS 301 ,NULL // Pas paramètres pour les statistiques 302 #endif 303 ,param_queue // Paramètres de la file 304 ,USE_VHDL); // Utilisation du modèle VHDL 305 \end{lstlisting} 306 \item Inclure le modèle dans la liste des composants internes 307 \lstparam{C++} 308 \begin{lstlisting} 309 _component->set_component(queue->_component 310 #ifdef POSITION 311 , 20, 20, 20, 20 312 // Coordonée pour l'outil de visualisation 313 #endif 314 , INSTANCE_LIBRARY 315 // Instancier uniquement les libraries 316 ); 317 \end{lstlisting} 318 \item Indiquer dans le fichier Makefile.deps que le composant dépends de ce modèle. 319 \lstparam{make} 320 \begin{lstlisting} 321 # Inclure les dépendances 322 ifndef Queue 323 include $(DIR_MORPHEO)/Behavioural/Generic/Queue/Makefile.deps 324 endif 325 326 # Inclure les librairies 327 Component_LIBRARY = -lComponent \ 328 $(Queue_LIBRARY) 329 330 # Les chemins vers les libraries 331 Component_DIR_LIBRARY = -L$(Component_DIR)/lib \ 332 $(Queue_DIR_LIBRARY) 333 334 # Construction de la librarie ``Component'' 335 Component_library : 336 @\ 337 $(MAKE) Queue_library; \ 338 $(MAKE) --directory=$(Component_DIR) --makefile=Makefile; 339 340 # Effacement des fichiers générés 341 Component_library_clean : 342 @\ 343 $(MAKE) Queue_library_clean; \ 344 $(MAKE) --directory=$(Component_DIR) --makefile=Makefile clean; 345 \end{lstlisting} 346 \end{enumerate} 347 348 \subSection{Instanciation} 349 L'instanciation ce fait comme avec des composants VHDL classique : 350 \lstparam{C++} 351 \begin{lstlisting} 352 vhdl->set_comment(0,""); 353 vhdl->set_comment(0,"-----------------------------------"); 354 vhdl->set_comment(0,"-- Instance queue "); 355 vhdl->set_comment(0,"-----------------------------------"); 356 vhdl->set_comment(0,""); 357 358 vhdl->set_body (0,"instance_"+_name+"_queue : "+_name+"_queue"); 359 vhdl->set_body (0,"port map ("); 360 vhdl->set_body (1," in_CLOCK \t=>\t in_CLOCK "); 361 vhdl->set_body (1,", in_NRESET \t=>\t in_NRESET"); 362 vhdl->set_body (1,", in_INSERT_VAL \t=>\tinternal_QUEUE_INSERT_VAL"); 363 vhdl->set_body (1,",out_INSERT_ACK \t=>\tinternal_QUEUE_INSERT_ACK"); 364 vhdl->set_body (1,", in_INSERT_DATA \t=>\tinternal_QUEUE_INSERT_DATA"); 365 vhdl->set_body (1,",out_RETIRE_VAL \t=>\tinternal_QUEUE_RETIRE_VAL"); 366 vhdl->set_body (1,", in_RETIRE_ACK \t=>\tinternal_QUEUE_RETIRE_ACK"); 367 vhdl->set_body (1,",out_RETIRE_DATA \t=>\tinternal_QUEUE_RETIRE_DATA"); 368 vhdl->set_body (0,");"); 369 \end{lstlisting} 370 222 371 \Section{Exemples}\label{example} 223 372 224 373 \subSection{Banc de Registres Monolithique} 225 374 375 \subsubSection{Fichier RegisterFile\_Monolithic\_vhdl.cpp} 376 377 \lstparam{C++} 378 \begin{lstlisting}[caption={RegisterFile\_Monolithic\_vhdl.cpp}] 379 void RegisterFile_Monolithic::vhdl (void) 380 { 381 Vhdl * vhdl = new Vhdl (_name); 382 383 _interfaces->set_port (vhdl); 384 _component ->vhdl_instance(vhdl); 385 386 vhdl_declaration (vhdl); 387 vhdl_body (vhdl); 388 389 vhdl->generate_file(); 390 391 delete vhdl; 392 }; 393 \end{lstlisting} 394 395 226 396 \subsubSection{Fichier RegisterFile\_Monolithic\_vhdl\_declaration.cpp} 227 \begin{verbatim} 397 398 \lstparam{C++} 399 \begin{lstlisting}[caption={RegisterFile\_Monolithic\_vhdl\_declaration.cpp}] 228 400 void RegisterFile_Monolithic::vhdl_declaration (Vhdl * & vhdl) 229 401 { … … 234 406 vhdl->set_signal ("reg_DATA", "Tregfile"); 235 407 }; 236 \end{verbatim} 408 \end{lstlisting} 409 237 410 \subsubSection{Fichier RegisterFile\_Monolithic\_vhdl\_body.cpp} 238 \begin{verbatim} 411 412 \lstparam{C++} 413 \begin{lstlisting}[caption={RegisterFile\_Monolithic\_vhdl\_body.cpp}] 239 414 void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl) 240 415 { 241 416 vhdl->set_body (0,""); 242 417 vhdl->set_comment(0,"---------------------------------------------------"); 243 vhdl->set_comment(0," Ack itement");418 vhdl->set_comment(0," Ack"); 244 419 vhdl->set_comment(0,"---------------------------------------------------"); 245 420 vhdl->set_body (0,""); … … 295 470 vhdl->set_body (0,"end process RegisterFile_write;"); 296 471 }; 297 \end{ verbatim}472 \end{lstlisting} 298 473 299 474 \subsubSection{Fichier RegisterFile\_Monolithic.vhdl} 300 \begin{verbatim} 301 library ieee; 475 476 \lstparam{VHDL} 477 \begin{lstlisting}[caption={RegisterFile\_Monolithic.cpp}] 478 library ieee; 302 479 use ieee.numeric_bit.all; 303 480 use ieee.numeric_std.all; … … 362 539 end process RegisterFile_write; 363 540 end behavioural; 364 365 \end{verbatim} 541 \end{lstlisting} 542 543 \subSection{Tampon entre la boucle d'exécutione et le buffer de réordonnancement} 544 545 \subsubSection{Fichier Execute\_queue\_vhdl.cpp} 546 547 \lstparam{C++} 548 \begin{lstlisting}[caption={Execute\_queue\_vhdl.cpp}] 549 void Execute_queue::vhdl (void) 550 { 551 morpheo::behavioural::generic::queue::Parameters * param_queue; 552 553 param_queue = new morpheo::behavioural::generic::queue::Parameters 554 (_param->_size_queue, 555 _param->_size_internal_queue 556 ); 557 558 morpheo::behavioural::generic::queue::Queue * queue; 559 560 std::string queue_name = _name + "_queue"; 561 queue = new morpheo::behavioural::generic::queue::Queue 562 (queue_name.c_str() 563 #ifdef STATISTICS 564 ,NULL 565 #endif 566 ,param_queue 567 ,USE_VHDL); 568 569 _component->set_component(queue->_component 570 #ifdef POSITION 571 , 50, 50, 50, 50 572 #endif 573 , INSTANCE_LIBRARY 574 ); 575 576 Vhdl * vhdl = new Vhdl (_name); 577 578 _interfaces->set_port(vhdl); 579 _component->vhdl_instance(vhdl); 580 581 vhdl_declaration (vhdl); 582 vhdl_body (vhdl); 583 584 vhdl->generate_file(); 585 586 delete vhdl; 587 }; 588 \end{lstlisting} 589 590 \subsubSection{Fichier Execute\_queue\_vhdl\_declaration.cpp} 591 592 \lstparam{C++} 593 \begin{lstlisting}[caption={Execute\_queue\_vhdl\_declaration.cpp}] 594 void Execute_queue::vhdl_declaration (Vhdl * & vhdl) 595 { 596 vhdl->set_alias ("internal_QUEUE_INSERT_VAL ", 597 1, 598 " in_EXECUTE_QUEUE_IN_VAL", 599 std_logic_range(1)); 600 vhdl->set_alias ("internal_QUEUE_INSERT_ACK ", 601 1, 602 "out_EXECUTE_QUEUE_IN_ACK", 603 std_logic_range(1)); 604 vhdl->set_signal ("internal_QUEUE_INSERT_DATA", 605 _param->_size_internal_queue); 606 vhdl->set_signal ("internal_QUEUE_RETIRE_DATA", 607 _param->_size_internal_queue); 608 vhdl->set_alias ("internal_QUEUE_RETIRE_VAL ", 609 1, 610 "out_EXECUTE_QUEUE_OUT_VAL", 611 std_logic_range(1)); 612 vhdl->set_alias ("internal_QUEUE_RETIRE_ACK ", 613 1, 614 " in_EXECUTE_QUEUE_OUT_ACK", 615 std_logic_range(1)); 616 617 uint32_t min = 0; 618 uint32_t max, size; 619 620 if(_param->_have_port_context_id ) 621 { 622 size = _param->_size_context_id; 623 max = min-1+size; 624 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_CONTEXT_ID ", 625 std_logic(size), 626 "internal_QUEUE_RETIRE_DATA", 627 std_logic_range(_param->_size_internal_queue,max,min)); 628 min = max+1; 629 } 630 if(_param->_have_port_front_end_id ) 631 { 632 size = _param->_size_front_end_id; 633 max = min-1+size; 634 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_FRONT_END_ID ", 635 std_logic(size), 636 "internal_QUEUE_RETIRE_DATA", 637 std_logic_range(_param->_size_internal_queue,max,min)); 638 min = max+1; 639 } 640 if(_param->_have_port_ooo_engine_id ) 641 { 642 size = _param->_size_ooo_engine_id; 643 max = min-1+size; 644 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID ", 645 std_logic(size), 646 "internal_QUEUE_RETIRE_DATA", 647 std_logic_range(_param->_size_internal_queue,max,min)); 648 min = max+1; 649 } 650 if(_param->_have_port_rob_ptr) 651 { 652 size = _param->_size_rob_ptr; 653 max = min-1+size; 654 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_PACKET_ID ", 655 std_logic(size), 656 "internal_QUEUE_RETIRE_DATA", 657 std_logic_range(_param->_size_internal_queue,max,min)); 658 min = max+1; 659 } 660 661 size = _param->_size_special_data; 662 max = min-1+size; 663 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_FLAGS ", 664 std_logic(size), 665 "internal_QUEUE_RETIRE_DATA", 666 std_logic_range(_param->_size_internal_queue,max,min)); 667 min = max+1; 668 669 size = _param->_size_exception; 670 max = min-1+size; 671 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_EXCEPTION ", 672 std_logic(size), 673 "internal_QUEUE_RETIRE_DATA", 674 std_logic_range(_param->_size_internal_queue,max,min)); 675 min = max+1; 676 677 size = 1; 678 max = min-1+size; 679 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE ", 680 std_logic(size), 681 "internal_QUEUE_RETIRE_DATA", 682 std_logic_range(_param->_size_internal_queue,max,min)); 683 min = max+1; 684 685 size = _param->_size_instruction_address; 686 max = min-1+size; 687 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_ADDRESS ", 688 std_logic(size), 689 "internal_QUEUE_RETIRE_DATA", 690 std_logic_range(_param->_size_internal_queue,max,min)); 691 min = max+1; 692 693 size = _param->_size_general_data; 694 max = min-1+size; 695 vhdl->set_alias ("internal_EXECUTE_QUEUE_OUT_DATA ", 696 std_logic(size), 697 "internal_QUEUE_RETIRE_DATA", 698 std_logic_range(_param->_size_internal_queue,max,min)); 699 min = max+1; 700 }; 701 \end{lstlisting} 702 703 \subsubSection{Fichier Execute\_queue\_vhdl\_body.cpp} 704 705 \lstparam{C++} 706 \begin{lstlisting}[caption={Execute\_queue\_vhdl\_body.cpp}] 707 void Execute_queue::vhdl_body (Vhdl * & vhdl) 708 { 709 vhdl->set_comment(0,""); 710 vhdl->set_comment(0,"-----------------------------------"); 711 vhdl->set_comment(0,"-- Instance queue "); 712 vhdl->set_comment(0,"-----------------------------------"); 713 vhdl->set_comment(0,""); 714 715 vhdl->set_body (0,"instance_"+_name+"_queue : "+_name+"_queue"); 716 vhdl->set_body (0,"port map ("); 717 vhdl->set_body (1," in_CLOCK \t=>\t in_CLOCK "); 718 vhdl->set_body (1,", in_NRESET \t=>\t in_NRESET"); 719 vhdl->set_body (1,", in_INSERT_VAL \t=>\tinternal_QUEUE_INSERT_VAL"); 720 vhdl->set_body (1,",out_INSERT_ACK \t=>\tinternal_QUEUE_INSERT_ACK"); 721 vhdl->set_body (1,", in_INSERT_DATA \t=>\tinternal_QUEUE_INSERT_DATA"); 722 vhdl->set_body (1,",out_RETIRE_VAL \t=>\tinternal_QUEUE_RETIRE_VAL"); 723 vhdl->set_body (1,", in_RETIRE_ACK \t=>\tinternal_QUEUE_RETIRE_ACK"); 724 vhdl->set_body (1,",out_RETIRE_DATA \t=>\tinternal_QUEUE_RETIRE_DATA"); 725 vhdl->set_body (0,");"); 726 727 vhdl->set_comment(0,""); 728 vhdl->set_comment(0,"-----------------------------------"); 729 vhdl->set_comment(0,"-- Input Buffer "); 730 vhdl->set_comment(0,"-----------------------------------"); 731 vhdl->set_comment(0,""); 732 733 { 734 uint32_t min = 0; 735 uint32_t max, size; 736 uint32_t size_queue = _param->_size_internal_queue; 737 738 if(_param->_have_port_context_id ) 739 { 740 size = _param->_size_context_id; 741 max = min-1+size; 742 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 743 " <= in_EXECUTE_QUEUE_IN_CONTEXT_ID;"); 744 min = max+1; 745 } 746 if(_param->_have_port_front_end_id ) 747 { 748 size = _param->_size_front_end_id; 749 max = min-1+size; 750 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 751 " <= in_EXECUTE_QUEUE_IN_FRONT_END_ID;"); 752 min = max+1; 753 } 754 if(_param->_have_port_ooo_engine_id ) 755 { 756 size = _param->_size_ooo_engine_id; 757 max = min-1+size; 758 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 759 " <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID;"); 760 min = max+1; 761 } 762 if(_param->_have_port_rob_ptr) 763 { 764 size = _param->_size_rob_ptr; 765 max = min-1+size; 766 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 767 " <= in_EXECUTE_QUEUE_IN_PACKET_ID;"); 768 min = max+1; 769 } 770 771 size = _param->_size_special_data; 772 max = min-1+size; 773 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 774 " <= in_EXECUTE_QUEUE_IN_FLAGS;"); 775 min = max+1; 776 777 size = _param->_size_exception; 778 max = min-1+size; 779 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 780 " <= in_EXECUTE_QUEUE_IN_EXCEPTION;"); 781 min = max+1; 782 783 size = 1; 784 max = min-1+size; 785 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 786 " <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE;"); 787 min = max+1; 788 789 size = _param->_size_instruction_address; 790 max = min-1+size; 791 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 792 " <= in_EXECUTE_QUEUE_IN_ADDRESS;"); 793 min = max+1; 794 795 size = _param->_size_general_data; 796 max = min-1+size; 797 vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(size_queue,max,min)+ 798 " <= in_EXECUTE_QUEUE_IN_DATA;"); 799 min = max+1; 800 } 801 802 vhdl->set_comment(0,""); 803 vhdl->set_comment(0,"-----------------------------------"); 804 vhdl->set_comment(0,"-- Output Buffer "); 805 vhdl->set_comment(0,"-----------------------------------"); 806 vhdl->set_comment(0,""); 807 808 if(_param->_have_port_context_id) 809 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID "+ 810 " <= internal_EXECUTE_QUEUE_OUT_CONTEXT_ID ;"); 811 if(_param->_have_port_front_end_id) 812 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID "+ 813 " <= internal_EXECUTE_QUEUE_OUT_FRONT_END_ID ;"); 814 if(_param->_have_port_ooo_engine_id) 815 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID"+ 816 " <= internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID;"); 817 if(_param->_have_port_rob_ptr) 818 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_PACKET_ID "+ 819 " <= internal_EXECUTE_QUEUE_OUT_PACKET_ID ;"); 820 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FLAGS "+ 821 " <= internal_EXECUTE_QUEUE_OUT_FLAGS ;"); 822 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_EXCEPTION "+ 823 " <= internal_EXECUTE_QUEUE_OUT_EXCEPTION ;"); 824 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE "+ 825 " <= internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE ;"); 826 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_ADDRESS "+ 827 " <= internal_EXECUTE_QUEUE_OUT_ADDRESS ;"); 828 vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_DATA "+ 829 " <= internal_EXECUTE_QUEUE_OUT_DATA ;"); 830 }; 831 \end{lstlisting} 832 833 \subsubSection{Fichier Execute\_queue.vhdl} 834 835 \lstparam{VHDL} 836 \begin{lstlisting}[caption={Execute\_queue.cpp}] 837 library ieee; 838 use ieee.numeric_bit.all; 839 use ieee.numeric_std.all; 840 use ieee.std_logic_1164.all; 841 use ieee.std_logic_arith.all; 842 use ieee.std_logic_misc.all; 843 --use ieee.std_logic_signed.all; 844 use ieee.std_logic_unsigned.all; 845 --use ieee.std_logic_textio.all; 846 847 library work; 848 use work.Execute_queue_0_Pack.all; 849 use work.Execute_queue_0_queue_Pack.all; 850 851 entity Execute_queue_0 is 852 port ( 853 in_CLOCK : in std_logic; 854 in_NRESET : in std_logic; 855 in_EXECUTE_QUEUE_IN_VAL : in std_logic; 856 out_EXECUTE_QUEUE_IN_ACK : out std_logic; 857 in_EXECUTE_QUEUE_IN_CONTEXT_ID : in std_logic; 858 in_EXECUTE_QUEUE_IN_FRONT_END_ID : in std_logic; 859 in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID : in std_logic; 860 in_EXECUTE_QUEUE_IN_PACKET_ID : in std_logic_vector(5 downto 0); 861 in_EXECUTE_QUEUE_IN_FLAGS : in std_logic_vector(1 downto 0); 862 in_EXECUTE_QUEUE_IN_EXCEPTION : in std_logic_vector(4 downto 0); 863 in_EXECUTE_QUEUE_IN_NO_SEQUENCE : in std_logic; 864 in_EXECUTE_QUEUE_IN_ADDRESS : in std_logic_vector(31 downto 0); 865 in_EXECUTE_QUEUE_IN_DATA : in std_logic_vector(31 downto 0); 866 out_EXECUTE_QUEUE_OUT_VAL : out std_logic; 867 in_EXECUTE_QUEUE_OUT_ACK : in std_logic; 868 out_EXECUTE_QUEUE_OUT_CONTEXT_ID : out std_logic; 869 out_EXECUTE_QUEUE_OUT_FRONT_END_ID : out std_logic; 870 out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID : out std_logic; 871 out_EXECUTE_QUEUE_OUT_PACKET_ID : out std_logic_vector(5 downto 0); 872 out_EXECUTE_QUEUE_OUT_FLAGS : out std_logic_vector(1 downto 0); 873 out_EXECUTE_QUEUE_OUT_EXCEPTION : out std_logic_vector(4 downto 0); 874 out_EXECUTE_QUEUE_OUT_NO_SEQUENCE : out std_logic; 875 out_EXECUTE_QUEUE_OUT_ADDRESS : out std_logic_vector(31 downto 0); 876 out_EXECUTE_QUEUE_OUT_DATA : out std_logic_vector(31 downto 0) 877 ); 878 end Execute_queue_0; 879 880 architecture behavioural of Execute_queue_0 is 881 882 signal internal_QUEUE_INSERT_DATA : std_logic_vector(80 downto 0); 883 signal internal_QUEUE_RETIRE_DATA : std_logic_vector(80 downto 0); 884 885 alias internal_QUEUE_INSERT_VAL : std_logic is 886 in_EXECUTE_QUEUE_IN_VAL; 887 alias internal_QUEUE_INSERT_ACK : std_logic is 888 out_EXECUTE_QUEUE_IN_ACK; 889 alias internal_QUEUE_RETIRE_VAL : std_logic is 890 out_EXECUTE_QUEUE_OUT_VAL; 891 alias internal_QUEUE_RETIRE_ACK : std_logic is 892 in_EXECUTE_QUEUE_OUT_ACK; 893 alias internal_EXECUTE_QUEUE_OUT_CONTEXT_ID : std_logic is 894 internal_QUEUE_RETIRE_DATA (0); 895 alias internal_EXECUTE_QUEUE_OUT_FRONT_END_ID : std_logic is 896 internal_QUEUE_RETIRE_DATA (1); 897 alias internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID : std_logic is 898 internal_QUEUE_RETIRE_DATA (2); 899 alias internal_EXECUTE_QUEUE_OUT_PACKET_ID : std_logic_vector(5 downto 0) is 900 internal_QUEUE_RETIRE_DATA (8 downto 3); 901 alias internal_EXECUTE_QUEUE_OUT_FLAGS : std_logic_vector(1 downto 0) is 902 internal_QUEUE_RETIRE_DATA (10 downto 9); 903 alias internal_EXECUTE_QUEUE_OUT_EXCEPTION : std_logic_vector(4 downto 0) is 904 internal_QUEUE_RETIRE_DATA (15 downto 11); 905 alias internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE : std_logic is 906 internal_QUEUE_RETIRE_DATA (16); 907 alias internal_EXECUTE_QUEUE_OUT_ADDRESS : std_logic_vector(31 downto 0) is 908 internal_QUEUE_RETIRE_DATA (48 downto 17); 909 alias internal_EXECUTE_QUEUE_OUT_DATA : std_logic_vector(31 downto 0) is 910 internal_QUEUE_RETIRE_DATA (80 downto 49); 911 912 begin 913 -- 914 -- ----------------------------------- 915 -- -- Instance queue 916 -- ----------------------------------- 917 -- 918 instance_Execute_queue_0_queue : Execute_queue_0_queue 919 port map ( 920 in_CLOCK => in_CLOCK 921 , in_NRESET => in_NRESET 922 , in_INSERT_VAL => internal_QUEUE_INSERT_VAL 923 ,out_INSERT_ACK => internal_QUEUE_INSERT_ACK 924 , in_INSERT_DATA => internal_QUEUE_INSERT_DATA 925 ,out_RETIRE_VAL => internal_QUEUE_RETIRE_VAL 926 , in_RETIRE_ACK => internal_QUEUE_RETIRE_ACK 927 ,out_RETIRE_DATA => internal_QUEUE_RETIRE_DATA 928 ); 929 -- 930 -- ----------------------------------- 931 -- -- Input Buffer 932 -- ----------------------------------- 933 -- 934 internal_QUEUE_INSERT_DATA (0) <= in_EXECUTE_QUEUE_IN_CONTEXT_ID; 935 internal_QUEUE_INSERT_DATA (1) <= in_EXECUTE_QUEUE_IN_FRONT_END_ID; 936 internal_QUEUE_INSERT_DATA (2) <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID; 937 internal_QUEUE_INSERT_DATA (8 downto 3) <= in_EXECUTE_QUEUE_IN_PACKET_ID; 938 internal_QUEUE_INSERT_DATA (10 downto 9) <= in_EXECUTE_QUEUE_IN_FLAGS; 939 internal_QUEUE_INSERT_DATA (15 downto 11) <= in_EXECUTE_QUEUE_IN_EXCEPTION; 940 internal_QUEUE_INSERT_DATA (16) <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE; 941 internal_QUEUE_INSERT_DATA (48 downto 17) <= in_EXECUTE_QUEUE_IN_ADDRESS; 942 internal_QUEUE_INSERT_DATA (80 downto 49) <= in_EXECUTE_QUEUE_IN_DATA; 943 -- 944 -- ----------------------------------- 945 -- -- Output Buffer 946 -- ----------------------------------- 947 -- 948 out_EXECUTE_QUEUE_OUT_CONTEXT_ID <= internal_EXECUTE_QUEUE_OUT_CONTEXT_ID; 949 out_EXECUTE_QUEUE_OUT_FRONT_END_ID <= internal_EXECUTE_QUEUE_OUT_FRONT_END_ID; 950 out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID <= internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID; 951 out_EXECUTE_QUEUE_OUT_PACKET_ID <= internal_EXECUTE_QUEUE_OUT_PACKET_ID; 952 out_EXECUTE_QUEUE_OUT_FLAGS <= internal_EXECUTE_QUEUE_OUT_FLAGS; 953 out_EXECUTE_QUEUE_OUT_EXCEPTION <= internal_EXECUTE_QUEUE_OUT_EXCEPTION; 954 out_EXECUTE_QUEUE_OUT_NO_SEQUENCE <= internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE; 955 out_EXECUTE_QUEUE_OUT_ADDRESS <= internal_EXECUTE_QUEUE_OUT_ADDRESS; 956 out_EXECUTE_QUEUE_OUT_DATA <= internal_EXECUTE_QUEUE_OUT_DATA; 957 958 end behavioural; 959 \end{lstlisting} 960 366 961 367 962 \Section {Test du VHDL}\label{testbench} … … 388 983 \item Nous ne vérifions pas la compatibilité au bit près des données présente sur une interface qui ne fait pas de transaction lors d'un cycle. 389 984 \end{itemize} 985 986 \lstparam{VHDL} 987 \begin{lstlisting}[caption={Execute\_queue\_Testbench.vhdl}] 988 library ieee; 989 use ieee.numeric_bit.all; 990 use ieee.numeric_std.all; 991 use ieee.std_logic_1164.all; 992 use ieee.std_logic_arith.all; 993 use ieee.std_logic_misc.all; 994 --use ieee.std_logic_signed.all; 995 use ieee.std_logic_unsigned.all; 996 --use ieee.std_logic_textio.all; 997 998 library work; 999 use work.Execute_queue_0_Pack.all; 1000 1001 entity Execute_queue_0_Testbench is 1002 end Execute_queue_0_Testbench; 1003 1004 architecture behavioural of Execute_queue_0_Testbench is 1005 1006 signal in_CLOCK : std_logic := '0'; 1007 signal in_NRESET : std_logic := '0'; 1008 signal in_EXECUTE_QUEUE_IN_VAL : std_logic; 1009 signal out_EXECUTE_QUEUE_IN_ACK : std_logic; 1010 signal out_EXECUTE_QUEUE_IN_ACK_test : std_logic; 1011 signal in_EXECUTE_QUEUE_IN_PACKET_ID : std_logic_vector(3 downto 0); 1012 signal in_EXECUTE_QUEUE_IN_FLAGS : std_logic_vector(1 downto 0); 1013 signal in_EXECUTE_QUEUE_IN_EXCEPTION : std_logic_vector(4 downto 0); 1014 signal in_EXECUTE_QUEUE_IN_NO_SEQUENCE : std_logic; 1015 signal in_EXECUTE_QUEUE_IN_ADDRESS : std_logic_vector(31 downto 0); 1016 signal in_EXECUTE_QUEUE_IN_DATA : std_logic_vector(31 downto 0); 1017 signal out_EXECUTE_QUEUE_OUT_VAL : std_logic; 1018 signal out_EXECUTE_QUEUE_OUT_VAL_test : std_logic; 1019 signal in_EXECUTE_QUEUE_OUT_ACK : std_logic; 1020 signal out_EXECUTE_QUEUE_OUT_PACKET_ID : std_logic_vector(3 downto 0); 1021 signal out_EXECUTE_QUEUE_OUT_PACKET_ID_test : std_logic_vector(3 downto 0); 1022 signal out_EXECUTE_QUEUE_OUT_FLAGS : std_logic_vector(1 downto 0); 1023 signal out_EXECUTE_QUEUE_OUT_FLAGS_test : std_logic_vector(1 downto 0); 1024 signal out_EXECUTE_QUEUE_OUT_EXCEPTION : std_logic_vector(4 downto 0); 1025 signal out_EXECUTE_QUEUE_OUT_EXCEPTION_test : std_logic_vector(4 downto 0); 1026 signal out_EXECUTE_QUEUE_OUT_NO_SEQUENCE : std_logic; 1027 signal out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test : std_logic; 1028 signal out_EXECUTE_QUEUE_OUT_ADDRESS : std_logic_vector(31 downto 0); 1029 signal out_EXECUTE_QUEUE_OUT_ADDRESS_test : std_logic_vector(31 downto 0); 1030 signal out_EXECUTE_QUEUE_OUT_DATA : std_logic_vector(31 downto 0); 1031 signal out_EXECUTE_QUEUE_OUT_DATA_test : std_logic_vector(31 downto 0); 1032 1033 signal counter : natural; 1034 signal test : std_logic; 1035 signal interface_test : std_logic; 1036 signal interface_test_ok : std_logic; 1037 signal interface_execute_queue_in_test : std_logic; 1038 signal interface_execute_queue_in_test_ok : std_logic; 1039 signal interface_execute_queue_in_test_transaction : std_logic; 1040 signal interface_execute_queue_in_test_tmp : std_logic; 1041 signal interface_execute_queue_out_test : std_logic; 1042 signal interface_execute_queue_out_test_ok : std_logic; 1043 signal interface_execute_queue_out_test_transaction : std_logic; 1044 signal interface_execute_queue_out_test_tmp : std_logic; 1045 1046 begin 1047 1048 ------------------------------------------------------ 1049 -- Component - Intanciation 1050 ------------------------------------------------------ 1051 1052 instance_Execute_queue_0 : Execute_queue_0 1053 port map ( 1054 in_CLOCK => in_CLOCK 1055 , in_NRESET => in_NRESET 1056 , in_EXECUTE_QUEUE_IN_VAL => in_EXECUTE_QUEUE_IN_VAL 1057 ,out_EXECUTE_QUEUE_IN_ACK => out_EXECUTE_QUEUE_IN_ACK 1058 , in_EXECUTE_QUEUE_IN_PACKET_ID => in_EXECUTE_QUEUE_IN_PACKET_ID 1059 , in_EXECUTE_QUEUE_IN_FLAGS => in_EXECUTE_QUEUE_IN_FLAGS 1060 , in_EXECUTE_QUEUE_IN_EXCEPTION => in_EXECUTE_QUEUE_IN_EXCEPTION 1061 , in_EXECUTE_QUEUE_IN_NO_SEQUENCE => in_EXECUTE_QUEUE_IN_NO_SEQUENCE 1062 , in_EXECUTE_QUEUE_IN_ADDRESS => in_EXECUTE_QUEUE_IN_ADDRESS 1063 , in_EXECUTE_QUEUE_IN_DATA => in_EXECUTE_QUEUE_IN_DATA 1064 ,out_EXECUTE_QUEUE_OUT_VAL => out_EXECUTE_QUEUE_OUT_VAL 1065 , in_EXECUTE_QUEUE_OUT_ACK => in_EXECUTE_QUEUE_OUT_ACK 1066 ,out_EXECUTE_QUEUE_OUT_PACKET_ID => out_EXECUTE_QUEUE_OUT_PACKET_ID 1067 ,out_EXECUTE_QUEUE_OUT_FLAGS => out_EXECUTE_QUEUE_OUT_FLAGS 1068 ,out_EXECUTE_QUEUE_OUT_EXCEPTION => out_EXECUTE_QUEUE_OUT_EXCEPTION 1069 ,out_EXECUTE_QUEUE_OUT_NO_SEQUENCE => out_EXECUTE_QUEUE_OUT_NO_SEQUENCE 1070 ,out_EXECUTE_QUEUE_OUT_ADDRESS => out_EXECUTE_QUEUE_OUT_ADDRESS 1071 ,out_EXECUTE_QUEUE_OUT_DATA => out_EXECUTE_QUEUE_OUT_DATA 1072 ); 1073 ------------------------------------------------------ 1074 -- interface "" 1075 ------------------------------------------------------ 1076 1077 -- Test exhaustive 1078 1079 interface_test_ok <= '1' when true 1080 else '0'; 1081 1082 interface_test <= '1' when (in_NRESET = '0') else interface_test_ok; 1083 ------------------------------------------------------ 1084 -- interface "execute_queue_in" 1085 ------------------------------------------------------ 1086 1087 with counter select 1088 in_EXECUTE_QUEUE_IN_VAL <= 1089 '0' when 0, 1090 '0' when 1, 1091 '0' when 2, 1092 '0' when 3, 1093 '0' when 4, 1094 '1' when 5, 1095 '1' when 6, 1096 '0' when 7, 1097 '0' when 8, 1098 '1' when 9, 1099 '1' when 10, 1100 '1' when 11, 1101 '1' when 12, 1102 '1' when 13, 1103 '1' when 14, 1104 '1' when 15, 1105 '1' when 16, 1106 '0' when 17, 1107 '1' when 18, 1108 '1' when 19, 1109 '1' when 20, 1110 '0' when 21, 1111 '1' when 22, 1112 '1' when 23, 1113 '0' when 24, 1114 '1' when 25, 1115 '0' when 26, 1116 '0' when others; 1117 1118 with counter select 1119 out_EXECUTE_QUEUE_IN_ACK_test <= 1120 '0' when 0, 1121 '1' when 1, 1122 '1' when 2, 1123 '1' when 3, 1124 '1' when 4, 1125 '1' when 5, 1126 '1' when 6, 1127 '1' when 7, 1128 '1' when 8, 1129 '1' when 9, 1130 '1' when 10, 1131 '1' when 11, 1132 '1' when 12, 1133 '1' when 13, 1134 '1' when 14, 1135 '1' when 15, 1136 '1' when 16, 1137 '1' when 17, 1138 '1' when 18, 1139 '1' when 19, 1140 '1' when 20, 1141 '1' when 21, 1142 '1' when 22, 1143 '1' when 23, 1144 '1' when 24, 1145 '1' when 25, 1146 '1' when 26, 1147 '0' when others; 1148 1149 with counter select 1150 in_EXECUTE_QUEUE_IN_PACKET_ID <= 1151 "0000" when 0, 1152 "0000" when 1, 1153 "0000" when 2, 1154 "0000" when 3, 1155 "0000" when 4, 1156 "0000" when 5, 1157 "0001" when 6, 1158 "0001" when 7, 1159 "0001" when 8, 1160 "0010" when 9, 1161 "0011" when 10, 1162 "0100" when 11, 1163 "0101" when 12, 1164 "0110" when 13, 1165 "0111" when 14, 1166 "1000" when 15, 1167 "1001" when 16, 1168 "1001" when 17, 1169 "1010" when 18, 1170 "1011" when 19, 1171 "1100" when 20, 1172 "1100" when 21, 1173 "1101" when 22, 1174 "1110" when 23, 1175 "1110" when 24, 1176 "1111" when 25, 1177 "1111" when 26, 1178 (others => '0') when others; 1179 1180 with counter select 1181 in_EXECUTE_QUEUE_IN_FLAGS <= 1182 "00" when 0, 1183 "00" when 1, 1184 "00" when 2, 1185 "00" when 3, 1186 "00" when 4, 1187 "11" when 5, 1188 "11" when 6, 1189 "11" when 7, 1190 "11" when 8, 1191 "00" when 9, 1192 "11" when 10, 1193 "11" when 11, 1194 "11" when 12, 1195 "10" when 13, 1196 "01" when 14, 1197 "01" when 15, 1198 "11" when 16, 1199 "11" when 17, 1200 "10" when 18, 1201 "00" when 19, 1202 "11" when 20, 1203 "11" when 21, 1204 "10" when 22, 1205 "01" when 23, 1206 "01" when 24, 1207 "01" when 25, 1208 "01" when 26, 1209 (others => '0') when others; 1210 1211 with counter select 1212 in_EXECUTE_QUEUE_IN_EXCEPTION <= 1213 "00000" when 0, 1214 "00000" when 1, 1215 "00000" when 2, 1216 "00000" when 3, 1217 "00000" when 4, 1218 "10001" when 5, 1219 "10010" when 6, 1220 "10010" when 7, 1221 "10010" when 8, 1222 "11011" when 9, 1223 "10011" when 10, 1224 "10001" when 11, 1225 "11000" when 12, 1226 "11011" when 13, 1227 "00001" when 14, 1228 "00001" when 15, 1229 "01010" when 16, 1230 "01010" when 17, 1231 "01100" when 18, 1232 "01100" when 19, 1233 "11011" when 20, 1234 "11011" when 21, 1235 "00101" when 22, 1236 "01001" when 23, 1237 "01001" when 24, 1238 "10001" when 25, 1239 "10001" when 26, 1240 (others => '0') when others; 1241 1242 with counter select 1243 in_EXECUTE_QUEUE_IN_NO_SEQUENCE <= 1244 '0' when 0, 1245 '0' when 1, 1246 '0' when 2, 1247 '0' when 3, 1248 '0' when 4, 1249 '1' when 5, 1250 '1' when 6, 1251 '1' when 7, 1252 '1' when 8, 1253 '1' when 9, 1254 '1' when 10, 1255 '1' when 11, 1256 '1' when 12, 1257 '1' when 13, 1258 '1' when 14, 1259 '1' when 15, 1260 '1' when 16, 1261 '1' when 17, 1262 '1' when 18, 1263 '1' when 19, 1264 '1' when 20, 1265 '1' when 21, 1266 '1' when 22, 1267 '1' when 23, 1268 '1' when 24, 1269 '1' when 25, 1270 '1' when 26, 1271 '0' when others; 1272 1273 with counter select 1274 in_EXECUTE_QUEUE_IN_ADDRESS <= 1275 "00000000000000000000000000000000" when 0, 1276 "00000000000000000000000000000000" when 1, 1277 "00000000000000000000000000000000" when 2, 1278 "00000000000000000000000000000000" when 3, 1279 "00000000000000000000000000000000" when 4, 1280 "00101010111010001001010001001010" when 5, 1281 "01111001111000101010100111100011" when 6, 1282 "01111001111000101010100111100011" when 7, 1283 "01111001111000101010100111100011" when 8, 1284 "00010001100100001100110111100111" when 9, 1285 "01000001101001111100010011001001" when 10, 1286 "00100101011100010011000010100011" when 11, 1287 "01100111011000111000010001011110" when 12, 1288 "01110001111100110010010001010100" when 13, 1289 "01110011011110111000110111011100" when 14, 1290 "01000100000010111010110111111100" when 15, 1291 "01010001111010101101001101101011" when 16, 1292 "01010001111010101101001101101011" when 17, 1293 "00011101010011101101010000111011" when 18, 1294 "00111000010000110111111111011011" when 19, 1295 "01111001101000011101111010101010" when 20, 1296 "01111001101000011101111010101010" when 21, 1297 "01100100100110111011011101111100" when 22, 1298 "00010101101101011010111101011100" when 23, 1299 "00010101101101011010111101011100" when 24, 1300 "01010111100110111110010011110001" when 25, 1301 "01010111100110111110010011110001" when 26, 1302 (others => '0') when others; 1303 1304 with counter select 1305 in_EXECUTE_QUEUE_IN_DATA <= 1306 "00000000000000000000000000000000" when 0, 1307 "00000000000000000000000000000000" when 1, 1308 "00000000000000000000000000000000" when 2, 1309 "00000000000000000000000000000000" when 3, 1310 "00000000000000000000000000000000" when 4, 1311 "01100010010101010101100011101100" when 5, 1312 "01110101010001011110000101000110" when 6, 1313 "01110101010001011110000101000110" when 7, 1314 "01110101010001011110000101000110" when 8, 1315 "01100110111011110100001110001101" when 9, 1316 "01101011011010000000011110011010" when 10, 1317 "01100010101110111101100101011010" when 11, 1318 "01110101101000101010100011010100" when 12, 1319 "00101100101010001000011000010001" when 13, 1320 "01101100111010101111000010000111" when 14, 1321 "00000101000001110010001101100111" when 15, 1322 "00101101010100010111011110010110" when 16, 1323 "00101101010100010111011110010110" when 17, 1324 "01110010010110100000011011111011" when 18, 1325 "01110110010001001010010001011100" when 19, 1326 "01110101110001101100001100111010" when 20, 1327 "01110101110001101100001100111010" when 21, 1328 "00100111010110101100011110010100" when 22, 1329 "01110100000100100010011010111011" when 23, 1330 "01110100000100100010011010111011" when 24, 1331 "00110001000011000101000010110011" when 25, 1332 "00110001000011000101000010110011" when 26, 1333 (others => '0') when others; 1334 1335 -- Test partial 1336 1337 interface_execute_queue_in_test_ok <= '1' when true 1338 and out_EXECUTE_QUEUE_IN_ACK = out_EXECUTE_QUEUE_IN_ACK_test 1339 else '0'; 1340 1341 interface_execute_queue_in_test_transaction <= '1' 1342 and in_EXECUTE_QUEUE_IN_VAL 1343 and out_EXECUTE_QUEUE_IN_ACK 1344 ; 1345 1346 with counter select 1347 interface_execute_queue_in_test_tmp <= 1348 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1349 when 5, 1350 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1351 when 6, 1352 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1353 when 9, 1354 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1355 when 10, 1356 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1357 when 11, 1358 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1359 when 12, 1360 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1361 when 13, 1362 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1363 when 14, 1364 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1365 when 15, 1366 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1367 when 16, 1368 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1369 when 18, 1370 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1371 when 19, 1372 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1373 when 20, 1374 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1375 when 22, 1376 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1377 when 23, 1378 interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 1379 when 25, 1380 not interface_execute_queue_in_test_transaction when others; 1381 1382 interface_execute_queue_in_test <= '1' when (in_NRESET = '0') else 1383 interface_execute_queue_in_test_tmp; 1384 ------------------------------------------------------ 1385 -- interface "execute_queue_out" 1386 ------------------------------------------------------ 1387 1388 with counter select 1389 out_EXECUTE_QUEUE_OUT_VAL_test <= 1390 '0' when 0, 1391 '0' when 1, 1392 '0' when 2, 1393 '0' when 3, 1394 '0' when 4, 1395 '0' when 5, 1396 '1' when 6, 1397 '1' when 7, 1398 '0' when 8, 1399 '0' when 9, 1400 '1' when 10, 1401 '1' when 11, 1402 '1' when 12, 1403 '1' when 13, 1404 '1' when 14, 1405 '1' when 15, 1406 '1' when 16, 1407 '1' when 17, 1408 '0' when 18, 1409 '1' when 19, 1410 '1' when 20, 1411 '1' when 21, 1412 '1' when 22, 1413 '1' when 23, 1414 '1' when 24, 1415 '0' when 25, 1416 '1' when 26, 1417 '0' when others; 1418 1419 with counter select 1420 in_EXECUTE_QUEUE_OUT_ACK <= 1421 '0' when 0, 1422 '0' when 1, 1423 '0' when 2, 1424 '0' when 3, 1425 '0' when 4, 1426 '1' when 5, 1427 '1' when 6, 1428 '1' when 7, 1429 '1' when 8, 1430 '0' when 9, 1431 '1' when 10, 1432 '1' when 11, 1433 '1' when 12, 1434 '1' when 13, 1435 '1' when 14, 1436 '1' when 15, 1437 '1' when 16, 1438 '1' when 17, 1439 '1' when 18, 1440 '1' when 19, 1441 '1' when 20, 1442 '0' when 21, 1443 '1' when 22, 1444 '1' when 23, 1445 '1' when 24, 1446 '1' when 25, 1447 '1' when 26, 1448 '0' when others; 1449 1450 with counter select 1451 out_EXECUTE_QUEUE_OUT_PACKET_ID_test <= 1452 "0000" when 0, 1453 "0000" when 1, 1454 "0000" when 2, 1455 "0000" when 3, 1456 "0000" when 4, 1457 "0000" when 5, 1458 "0000" when 6, 1459 "0001" when 7, 1460 "0001" when 8, 1461 "0001" when 9, 1462 "0010" when 10, 1463 "0011" when 11, 1464 "0100" when 12, 1465 "0101" when 13, 1466 "0110" when 14, 1467 "0111" when 15, 1468 "1000" when 16, 1469 "1001" when 17, 1470 "1001" when 18, 1471 "1010" when 19, 1472 "1011" when 20, 1473 "1100" when 21, 1474 "1100" when 22, 1475 "1101" when 23, 1476 "1110" when 24, 1477 "1110" when 25, 1478 "1111" when 26, 1479 (others => '0') when others; 1480 1481 with counter select 1482 out_EXECUTE_QUEUE_OUT_FLAGS_test <= 1483 "00" when 0, 1484 "00" when 1, 1485 "00" when 2, 1486 "00" when 3, 1487 "00" when 4, 1488 "00" when 5, 1489 "11" when 6, 1490 "11" when 7, 1491 "11" when 8, 1492 "11" when 9, 1493 "00" when 10, 1494 "11" when 11, 1495 "11" when 12, 1496 "11" when 13, 1497 "10" when 14, 1498 "01" when 15, 1499 "01" when 16, 1500 "11" when 17, 1501 "11" when 18, 1502 "10" when 19, 1503 "00" when 20, 1504 "11" when 21, 1505 "11" when 22, 1506 "10" when 23, 1507 "01" when 24, 1508 "01" when 25, 1509 "01" when 26, 1510 (others => '0') when others; 1511 1512 with counter select 1513 out_EXECUTE_QUEUE_OUT_EXCEPTION_test <= 1514 "00000" when 0, 1515 "00000" when 1, 1516 "00000" when 2, 1517 "00000" when 3, 1518 "00000" when 4, 1519 "00000" when 5, 1520 "10001" when 6, 1521 "10010" when 7, 1522 "10010" when 8, 1523 "10010" when 9, 1524 "11011" when 10, 1525 "10011" when 11, 1526 "10001" when 12, 1527 "11000" when 13, 1528 "11011" when 14, 1529 "00001" when 15, 1530 "00001" when 16, 1531 "01010" when 17, 1532 "01010" when 18, 1533 "01100" when 19, 1534 "01100" when 20, 1535 "11011" when 21, 1536 "11011" when 22, 1537 "00101" when 23, 1538 "01001" when 24, 1539 "01001" when 25, 1540 "10001" when 26, 1541 (others => '0') when others; 1542 1543 with counter select 1544 out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test <= 1545 '0' when 0, 1546 '0' when 1, 1547 '0' when 2, 1548 '0' when 3, 1549 '0' when 4, 1550 '0' when 5, 1551 '1' when 6, 1552 '1' when 7, 1553 '1' when 8, 1554 '1' when 9, 1555 '1' when 10, 1556 '1' when 11, 1557 '1' when 12, 1558 '1' when 13, 1559 '1' when 14, 1560 '1' when 15, 1561 '1' when 16, 1562 '1' when 17, 1563 '1' when 18, 1564 '1' when 19, 1565 '1' when 20, 1566 '1' when 21, 1567 '1' when 22, 1568 '1' when 23, 1569 '1' when 24, 1570 '1' when 25, 1571 '1' when 26, 1572 '0' when others; 1573 1574 with counter select 1575 out_EXECUTE_QUEUE_OUT_ADDRESS_test <= 1576 "00000000000000000000000000000000" when 0, 1577 "00000000000000000000000000000000" when 1, 1578 "00000000000000000000000000000000" when 2, 1579 "00000000000000000000000000000000" when 3, 1580 "00000000000000000000000000000000" when 4, 1581 "00000000000000000000000000000000" when 5, 1582 "00101010111010001001010001001010" when 6, 1583 "01111001111000101010100111100011" when 7, 1584 "01111001111000101010100111100011" when 8, 1585 "01111001111000101010100111100011" when 9, 1586 "00010001100100001100110111100111" when 10, 1587 "01000001101001111100010011001001" when 11, 1588 "00100101011100010011000010100011" when 12, 1589 "01100111011000111000010001011110" when 13, 1590 "01110001111100110010010001010100" when 14, 1591 "01110011011110111000110111011100" when 15, 1592 "01000100000010111010110111111100" when 16, 1593 "01010001111010101101001101101011" when 17, 1594 "01010001111010101101001101101011" when 18, 1595 "00011101010011101101010000111011" when 19, 1596 "00111000010000110111111111011011" when 20, 1597 "01111001101000011101111010101010" when 21, 1598 "01111001101000011101111010101010" when 22, 1599 "01100100100110111011011101111100" when 23, 1600 "00010101101101011010111101011100" when 24, 1601 "00010101101101011010111101011100" when 25, 1602 "01010111100110111110010011110001" when 26, 1603 (others => '0') when others; 1604 1605 with counter select 1606 out_EXECUTE_QUEUE_OUT_DATA_test <= 1607 "00000000000000000000000000000000" when 0, 1608 "00000000000000000000000000000000" when 1, 1609 "00000000000000000000000000000000" when 2, 1610 "00000000000000000000000000000000" when 3, 1611 "00000000000000000000000000000000" when 4, 1612 "00000000000000000000000000000000" when 5, 1613 "01100010010101010101100011101100" when 6, 1614 "01110101010001011110000101000110" when 7, 1615 "01110101010001011110000101000110" when 8, 1616 "01110101010001011110000101000110" when 9, 1617 "01100110111011110100001110001101" when 10, 1618 "01101011011010000000011110011010" when 11, 1619 "01100010101110111101100101011010" when 12, 1620 "01110101101000101010100011010100" when 13, 1621 "00101100101010001000011000010001" when 14, 1622 "01101100111010101111000010000111" when 15, 1623 "00000101000001110010001101100111" when 16, 1624 "00101101010100010111011110010110" when 17, 1625 "00101101010100010111011110010110" when 18, 1626 "01110010010110100000011011111011" when 19, 1627 "01110110010001001010010001011100" when 20, 1628 "01110101110001101100001100111010" when 21, 1629 "01110101110001101100001100111010" when 22, 1630 "00100111010110101100011110010100" when 23, 1631 "01110100000100100010011010111011" when 24, 1632 "01110100000100100010011010111011" when 25, 1633 "00110001000011000101000010110011" when 26, 1634 (others => '0') when others; 1635 1636 -- Test partial 1637 1638 interface_execute_queue_out_test_ok <= '1' when true 1639 and out_EXECUTE_QUEUE_OUT_VAL = out_EXECUTE_QUEUE_OUT_VAL_test 1640 and out_EXECUTE_QUEUE_OUT_PACKET_ID = out_EXECUTE_QUEUE_OUT_PACKET_ID_test 1641 and out_EXECUTE_QUEUE_OUT_FLAGS = out_EXECUTE_QUEUE_OUT_FLAGS_test 1642 and out_EXECUTE_QUEUE_OUT_EXCEPTION = out_EXECUTE_QUEUE_OUT_EXCEPTION_test 1643 and out_EXECUTE_QUEUE_OUT_NO_SEQUENCE = out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test 1644 and out_EXECUTE_QUEUE_OUT_ADDRESS = out_EXECUTE_QUEUE_OUT_ADDRESS_test 1645 and out_EXECUTE_QUEUE_OUT_DATA = out_EXECUTE_QUEUE_OUT_DATA_test 1646 else '0'; 1647 1648 interface_execute_queue_out_test_transaction <= '1' 1649 and out_EXECUTE_QUEUE_OUT_VAL 1650 and in_EXECUTE_QUEUE_OUT_ACK 1651 ; 1652 1653 with counter select 1654 interface_execute_queue_out_test_tmp <= 1655 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1656 when 6, 1657 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1658 when 7, 1659 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1660 when 10, 1661 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1662 when 11, 1663 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1664 when 12, 1665 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1666 when 13, 1667 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1668 when 14, 1669 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1670 when 15, 1671 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1672 when 16, 1673 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1674 when 17, 1675 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1676 when 19, 1677 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1678 when 20, 1679 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1680 when 22, 1681 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1682 when 23, 1683 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1684 when 24, 1685 interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 1686 when 26, 1687 not interface_execute_queue_out_test_transaction when others; 1688 1689 interface_execute_queue_out_test <= '1' when (in_NRESET = '0') else 1690 interface_execute_queue_out_test_tmp; 1691 1692 ------------------------------------------------------ 1693 -- Test 1694 ------------------------------------------------------ 1695 1696 test <= '1' 1697 and interface_test 1698 and interface_execute_queue_in_test 1699 and interface_execute_queue_out_test; 1700 1701 ------------------------------------------------------ 1702 -- reset 1703 ------------------------------------------------------ 1704 1705 -- if the systemC simulate have multiple reset, we make the last 1706 in_NRESET <= '1' after 150 ns; 1707 1708 ------------------------------------------------------ 1709 -- process clock_name 1710 ------------------------------------------------------ 1711 1712 in_CLOCK <= not in_CLOCK after 50 ns; 1713 1714 process (in_CLOCK) 1715 begin 1716 if (in_CLOCK'event and in_CLOCK = '1') then 1717 1718 if (in_NRESET = '0') then 1719 counter <= 4; 1720 else 1721 counter <= counter+1; 1722 1723 assert not (counter >= 27) report "Test OK" severity FAILURE; 1724 assert not (test = '0') report "Test KO" severity FAILURE; 1725 end if; 1726 end if; 1727 end process; 1728 end behavioural; 1729 \end{lstlisting} -
trunk/IPs/systemC/processor/Morpheo/Documentation/sty/doc-style.sty
r91 r98 16 16 \usepackage[latin1]{inputenc} % Car jâécris selon le jeu de caractÚres ISO-8859-1 17 17 %\usepackage[utf8]{inputenc} % Car jâécris selon le jeu de caractÚres UTF-8 18 18 \usepackage{listings} 19 19 \usepackage{openbib} 20 20 \usepackage{fancyhdr} … … 83 83 } 84 84 85 \newcommand{\lstparam}[1] 86 { 87 \lstset{ 88 language=#1, 89 numbers=left, 90 numberstyle=\tiny, 91 stepnumber=5, 92 numbersep=5pt, 93 firstnumber=1} 94 } 85 95 \newcommand{\TODO}[1] 86 96 {
Note: See TracChangeset
for help on using the changeset viewer.