1 | /* |
---|
2 | * $Id$ |
---|
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 | 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 | log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation"); |
---|
36 | allocation (); |
---|
37 | |
---|
38 | #ifdef STATISTICS |
---|
39 | statistics_declaration(param_statistics); |
---|
40 | #endif |
---|
41 | |
---|
42 | #ifdef VHDL |
---|
43 | // generate the vhdl |
---|
44 | vhdl(); |
---|
45 | #endif |
---|
46 | |
---|
47 | #ifdef SYSTEMC |
---|
48 | if (_usage & USE_SYSTEMC) |
---|
49 | { |
---|
50 | SC_METHOD (transition); |
---|
51 | dont_initialize (); |
---|
52 | sensitive << (*(in_CLOCK)).pos(); |
---|
53 | |
---|
54 | SC_METHOD (genMealy_read); |
---|
55 | dont_initialize (); |
---|
56 | sensitive << (*(in_CLOCK)).neg(); |
---|
57 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
58 | { |
---|
59 | sensitive << *(in_READ_VAL [i]); |
---|
60 | if (_param->_have_port_address) |
---|
61 | sensitive << *(in_READ_ADDRESS [i]); |
---|
62 | } |
---|
63 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
64 | { |
---|
65 | sensitive << *(in_READ_WRITE_VAL [i]) |
---|
66 | << *(in_READ_WRITE_RW [i]); |
---|
67 | if (_param->_have_port_address) |
---|
68 | sensitive << *(in_READ_WRITE_ADDRESS [i]); |
---|
69 | } |
---|
70 | |
---|
71 | # ifdef SYSTEMCASS_SPECIFIC |
---|
72 | // List dependency information |
---|
73 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
74 | { |
---|
75 | (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); |
---|
76 | if (_param->_have_port_address) |
---|
77 | (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); |
---|
78 | } |
---|
79 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
80 | { |
---|
81 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); |
---|
82 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); |
---|
83 | if (_param->_have_port_address) |
---|
84 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); |
---|
85 | } |
---|
86 | # endif |
---|
87 | |
---|
88 | for (uint32_t i=0; i<_param->_nb_port_read ; i++) |
---|
89 | PORT_WRITE(out_READ_ACK [i], 1); |
---|
90 | for (uint32_t i=0; i<_param->_nb_port_write ; i++) |
---|
91 | PORT_WRITE(out_WRITE_ACK [i], 1); |
---|
92 | for (uint32_t i=0; i<_param->_nb_port_read_write ; i++) |
---|
93 | PORT_WRITE(out_READ_WRITE_ACK [i], 1); |
---|
94 | } |
---|
95 | #endif |
---|
96 | |
---|
97 | log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End"); |
---|
98 | }; |
---|
99 | |
---|
100 | RegisterFile_Monolithic::~RegisterFile_Monolithic (void) |
---|
101 | { |
---|
102 | #ifdef STATISTICS |
---|
103 | if (_usage & USE_STATISTICS) |
---|
104 | { |
---|
105 | delete _stat; |
---|
106 | } |
---|
107 | #endif |
---|
108 | |
---|
109 | deallocation (); |
---|
110 | }; |
---|
111 | |
---|
112 | }; // end namespace registerfile_monolithic |
---|
113 | }; // end namespace registerfile |
---|
114 | }; // end namespace generic |
---|
115 | }; // end namespace behavioural |
---|
116 | }; // end namespace morpheo |
---|