Ignore:
Timestamp:
Apr 14, 2009, 8:39:12 PM (15 years ago)
Author:
rosiere
Message:

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp

    r101 r113  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
    77
    8 #include "Behavioural/Generic/Queue/SelfTest/include/test.h"
     8#include "Behavioural/Generic/Queue/SelfTest/include/top.h"
    99
    10 #define NB_PARAMS 5
     10#ifndef MTI_SYSTEMC
     11# ifndef SYSTEMC
     12int main    (int argc, char * argv[])
     13# else
     14int sc_main (int argc, char * argv[])
     15# endif
     16{
     17  int _return = EXIT_SUCCESS;
    1118
    12 void usage (int argc, char * argv[])
    13 {
    14   cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
    15        << "list_params is :" << endl
    16        << " - size_queue      (uint32_t)" << endl
    17        << " - size_data       (uint32_t)" << endl
    18        << " - nb_port_slot    (uint32_t)" << endl
    19        << " - have_port_write (bool    )" << endl
    20        << " - have_port_read  (bool    )" << endl
    21        << "" << endl;
    22 
    23   for (int i=0; i<argc; i++)
    24     cerr << argv[i] << " ";
    25   cerr << endl;
    26 
    27   exit (1);
    28 }
    29 
    30 #ifndef SYSTEMC
    31 int main    (int argc, char * argv[])
    32 #else
    33 int sc_main (int argc, char * argv[])
    34 #endif
    35 {
    36   if (argc != 2+NB_PARAMS)
    37     usage (argc, argv);
    38 
    39   uint32_t       x = 1;
    40  
    41   const string   name            =      argv[x++];
    42   const uint32_t size_queue      = fromString<uint32_t>(argv[x++]);
    43   const uint32_t size_data       = fromString<uint32_t>(argv[x++]);
    44   const uint32_t nb_port_slot    = fromString<uint32_t>(argv[x++]);
    45   const bool     have_port_write = fromString<bool>(argv[x++]);
    46   const bool     have_port_read  = fromString<bool>(argv[x++]);
    4719  try
    4820    {
    49       morpheo::behavioural::generic::queue::Parameters * param = new morpheo::behavioural::generic::queue::Parameters
    50         (size_queue,
    51          size_data ,
    52          nb_port_slot,
    53          have_port_write,
    54          have_port_read
    55         );
    56      
    57       cout << param->print(1);
    58      
    59       test (name,param);
     21      top * my_top = new top ("my_top",argc,argv);
     22
     23      my_top->test();
     24
     25      delete my_top;
    6026    }
    6127  catch (morpheo::ErrorMorpheo & error)
    6228    {
    63       cout << "<" << name << "> : " <<  error.what ();
    64       exit (EXIT_FAILURE);
     29      msgError(_("%s\n"),error.what ());
     30      _return = EXIT_FAILURE;
    6531    }
    66   catch (...)
     32 
     33  try
    6734    {
    68       cerr << "<" << name << "> : This test must generate a error" << endl;
    69       exit (EXIT_FAILURE);
     35      if (_return == EXIT_SUCCESS)
     36        TEST_OK("Queue : no error");
     37      else
     38        TEST_KO("Queue : a lot of error");
     39    }
     40  catch (morpheo::ErrorMorpheo & error)
     41    {
     42//    msgError(_("<%s> :\n%s"),name.c_str(), error.what ());
     43      _return = EXIT_FAILURE;
    7044    }
    7145
    72   return (EXIT_SUCCESS);
     46  return _return;
    7347}
    74 
     48#endif
Note: See TracChangeset for help on using the changeset viewer.