[2] | 1 | /* |
---|
| 2 | * $Id: RegisterFile_Monolithic.cpp 132 2009-07-11 16:39:35Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" |
---|
[2] | 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace generic { |
---|
| 13 | namespace registerfile { |
---|
[15] | 14 | namespace registerfile_monolithic { |
---|
[2] | 15 | |
---|
[57] | 16 | RegisterFile_Monolithic::RegisterFile_Monolithic |
---|
| 17 | ( |
---|
[2] | 18 | #ifdef SYSTEMC |
---|
[57] | 19 | sc_module_name name, |
---|
[2] | 20 | #else |
---|
[75] | 21 | std::string name , |
---|
[2] | 22 | #endif |
---|
| 23 | #ifdef STATISTICS |
---|
[57] | 24 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[2] | 25 | #endif |
---|
[57] | 26 | morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param, |
---|
| 27 | morpheo::behavioural::Tusage_t usage |
---|
| 28 | ): |
---|
| 29 | _name (name), |
---|
| 30 | _param (param), |
---|
| 31 | _usage (usage) |
---|
[2] | 32 | { |
---|
[41] | 33 | log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin"); |
---|
| 34 | |
---|
[123] | 35 | // #if DEBUG_RegisterFile_Monolithic == true |
---|
| 36 | // log_printf(INFO,RegisterFile_Monolithic,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 37 | |
---|
[123] | 38 | // std::cout << *param << std::endl; |
---|
| 39 | // #endif |
---|
[88] | 40 | |
---|
[41] | 41 | log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation"); |
---|
| 42 | allocation (); |
---|
| 43 | |
---|
[2] | 44 | #ifdef STATISTICS |
---|
[88] | 45 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[75] | 46 | statistics_declaration(param_statistics); |
---|
[2] | 47 | #endif |
---|
| 48 | |
---|
| 49 | #ifdef VHDL |
---|
| 50 | // generate the vhdl |
---|
[98] | 51 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 52 | vhdl(); |
---|
[2] | 53 | #endif |
---|
| 54 | |
---|
| 55 | #ifdef SYSTEMC |
---|
[88] | 56 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[2] | 57 | { |
---|
[131] | 58 | |
---|
| 59 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 60 | constant(); |
---|
| 61 | #else |
---|
| 62 | SC_METHOD (constant); |
---|
| 63 | // dont_initialize (); |
---|
| 64 | #endif |
---|
| 65 | |
---|
[57] | 66 | SC_METHOD (transition); |
---|
| 67 | dont_initialize (); |
---|
[66] | 68 | sensitive << (*(in_CLOCK)).pos(); |
---|
[131] | 69 | |
---|
[57] | 70 | SC_METHOD (genMealy_read); |
---|
| 71 | dont_initialize (); |
---|
[132] | 72 | sensitive << (*(in_CLOCK)).neg() |
---|
| 73 | << (*(in_NRESET)); |
---|
| 74 | |
---|
[57] | 75 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
[62] | 76 | { |
---|
| 77 | sensitive << *(in_READ_VAL [i]); |
---|
| 78 | if (_param->_have_port_address) |
---|
| 79 | sensitive << *(in_READ_ADDRESS [i]); |
---|
| 80 | } |
---|
[57] | 81 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
[62] | 82 | { |
---|
| 83 | sensitive << *(in_READ_WRITE_VAL [i]) |
---|
| 84 | << *(in_READ_WRITE_RW [i]); |
---|
| 85 | if (_param->_have_port_address) |
---|
| 86 | sensitive << *(in_READ_WRITE_ADDRESS [i]); |
---|
| 87 | } |
---|
[57] | 88 | |
---|
[71] | 89 | # ifdef SYSTEMCASS_SPECIFIC |
---|
[57] | 90 | // List dependency information |
---|
| 91 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
| 92 | { |
---|
| 93 | (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); |
---|
[62] | 94 | if (_param->_have_port_address) |
---|
| 95 | (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); |
---|
[57] | 96 | } |
---|
| 97 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
| 98 | { |
---|
| 99 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); |
---|
| 100 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); |
---|
[62] | 101 | if (_param->_have_port_address) |
---|
| 102 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); |
---|
[57] | 103 | } |
---|
[71] | 104 | # endif |
---|
[2] | 105 | } |
---|
| 106 | #endif |
---|
[57] | 107 | |
---|
[41] | 108 | log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End"); |
---|
[2] | 109 | }; |
---|
| 110 | |
---|
[15] | 111 | RegisterFile_Monolithic::~RegisterFile_Monolithic (void) |
---|
[2] | 112 | { |
---|
| 113 | #ifdef STATISTICS |
---|
[88] | 114 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[75] | 115 | delete _stat; |
---|
[2] | 116 | #endif |
---|
[41] | 117 | |
---|
| 118 | deallocation (); |
---|
[2] | 119 | }; |
---|
| 120 | |
---|
[15] | 121 | }; // end namespace registerfile_monolithic |
---|
[2] | 122 | }; // end namespace registerfile |
---|
| 123 | }; // end namespace generic |
---|
| 124 | }; // end namespace behavioural |
---|
| 125 | }; // end namespace morpheo |
---|