[880] | 1 | /* -*- c++ -*- |
---|
| 2 | * |
---|
| 3 | * SOCLIB_LGPL_HEADER_BEGIN |
---|
[881] | 4 | * |
---|
[880] | 5 | * This file is part of SoCLib, GNU LGPLv2.1. |
---|
[881] | 6 | * |
---|
[880] | 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. |
---|
[881] | 10 | * |
---|
[880] | 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. |
---|
[881] | 15 | * |
---|
[880] | 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 |
---|
[881] | 20 | * |
---|
[880] | 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 |
---|
[881] | 41 | : public caba::BaseModule |
---|
[880] | 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; |
---|
[881] | 51 | const size_t m_cfg_count; |
---|
[880] | 52 | |
---|
| 53 | uint32_t* r_msk_pti; |
---|
| 54 | uint32_t* r_msk_wti; |
---|
| 55 | uint32_t* r_msk_hwi; |
---|
| 56 | uint32_t r_pti_pending; |
---|
| 57 | uint32_t r_wti_pending; |
---|
| 58 | uint32_t r_hwi_pending; |
---|
| 59 | uint32_t *r_pti_per; |
---|
| 60 | uint32_t *r_pti_val; |
---|
| 61 | uint32_t *r_wti_reg; |
---|
[881] | 62 | uint32_t *r_cfg_reg; |
---|
[880] | 63 | |
---|
| 64 | uint32_t m_clock_cycles; |
---|
| 65 | |
---|
| 66 | |
---|
[881] | 67 | bool on_write( int seg, |
---|
| 68 | typename vci_param::addr_t addr, |
---|
| 69 | typename vci_param::data_t data, |
---|
[880] | 70 | int be ); |
---|
[881] | 71 | bool on_read( int seg, |
---|
| 72 | typename vci_param::addr_t addr, |
---|
[880] | 73 | typename vci_param::data_t &data ); |
---|
| 74 | |
---|
| 75 | void transition(); |
---|
| 76 | void genMoore(); |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | protected: |
---|
| 80 | SC_HAS_PROCESS(VciXicu); |
---|
| 81 | |
---|
| 82 | public: |
---|
| 83 | sc_core::sc_in<bool> p_clk; |
---|
| 84 | sc_core::sc_in<bool> p_resetn; |
---|
| 85 | soclib::caba::VciTarget<vci_param> p_vci; |
---|
| 86 | sc_core::sc_out<bool>* p_irq; |
---|
| 87 | sc_core::sc_in<bool>* p_hwi; |
---|
[881] | 88 | sc_core::sc_out<uint32_t>* p_cfg; |
---|
[880] | 89 | |
---|
| 90 | void print_trace( size_t channel ); |
---|
| 91 | |
---|
[881] | 92 | ~VciXicu(); |
---|
[880] | 93 | |
---|
[881] | 94 | VciXicu( sc_core::sc_module_name name, |
---|
| 95 | const soclib::common::MappingTable &mt, |
---|
| 96 | const soclib::common::IntTab &index, |
---|
| 97 | size_t pti_count, |
---|
| 98 | size_t hwi_count, |
---|
| 99 | size_t wti_count, |
---|
| 100 | size_t irq_count, |
---|
| 101 | size_t cfg_count = 0 ); |
---|
[880] | 102 | |
---|
| 103 | soclib_static_assert(vci_param::B == 4); |
---|
| 104 | }; |
---|
| 105 | |
---|
| 106 | }} |
---|
| 107 | |
---|
| 108 | #endif /* SOCLIB_VCI_XICU_H */ |
---|
| 109 | |
---|
| 110 | // Local Variables: |
---|
| 111 | // tab-width: 4 |
---|
| 112 | // c-basic-offset: 4 |
---|
| 113 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 114 | // indent-tabs-mode: nil |
---|
| 115 | // End: |
---|
| 116 | |
---|
| 117 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 118 | |
---|