Changeset 100 for trunk/IPs/systemC/processor/Morpheo/Documentation/doc
- Timestamp:
- Jan 8, 2009, 2:06:27 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
Makefile.flags
Makefile.tools
Makefile.tools_path
-
Property
svn:ignore
set to
-
trunk/IPs/systemC/processor/Morpheo/Documentation/doc/document-morpheo-vhdl_generation/tex/document-morpheo-vhdl_generation-fr.tex
r98 r100 5 5 \SEction{Introduction} 6 6 7 Ce document est une aide pour les développeur des générateurs de modèles VHDL de \cpu.7 Ce document est une aide pour les développeurs des générateurs de modèles VHDL de \cpu. 8 8 Il est décomposé en 6 sections : 9 9 \begin{itemize} … … 16 16 \end{itemize} 17 17 18 \Section{Arborescence}\label{tree} 19 20 Dans le répertoire contenant le projet, nous avons les répertoires suivant : 21 \begin{description} 22 \item[IPs/systemC/processor/Morpheo/Documentation/ :] Contient différent document décrivant certain point du projet, dont cette documentation. 23 \item[IPs/systemC/processor/Morpheo/Behavioural/ :] 24 \item[IPs/systemC/processor/Morpheo/Behavioural/include/ :] 25 \begin{description} 26 \item [Parameters.h :] Contient la classe {\it Parameters}, cette classe définit les paramètres constants. 27 \item [Vhdl.h :] Contient la classe {\it Vhdl}. 28 \end{description} 29 \item[IPs/systemC/processor/Morpheo/Behavioural/\dots/Component :] Chaque composant est inclue dans un répertoire spécifique. 30 \item[IPs/systemC/processor/Morpheo/Behavioural/\dots/Component/include :] 31 \begin{description} 32 \item [Parameters.h :] Contient la classe {\it Parameters}, elle dérive de la classe contenu dans le fichier le répertoire {\it \dots/Behavioural/include/}. 33 \item [Component.h :] Contient la classe {\it Component}. Il définit l'interface, les registres ainsi que les méthodes du modèle systemC. 34 \item [Types.h :] Contient les types spéciaux. 35 \end{description} 36 \item[IPs/systemC/processor/Morpheo/Behavioural/\dots/Component/src :] 37 \begin{description} 38 \item [Component\_transition.cpp :] 39 \item [Component\_genMoore.cpp :] 40 \item [Component\_genMealy\_XXX.cpp :] 41 42 \item [Component\_vhdl\_declaration.cpp :] 43 \item [Component\_vhdl\_body.cpp :] 44 \end{description} 45 \item[IPs/systemC/processor/Morpheo/Behavioural/\dots/Component/Selftest :] 46 \end{description} 47 48 \Section{VHDL : déclaration}\label{vhdl_declaration} 49 50 Les déclarations ce font dans le fichier {\it Component\_vhdl\_declaration.cpp}. 51 52 \subSection{Interfaces} 53 L'interface est définit dans le modèle SystemC. Il n'ont pas nécessaire de la redéfinir pour le modèle VHDL. 54 55 La nomenclature est la suivante : 56 \begin{itemize} 57 \item La direction en minuscule ({\it in}, {\it out}). 58 \item Le nom de l'interface en majuscule ({\it READ}, {\it PUSH}, \dots). 59 \item Le numéro de l'interface (la première interface aura le numéro 0. S'il n'y a qu'une interface, celle ci aura tout de même le numéro 0). 60 \item Le nom du signal en majuscule ({\it VAL}, {\it ADDRESS}, \dots). 61 \end{itemize} 62 63 Par exemple pour la 2 ème interface de lecture d'un banc de registre : 64 \lstparam{VHDL} 65 \begin{lstlisting} 66 in_READ_1_VAL : in std_logic; 67 out_READ_1_ACK : out std_logic; 68 in_READ_1_ADDRESS : in std_logic_vector(8 downto 0); 69 out_READ_1_DATA : out std_logic_vector(31 downto 0); 70 \end{lstlisting} 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. 73 \lstparam{VHDL} 74 \begin{lstlisting} 75 in_CLOCK : in std_logic; 76 in_NRESET : in std_logic; 77 \end{lstlisting} 78 79 \subSection{Types} 80 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 : 82 83 \lstparam{C++} 84 \begin{lstlisting} 85 std::string std_logic (uint32_t size); 86 \end{lstlisting} 87 88 Pour accéder à une partie du vecteur on utilise la fonction {\it std\_logic\_range}. Elle a les prototypes suivant : 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} 104 105 La première fonction fais un test sur la taille que la seconde ne fait pas. 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). 107 Toute les fonctions avec préfixé par un underscore n'effectue pas de test sur les bornes. 108 109 Par exemple : 110 \begin{verbatim} 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)". 114 \end{verbatim} 115 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. 117 118 \lstparam{C++} 119 \begin{lstlisting} 120 void set_type (std::string name, 121 std::string type); 122 \end{lstlisting} 123 124 L'exemple suivant définit un type représentat un tableau de {\it nb\_word} mots de {\it size\_word} bit chacun : 125 \lstparam{C++} 126 \begin{lstlisting} 127 vhdl->set_type ("Tregfile", 128 "array "+std_logic_range(nb_word)+" of "+std_logic(size_word)); 129 \end{lstlisting} 130 131 \subSection{Constantes} 132 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}. 134 135 \lstparam{C++} 136 \begin{lstlisting} 137 void set_constant (std::string name, 138 std::string type, 139 std::string init); 140 void set_constant (std::string name, 141 uint32_t size, 142 std::string init); 143 void set_constant (std::string name, 144 uint32_t size, 145 uint32_t init); 146 \end{lstlisting} 147 148 Par exemple pour coder les états d'un automate à 5 états en One Hot : 149 \lstparam{C++} 150 \begin{lstlisting} 151 vhdl->set_constant ("State_idle",5,1); 152 \end{lstlisting} 153 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. 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. 156 157 \lstparam{C++} 158 \begin{lstlisting} 159 std::string std_logic_others (uint32_t size, 160 bool cst ); 161 \end{lstlisting} 162 163 Pour toute les autres constantes, la méthode {\it std\_logic\_conv} transforme un entier en {\it std\_logic\_vector}. 164 165 \lstparam{C++} 166 \begin{lstlisting} 167 std::string std_logic_conv (uint32_t size, 168 std::string value); 169 std::string std_logic_conv (uint32_t size, 170 uint32_t value); 171 \end{lstlisting} 172 173 174 \subSection{Signaux internes} 175 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}). 177 \lstparam{C++} 178 \begin{lstlisting} 179 void set_signal (std::string name, 180 std::string type); 181 void set_signal (std::string name, 182 uint32_t size); 183 \end{lstlisting} 184 185 La méthode est également surchargé si le signal à besoin d'une initialisation. 186 187 \lstparam{C++} 188 \begin{lstlisting} 189 void set_signal (std::string name, 190 std::string type, 191 std::string init); 192 void set_signal (std::string name, 193 uint32_t size, 194 std::string init); 195 void set_signal (std::string name, 196 uint32_t size, 197 uint32_t init); 198 \end{lstlisting} 199 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}. 201 202 \lstparam{C++} 203 \begin{lstlisting} 204 void set_alias (std::string name1 , 205 std::string type1 , 206 std::string name2 , 207 std::string range2); 208 void set_alias (std::string name1 , 209 uint32_t size1 , 210 std::string name2 , 211 std::string range2); 212 \end{lstlisting} 213 214 \Section{VHDL : comportement}\label{vhdl_body} 215 216 Le comportement du composant est définit dans le fichier {\it Component\_vhdl\_body.cpp}. 217 218 Il n'y a pas de fonction aidant à l'écriture du Vhdl. 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. 220 \lstparam{C++} 221 \begin{lstlisting} 222 void set_body (uint32_t depth, 223 std::string text ); 224 void set_body (std::string text ); 225 \end{lstlisting} 226 227 Pour les commentaires, il y a la fonction {\it set\_comment}. 228 \lstparam{C++} 229 \begin{lstlisting} 230 void set_comment (uint32_t depth, 231 std::string text ); 232 void set_comment (std::string text ); 233 \end{lstlisting} 234 235 \Section{VHDL : structurelle}\label{vhdl_structural} 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 371 \Section{Exemples}\label{example} 372 373 \subSection{Banc de Registres Monolithique} 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 396 \subsubSection{Fichier RegisterFile\_Monolithic\_vhdl\_declaration.cpp} 397 398 \lstparam{C++} 399 \begin{lstlisting}[caption={RegisterFile\_Monolithic\_vhdl\_declaration.cpp}] 400 void RegisterFile_Monolithic::vhdl_declaration (Vhdl * & vhdl) 401 { 402 vhdl->set_type ("Tregfile", "array " + std_logic_range(_param->_nb_word,true)+ 403 " of "+ 404 std_logic(_param->_size_word)); 405 406 vhdl->set_signal ("reg_DATA", "Tregfile"); 407 }; 408 \end{lstlisting} 409 410 \subsubSection{Fichier RegisterFile\_Monolithic\_vhdl\_body.cpp} 411 412 \lstparam{C++} 413 \begin{lstlisting}[caption={RegisterFile\_Monolithic\_vhdl\_body.cpp}] 414 void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl) 415 { 416 vhdl->set_body (0,""); 417 vhdl->set_comment(0,"---------------------------------------------------"); 418 vhdl->set_comment(0," Ack"); 419 vhdl->set_comment(0,"---------------------------------------------------"); 420 vhdl->set_body (0,""); 421 422 for (uint32_t i = 0; i < _param->_nb_port_read; i++) 423 vhdl->set_body (0,"out_READ_"+toString(i)+"_ACK <= '1';"); 424 for (uint32_t i = 0; i < _param->_nb_port_write; i++) 425 vhdl->set_body (0,"out_WRITE_"+toString(i)+"_ACK <= '1';"); 426 427 vhdl->set_body (0,""); 428 vhdl->set_comment(0,"---------------------------------------------------"); 429 vhdl->set_comment(0," Read RegisterFile"); 430 vhdl->set_comment(0,"---------------------------------------------------"); 431 vhdl->set_body (0,""); 432 433 for (uint32_t i = 0; i < _param->_nb_port_read; i++) 434 { 435 std::string str_address; 436 if (_param->_have_port_address) 437 str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)"; 438 else 439 str_address = "0"; 440 441 vhdl->set_body (0,"out_READ_"+toString(i)+"_DATA <= reg_DATA ("+str_address+ 442 ") when in_READ_"+toString(i)+"_VAL = '1' else "+ 443 std_logic_others(_param->_size_word,0)+";"); 444 } 445 446 vhdl->set_body (0,""); 447 vhdl->set_comment(0,"---------------------------------------------------"); 448 vhdl->set_comment(0," Write RegisterFile"); 449 vhdl->set_comment(0,"---------------------------------------------------"); 450 vhdl->set_body (0,""); 451 452 vhdl->set_body (0,"RegisterFile_write: process (in_CLOCK)"); 453 vhdl->set_body (0,"begin -- process RegisterFile_write"); 454 vhdl->set_body (1,"if in_CLOCK'event and in_CLOCK = '1' then"); 455 456 for (uint32_t i = 0; i < _param->_nb_port_write; i++) 457 { 458 std::string str_address; 459 if (_param->_have_port_address) 460 str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)"; 461 else 462 str_address = "0"; 463 464 vhdl->set_body (2,"if (in_WRITE_"+toString(i)+"_VAL = '1') then"); 465 vhdl->set_body (3,"reg_DATA("+str_address+") <= in_WRITE_"+toString(i)+"_DATA;"); 466 vhdl->set_body (2,"end if;"); 467 } 468 469 vhdl->set_body (1,"end if;"); 470 vhdl->set_body (0,"end process RegisterFile_write;"); 471 }; 472 \end{lstlisting} 473 474 \subsubSection{Fichier RegisterFile\_Monolithic.vhdl} 475 476 \lstparam{VHDL} 477 \begin{lstlisting}[caption={RegisterFile\_Monolithic.cpp}] 478 library ieee; 479 use ieee.numeric_bit.all; 480 use ieee.numeric_std.all; 481 use ieee.std_logic_1164.all; 482 use ieee.std_logic_arith.all; 483 use ieee.std_logic_misc.all; 484 --use ieee.std_logic_signed.all; 485 use ieee.std_logic_unsigned.all; 486 --use ieee.std_logic_textio.all; 487 488 489 library work; 490 use work.RegisterFile_Monolithic_Pack.all; 491 492 493 entity RegisterFile_Monolithic is 494 port ( in_CLOCK : in std_logic; 495 in_NRESET : in std_logic; 496 in_READ_0_VAL : in std_logic; 497 out_READ_0_ACK : out std_logic; 498 in_READ_0_ADDRESS : in std_logic_vector(8 downto 0); 499 out_READ_0_DATA : out std_logic_vector(31 downto 0); 500 in_WRITE_0_VAL : in std_logic; 501 out_WRITE_0_ACK : out std_logic; 502 in_WRITE_0_ADDRESS: in std_logic_vector(8 downto 0); 503 in_WRITE_0_DATA : in std_logic_vector(31 downto 0) 504 ); 505 end RegisterFile_Monolithic; 506 507 architecture behavioural of RegisterFile_Monolithic is 508 type Tregfile is array (511 downto 0) of std_logic_vector(31 downto 0); 509 510 signal reg_DATA : Tregfile; 511 512 begin 513 ----------------------------------------------------- 514 -- Ackitement 515 ----------------------------------------------------- 516 517 out_READ_0_ACK <= '1'; 518 out_WRITE_0_ACK <= '1'; 519 520 ----------------------------------------------------- 521 -- Read RegisterFile 522 ----------------------------------------------------- 523 524 out_READ_0_DATA <= reg_DATA (conv_integer(in_READ_0_ADDRESS)) 525 when in_READ_0_VAL = '1' 526 else (others => '0'); 527 528 ----------------------------------------------------- 529 -- Write RegisterFile 530 ----------------------------------------------------- 531 532 RegisterFile_write: process (in_CLOCK) 533 begin -- process RegisterFile_write 534 if in_CLOCK'event and in_CLOCK = '1' then 535 if (in_WRITE_0_VAL = '1') then 536 reg_DATA(conv_integer(in_WRITE_0_ADDRESS)) <= in_WRITE_0_DATA; 537 end if; 538 end if; 539 end process RegisterFile_write; 540 end behavioural; 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 961 962 \Section {Test du VHDL}\label{testbench} 963 964 Lors d'une simulation systemC, \cpu va générer des fichiers de tests pour le modèle VHDL de chaque composant interne. 965 Ces tests sont tous écrit de la même façon. Soit l'interface X et le signal Y : 966 \begin{itemize} 967 \item Une variable {\it counter} indique le numéro de cycle courant. Elle est initialisé à 0. Elle est incrémenté à chaque cycle. 968 \item Le composant est instancé avec des signaux internes de même nom. 969 \item Pour chaque cycle, on affecte à chaque entrée la valeur obtenu lors de la simulation systemC. 970 \item Pour chaque sortie, on définit un signal dont le nom est {\it out\_X\_Y\_test}. Ces signaux sont affecté au valeur obtenu des sorties lors la simulation systemC. 971 \item Le signal {\it interface\_X\_test\_ok} est égal à 1 si chaque sortie calculé par la simulation VHDL est égal au sortie attendu (calculé par la simulation systemC). 972 \item Le signal {\it interface\_X\_test\_transaction} est à 1 si tous les signaux de validité et d'aquittement sont à 1. 973 \item Le signal {\it interface\_X\_test\_tmp} est à 1 si la simulation systemC indique qu'il y a une transaction et que la simulation vhdl indique également une transaction et que toute les sortie sont bien les sorties obtenu. Si la simulation systemC n'indique pas de transaction, on vérifie que c'est également le cas pour la simulation VHDL. 974 \item Le signal {\it interface\_X\_test} est égal au signal {\it interface\_X\_test\_tmp} quand il n'y a pas de reset. sinon il est positionné à 1. 975 \item Le signal {\it test} est un et logique entre tout tous les signaux {\it interface\_X\_test}. 976 \item La simulation VHDL ce termine si le signal {\it test} vaut 0 (dans ce cas, le test est un échec), ou que le registre {\it counter} vaut le nombre de cycle requis par la simulation systemC (dans ce cas, le test est un succès). 977 \end{itemize} 978 979 Nous pouvons remarquer que : 980 \begin{itemize} 981 \item Nous vérifions la compatibilité au cycle des transactions entre le modèle systemC et le modèle VHDL. 982 \item Nous vérifions la compatibilité au bit près des données échangé lors qu'il y a une transaction sur une interface. 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. 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} 18 \input{\dirroot/document-morpheo-vhdl_generation-fr-01_tree} 19 \input{\dirroot/document-morpheo-vhdl_generation-fr-02_vhdl_declaration} 20 \input{\dirroot/document-morpheo-vhdl_generation-fr-03_vhdl_body} 21 \input{\dirroot/document-morpheo-vhdl_generation-fr-04_vhdl_structural} 22 \input{\dirroot/document-morpheo-vhdl_generation-fr-05_example} 23 \input{\dirroot/document-morpheo-vhdl_generation-fr-06_testbench}
Note: See TracChangeset
for help on using the changeset viewer.