source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_port.cpp @ 10

Last change on this file since 10 was 10, checked in by rosiere, 17 years ago
File size: 1.7 KB
Line 
1#ifdef VHDL
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace registerfile_multi_banked {
15
16#ifdef VHDL_TESTBENCH
17# define VHDL_SET_PORT(name,direction,size) vhdl.set_port (name,direction,size); _vhdl_testbench->set_port (name,direction,size);
18#else
19# define VHDL_SET_PORT(name,direction,size) vhdl.set_port (name,direction,size);
20#endif
21
22  void RegisterFile_Multi_Banked::vhdl_port (Vhdl & vhdl)
23  {
24    log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_port","Begin");
25
26    vhdl.set_port (" in_CLOCK" , IN, 1);
27    VHDL_SET_PORT (" in_NRESET", IN, 1);
28
29    // ----- Interface Read
30    for (uint32_t i=0; i<_param._nb_port_read; i++)
31      {
32        VHDL_SET_PORT(" in_READ_VAL_"+toString(i)+"     ", IN, 1);
33        VHDL_SET_PORT("out_READ_ACK_"+toString(i)+"     ",OUT, 1);
34        VHDL_SET_PORT(" in_READ_ADDRESS_"+toString(i)+" ", IN, static_cast<uint32_t>(log2(_param._nb_word)));
35        VHDL_SET_PORT("out_READ_DATA_"+toString(i)+"    ",OUT, _param._size_word);
36      }
37
38    // ----- Interface Write
39    for (uint32_t i=0; i<_param._nb_port_write; i++)
40      {
41        VHDL_SET_PORT(" in_WRITE_VAL_"+toString(i)+"    ", IN, 1);
42        VHDL_SET_PORT("out_WRITE_ACK_"+toString(i)+"    ",OUT, 1);
43        VHDL_SET_PORT(" in_WRITE_ADDRESS_"+toString(i)+"", IN, static_cast<uint32_t>(log2(_param._nb_word)));
44        VHDL_SET_PORT(" in_WRITE_DATA_"+toString(i)+"   ", IN, _param._size_word);                           
45      }
46   
47    log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_port","End");
48  };
49
50}; // end namespace registerfile_multi_banked
51}; // end namespace generic
52
53}; // end namespace behavioural
54}; // end namespace morpheo             
55#endif
Note: See TracBrowser for help on using the repository browser.