source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_test.cpp @ 3

Last change on this file since 3 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 934 bytes
Line 
1#ifdef VHDL_TESTBENCH
2
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/include/Vhdl_Testbench.h"
11
12#include <sstream>
13using namespace std;
14
15namespace morpheo              {
16namespace behavioural          {
17 
18  uint32_t Vhdl_Testbench::get_test (void)
19  {
20    list<bool>::iterator i   = _list_test.begin();
21   
22    uint32_t counter = 0;
23
24    if (i != _list_test.end())
25      {
26        _vhdl->set_body ("");
27        _vhdl->set_body ("with testbench_counter select");
28        _vhdl->set_body ("\ttestbench_must_test <=");
29
30        while (i != _list_test.end())
31          {
32            list<bool>::iterator j = i;
33            ++i;
34
35            string str = (*j==true)?"1":"0";
36
37            if (i != _list_test.end())
38              _vhdl->set_body ("\t'"+str+"' when "+toString(counter++)+",");
39            else
40              _vhdl->set_body ("\t'"+str+"' when others;");
41          }
42      }
43
44    return counter;
45  };
46 
47}; // end namespace behavioural         
48}; // end namespace morpheo             
49
50#endif
Note: See TracBrowser for help on using the repository browser.