/* -*- 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 * * Copyright (c) UPMC, Lip6, Asim * Nicolas Pouillon , 2007 * * Maintainers: alain */ #ifndef SOCLIB_VCI_TTY_TSAR_H #define SOCLIB_VCI_TTY_TSAR_H #include #include "caba_base_module.h" #include "tty_wrapper.h" #include "mapping_table.h" #include "int_tab.h" #include "vci_target.h" namespace soclib { namespace caba { using namespace sc_core; using namespace soclib::common; /////////////////////////////////////////// template class VciTtyTsar /////////////////////////////////////////// : public soclib::caba::BaseModule { public: typedef typename vci_param::fast_addr_t vci_addr_t; typedef typename vci_param::fast_data_t vci_data_t; typedef typename vci_param::srcid_t vci_srcid_t; typedef typename vci_param::trdid_t vci_trdid_t; typedef typename vci_param::pktid_t vci_pktid_t; enum fsm_state_e { IDLE, RSP_WRITE, RSP_READ, RSP_ERROR, }; // Ports sc_in p_clk; sc_in p_resetn; soclib::caba::VciTarget p_vci; sc_out* p_irq_rx; sc_out* p_irq_tx; VciTtyTsar( sc_module_name name, const IntTab &index, const MappingTable &mt, const std::vector &names ); VciTtyTsar( sc_module_name name, const IntTab &index, const MappingTable &mt, const char* first_name, ...); ~VciTtyTsar(); private: // Registers sc_signal r_fsm_state; sc_signal r_rdata; sc_signal r_srcid; sc_signal r_trdid; sc_signal r_pktid; sc_signal r_rx_irq_enable[32]; sc_signal r_tx_irq_enable[32]; std::vector m_term; std::list m_seglist; void transition(); void genMoore(); void init(const std::vector &names ); protected: SC_HAS_PROCESS(VciTtyTsar); public: void print_trace( size_t channel ); }; }} #endif /* SOCLIB_VCI_TTY_TSAR_H */ // Local Variables: // tab-width: 4 // c-basic-offset: 4 // c-file-offsets:((innamespace . 0)(inline-open . 0)) // indent-tabs-mode: nil // End: // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4