source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp @ 15

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

Interface normalisé
Début du banc de registres multi niveaux

File size: 2.4 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
9
10namespace morpheo                    {
11namespace behavioural                {
12namespace generic                    {
13namespace registerfile               {
14namespace registerfile_monolithic    {
15
16  RegisterFile_Monolithic::RegisterFile_Monolithic (
17#ifdef SYSTEMC
18                                                    sc_module_name name,
19#else
20                                                    string name        ,
21#endif
22#ifdef STATISTICS
23                                                    morpheo::behavioural::Parameters_Statistics             param_statistics,
24#endif
25                                                    morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters param ):
26    _name   (name),
27    _param (param)
28  {
29#ifdef STATISTICS
30    _stat = new Statistics (static_cast<string>(_name),
31                            param_statistics          ,
32                            param);
33#endif
34
35#ifdef VHDL_TESTBENCH
36    _vhdl_testbench = new Vhdl_Testbench (_name);
37    vhdl_testbench_port           (*_vhdl_testbench);
38    _vhdl_testbench->set_clock    ("in_CLOCK",true);
39#endif
40
41#ifdef VHDL
42    // generate the vhdl
43    vhdl();
44#endif
45
46#ifdef SYSTEMC
47    allocation ();
48
49    SC_METHOD (transition);
50    dont_initialize ();
51    sensitive_pos << *(in_CLOCK);
52   
53    SC_METHOD (genMealy_read);
54    dont_initialize ();
55    sensitive_neg << *(in_CLOCK);
56    for (uint32_t i=0; i<_param._nb_port_read; i++)
57      sensitive << *(in_READ_VAL     [i])
58                << *(in_READ_ADDRESS [i]);
59
60#ifdef SYSTEMCASS_SPECIFIC
61    // List dependency information
62    for (uint32_t i=0; i<_param._nb_port_read; i++)
63      {
64        (*(out_READ_DATA [i])) (*( in_READ_VAL     [i]));
65        (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i]));
66      }
67#endif   
68
69    for (uint32_t i=0; i<_param._nb_port_read ; i++)
70      PORT_WRITE(out_READ_ACK  [i], 1);
71    for (uint32_t i=0; i<_param._nb_port_write; i++)
72      PORT_WRITE(out_WRITE_ACK [i], 1);
73#endif
74  };
75 
76  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
77  {
78#ifdef SYSTEMC
79    deallocation ();
80#endif
81
82#ifdef VHDL_TESTBENCH
83    // generate the test bench
84    _vhdl_testbench->generate_file();
85    delete _vhdl_testbench;
86#endif
87
88#ifdef STATISTICS
89    _stat->generate_file(statistics(0));
90    delete _stat;
91#endif
92  };
93
94}; // end namespace registerfile_monolithic
95}; // end namespace registerfile
96}; // end namespace generic
97}; // end namespace behavioural         
98}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.