1 /***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 15 implied. See the License for the specific language governing 16 permissions and limitations under the License. 17 18 *****************************************************************************/ 19 20 //===================================================================== 21 /// @file initiator_top.h 22 // 23 /// @brief Initiator top module contains a traffic generator and an 24 /// example initiator module unique for the example 25 // 26 //===================================================================== 27 // Original Authors: 28 // Bill Bunton, ESLX 29 // Charles Wilson, ESLX 30 // Jack Donovan, ESLX 31 //===================================================================== 32 33 #ifndef __INITIATOR_TOP_H__ 34 #define __INITIATOR_TOP_H__ 35 36 #include "tlm.h" // TLM headers 37 #include "select_initiator.h" // AT initiator 38 #include "traffic_generator.h" // traffic generator 39 40 class initiator_top 41 : public sc_core::sc_module 42 , virtual public tlm::tlm_bw_transport_if<> // backward non-blocking interface 43 { 44 //Member Methods ===================================================== 45 46 public: 47 48 //===================================================================== 49 /// @fn initiator_top::initiator_top 50 // 51 /// @brief initiator_top constructor 52 // 53 /// @details 54 /// Initiator top module contains a traffic generator and an example 55 /// unique initiator module 56 // 57 //===================================================================== 58 initiator_top 59 ( sc_core::sc_module_name name ///< module name 60 , const unsigned int ID ///< initiator ID 61 , sc_dt::uint64 base_address_1 ///< first base address 62 , sc_dt::uint64 base_address_2 ///< second base address 63 , unsigned int active_txn_count ///< Max number of active transactions 64 ); 65 66 private: 67 68 /// Not Implemented for this example but required by the initiator socket 69 void 70 invalidate_direct_mem_ptr 71 ( sc_dt::uint64 start_range 72 , sc_dt::uint64 end_range 73 ); 74 75 /// Not Implemented for this example but require by the initiator socket 76 tlm::tlm_sync_enum 77 nb_transport_bw 78 ( tlm::tlm_generic_payload &payload 79 , tlm::tlm_phase &phase 80 , sc_core::sc_time &delta 81 ); 82 83 //Member Variables/Objects =========================================== 84 85 public: 86 87 tlm::tlm_initiator_socket<> initiator_socket; ///< processor socket 88 89 private: 90 91 typedef tlm::tlm_generic_payload *gp_ptr; ///< Generic Payload pointer 92 93 sc_core::sc_fifo <gp_ptr> m_request_fifo; ///< request SC FIFO 94 sc_core::sc_fifo <gp_ptr> m_response_fifo; ///< response SC FIFO 95 96 const unsigned int m_ID; ///< initiator ID 97 98 select_initiator m_initiator; ///< TLM initiator instance 99 traffic_generator m_traffic_gen; ///< traffic generator instance 100 101 }; 102 103 #endif /* __INITIATOR_TOP_H__ */ 104