event_finder.hh (13522:1b2565619f41) event_finder.hh (13525:2d588ebdee7a)
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

--- 6 unchanged lines hidden (view full) ---

15 implied. See the License for the specific language governing
16 permissions and limitations under the License.
17
18 *****************************************************************************/
19
20#ifndef __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__
21#define __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__
22
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

--- 6 unchanged lines hidden (view full) ---

15 implied. See the License for the specific language governing
16 permissions and limitations under the License.
17
18 *****************************************************************************/
19
20#ifndef __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__
21#define __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__
22
23#include <sstream>
24
23#include "tlm_core/1/req_rsp/interfaces/tag.hh"
24
25namespace tlm
26{
27
28template <class IF, class T>
29class tlm_event_finder_t : public sc_core::sc_event_finder
30{

--- 20 unchanged lines hidden (view full) ---

51};
52
53template <class IF, class T>
54inline const sc_core::sc_event &
55tlm_event_finder_t<IF, T>::find_event(sc_core::sc_interface *if_p) const
56{
57 const IF *iface = if_p ? dynamic_cast<const IF *>(if_p) :
58 dynamic_cast<const IF *>(port()->_gem5Interface(0));
25#include "tlm_core/1/req_rsp/interfaces/tag.hh"
26
27namespace tlm
28{
29
30template <class IF, class T>
31class tlm_event_finder_t : public sc_core::sc_event_finder
32{

--- 20 unchanged lines hidden (view full) ---

53};
54
55template <class IF, class T>
56inline const sc_core::sc_event &
57tlm_event_finder_t<IF, T>::find_event(sc_core::sc_interface *if_p) const
58{
59 const IF *iface = if_p ? dynamic_cast<const IF *>(if_p) :
60 dynamic_cast<const IF *>(port()->_gem5Interface(0));
59 static sc_core::sc_event none;
60 if (iface == nullptr) {
61 if (iface == nullptr) {
61 report_error(sc_core::SC_ID_FIND_EVENT_, "port is not bound");
62 std::ostringstream out;
63 out << "port is not bound: port '" << port()->name() <<
64 "' (" << port()->kind() << ")";
65 SC_REPORT_ERROR(sc_core::SC_ID_FIND_EVENT_, out.str().c_str());
66 static sc_core::sc_event none;
62 return none;
63 }
64 return (const_cast<IF *>(iface)->*m_event_method)(nullptr);
65}
66
67} // namespace tlm
68
69#endif /* __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__ */
67 return none;
68 }
69 return (const_cast<IF *>(iface)->*m_event_method)(nullptr);
70}
71
72} // namespace tlm
73
74#endif /* __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_PORTS_EVENT_FINDER_HH__ */