source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_vhdl_declaration.cpp @ 67

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

Ajout d'un nouveau composant : fifo generic (un port lecture et un port ecriture).

File size: 1.7 KB
Line 
1#ifdef VHDL
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Queue/include/Queue.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace generic {
14namespace queue {
15
16
17#undef  FUNCTION
18#define FUNCTION "Queue::vhdl_declaration"
19  void Queue::vhdl_declaration (Vhdl * & vhdl)
20  {
21    log_printf(FUNC,Queue,FUNCTION,"Begin");
22
23    vhdl->set_type    ("Tqueue","array ("+toString(_param->_size_queue-1)+" downto 0) of "+std_logic(_param->_size_data));
24   
25    vhdl->set_signal  ("reg_DATA             ", "Tqueue");
26    vhdl->set_signal  ("reg_FULL             ", 1);
27    vhdl->set_signal  ("reg_EMPTY            ", 1);
28    if (_param->_size_queue > 1)
29      {
30        vhdl->set_signal  ("reg_PTR_READ         ", log2(_param->_size_queue));
31        vhdl->set_signal  ("reg_PTR_WRITE        ", log2(_param->_size_queue));
32      }
33    vhdl->set_signal  ("signal_READ          ", 1);
34    vhdl->set_signal  ("signal_WRITE         ", 1);
35    vhdl->set_signal  ("signal_PTR_EQUAL     ", 1);
36
37    if (_param->_size_queue > 1)
38      {
39        vhdl->set_signal  ("signal_NEXT_PTR_READ ", log2(_param->_size_queue));
40        vhdl->set_signal  ("signal_NEXT_PTR_WRITE", log2(_param->_size_queue));
41      }
42
43    vhdl->set_signal  ("signal_NEXT_FULL     ", 1);
44    vhdl->set_signal  ("signal_NEXT_EMPTY    ", 1);
45   
46    if (_param->_size_queue > 1)
47      {
48        vhdl->set_constant("const_PTR_INIT       ", log2(_param->_size_queue), 0);
49        if (is_log2(_param->_size_queue) == false)
50          vhdl->set_constant("const_PTR_MAX        ", log2(_param->_size_queue), _param->_size_queue-1);
51      }
52    log_printf(FUNC,Queue,FUNCTION,"End");
53  };
54
55}; // end namespace queue
56}; // end namespace generic
57}; // end namespace behavioural
58}; // end namespace morpheo             
59#endif
Note: See TracBrowser for help on using the repository browser.