pinapa-port-deco.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * arch-tag: Matthieu Moy  September 15, 2003 (parser/include/scp-port-deco.h)
00003  *------------------------------------------------------------------------------
00004  *         Copyright (c) STMicroelectronics,Verimag
00005  * Pinapa is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00018  * MA 02111-1307, USA
00019  *------------------------------------------------------------------------------
00020  *                 System Platform Group - HPC
00021  *******************************************************************************/
00022 
00037 #include "pinapa-parser-all.h"
00038 
00039 #ifndef PINAPA_BASIC_PORT_DECO_H
00040 #define PINAPA_BASIC_PORT_DECO_H
00041 
00042 #include <vector>
00043 #include <ext/hash_set>
00044 
00045 #include "pinapa-process-plus.h"
00046 #include "pinapa-decoration-base.h"
00047 #include "pinapa-systemc-light.h"
00048 
00049 namespace pinapa {
00050   
00051   class st_port_deco_t {
00052   public:
00053     st_port_deco_t() : m_is_array(false), m_index(NULL) {}
00055     const hash_set<sc_process_b *> & get_processes_using() const {return m_processes_using;}
00057     void add_process_using(sc_process_b * p) {m_processes_using.insert(p);}
00058     
00059     const vector<sc_port_base *> & get_bound_ports() const {return m_bound_ports;}
00060     void add_port_bound(sc_port_base * port) {m_bound_ports.push_back(port);}
00061     size_t get_number_of_bound_ports() const {return m_bound_ports.size();}
00062 
00063 #ifndef _WITH_SYSTEMC_2_0_
00064     const vector<sc_export_base *> & get_bound_exports() const {return m_bound_exports;}
00065     void add_export_bound(sc_export_base * e) {m_bound_exports.push_back(e);}
00066     size_t get_number_of_bound_exports() const {return m_bound_exports.size();}
00067 
00068 #endif
00069 
00070     void set_array(bool a) {m_is_array = a;}
00071     bool is_array() const {return m_is_array;}
00072 
00073     void set_index(tree i) {
00074       PINAPA_ASSERT(is_array(), "index can only be used on arrays");
00075       m_index = i;}
00076 
00077     tree get_index() const {
00078       PINAPA_ASSERT(is_array(), "index can only be used on arrays");
00079       return m_index;}
00080 
00081   private:
00083     hash_set<sc_process_b *> m_processes_using;
00084     vector<sc_port_base *> m_bound_ports;
00085 #ifndef _WITH_SYSTEMC_2_0_
00086     vector<sc_export_base *> m_bound_exports;
00087 #endif
00088     bool m_is_array;
00089     tree m_index;
00090   };
00091   
00092   typedef st_deco_first<st_port_deco_t,
00093                         sc_port_base> st_port_deco;
00094   typedef st_port_deco * port_deco;
00095     
00096 #ifndef _WITH_SYSTEMC_2_0_
00097   typedef st_deco_first<st_port_deco_t,
00098                         sc_export_base> st_export_deco;
00099   typedef st_export_deco * export_deco;
00100 #endif
00101     
00102 #ifdef PINAPA_TLM_BASIC
00103 
00109   class st_basic_target_port_deco_t {
00110   public:
00111     
00112   };
00113   typedef st_deco_first<st_basic_target_port_deco_t,
00114                         sc_core::sc_export_base> st_basic_target_port_deco;
00115   typedef st_basic_target_port_deco * basic_target_port_deco;
00116 
00122   class st_basic_initiator_port_deco_t {
00123   public:
00124     
00125   };
00126   typedef st_deco_first<st_basic_initiator_port_deco_t,
00127                         sc_core::sc_port_base> st_basic_initiator_port_deco;
00128   typedef st_basic_initiator_port_deco * basic_initiator_port_deco;
00129   
00130 #endif // PINAPA_TLM_BASIC  
00131 
00132 #ifdef PINAPA_TLM_TAC
00133 
00139   class st_tac_target_port_deco_t {
00140   public:
00141     
00142   };
00143   typedef st_deco_first<st_tac_target_port_deco_t,
00144                         sc_core::sc_export_base> st_tac_target_port_deco;
00145   typedef st_tac_target_port_deco * tac_target_port_deco;
00146 
00152   class st_tac_initiator_port_deco_t {
00153   public:
00154     
00155   };
00156   typedef st_deco_first<st_tac_initiator_port_deco_t,
00157                         sc_core::sc_port_base> st_tac_initiator_port_deco;
00158   typedef st_tac_initiator_port_deco * tac_initiator_port_deco;
00159   
00160 #endif // PINAPA_TLM_TAC  
00161 
00162 #ifdef PINAPA_TLM_BASE
00163 
00169   class st_tlm_target_port_deco_t {
00170   public:
00171     
00172   };
00173   typedef st_deco_first<st_tlm_target_port_deco_t,
00174                         sc_core::sc_export_base> st_tlm_target_port_deco;
00175   typedef st_tlm_target_port_deco * tlm_target_port_deco;
00176 
00182   class st_tlm_initiator_port_deco_t {
00183   public:
00184     
00185   };
00186   typedef st_deco_first<st_tlm_initiator_port_deco_t,
00187                         sc_core::sc_port_base> st_tlm_initiator_port_deco;
00188   typedef st_tlm_initiator_port_deco * tlm_initiator_port_deco;
00189 #endif // PINAPA_TLM_BASE
00190  
00191 }
00192   
00193 #endif // PINAPA_PORT_DECO_H
00194 
Generated by
Matthieu Moy <Matthieu.Moy@st.com>
Back to Pinapa Home Page