source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_vhdl_testbench_port.cpp @ 2

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

Import Morpheo

File size: 1.4 KB
Line 
1#ifdef VHDL_TESTBENCH
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Shifter/include/Shifter.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace shifter {
15
16
17  void Shifter::vhdl_testbench_port (Vhdl_Testbench & vhdl_testbench)
18  {
19    for (uint32_t i=0; i<_param._nb_port; i++)
20      {
21        vhdl_testbench.set_port (" in_SHIFTER_DATA_"+toString(i)      , IN, _param._size_data);
22        if (_param._shift_value == 0)
23        vhdl_testbench.set_port (" in_SHIFTER_SHIFT_"+toString(i)     , IN, static_cast<uint32_t>(ceil(log2(_param._size_data))));
24        if (_param._direction   == external_direction)
25        vhdl_testbench.set_port (" in_SHIFTER_DIRECTION_"+toString(i) , IN, 1);
26        if (_param._rotate      == external_rotate)
27        vhdl_testbench.set_port (" in_SHIFTER_TYPE_"+toString(i)      , IN, 1);
28        if (_param._carry       == external_carry)
29        vhdl_testbench.set_port (" in_SHIFTER_CARRY_"+toString(i)     , IN, 1);
30        if (_param._carry       == external_completion)
31        if (_param._type_completion_bool == true)
32        vhdl_testbench.set_port (" in_SHIFTER_CARRY_IN_"+toString(i)  , IN, 1);
33        else
34        vhdl_testbench.set_port (" in_SHIFTER_COMPLETION_"+toString(i), IN, _param._size_data_completion);
35        vhdl_testbench.set_port ("out_SHIFTER_DATA_"+toString(i)      ,OUT, _param._size_data);
36      }
37  };
38
39}; // end namespace shifter
40}; // end namespace generic
41
42}; // end namespace behavioural
43}; // end namespace morpheo             
44#endif
Note: See TracBrowser for help on using the repository browser.