source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_port.cpp @ 2

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

Import Morpheo

File size: 1.0 KB
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  void Vhdl_Testbench::set_port (string      name     ,
19                                 direction_t direction,
20                                 uint32_t    size     )
21  {
22    string   name2;
23    uint32_t size_old;
24    if (direction == IN)
25      {
26        _list_input_size.push_back(size);
27        size_old      = _size_input;
28        _size_input  += size;
29        name2         = "testbench_input";
30      }
31    else
32      {
33        _list_output_size.push_back(size);
34        size_old      = _size_output;
35        _size_output += size;
36        name2         = "testbench_output";
37      }
38
39    string range;
40    if (size == 1)
41      range = "("+toString(size_old)+")";
42    else
43      range = "("+toString(size_old+size-1)+" downto "+toString(size_old)+")";
44   
45    _vhdl->set_alias (name, std_logic(size), name2, range);
46
47    _list_port.push_back(name);
48  };
49 
50}; // end namespace behavioural         
51}; // end namespace morpheo             
52
53#endif
Note: See TracBrowser for help on using the repository browser.