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

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/*
2 * $Id: Select_Priority_Fixed_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
9
10namespace morpheo{
11namespace behavioural {
12namespace generic {
13namespace select {
14namespace select_priority_fixed {
15
16  void Select_Priority_Fixed::allocation (void)
17  {
18    log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin");
19
20    _component   = new Component (_usage);
21
22    Entity * entity = _component->set_entity (_name                 
23                                             ,"Select_Priority_Fixed"
24#ifdef POSITION
25                                             ,COMBINATORY           
26#endif
27                                              );
28   
29    _interfaces = entity->set_interfaces();
30
31    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
33    Interface_fifo * interface = _interfaces->set_interface(""
34#ifdef POSITION
35                                                            ,IN 
36                                                            ,WEST
37                                                            ,"Generalist interface"
38#endif
39                                                            );
40
41     in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_NO);
42     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_NO);
43
44     in_VAL          = new SC_IN (Tcontrol_t)           * [_param->_nb_entity];
45    if (_param->_encoding_one_hot)
46    out_ACK          = new SC_OUT(Tcontrol_t)           * [_param->_nb_entity];
47
48    for (uint32_t i=0; i<_param->_nb_entity; i++)
49      {
50         in_VAL [i]    = interface->set_signal_in  <Tcontrol_t> ("val_"+toString(i),1);
51        if (_param->_encoding_one_hot)
52        out_ACK [i]    = interface->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);
53      }
54
55    if (_param->_encoding_compact)
56      {
57        out_ENTITY     = interface->set_signal_out <Tentity_t > ("entity"    , _param->_size_entity);
58        out_ENTITY_ACK = interface->set_signal_out <Tcontrol_t> ("entity_ack", 1);
59      }
60
61    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
62
63#ifdef POSITION
64    if (usage_is_set(_usage,USE_POSITION))
65      _component->generate_file();
66#endif
67
68    log_printf(FUNC,Select_Priority_Fixed,"allocation","End");
69  };
70
71}; // end namespace select_priority_fixed
72}; // end namespace select
73}; // end namespace generic
74}; // end namespace behavioural
75}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.