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, Asim |
---|
24 | * Cesar Fuguet <cesar.fuguet-tortolero@lip6.fr>, 2014 |
---|
25 | * |
---|
26 | */ |
---|
27 | #ifndef SOCLIB_VCI_TSAR_CONFIG_H |
---|
28 | #define SOCLIB_VCI_TSAR_CONFIG_H |
---|
29 | |
---|
30 | #include <systemc> |
---|
31 | #include "caba_base_module.h" |
---|
32 | #include "mapping_table.h" |
---|
33 | #include "int_tab.h" |
---|
34 | #include "vci_target.h" |
---|
35 | |
---|
36 | namespace soclib { |
---|
37 | namespace caba { |
---|
38 | |
---|
39 | using namespace sc_core; |
---|
40 | using namespace soclib::common; |
---|
41 | |
---|
42 | template<typename vci_param> |
---|
43 | class VciTsarConfig : public soclib::caba::BaseModule |
---|
44 | { |
---|
45 | typedef typename vci_param::fast_addr_t vci_addr_t; |
---|
46 | typedef typename vci_param::fast_data_t vci_data_t; |
---|
47 | typedef typename vci_param::srcid_t vci_srcid_t; |
---|
48 | typedef typename vci_param::trdid_t vci_trdid_t; |
---|
49 | typedef typename vci_param::pktid_t vci_pktid_t; |
---|
50 | |
---|
51 | public: |
---|
52 | |
---|
53 | enum fsm_state_e |
---|
54 | { |
---|
55 | IDLE, |
---|
56 | RSP_WRITE, |
---|
57 | RSP_READ, |
---|
58 | RSP_ERROR, |
---|
59 | }; |
---|
60 | |
---|
61 | // Ports |
---|
62 | sc_core::sc_in<bool> p_clk; |
---|
63 | sc_core::sc_in<bool> p_resetn; |
---|
64 | sc_core::sc_out<int> p_blackhole_pos; |
---|
65 | VciTarget<vci_param> p_vci; |
---|
66 | |
---|
67 | VciTsarConfig(sc_module_name name, |
---|
68 | const IntTab &index, |
---|
69 | const MappingTable &mt); |
---|
70 | |
---|
71 | ~VciTsarConfig(); |
---|
72 | |
---|
73 | |
---|
74 | private: |
---|
75 | |
---|
76 | // Registers |
---|
77 | sc_signal<int> r_fsm_state; |
---|
78 | |
---|
79 | sc_signal<vci_data_t> r_rdata; |
---|
80 | sc_signal<vci_srcid_t> r_srcid; |
---|
81 | sc_signal<vci_trdid_t> r_trdid; |
---|
82 | sc_signal<vci_pktid_t> r_pktid; |
---|
83 | |
---|
84 | sc_signal<int> r_blackhole_pos; |
---|
85 | |
---|
86 | std::list<soclib::common::Segment> m_seglist; |
---|
87 | |
---|
88 | void transition(); |
---|
89 | void genMoore(); |
---|
90 | |
---|
91 | protected: |
---|
92 | |
---|
93 | SC_HAS_PROCESS(VciTsarConfig); |
---|
94 | |
---|
95 | public: |
---|
96 | |
---|
97 | void print_trace(); |
---|
98 | }; |
---|
99 | |
---|
100 | }} |
---|
101 | |
---|
102 | #endif /* SOCLIB_VCI_TSAR_CONFIG_H */ |
---|
103 | |
---|
104 | // Local Variables: |
---|
105 | // tab-width: 4 |
---|
106 | // c-basic-offset: 4 |
---|
107 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
108 | // indent-tabs-mode: nil |
---|
109 | // End: |
---|
110 | |
---|
111 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
112 | |
---|