source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Multiplier/include/Multiplier.h @ 116

Last change on this file since 116 was 116, checked in by moulu, 15 years ago

1) added a generic multiplier (systemC isn't working with 8bits)
2) added a partial functionnal unit vhdl.

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1#ifndef morpheo_behavioural_generic_multiplier_Multiplier_h
2#define morpheo_behavioural_generic_multiplier_Multiplier_h
3
4/*
5 * $Id: Multiplier.h 116 2009-04-30 13:51:41Z moulu $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15
16#include "Behavioural/Generic/Multiplier/include/Parameters.h"
17#include "Behavioural/Generic/Multiplier/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#include <vector>
32
33namespace morpheo {
34namespace behavioural {
35
36namespace generic {
37namespace multiplier {
38
39
40  class Multiplier
41#if SYSTEMC
42    : public sc_module
43#endif
44  {
45    // -----[ fields ]----------------------------------------------------
46    // Parameters
47  protected : const std::string  _name;
48  protected : const Parameters * _param;
49  private   : const Tusage_t     _usage;
50
51#ifdef STATISTICS
52  public    : Stat                           * _stat;
53#endif
54
55  public    : Component                      * _component;
56  private   : Interfaces                     * _interfaces;
57
58#ifdef SYSTEMC
59    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
61    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62  public    : SC_CLOCK                      *  in_CLOCK        ;
63  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
64
65    // ~~~~~[ Interface : "multiplier" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66  public    : SC_IN (Tdata_t)               *   in_MULTIPLIER_DATA_IN_0;
67  public    : SC_IN (Tdata_t)               *   in_MULTIPLIER_DATA_IN_1;
68  public    : SC_IN (Tcontrol_t)            *   in_MULTIPLIER_NSTALL;
69
70  public    : SC_OUT(Tdata_t)               *  out_MULTIPLIER_DATA_LSB_OUT;
71  public    : SC_OUT(Tdata_t)               *  out_MULTIPLIER_DATA_MSB_OUT;
72   
73
74    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
75
76    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
77  private   : std::vector<result_t> * _pipeline;
78    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79  private   : Tdata_t                       sig_MULTIPLIER_DATA_IN_0;
80  private   : Tdata_t                       sig_MULTIPLIER_DATA_IN_1;
81#endif
82
83    // -----[ Methods ]---------------------------------------------------
84
85#ifdef SYSTEMC
86    SC_HAS_PROCESS (Multiplier);
87#endif
88  public  :          Multiplier             
89  (
90#ifdef SYSTEMC
91   sc_module_name                                name,
92#else                                         
93   std::string                                   name,
94#endif                                         
95#ifdef STATISTICS
96   morpheo::behavioural::Parameters_Statistics * param_statistics,
97#endif
98   Parameters                                  * param,
99   morpheo::behavioural::Tusage_t                usage
100   );
101  public  :          ~Multiplier             (void);
102                                               
103  private : void        allocation                (
104#ifdef STATISTICS
105                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
106#else
107                                                   void
108#endif
109                                                   );
110  private : void        deallocation              (void);
111                                               
112#ifdef SYSTEMC                                 
113  public  : void        transition                (void);
114  public  : void        genMealy                  (void);
115#endif                                         
116
117#if VHDL                                       
118  public  : void        vhdl                      (void);
119  private : void        vhdl_declaration          (Vhdl * & vhdl);
120  private : void        vhdl_body                 (Vhdl * & vhdl);
121
122  private : void        vhdl_xilinx_declaration   (Vhdl * & vhdl);
123  private : void        vhdl_xilinx_body          (Vhdl * & vhdl);
124#endif                                         
125
126#ifdef STATISTICS
127  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
128  public  : void        statistics_deallocation   (void);
129#endif
130#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
131  private : void        end_cycle                 (void);
132#endif
133  };
134
135}; // end namespace multiplier
136}; // end namespace generic
137
138}; // end namespace behavioural
139}; // end namespace morpheo             
140
141#endif
Note: See TracBrowser for help on using the repository browser.