%------------------------------------------------------------------------------
% $Id: document-morpheo-vhdl_generation-fr-06_testbench.tex 100 2009-01-08 13:06:27Z rosiere $
%------------------------------------------------------------------------------

\Section {Test du VHDL}\label{testbench}

Lors d'une simulation systemC, \cpu va générer des fichiers de tests pour le modèle VHDL de chaque composant interne.
Ces tests sont tous écrits de la même façon. Soit l'interface X et le signal Y :
\begin{itemize}
\item Une variable {\it counter} indique le numéro de cycle courant. Elle est initialisée à 0. Elle est incrémentée à chaque cycle.
\item Le composant est instancé avec des signaux internes de même nom.
\item Pour chaque cycle, on affecte à chaque entrée la valeur obtenue lors de la simulation systemC.
\item Pour chaque sortie, on définit un signal dont le nom est {\it out\_X\_Y\_test}. Ces signaux sont affectés à la valeur obtenue des sorties lors de la simulation systemC.
\item Le signal {\it interface\_X\_test\_ok} est égal à 1 si chaque sortie calculée par la simulation VHDL est égal à la sortie attendue (calculé par la simulation systemC).
\item Le signal {\it interface\_X\_test\_transaction} est à 1 si tous les signaux de validité et d'acquittement sont à 1.
\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 toutes les sorties sont bien les sorties obtenues. Si la simulation systemC n'indique pas de transaction, on vérifie que c'est également le cas pour la simulation VHDL.
\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.
\item Le signal {\it test} est un et logique entre tous tous les signaux {\it interface\_X\_test}.
\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 cycles requis par la simulation systemC (dans ce cas, le test est un succès).
\end{itemize}

Nous pouvons remarquer que :
\begin{itemize}
\item Nous vérifions la compatibilité au cycle des transactions entre le modèle systemC et le modèle VHDL.
\item Nous vérifions la compatibilité au bit près des données échangées lors qu'il y a une transaction sur une interface.
\item Nous ne vérifions pas la compatibilité au bit près des données présentes sur une interface qui ne fait pas de transaction lors d'un cycle.
\end{itemize}

\lstparam{VHDL}
\begin{lstlisting}[caption={Execute\_queue\_Testbench.vhdl}]
library ieee;
  use ieee.numeric_bit.all;       
  use ieee.numeric_std.all;       
  use ieee.std_logic_1164.all;    
  use ieee.std_logic_arith.all;   
  use ieee.std_logic_misc.all;    
--use ieee.std_logic_signed.all;  
  use ieee.std_logic_unsigned.all;
--use ieee.std_logic_textio.all;  

library work;
use work.Execute_queue_0_Pack.all;

entity Execute_queue_0_Testbench is
end Execute_queue_0_Testbench;

architecture behavioural of Execute_queue_0_Testbench is

  signal  in_CLOCK                              : std_logic := '0';
  signal  in_NRESET                             : std_logic := '0';
  signal  in_EXECUTE_QUEUE_IN_VAL               : std_logic;
  signal out_EXECUTE_QUEUE_IN_ACK               : std_logic;
  signal out_EXECUTE_QUEUE_IN_ACK_test          : std_logic;
  signal  in_EXECUTE_QUEUE_IN_PACKET_ID         : std_logic_vector(3 downto 0);
  signal  in_EXECUTE_QUEUE_IN_FLAGS             : std_logic_vector(1 downto 0);
  signal  in_EXECUTE_QUEUE_IN_EXCEPTION         : std_logic_vector(4 downto 0);
  signal  in_EXECUTE_QUEUE_IN_NO_SEQUENCE       : std_logic;
  signal  in_EXECUTE_QUEUE_IN_ADDRESS           : std_logic_vector(31 downto 0);
  signal  in_EXECUTE_QUEUE_IN_DATA              : std_logic_vector(31 downto 0);
  signal out_EXECUTE_QUEUE_OUT_VAL              : std_logic;
  signal out_EXECUTE_QUEUE_OUT_VAL_test         : std_logic;
  signal  in_EXECUTE_QUEUE_OUT_ACK              : std_logic;
  signal out_EXECUTE_QUEUE_OUT_PACKET_ID        : std_logic_vector(3 downto 0);
  signal out_EXECUTE_QUEUE_OUT_PACKET_ID_test   : std_logic_vector(3 downto 0);
  signal out_EXECUTE_QUEUE_OUT_FLAGS            : std_logic_vector(1 downto 0);
  signal out_EXECUTE_QUEUE_OUT_FLAGS_test       : std_logic_vector(1 downto 0);
  signal out_EXECUTE_QUEUE_OUT_EXCEPTION        : std_logic_vector(4 downto 0);
  signal out_EXECUTE_QUEUE_OUT_EXCEPTION_test   : std_logic_vector(4 downto 0);
  signal out_EXECUTE_QUEUE_OUT_NO_SEQUENCE      : std_logic;
  signal out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test : std_logic;
  signal out_EXECUTE_QUEUE_OUT_ADDRESS          : std_logic_vector(31 downto 0);
  signal out_EXECUTE_QUEUE_OUT_ADDRESS_test     : std_logic_vector(31 downto 0);
  signal out_EXECUTE_QUEUE_OUT_DATA             : std_logic_vector(31 downto 0);
  signal out_EXECUTE_QUEUE_OUT_DATA_test        : std_logic_vector(31 downto 0);

  signal counter                                      : natural;
  signal test                                         : std_logic;
  signal interface_test                               : std_logic;
  signal interface_test_ok                            : std_logic;
  signal interface_execute_queue_in_test              : std_logic;
  signal interface_execute_queue_in_test_ok           : std_logic;
  signal interface_execute_queue_in_test_transaction  : std_logic;
  signal interface_execute_queue_in_test_tmp          : std_logic;
  signal interface_execute_queue_out_test             : std_logic;
  signal interface_execute_queue_out_test_ok          : std_logic;
  signal interface_execute_queue_out_test_transaction : std_logic;
  signal interface_execute_queue_out_test_tmp         : std_logic;

begin
  
  ------------------------------------------------------
  -- Component - Intanciation
  ------------------------------------------------------
  
  instance_Execute_queue_0 : Execute_queue_0
  port map (
      in_CLOCK                         =>  in_CLOCK
    , in_NRESET                        =>  in_NRESET
    , in_EXECUTE_QUEUE_IN_VAL          =>  in_EXECUTE_QUEUE_IN_VAL
    ,out_EXECUTE_QUEUE_IN_ACK          => out_EXECUTE_QUEUE_IN_ACK
    , in_EXECUTE_QUEUE_IN_PACKET_ID    =>  in_EXECUTE_QUEUE_IN_PACKET_ID
    , in_EXECUTE_QUEUE_IN_FLAGS        =>  in_EXECUTE_QUEUE_IN_FLAGS
    , in_EXECUTE_QUEUE_IN_EXCEPTION    =>  in_EXECUTE_QUEUE_IN_EXCEPTION
    , in_EXECUTE_QUEUE_IN_NO_SEQUENCE  =>  in_EXECUTE_QUEUE_IN_NO_SEQUENCE
    , in_EXECUTE_QUEUE_IN_ADDRESS      =>  in_EXECUTE_QUEUE_IN_ADDRESS
    , in_EXECUTE_QUEUE_IN_DATA         =>  in_EXECUTE_QUEUE_IN_DATA
    ,out_EXECUTE_QUEUE_OUT_VAL         => out_EXECUTE_QUEUE_OUT_VAL
    , in_EXECUTE_QUEUE_OUT_ACK         =>  in_EXECUTE_QUEUE_OUT_ACK
    ,out_EXECUTE_QUEUE_OUT_PACKET_ID   => out_EXECUTE_QUEUE_OUT_PACKET_ID
    ,out_EXECUTE_QUEUE_OUT_FLAGS       => out_EXECUTE_QUEUE_OUT_FLAGS
    ,out_EXECUTE_QUEUE_OUT_EXCEPTION   => out_EXECUTE_QUEUE_OUT_EXCEPTION
    ,out_EXECUTE_QUEUE_OUT_NO_SEQUENCE => out_EXECUTE_QUEUE_OUT_NO_SEQUENCE
    ,out_EXECUTE_QUEUE_OUT_ADDRESS     => out_EXECUTE_QUEUE_OUT_ADDRESS
    ,out_EXECUTE_QUEUE_OUT_DATA        => out_EXECUTE_QUEUE_OUT_DATA
     );
  ------------------------------------------------------
  -- interface ""
  ------------------------------------------------------
  
  -- Test exhaustive
  
  interface_test_ok <= '1' when true
    else '0';
  
  interface_test <= '1' when (in_NRESET = '0') else interface_test_ok;
  ------------------------------------------------------
  -- interface "execute_queue_in"
  ------------------------------------------------------
  
  with counter select
    in_EXECUTE_QUEUE_IN_VAL <=
    '0' when 0,
    '0' when 1,
    '0' when 2,
    '0' when 3,
    '0' when 4,
    '1' when 5,
    '1' when 6,
    '0' when 7,
    '0' when 8,
    '1' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '0' when 17,
    '1' when 18,
    '1' when 19,
    '1' when 20,
    '0' when 21,
    '1' when 22,
    '1' when 23,
    '0' when 24,
    '1' when 25,
    '0' when 26,
    '0' when others;
  
  with counter select
    out_EXECUTE_QUEUE_IN_ACK_test <=
    '0' when 0,
    '1' when 1,
    '1' when 2,
    '1' when 3,
    '1' when 4,
    '1' when 5,
    '1' when 6,
    '1' when 7,
    '1' when 8,
    '1' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '1' when 17,
    '1' when 18,
    '1' when 19,
    '1' when 20,
    '1' when 21,
    '1' when 22,
    '1' when 23,
    '1' when 24,
    '1' when 25,
    '1' when 26,
    '0' when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_PACKET_ID <=
    "0000" when 0,
    "0000" when 1,
    "0000" when 2,
    "0000" when 3,
    "0000" when 4,
    "0000" when 5,
    "0001" when 6,
    "0001" when 7,
    "0001" when 8,
    "0010" when 9,
    "0011" when 10,
    "0100" when 11,
    "0101" when 12,
    "0110" when 13,
    "0111" when 14,
    "1000" when 15,
    "1001" when 16,
    "1001" when 17,
    "1010" when 18,
    "1011" when 19,
    "1100" when 20,
    "1100" when 21,
    "1101" when 22,
    "1110" when 23,
    "1110" when 24,
    "1111" when 25,
    "1111" when 26,
    (others => '0') when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_FLAGS <=
    "00" when 0,
    "00" when 1,
    "00" when 2,
    "00" when 3,
    "00" when 4,
    "11" when 5,
    "11" when 6,
    "11" when 7,
    "11" when 8,
    "00" when 9,
    "11" when 10,
    "11" when 11,
    "11" when 12,
    "10" when 13,
    "01" when 14,
    "01" when 15,
    "11" when 16,
    "11" when 17,
    "10" when 18,
    "00" when 19,
    "11" when 20,
    "11" when 21,
    "10" when 22,
    "01" when 23,
    "01" when 24,
    "01" when 25,
    "01" when 26,
    (others => '0') when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_EXCEPTION <=
    "00000" when 0,
    "00000" when 1,
    "00000" when 2,
    "00000" when 3,
    "00000" when 4,
    "10001" when 5,
    "10010" when 6,
    "10010" when 7,
    "10010" when 8,
    "11011" when 9,
    "10011" when 10,
    "10001" when 11,
    "11000" when 12,
    "11011" when 13,
    "00001" when 14,
    "00001" when 15,
    "01010" when 16,
    "01010" when 17,
    "01100" when 18,
    "01100" when 19,
    "11011" when 20,
    "11011" when 21,
    "00101" when 22,
    "01001" when 23,
    "01001" when 24,
    "10001" when 25,
    "10001" when 26,
    (others => '0') when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_NO_SEQUENCE <=
    '0' when 0,
    '0' when 1,
    '0' when 2,
    '0' when 3,
    '0' when 4,
    '1' when 5,
    '1' when 6,
    '1' when 7,
    '1' when 8,
    '1' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '1' when 17,
    '1' when 18,
    '1' when 19,
    '1' when 20,
    '1' when 21,
    '1' when 22,
    '1' when 23,
    '1' when 24,
    '1' when 25,
    '1' when 26,
    '0' when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_ADDRESS <=
    "00000000000000000000000000000000" when 0,
    "00000000000000000000000000000000" when 1,
    "00000000000000000000000000000000" when 2,
    "00000000000000000000000000000000" when 3,
    "00000000000000000000000000000000" when 4,
    "00101010111010001001010001001010" when 5,
    "01111001111000101010100111100011" when 6,
    "01111001111000101010100111100011" when 7,
    "01111001111000101010100111100011" when 8,
    "00010001100100001100110111100111" when 9,
    "01000001101001111100010011001001" when 10,
    "00100101011100010011000010100011" when 11,
    "01100111011000111000010001011110" when 12,
    "01110001111100110010010001010100" when 13,
    "01110011011110111000110111011100" when 14,
    "01000100000010111010110111111100" when 15,
    "01010001111010101101001101101011" when 16,
    "01010001111010101101001101101011" when 17,
    "00011101010011101101010000111011" when 18,
    "00111000010000110111111111011011" when 19,
    "01111001101000011101111010101010" when 20,
    "01111001101000011101111010101010" when 21,
    "01100100100110111011011101111100" when 22,
    "00010101101101011010111101011100" when 23,
    "00010101101101011010111101011100" when 24,
    "01010111100110111110010011110001" when 25,
    "01010111100110111110010011110001" when 26,
    (others => '0') when others;
  
  with counter select
    in_EXECUTE_QUEUE_IN_DATA <=
    "00000000000000000000000000000000" when 0,
    "00000000000000000000000000000000" when 1,
    "00000000000000000000000000000000" when 2,
    "00000000000000000000000000000000" when 3,
    "00000000000000000000000000000000" when 4,
    "01100010010101010101100011101100" when 5,
    "01110101010001011110000101000110" when 6,
    "01110101010001011110000101000110" when 7,
    "01110101010001011110000101000110" when 8,
    "01100110111011110100001110001101" when 9,
    "01101011011010000000011110011010" when 10,
    "01100010101110111101100101011010" when 11,
    "01110101101000101010100011010100" when 12,
    "00101100101010001000011000010001" when 13,
    "01101100111010101111000010000111" when 14,
    "00000101000001110010001101100111" when 15,
    "00101101010100010111011110010110" when 16,
    "00101101010100010111011110010110" when 17,
    "01110010010110100000011011111011" when 18,
    "01110110010001001010010001011100" when 19,
    "01110101110001101100001100111010" when 20,
    "01110101110001101100001100111010" when 21,
    "00100111010110101100011110010100" when 22,
    "01110100000100100010011010111011" when 23,
    "01110100000100100010011010111011" when 24,
    "00110001000011000101000010110011" when 25,
    "00110001000011000101000010110011" when 26,
    (others => '0') when others;
  
  -- Test partial
  
  interface_execute_queue_in_test_ok <= '1' when true
    and out_EXECUTE_QUEUE_IN_ACK = out_EXECUTE_QUEUE_IN_ACK_test
    else '0';
  
  interface_execute_queue_in_test_transaction <= '1'
    and in_EXECUTE_QUEUE_IN_VAL
    and out_EXECUTE_QUEUE_IN_ACK
    ;
  
  with counter select
    interface_execute_queue_in_test_tmp <=
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 5,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 6,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 9,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 10,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 11,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 12,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 13,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 14,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 15,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 16,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 18,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 19,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 20,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 22,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 23,
    interface_execute_queue_in_test_transaction and interface_execute_queue_in_test_ok 
      when 25,
    not interface_execute_queue_in_test_transaction when others;
  
  interface_execute_queue_in_test <= '1' when (in_NRESET = '0') else
                                     interface_execute_queue_in_test_tmp;
  ------------------------------------------------------
  -- interface "execute_queue_out"
  ------------------------------------------------------
  
  with counter select
    out_EXECUTE_QUEUE_OUT_VAL_test <=
    '0' when 0,
    '0' when 1,
    '0' when 2,
    '0' when 3,
    '0' when 4,
    '0' when 5,
    '1' when 6,
    '1' when 7,
    '0' when 8,
    '0' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '1' when 17,
    '0' when 18,
    '1' when 19,
    '1' when 20,
    '1' when 21,
    '1' when 22,
    '1' when 23,
    '1' when 24,
    '0' when 25,
    '1' when 26,
    '0' when others;
  
  with counter select
    in_EXECUTE_QUEUE_OUT_ACK <=
    '0' when 0,
    '0' when 1,
    '0' when 2,
    '0' when 3,
    '0' when 4,
    '1' when 5,
    '1' when 6,
    '1' when 7,
    '1' when 8,
    '0' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '1' when 17,
    '1' when 18,
    '1' when 19,
    '1' when 20,
    '0' when 21,
    '1' when 22,
    '1' when 23,
    '1' when 24,
    '1' when 25,
    '1' when 26,
    '0' when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_PACKET_ID_test <=
    "0000" when 0,
    "0000" when 1,
    "0000" when 2,
    "0000" when 3,
    "0000" when 4,
    "0000" when 5,
    "0000" when 6,
    "0001" when 7,
    "0001" when 8,
    "0001" when 9,
    "0010" when 10,
    "0011" when 11,
    "0100" when 12,
    "0101" when 13,
    "0110" when 14,
    "0111" when 15,
    "1000" when 16,
    "1001" when 17,
    "1001" when 18,
    "1010" when 19,
    "1011" when 20,
    "1100" when 21,
    "1100" when 22,
    "1101" when 23,
    "1110" when 24,
    "1110" when 25,
    "1111" when 26,
    (others => '0') when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_FLAGS_test <=
    "00" when 0,
    "00" when 1,
    "00" when 2,
    "00" when 3,
    "00" when 4,
    "00" when 5,
    "11" when 6,
    "11" when 7,
    "11" when 8,
    "11" when 9,
    "00" when 10,
    "11" when 11,
    "11" when 12,
    "11" when 13,
    "10" when 14,
    "01" when 15,
    "01" when 16,
    "11" when 17,
    "11" when 18,
    "10" when 19,
    "00" when 20,
    "11" when 21,
    "11" when 22,
    "10" when 23,
    "01" when 24,
    "01" when 25,
    "01" when 26,
    (others => '0') when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_EXCEPTION_test <=
    "00000" when 0,
    "00000" when 1,
    "00000" when 2,
    "00000" when 3,
    "00000" when 4,
    "00000" when 5,
    "10001" when 6,
    "10010" when 7,
    "10010" when 8,
    "10010" when 9,
    "11011" when 10,
    "10011" when 11,
    "10001" when 12,
    "11000" when 13,
    "11011" when 14,
    "00001" when 15,
    "00001" when 16,
    "01010" when 17,
    "01010" when 18,
    "01100" when 19,
    "01100" when 20,
    "11011" when 21,
    "11011" when 22,
    "00101" when 23,
    "01001" when 24,
    "01001" when 25,
    "10001" when 26,
    (others => '0') when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test <=
    '0' when 0,
    '0' when 1,
    '0' when 2,
    '0' when 3,
    '0' when 4,
    '0' when 5,
    '1' when 6,
    '1' when 7,
    '1' when 8,
    '1' when 9,
    '1' when 10,
    '1' when 11,
    '1' when 12,
    '1' when 13,
    '1' when 14,
    '1' when 15,
    '1' when 16,
    '1' when 17,
    '1' when 18,
    '1' when 19,
    '1' when 20,
    '1' when 21,
    '1' when 22,
    '1' when 23,
    '1' when 24,
    '1' when 25,
    '1' when 26,
    '0' when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_ADDRESS_test <=
    "00000000000000000000000000000000" when 0,
    "00000000000000000000000000000000" when 1,
    "00000000000000000000000000000000" when 2,
    "00000000000000000000000000000000" when 3,
    "00000000000000000000000000000000" when 4,
    "00000000000000000000000000000000" when 5,
    "00101010111010001001010001001010" when 6,
    "01111001111000101010100111100011" when 7,
    "01111001111000101010100111100011" when 8,
    "01111001111000101010100111100011" when 9,
    "00010001100100001100110111100111" when 10,
    "01000001101001111100010011001001" when 11,
    "00100101011100010011000010100011" when 12,
    "01100111011000111000010001011110" when 13,
    "01110001111100110010010001010100" when 14,
    "01110011011110111000110111011100" when 15,
    "01000100000010111010110111111100" when 16,
    "01010001111010101101001101101011" when 17,
    "01010001111010101101001101101011" when 18,
    "00011101010011101101010000111011" when 19,
    "00111000010000110111111111011011" when 20,
    "01111001101000011101111010101010" when 21,
    "01111001101000011101111010101010" when 22,
    "01100100100110111011011101111100" when 23,
    "00010101101101011010111101011100" when 24,
    "00010101101101011010111101011100" when 25,
    "01010111100110111110010011110001" when 26,
    (others => '0') when others;
  
  with counter select
    out_EXECUTE_QUEUE_OUT_DATA_test <=
    "00000000000000000000000000000000" when 0,
    "00000000000000000000000000000000" when 1,
    "00000000000000000000000000000000" when 2,
    "00000000000000000000000000000000" when 3,
    "00000000000000000000000000000000" when 4,
    "00000000000000000000000000000000" when 5,
    "01100010010101010101100011101100" when 6,
    "01110101010001011110000101000110" when 7,
    "01110101010001011110000101000110" when 8,
    "01110101010001011110000101000110" when 9,
    "01100110111011110100001110001101" when 10,
    "01101011011010000000011110011010" when 11,
    "01100010101110111101100101011010" when 12,
    "01110101101000101010100011010100" when 13,
    "00101100101010001000011000010001" when 14,
    "01101100111010101111000010000111" when 15,
    "00000101000001110010001101100111" when 16,
    "00101101010100010111011110010110" when 17,
    "00101101010100010111011110010110" when 18,
    "01110010010110100000011011111011" when 19,
    "01110110010001001010010001011100" when 20,
    "01110101110001101100001100111010" when 21,
    "01110101110001101100001100111010" when 22,
    "00100111010110101100011110010100" when 23,
    "01110100000100100010011010111011" when 24,
    "01110100000100100010011010111011" when 25,
    "00110001000011000101000010110011" when 26,
    (others => '0') when others;
  
  -- Test partial
  
  interface_execute_queue_out_test_ok <= '1' when true
    and out_EXECUTE_QUEUE_OUT_VAL = out_EXECUTE_QUEUE_OUT_VAL_test
    and out_EXECUTE_QUEUE_OUT_PACKET_ID = out_EXECUTE_QUEUE_OUT_PACKET_ID_test
    and out_EXECUTE_QUEUE_OUT_FLAGS = out_EXECUTE_QUEUE_OUT_FLAGS_test
    and out_EXECUTE_QUEUE_OUT_EXCEPTION = out_EXECUTE_QUEUE_OUT_EXCEPTION_test
    and out_EXECUTE_QUEUE_OUT_NO_SEQUENCE = out_EXECUTE_QUEUE_OUT_NO_SEQUENCE_test
    and out_EXECUTE_QUEUE_OUT_ADDRESS = out_EXECUTE_QUEUE_OUT_ADDRESS_test
    and out_EXECUTE_QUEUE_OUT_DATA = out_EXECUTE_QUEUE_OUT_DATA_test
    else '0';
  
  interface_execute_queue_out_test_transaction <= '1'
    and out_EXECUTE_QUEUE_OUT_VAL
    and in_EXECUTE_QUEUE_OUT_ACK
    ;
  
  with counter select
    interface_execute_queue_out_test_tmp <=
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 6,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 7,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 10,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 11,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 12,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 13,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 14,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 15,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 16,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 17,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 19,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 20,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 22,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 23,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 24,
    interface_execute_queue_out_test_transaction and interface_execute_queue_out_test_ok 
      when 26,
    not interface_execute_queue_out_test_transaction when others;
  
  interface_execute_queue_out_test <= '1' when (in_NRESET = '0') else
                                      interface_execute_queue_out_test_tmp;
  
  ------------------------------------------------------
  -- Test
  ------------------------------------------------------
  
  test <= '1' 
           and interface_test
           and interface_execute_queue_in_test
           and interface_execute_queue_out_test;
  
  ------------------------------------------------------
  -- reset
  ------------------------------------------------------
  
  -- if the systemC simulate have multiple reset, we make the last
  in_NRESET <= '1' after 150 ns;
  
  ------------------------------------------------------
  -- process clock_name
  ------------------------------------------------------
  
  in_CLOCK <= not in_CLOCK after 50 ns;
  
  process (in_CLOCK)
  begin
    if (in_CLOCK'event and in_CLOCK = '1') then
  
      if (in_NRESET = '0') then
        counter <= 4;
      else
        counter <= counter+1;

        assert not (counter >= 27) report "Test OK" severity FAILURE;
        assert not (test = '0') report "Test KO" severity FAILURE;
      end if;
    end if;
  end process;
end behavioural;
\end{lstlisting}
