source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Write_unit.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: 2.6 KB
Line 
1/*
2 * $Id: Write_unit.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/include/Write_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_write_unit {
16namespace write_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Write_unit::Write_unit"
21  Write_unit::Write_unit
22  (
23#ifdef SYSTEMC
24   sc_module_name name,
25#else
26   string name,
27#endif
28#ifdef STATISTICS
29   morpheo::behavioural::Parameters_Statistics * param_statistics,
30#endif
31   morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_begin(Write_unit,FUNCTION);
39
40// #if DEBUG_Write_unit == true
41//     log_printf(INFO,Write_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
42
43//     std::cout << *param << std::endl;
44// #endif   
45
46    log_printf(INFO,Write_unit,FUNCTION,_("<%s> Allocation"),_name.c_str());
47
48    allocation (
49#ifdef STATISTICS
50                param_statistics
51#endif
52                );
53
54#ifdef STATISTICS
55    if (usage_is_set(_usage,USE_STATISTICS))
56      { 
57        log_printf(INFO,Write_unit,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str());
58
59        statistics_declaration(param_statistics);
60      }
61#endif
62
63#ifdef VHDL
64    if (usage_is_set(_usage,USE_VHDL))
65      {
66        // generate the vhdl
67        log_printf(INFO,Write_unit,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
68       
69        vhdl();
70      }
71#endif
72
73#ifdef SYSTEMC
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76        log_printf(INFO,Write_unit,FUNCTION,_("<%s> Method - transition"),_name.c_str());
77
78        SC_METHOD (transition);
79        dont_initialize ();
80        sensitive << (*(in_CLOCK)).pos();
81       
82# ifdef SYSTEMCASS_SPECIFIC
83        // List dependency information
84# endif   
85       
86#endif
87      }
88    log_end(Write_unit,FUNCTION);
89  };
90   
91#undef  FUNCTION
92#define FUNCTION "Write_unit::~Write_unit"
93  Write_unit::~Write_unit (void)
94  {
95    log_begin(Write_unit,FUNCTION);
96
97#ifdef STATISTICS
98    if (usage_is_set(_usage,USE_STATISTICS))
99      {
100        log_printf(INFO,Write_unit,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str());
101
102        delete _stat;
103      }
104#endif
105
106    log_printf(INFO,Write_unit,FUNCTION,_("<%s> Deallocation"),_name.c_str());
107    deallocation ();
108
109    log_end(Write_unit,FUNCTION);
110  };
111
112}; // end namespace write_unit
113}; // end namespace multi_write_unit
114}; // end namespace execute_loop
115}; // end namespace multi_execute_loop
116}; // end namespace core
117
118}; // end namespace behavioural
119}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.