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
RevLine 
[2]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
[42]17  void Shifter::vhdl_declaration (Vhdl * & vhdl)
[2]18  {
[112]19    uint32_t log2_size_data = static_cast<uint32_t>(ceil(log2(_param->_size_data)));
[2]20
[42]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     );
[112]27    vhdl->set_constant("cst_completion         ",_param->_size_data,"(others => '1')");
[2]28   
[112]29    for (uint32_t i=0; i<_param->_nb_port; i++)
[2]30      {
[112]31        if (_param->_shift_value != 0)
32          vhdl->set_constant("shift_"+toString(i),log2_size_data, _param->_shift_value);
[2]33        else
[42]34          vhdl->set_alias   ("shift_"+toString(i),std_logic(log2_size_data), "in_SHIFTER_"+toString(i)+"_SHIFT",std_logic_range(log2_size_data));
[2]35       
[112]36        if (_param->_size_data_completion > 0)
[2]37          {
[112]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);
[2]42          }
43       
44        //-----[ Shift logic Left ]--------------------------------------------
[112]45        if (_param->_have_shift_logic_left)
46          vhdl->set_signal ("shift_logic_left_"+toString(i)+"      ",_param->_size_data);
[2]47       
48        //-----[ Shift logic Right ]-------------------------------------------
[112]49        if (_param->_have_shift_logic_right)
50          vhdl->set_signal ("shift_logic_right_"+toString(i)+"     ",_param->_size_data);
[2]51       
52        //-----[ Shift arithmetic Left ]---------------------------------------
[112]53        if (_param->_have_shift_arithmetic_left)
54          vhdl->set_signal ("shift_arithmetic_left_"+toString(i)+" ",_param->_size_data);
[2]55       
56        //-----[ Shift arithmetic Right ]--------------------------------------
[112]57        if (_param->_have_shift_arithmetic_right)
58          vhdl->set_signal ("shift_arithmetic_right_"+toString(i)+"",_param->_size_data);
[2]59       
60        //-----[ Rotate Left ]-------------------------------------------------
[112]61        if (_param->_have_rotate_left)
62          vhdl->set_signal ("rotate_left_"+toString(i)+"           ",_param->_size_data);
[2]63       
64        //-----[ Rotate Right ]------------------------------------------------
[112]65        if (_param->_have_rotate_right)
66          vhdl->set_signal ("rotate_right_"+toString(i)+"          ",_param->_size_data);
[2]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.