TLM-2.0: include/tlm/tlm_1/tlm_req_rsp/tlm_ports/tlm_nonblocking_port.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# include/tlm/tlm_1/tlm_req_rsp/tlm_ports/tlm_nonblocking_port.h

Go to the documentation of this file.

    00001 /*****************************************************************************
    00002
    00003   The following code is derived, directly or indirectly, from the SystemC
    00004   source code Copyright (c) 1996-2008 by all Contributors.
    00005   All Rights reserved.
    00006
    00007   The contents of this file are subject to the restrictions and limitations
    00008   set forth in the SystemC Open Source License Version 3.0 (the "License");
    00009   You may not use this file except in compliance with such restrictions and
    00010   limitations. You may obtain instructions on how to receive a copy of the
    00011   License at http://www.systemc.org/. Software distributed by Contributors
    00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
    00013   ANY KIND, either express or implied. See the License for the specific
    00014   language governing rights and limitations under the License.
    00015
    00016  *****************************************************************************/
    00017
    00018 #ifndef __TLM_NONBLOCKING_PORT_H__
    00019 #define __TLM_NONBLOCKING_PORT_H__
    00020
    00021 #include "tlm_1/tlm_req_rsp/tlm_1_interfaces/tlm_core_ifs.h"
    00022 #include "tlm_1/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 } // namespace tlm
    00088
    00089 #endif