source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_allocation.cpp @ 112

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1/*
2 * $Id: Shifter_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Shifter/include/Shifter.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace shifter {
15
16
17  void Shifter::allocation (void)
18  {
19    _component   = new Component (_usage);
20
21    Entity * entity = _component->set_entity (_name       
22                                             ,"Shifter"   
23#ifdef POSITION
24                                             ,COMBINATORY
25#endif
26                                             );
27   
28    _interfaces = entity->set_interfaces();
29
30#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
31    {
32      Interface_fifo * interface = _interfaces->set_interface(""
33#ifdef POSITION
34                                                              , IN 
35                                                              , SOUTH
36                                                              , _("Generalist interface")
37#endif
38                                                              );
39     
40       in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_NO);
41       in_NRESET       = interface->set_signal_in <Tcontrol_t>  ("nreset",1, RESET_VHDL_NO);
42    }
43#endif
44   
45    {
46      ALLOC1_INTERFACE_BEGIN("shifter", IN, SOUTH,_("Generalist interface"),_param->_nb_port);
47     
48      ALLOC1_SIGNAL_IN ( in_SHIFTER_DATA       ,"data"      ,Tdata_t     ,_param->_size_data);
49      if (_param->_shift_value == 0)
50      ALLOC1_SIGNAL_IN ( in_SHIFTER_SHIFT      ,"shift"     ,Tshift_t    ,_param->_size_shift);
51      if (_param->_direction == external_direction)
52      ALLOC1_SIGNAL_IN ( in_SHIFTER_DIRECTION  ,"direction" ,Tdirection_t,1);
53      if (_param->_rotate == external_rotate)
54      ALLOC1_SIGNAL_IN ( in_SHIFTER_TYPE       ,"type"      ,Ttype_t     ,1);
55      if (_param->_carry == external_carry)
56      ALLOC1_SIGNAL_IN ( in_SHIFTER_CARRY      ,"carry"     ,Tcarry_t    ,1);
57      if (_param->_carry == external_completion)
58      {
59      if (_param->_type_completion_bool == true)
60        {
61      ALLOC1_SIGNAL_IN ( in_SHIFTER_CARRY_IN   ,"carry_in"  ,Tcontrol_t  ,1);
62        }
63      else
64        {
65      ALLOC1_SIGNAL_IN ( in_SHIFTER_COMPLETION ,"completion",Tdata_t     ,_param->_size_data_completion);
66        }
67      }
68      ALLOC1_SIGNAL_OUT(out_SHIFTER_DATA       ,"data"      ,Tdata_t     ,_param->_size_data);
69     
70      ALLOC1_INTERFACE_END(_param->_nb_port);
71    }
72   
73#ifdef POSITION
74    if (usage_is_set(_usage,USE_POSITION))
75      _component->generate_file();
76#endif
77
78  };
79 
80}; // end namespace shifter
81}; // end namespace generic
82}; // end namespace behavioural
83}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.