source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_vhdl_declaration.cpp

Last change on this file 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.8 KB
Line 
1#ifdef VHDL
2/*
3 * $Id: Shifter_vhdl_declaration.cpp 112 2009-03-18 22:36:26Z rosiere $
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_declaration (Vhdl * & vhdl)
18  {
19    uint32_t log2_size_data = static_cast<uint32_t>(ceil(log2(_param->_size_data)));
20
21    vhdl->set_constant("cst_is_direction_left  ",1,_left      );
22    vhdl->set_constant("cst_is_direction_right ",1,_right     );
23    vhdl->set_constant("cst_is_type_shift      ",1,_shift     );
24    vhdl->set_constant("cst_is_type_rotate     ",1,_rotate    );
25    vhdl->set_constant("cst_is_carry_arithmetic",1,_arithmetic);
26    vhdl->set_constant("cst_is_carry_logic     ",1,_logic     );
27    vhdl->set_constant("cst_completion         ",_param->_size_data,"(others => '1')");
28   
29    for (uint32_t i=0; i<_param->_nb_port; i++)
30      {
31        if (_param->_shift_value != 0)
32          vhdl->set_constant("shift_"+toString(i),log2_size_data, _param->_shift_value);
33        else
34          vhdl->set_alias   ("shift_"+toString(i),std_logic(log2_size_data), "in_SHIFTER_"+toString(i)+"_SHIFT",std_logic_range(log2_size_data));
35       
36        if (_param->_size_data_completion > 0)
37          {
38            vhdl->set_signal ("shifter_completion_left_"+toString(i)+" ",_param->_size_data);
39            vhdl->set_signal ("shifter_completion_right_"+toString(i)+"",_param->_size_data);
40            vhdl->set_signal ("mask_completion_left_"+toString(i)+"    ",_param->_size_data);
41            vhdl->set_signal ("mask_completion_right_"+toString(i)+"   ",_param->_size_data);
42          }
43       
44        //-----[ Shift logic Left ]--------------------------------------------
45        if (_param->_have_shift_logic_left)
46          vhdl->set_signal ("shift_logic_left_"+toString(i)+"      ",_param->_size_data);
47       
48        //-----[ Shift logic Right ]-------------------------------------------
49        if (_param->_have_shift_logic_right)
50          vhdl->set_signal ("shift_logic_right_"+toString(i)+"     ",_param->_size_data);
51       
52        //-----[ Shift arithmetic Left ]---------------------------------------
53        if (_param->_have_shift_arithmetic_left)
54          vhdl->set_signal ("shift_arithmetic_left_"+toString(i)+" ",_param->_size_data);
55       
56        //-----[ Shift arithmetic Right ]--------------------------------------
57        if (_param->_have_shift_arithmetic_right)
58          vhdl->set_signal ("shift_arithmetic_right_"+toString(i)+"",_param->_size_data);
59       
60        //-----[ Rotate Left ]-------------------------------------------------
61        if (_param->_have_rotate_left)
62          vhdl->set_signal ("rotate_left_"+toString(i)+"           ",_param->_size_data);
63       
64        //-----[ Rotate Right ]------------------------------------------------
65        if (_param->_have_rotate_right)
66          vhdl->set_signal ("rotate_right_"+toString(i)+"          ",_param->_size_data);
67      }
68  };
69
70}; // end namespace shifter
71}; // end namespace generic
72}; // end namespace behavioural
73}; // end namespace morpheo             
74#endif
Note: See TracBrowser for help on using the repository browser.