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

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

Import Morpheo

File size: 1.6 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_transition (Vhdl_Testbench & vhdl_testbench)
18  {
19#ifndef SYSTEMCASS_SPECIFIC
20    sc_cycle(0);
21#endif
22
23    // In order with file Shifter_vhdl_testbench_port.cpp
24
25    for (uint32_t i=0; i<_param._nb_port; i++)
26      {
27        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_DATA      [i]));
28        if (_param._shift_value == 0)
29        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_SHIFT     [i]));
30        if (_param._direction   == external_direction)
31        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_DIRECTION [i]));
32        if (_param._rotate      == external_rotate)
33        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_TYPE      [i]));
34        if (_param._carry       == external_carry)
35        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_CARRY     [i]));
36        if (_param._carry       == external_completion)
37        if (_param._type_completion_bool == true)
38        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_CARRY_IN  [i]));
39        else
40        vhdl_testbench.add_input  (PORT_READ( in_SHIFTER_COMPLETION[i]));
41        vhdl_testbench.add_output (PORT_READ(out_SHIFTER_DATA      [i]));
42      }
43   
44    // add_test :
45    //  - True  : the cycle must be compare with the output of systemC
46    //  - False : no test
47    vhdl_testbench.add_test(true);
48
49    vhdl_testbench.new_cycle (); // always at the end
50  };
51
52}; // end namespace shifter
53}; // end namespace generic
54
55}; // end namespace behavioural
56}; // end namespace morpheo             
57#endif
Note: See TracBrowser for help on using the repository browser.