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