/* -*- c++ -*- * SOCLIB_LGPL_HEADER_BEGIN * * This file is part of SoCLib, GNU LGPLv2.1. * * SoCLib is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 of the License. * * SoCLib is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with SoCLib; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * SOCLIB_LGPL_HEADER_END * * Authors : Franck WAJSBÜRT, Abdelmalek SI MERABET * Date : january 2009 * Copyright: UPMC - LIP6 */ #ifndef SOCLIB_CABA_GATE_PORTS_H_ #define SOCLIB_CABA_GATE_PORTS_H_ #include "gate_signals_2.h" namespace soclib { namespace caba { template class GateTarget2 { public: sc_core::sc_out > cmd_data; sc_core::sc_in cmd_wok; sc_core::sc_out cmd_w; sc_core::sc_in > rsp_data; sc_core::sc_out rsp_r; sc_core::sc_in rsp_rok; GateTarget2(const std::string &name = sc_gen_unique_name("gate_target_2_")) : cmd_data ((name+"cmd_data").c_str()), cmd_wok ((name+"cmd_wok").c_str()), cmd_w ((name+"cmd_w").c_str()), rsp_data ((name+"rsp_data").c_str()), rsp_r ((name+"rsp_r").c_str()), rsp_rok ((name+"rsp_rok").c_str()) { } void operator () (GateSignals2 &sig) { cmd_data (sig.cmd_data); cmd_wok (sig.cmd_r_wok); cmd_w (sig.cmd_w_rok); rsp_data (sig.rsp_data); rsp_r (sig.rsp_r_wok); rsp_rok (sig.rsp_w_rok); } void operator () (GateTarget2 &port) { cmd_data (port.cmd_data); cmd_wok (port.cmd_wok); cmd_w (port.cmd_w); rsp_data (port.rsp_data); rsp_r (port.rsp_r); rsp_rok (port.rsp_rok); } }; template class GateInitiator2 { public: sc_core::sc_in > cmd_data; sc_core::sc_out cmd_r; sc_core::sc_in cmd_rok; sc_core::sc_out > rsp_data; sc_core::sc_in rsp_wok; sc_core::sc_out rsp_w; GateInitiator2(const std::string &name = sc_gen_unique_name("gate_initiator_2_")) : cmd_data ((name+"cmd_data").c_str()), cmd_r ((name+"cmd_r").c_str()), cmd_rok ((name+"cmd_rok").c_str()), rsp_data ((name+"rsp_data").c_str()), rsp_wok ((name+"rsp_wok").c_str()), rsp_w ((name+"rsp_w").c_str()) { } void operator () (GateSignals2 &sig) { cmd_data (sig.cmd_data); cmd_r (sig.cmd_r_wok); cmd_rok (sig.cmd_w_rok); rsp_data (sig.rsp_data); rsp_wok (sig.rsp_r_wok); rsp_w (sig.rsp_w_rok); } void operator () (GateInitiator2 &port) { cmd_data (port.cmd_data); cmd_r (port.cmd_r); cmd_rok (port.cmd_rok); rsp_data (port.rsp_data); rsp_wok (port.rsp_wok); rsp_w (port.rsp_w); } }; }} #endif // SOCLIB_CABA_GATE_PORTS_H_