source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/include/Comparator.h @ 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.8 KB
Line 
1#ifndef morpheo_behavioural_generic_comparator_Comparator_h
2#define morpheo_behavioural_generic_comparator_Comparator_h
3
4/*
5 * $Id: Comparator.h 113 2009-04-14 18:39:12Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15
16#include "Behavioural/Generic/Comparator/include/Parameters.h"
17#include "Behavioural/Generic/Comparator/include/Types.h"
18#ifdef STATISTICS
19#include "Behavioural/include/Stat.h"
20#endif
21#include "Behavioural/include/Component.h"
22#ifdef VHDL
23#include "Behavioural/include/Vhdl.h"
24#endif
25#include "Behavioural/include/Usage.h"
26
27#include "Common/include/ToString.h"
28#include "Common/include/Debug.h"
29
30#include <iostream>
31
32namespace morpheo {
33namespace behavioural {
34
35namespace generic {
36namespace comparator {
37
38
39  class Comparator
40#if SYSTEMC
41    : public sc_module
42#endif
43  {
44    // -----[ fields ]----------------------------------------------------
45    // Parameters
46  protected : const std::string  _name;
47  protected : const Parameters * _param;
48  private   : const Tusage_t     _usage;
49
50#ifdef STATISTICS
51  public    : Stat                           * _stat;
52#endif
53
54  public    : Component                      * _component;
55  private   : Interfaces                     * _interfaces;
56
57#ifdef SYSTEMC
58    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60  public    : SC_CLOCK                      *  in_CLOCK        ;
61  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
62
63    // ~~~~~[ Interface : "compare" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64  public    : SC_IN (Tdata_t   )            *  in_COMPARE_DATA_0;
65  public    : SC_IN (Tdata_t   )            *  in_COMPARE_DATA_1;
66  public    : SC_OUT(Tcontrol_t)            * out_COMPARE_TEST  ;
67
68    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
69
70    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
71
72    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73#endif
74
75    // -----[ Methods ]---------------------------------------------------
76
77#ifdef SYSTEMC
78    SC_HAS_PROCESS (Comparator);
79#endif
80  public  :          Comparator             
81  (
82#ifdef SYSTEMC
83   sc_module_name                                name,
84#else                                         
85   std::string                                   name,
86#endif                                         
87#ifdef STATISTICS
88   morpheo::behavioural::Parameters_Statistics * param_statistics,
89#endif
90   Parameters                                  * param,
91   morpheo::behavioural::Tusage_t                usage
92   );
93  public  :          ~Comparator             (void);
94                                               
95  private : void        allocation                (
96#ifdef STATISTICS
97                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
98#else
99                                                   void
100#endif
101                                                   );
102  private : void        deallocation              (void);
103                                               
104#ifdef SYSTEMC                                 
105  public  : void        transition                (void);
106  public  : void        genMealy                  (void);
107#endif                                         
108
109#if VHDL                                       
110  public  : void        vhdl                      (void);
111  private : void        vhdl_declaration          (Vhdl * & vhdl);
112  private : void        vhdl_body                 (Vhdl * & vhdl);
113
114  private : void        vhdl_xilinx_declaration   (Vhdl * & vhdl);
115  private : void        vhdl_xilinx_body          (Vhdl * & vhdl);
116#endif                                         
117
118#ifdef STATISTICS
119  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
120  public  : void        statistics_deallocation   (void);
121#endif
122#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
123  private : void        end_cycle                 (void);
124#endif
125  };
126
127}; // end namespace comparator
128}; // end namespace generic
129
130}; // end namespace behavioural
131}; // end namespace morpheo             
132
133#endif
Note: See TracBrowser for help on using the repository browser.