[647] | 1 | /* -*- c++ -*- |
---|
| 2 | * |
---|
| 3 | * SOCLIB_LGPL_HEADER_BEGIN |
---|
| 4 | * |
---|
| 5 | * This file is part of SoCLib, GNU LGPLv2.1. |
---|
| 6 | * |
---|
| 7 | * SoCLib is free software; you can redistribute it and/or modify it |
---|
| 8 | * under the terms of the GNU Lesser General Public License as published |
---|
| 9 | * by the Free Software Foundation; version 2.1 of the License. |
---|
| 10 | * |
---|
| 11 | * SoCLib is distributed in the hope that it will be useful, but |
---|
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 14 | * Lesser General Public License for more details. |
---|
| 15 | * |
---|
| 16 | * You should have received a copy of the GNU Lesser General Public |
---|
| 17 | * License along with SoCLib; if not, write to the Free Software |
---|
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
---|
| 19 | * 02110-1301 USA |
---|
| 20 | * |
---|
| 21 | * SOCLIB_LGPL_HEADER_END |
---|
| 22 | * |
---|
| 23 | * Copyright (c) UPMC, Lip6 |
---|
| 24 | * Nicolas Pouillon <nipo@ssji.net>, 2009 |
---|
| 25 | * |
---|
| 26 | * Maintainers: nipo |
---|
| 27 | */ |
---|
| 28 | #ifndef SOCLIB_VCI_XICU_H |
---|
| 29 | #define SOCLIB_VCI_XICU_H |
---|
| 30 | |
---|
| 31 | #include <systemc> |
---|
| 32 | #include "vci_target_fsm.h" |
---|
| 33 | #include "caba_base_module.h" |
---|
| 34 | #include "mapping_table.h" |
---|
| 35 | |
---|
| 36 | namespace soclib { |
---|
| 37 | namespace caba { |
---|
| 38 | |
---|
| 39 | template<typename vci_param> |
---|
| 40 | class VciXicu |
---|
| 41 | : public caba::BaseModule |
---|
| 42 | { |
---|
| 43 | private: |
---|
| 44 | std::list<soclib::common::Segment> m_seglist; |
---|
| 45 | soclib::caba::VciTargetFsm<vci_param, true> m_vci_fsm; |
---|
| 46 | |
---|
| 47 | const size_t m_pti_count; |
---|
| 48 | const size_t m_hwi_count; |
---|
| 49 | const size_t m_wti_count; |
---|
| 50 | const size_t m_irq_count; |
---|
| 51 | |
---|
| 52 | uint32_t* r_msk_pti; |
---|
| 53 | uint32_t* r_msk_wti; |
---|
| 54 | uint32_t* r_msk_hwi; |
---|
| 55 | uint32_t r_pti_pending; |
---|
| 56 | uint32_t r_wti_pending; |
---|
| 57 | uint32_t r_hwi_pending; |
---|
| 58 | uint32_t *r_pti_per; |
---|
| 59 | uint32_t *r_pti_val; |
---|
| 60 | uint32_t *r_wti_reg; |
---|
| 61 | |
---|
| 62 | uint32_t m_clock_cycles; |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | bool on_write( int seg, |
---|
| 66 | typename vci_param::addr_t addr, |
---|
| 67 | typename vci_param::data_t data, |
---|
| 68 | int be ); |
---|
| 69 | bool on_read( int seg, |
---|
| 70 | typename vci_param::addr_t addr, |
---|
| 71 | typename vci_param::data_t &data ); |
---|
| 72 | |
---|
| 73 | void transition(); |
---|
| 74 | void genMoore(); |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | protected: |
---|
| 78 | SC_HAS_PROCESS(VciXicu); |
---|
| 79 | |
---|
| 80 | public: |
---|
| 81 | sc_core::sc_in<bool> p_clk; |
---|
| 82 | sc_core::sc_in<bool> p_resetn; |
---|
| 83 | soclib::caba::VciTarget<vci_param> p_vci; |
---|
| 84 | sc_core::sc_out<bool>* p_irq; |
---|
| 85 | sc_core::sc_in<bool>* p_hwi; |
---|
| 86 | |
---|
| 87 | void print_trace( size_t channel ); |
---|
| 88 | |
---|
| 89 | ~VciXicu(); |
---|
| 90 | |
---|
| 91 | VciXicu( |
---|
| 92 | sc_core::sc_module_name name, |
---|
| 93 | const soclib::common::MappingTable &mt, |
---|
| 94 | const soclib::common::IntTab &index, |
---|
| 95 | size_t pti_count, |
---|
| 96 | size_t hwi_count, |
---|
| 97 | size_t wti_count, |
---|
| 98 | size_t irq_count); |
---|
| 99 | |
---|
| 100 | soclib_static_assert(vci_param::B == 4); |
---|
| 101 | }; |
---|
| 102 | |
---|
| 103 | }} |
---|
| 104 | |
---|
| 105 | #endif /* SOCLIB_VCI_XICU_H */ |
---|
| 106 | |
---|
| 107 | // Local Variables: |
---|
| 108 | // tab-width: 4 |
---|
| 109 | // c-basic-offset: 4 |
---|
| 110 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 111 | // indent-tabs-mode: nil |
---|
| 112 | // End: |
---|
| 113 | |
---|
| 114 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 115 | |
---|