1 | #ifdef VHDL |
---|
2 | /* |
---|
3 | * $Id: RegisterFile_Internal_Banked_vhdl_declaration.cpp 145 2010-10-13 18:15:51Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Internal_Banked/include/RegisterFile_Internal_Banked.h" |
---|
10 | #include "Behavioural/include/Vhdl.h" |
---|
11 | #include "Common/include/ToString.h" |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace generic { |
---|
15 | namespace registerfile { |
---|
16 | namespace registerfile_internal_banked { |
---|
17 | |
---|
18 | void RegisterFile_Internal_Banked::vhdl_declaration (Vhdl * & vhdl) |
---|
19 | { |
---|
20 | vhdl->set_type ("Tregfile", "array " + _std_logic_range(_param->_nb_word) + " of " + std_logic(_param->_size_word)); |
---|
21 | |
---|
22 | for (uint32_t num_write=0; num_write<_param->_nb_port_write; ++num_write) |
---|
23 | for (uint32_t num_read=0; num_read<_param->_nb_port_read; ++num_read) |
---|
24 | vhdl->set_signal ("reg_DATA_"+toString(num_write)+"_"+toString(num_read), "Tregfile"); |
---|
25 | |
---|
26 | if (_param->_size_ptr_write > 0) |
---|
27 | { |
---|
28 | for (uint32_t num_read=0; num_read<_param->_nb_port_read; ++num_read) |
---|
29 | vhdl->set_signal ("READ_NUM_BANK_"+toString(num_read), _param->_size_ptr_write); |
---|
30 | } |
---|
31 | #ifdef PTR_IS_REGFILE |
---|
32 | if (_param->_size_ptr_write > 0) |
---|
33 | { |
---|
34 | vhdl->set_type ("Tptr_write", "array " + _std_logic_range(_param->_nb_word) + " of " + std_logic(_param->_size_ptr_write)); |
---|
35 | vhdl->set_signal ("reg_PTR_WRITE", "Tptr_write"); |
---|
36 | } |
---|
37 | #else |
---|
38 | if (_param->_size_ptr_write > 0) |
---|
39 | for (uint32_t num_word=0; num_word<_param->_nb_word; ++num_word) |
---|
40 | vhdl->set_signal ("reg_PTR_WRITE_"+toString(num_word), _param->_size_ptr_write); |
---|
41 | #endif |
---|
42 | }; |
---|
43 | |
---|
44 | }; // end namespace registerfile_internal_banked |
---|
45 | }; // end namespace registerfile |
---|
46 | }; // end namespace generic |
---|
47 | }; // end namespace behavioural |
---|
48 | }; // end namespace morpheo |
---|
49 | #endif |
---|