source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp @ 131

Last change on this file since 131 was 131, checked in by rosiere, 15 years ago

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1/*
2 * $Id: RegisterFile_Monolithic.cpp 131 2009-07-08 18:40:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
9
10namespace morpheo                    {
11namespace behavioural                {
12namespace generic                    {
13namespace registerfile               {
14namespace 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        for (uint32_t i=0; i<_param->_nb_port_read; i++)
74          {
75            sensitive << *(in_READ_VAL     [i]);
76            if (_param->_have_port_address)
77              sensitive << *(in_READ_ADDRESS [i]);
78          }
79        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
80          {
81            sensitive << *(in_READ_WRITE_VAL     [i])
82                      << *(in_READ_WRITE_RW      [i]);
83            if (_param->_have_port_address)
84              sensitive << *(in_READ_WRITE_ADDRESS [i]);
85          }
86       
87# ifdef SYSTEMCASS_SPECIFIC
88        // List dependency information
89        for (uint32_t i=0; i<_param->_nb_port_read; i++)
90          {
91            (*(out_READ_DATA  [i])) (*( in_READ_VAL     [i]));
92            if (_param->_have_port_address)
93              (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
94          }
95        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
96          { 
97            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL     [i]));
98            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW      [i]));
99            if (_param->_have_port_address)
100              (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
101          }
102# endif   
103      }
104#endif
105   
106    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
107  };
108 
109  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
110  {
111#ifdef STATISTICS
112    if (usage_is_set(_usage,USE_STATISTICS))
113      delete _stat;
114#endif
115
116    deallocation ();
117  };
118
119}; // end namespace registerfile_monolithic
120}; // end namespace registerfile
121}; // end namespace generic
122}; // end namespace behavioural         
123}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.