source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp @ 29

Last change on this file since 29 was 29, checked in by rosiere, 17 years ago

Changement de classes de gestions des Interfaces.

-> simplification pour les déclarations de ports, application pour le composant Select_Priority_Fixed.
-> !!! essayer de supprimer la redondance dans les fichierx xxx_vhdl_testbench_transition.cpp

File size: 1.7 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace select {
15namespace select_priority_fixed {
16
17  void Select_Priority_Fixed::allocation (void)
18  {
19    string rename;
20
21    log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin");
22
23    interfaces = new Interfaces;
24
25    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26    Interface interface_ ("", IN, WEST);
27   
28    in_CLOCK        = interface_.set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
29    in_NRESET       = interface_.set_signal_in  <Tcontrol_t> ("nreset",1);
30
31     in_VAL          = new SC_IN (Tcontrol_t)           * [_param._nb_entity];
32    if (_param._encoding_one_hot)
33    out_ACK          = new SC_OUT(Tcontrol_t)           * [_param._nb_entity];
34
35    for (uint32_t i=0; i<_param._nb_entity; i++)
36      {
37         in_VAL [i]    = interface_.set_signal_in  <Tcontrol_t> ("val_"+toString(i),1);
38        if (_param._encoding_one_hot)
39        out_ACK [i]    = interface_.set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);
40      }
41
42    if (_param._encoding_compact)
43      {
44        out_ENTITY     = interface_.set_signal_out <Tentity_t > ("entity"    , _param._size_entity);
45        out_ENTITY_ACK = interface_.set_signal_out <Tcontrol_t> ("entity_ack", 1);
46      }
47
48    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
49
50    log_printf(FUNC,Select_Priority_Fixed,"allocation","End");
51  };
52
53}; // end namespace select_priority_fixed
54}; // end namespace select
55}; // end namespace generic
56}; // end namespace behavioural
57}; // end namespace morpheo             
58#endif
Note: See TracBrowser for help on using the repository browser.