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

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

1) Stat List : scan all queue to find free register
2) Write_queue : test "genMealy" add bypass [0]
3) Functionnal_unit : add const parameters to add or not the pipeline_in
4) Load Store Unit : if load make an exception, free nb_check
5) Debug, change test to add model

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1/*
2 * $Id: Write_queue.cpp 118 2009-05-20 22:01:32Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_write_unit {
16namespace write_unit {
17namespace write_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Write_queue::Write_queue"
22  Write_queue::Write_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::write_queue::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage            (usage)
38  {
39    log_begin(Write_queue,FUNCTION);
40
41// #if DEBUG_Write_queue == true
42//     log_printf(INFO,Write_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Write_queue,FUNCTION,_("<%s> Allocation"),_name.c_str());
48    allocation ();
49
50#ifdef STATISTICS
51    if (usage_is_set(_usage,USE_STATISTICS))
52      { 
53        log_printf(INFO,Write_queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str());
54
55        statistics_declaration(param_statistics);
56      }
57#endif
58
59#ifdef VHDL
60    if (usage_is_set(_usage,USE_VHDL))
61      {
62        // generate the vhdl
63        log_printf(INFO,Write_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
64       
65        vhdl();
66      }
67#endif
68
69#ifdef SYSTEMC
70    if (usage_is_set(_usage,USE_SYSTEMC))
71      {
72        log_printf(INFO,Write_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str());
73
74        SC_METHOD (transition);
75        dont_initialize ();
76        sensitive << (*(in_CLOCK)).pos();
77       
78# ifdef SYSTEMCASS_SPECIFIC
79        // List dependency information
80# endif   
81
82        log_printf(INFO,Write_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str());
83
84        SC_METHOD (genMoore);
85        dont_initialize ();
86        sensitive << (*(in_CLOCK)).neg(); // need internal register
87       
88# ifdef SYSTEMCASS_SPECIFIC
89        // List dependency information
90# endif   
91
92        if (_param->_queue_scheme == WRITE_QUEUE_SCHEME_MEALY)
93          {
94        log_printf(INFO,Write_queue,FUNCTION,"Method - genMealy_write");
95
96        SC_METHOD (genMealy_write);
97        dont_initialize ();
98        sensitive << (*(in_CLOCK)).neg(); // need internal register
99        for (uint32_t i=0; i<_param->_nb_gpr_write; ++i)
100          sensitive << (*(in_GPR_WRITE_ACK [i]));
101        for (uint32_t i=0; i<_param->_nb_spr_write; ++i)
102          sensitive << (*(in_SPR_WRITE_ACK [i]));       
103
104# ifdef SYSTEMCASS_SPECIFIC
105        // List dependency information
106# endif   
107          }
108
109        if ((_param->_bypass_write_scheme == BYPASS_WRITE_FROM_ALU) and
110            (_param->_nb_bypass_write > 0))
111          {
112        log_printf(INFO,Write_queue,FUNCTION,"Method - genMealy_bypass");
113
114        SC_METHOD (genMealy_bypass);
115        dont_initialize ();
116//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
117        sensitive << (*(in_WRITE_QUEUE_IN_VAL          ))
118                  << (*(in_WRITE_QUEUE_IN_WRITE_RD     ))
119                  << (*(in_WRITE_QUEUE_IN_NUM_REG_RD   ))
120                  << (*(in_WRITE_QUEUE_IN_DATA_RD      ))
121                  << (*(in_WRITE_QUEUE_IN_WRITE_RE     ))
122                  << (*(in_WRITE_QUEUE_IN_NUM_REG_RE   ))
123                  << (*(in_WRITE_QUEUE_IN_DATA_RE      ));
124        if (_param->_have_port_ooo_engine_id)
125        sensitive << (*(in_WRITE_QUEUE_IN_OOO_ENGINE_ID));
126
127
128# ifdef SYSTEMCASS_SPECIFIC
129        // List dependency information
130# endif   
131          }
132
133#endif
134      }
135    log_end(Write_queue,FUNCTION);
136  };
137   
138#undef  FUNCTION
139#define FUNCTION "Write_queue::~Write_queue"
140  Write_queue::~Write_queue (void)
141  {
142    log_begin(Write_queue,FUNCTION);
143
144#ifdef STATISTICS
145    if (usage_is_set(_usage,USE_STATISTICS))
146      {
147        log_printf(INFO,Write_queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str());
148       
149        delete _stat;
150      }
151#endif
152
153    log_printf(INFO,Write_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str());
154    deallocation ();
155
156    log_end(Write_queue,FUNCTION);
157  };
158
159}; // end namespace write_queue
160}; // end namespace write_unit
161}; // end namespace multi_write_unit
162}; // end namespace execute_loop
163}; // end namespace multi_execute_loop
164}; // end namespace core
165
166}; // end namespace behavioural
167}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.