source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue.cpp @ 113

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

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1/*
2 * $Id: Execute_queue.cpp 113 2009-04-14 18:39:12Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_write_unit {
16namespace write_unit {
17namespace execute_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Execute_queue::Execute_queue"
22  Execute_queue::Execute_queue
23  (
24#ifdef SYSTEMC
25   sc_module_name name,
26#else
27   string name,
28#endif
29#ifdef STATISTICS
30   morpheo::behavioural::Parameters_Statistics * param_statistics,
31#endif
32   morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37  {
38    log_begin(Execute_queue,FUNCTION);
39
40    _usage = usage_environment(usage);
41
42// #if DEBUG_Execute_queue == true
43//     log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
44
45//     std::cout << *param << std::endl;
46// #endif   
47
48#ifdef MODELSIM_COSIMULATION
49    {
50      std::string param_id = param->id();
51     
52      if ((_model.get_type(_param->_type) == MODEL_VHDL) and
53          (param_id != "")
54          )
55        {
56          std::string vhdl_id = vhdl_get_id(_name);
57         
58          if (vhdl_id == param_id)
59            {
60              msgInformation(_("<%s> Use VHDL model\n"),_name.c_str());
61              _usage = usage_cosimulation(_usage);
62            }
63          else
64            {
65              log_printf(TRACE,Execute_queue,FUNCTION,"get_id : %s",vhdl_id.c_str());
66              log_printf(TRACE,Execute_queue,FUNCTION,"id     : %s",param_id.c_str());
67           
68              msgWarning(_("<%s> Can't load VHDL model, continue with SystemC model\n"),_name.c_str());
69            }
70        }
71    }
72#endif
73
74    log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Allocation"),_name.c_str());
75    allocation ();
76
77#ifdef STATISTICS
78    if (usage_is_set(_usage,USE_STATISTICS))
79      { 
80        log_printf(INFO,Execute_queue,FUNCTION,("<%s> Allocation of statistics"),_name.c_str());
81
82        statistics_declaration(param_statistics);
83      }
84#endif
85
86#ifdef VHDL
87    if (usage_is_set(_usage,USE_VHDL))
88      {
89        // generate the vhdl
90        log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
91       
92        vhdl();
93      }
94#endif
95
96#ifdef SYSTEMC
97    if (usage_is_set(_usage,USE_SYSTEMC_BODY))
98      {
99        log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str());
100
101        SC_METHOD (transition);
102        dont_initialize ();
103        sensitive << (*(in_CLOCK)).pos();
104       
105# ifdef SYSTEMCASS_SPECIFIC
106        // List dependency information
107# endif   
108
109        log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str());
110
111        SC_METHOD (genMoore);
112        dont_initialize ();
113        sensitive << (*(in_CLOCK)).neg();
114       
115# ifdef SYSTEMCASS_SPECIFIC
116        // List dependency information
117# endif   
118      }
119#endif
120    log_end(Execute_queue,FUNCTION);
121  };
122   
123#undef  FUNCTION
124#define FUNCTION "Execute_queue::~Execute_queue"
125  Execute_queue::~Execute_queue (void)
126  {
127    log_begin(Execute_queue,FUNCTION);
128
129#ifdef STATISTICS
130    if (usage_is_set(_usage,USE_STATISTICS))
131      {
132        log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str());
133       
134        delete _stat;
135      }
136#endif
137
138    log_printf(INFO,Execute_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str());
139    deallocation ();
140
141    log_end(Execute_queue,FUNCTION);
142  };
143
144}; // end namespace execute_queue
145}; // end namespace write_unit
146}; // end namespace multi_write_unit
147}; // end namespace execute_loop
148}; // end namespace multi_execute_loop
149}; // end namespace core
150
151}; // end namespace behavioural
152}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.