00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __TLM_NONBLOCKING_PORT_H__
00019 #define __TLM_NONBLOCKING_PORT_H__
00020
00021 #include "tlm_h/tlm_req_rsp/tlm_1_interfaces/tlm_core_ifs.h"
00022 #include "tlm_h/tlm_req_rsp/tlm_ports/tlm_event_finder.h"
00023
00024 namespace tlm {
00025
00026 template < typename T >
00027 class tlm_nonblocking_get_port :
00028 public sc_core::sc_port< tlm_nonblocking_get_if< T > , 1 >
00029 {
00030 public:
00031 typedef tlm_nonblocking_get_if<T> get_if_type;
00032
00033 tlm_nonblocking_get_port( const char *port_name ) :
00034 sc_core::sc_port< tlm_nonblocking_get_if< T > , 1 >( port_name ) {}
00035
00036 sc_core::sc_event_finder& ok_to_get() const {
00037
00038 return *new tlm_event_finder_t< get_if_type , T >(
00039 *this,
00040 &get_if_type::ok_to_get );
00041
00042 }
00043
00044 };
00045
00046 template < typename T >
00047 class tlm_nonblocking_peek_port :
00048 public sc_core::sc_port< tlm_nonblocking_peek_if< T > , 1 >
00049 {
00050 public:
00051 typedef tlm_nonblocking_peek_if<T> peek_if_type;
00052
00053 tlm_nonblocking_peek_port( const char *port_name ) :
00054 sc_core::sc_port< tlm_nonblocking_peek_if< T > , 1 >( port_name ) {}
00055
00056 sc_core::sc_event_finder& ok_to_peek() const {
00057
00058 return *new tlm_event_finder_t< peek_if_type , T >(
00059 *this,
00060 &peek_if_type::ok_to_peek );
00061
00062 }
00063
00064 };
00065
00066
00067 template < typename T >
00068 class tlm_nonblocking_put_port :
00069 public sc_core::sc_port< tlm_nonblocking_put_if< T > , 1 >
00070 {
00071 public:
00072 typedef tlm_nonblocking_put_if<T> put_if_type;
00073
00074 tlm_nonblocking_put_port( const char *port_name ) :
00075 sc_core::sc_port< tlm_nonblocking_put_if< T > , 1 >( port_name ) {}
00076
00077 sc_core::sc_event_finder& ok_to_put() const {
00078
00079 return *new tlm_event_finder_t< put_if_type , T >(
00080 *this,
00081 &put_if_type::ok_to_put );
00082
00083 }
00084
00085 };
00086
00087 }
00088
00089 #endif