source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/SelfTest/src/top_test.cpp @ 113

Last change on this file since 113 was 113, checked in by rosiere, 15 years ago

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 size: 1.4 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 * Test
7 */
8
9#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
10#include "Behavioural/include/Allocation.h"
11
12void top::test (void)
13{
14#ifdef SYSTEMC
15  if (usage_is_set(_usage,USE_SYSTEMC))
16    {
17      msgInformation(_("<%s> : Start Simulation ............\n"),name.c_str());
18     
19      Time * _time = new Time();
20     
21      /********************************************************
22       * Simulation - Begin
23       ********************************************************/
24     
25      // Initialisation
26     
27      const uint32_t seed = 0;
28    //const uint32_t seed = static_cast<uint32_t>(time(NULL));
29     
30      srand(seed);
31     
32      SC_CYCLE(0);
33      LABEL("Initialisation");
34     
35      LABEL("Reset");
36      in_NRESET->write(0);
37      SC_CYCLE(5);
38      in_NRESET->write(1); 
39     
40      LABEL("Loop of Test");
41     
42      for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
43        {
44          LABEL("Iteration %d",iteration);
45         
46          SC_CYCLE(1);
47        }
48     
49      /********************************************************
50       * Simulation - End
51       ********************************************************/
52     
53      TEST_OK ("");
54     
55      sc_stop();
56      delete _time;
57     
58      msgInformation(_("<%s> : ............ Stop Simulation\n"),name.c_str());
59    }
60#endif
61}
Note: See TracBrowser for help on using the repository browser.