tlm_ifs.svh

Go to the documentation of this file.
00001 // $Id: tlm__ifs_8svh-source.html,v 1.1 2008/10/07 21:54:09 alex.marin Exp $
00002 //----------------------------------------------------------------------
00003 //   Copyright 2007-2008 Mentor Graphics Corporation
00004 //   Copyright 2007-2008 Cadence Design Systems, Inc.
00005 //   All Rights Reserved Worldwide
00006 //
00007 //   Licensed under the Apache License, Version 2.0 (the
00008 //   "License"); you may not use this file except in
00009 //   compliance with the License.  You may obtain a copy of
00010 //   the License at
00011 //
00012 //       http://www.apache.org/licenses/LICENSE-2.0
00013 //
00014 //   Unless required by applicable law or agreed to in
00015 //   writing, software distributed under the License is
00016 //   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
00017 //   CONDITIONS OF ANY KIND, either express or implied.  See
00018 //   the License for the specific language governing
00019 //   permissions and limitations under the License.
00020 //----------------------------------------------------------------------
00021 
00022 //----------------------------------------------------------------------
00023 //
00024 // TLM Interfaces
00025 //
00026 //----------------------------------------------------------------------
00027 //
00028 // The unidirectional TLM interfaces are divided into put, get and peek
00029 // interfaces, and blocking, nonblocking and combined interfaces.
00030 // 
00031 // A blocking call always succeeds, but may need to consume time to do
00032 // so. As a result, these methods must be tasks.
00033 //
00034 // A nonblocking call may not succeed, but consumes no time. As a result,
00035 // these methods are functions.
00036 //
00037 // The difference between get and peek is that get consumes the data
00038 // while peek does not. So successive calls to peek with no calls get
00039 // or try_get are guaranteed to return the same value.
00040 //
00041 // The transport interface is a bidirectional blocking interface used
00042 // when the request and response are tightly coupled in a one to one
00043 // relationship.
00044 //----------------------------------------------------------------------
00045 
00046 `define TASK_ERROR "TLM interface task not implemented"
00047 `define FUNCTION_ERROR "TLM interface function not implemented"
00048 
00049 virtual class tlm_if_base #(type T1=int, type T2=int);
00050 
00051   virtual task put( input T1 t );
00052     ovm_report_error("put", `TASK_ERROR);
00053   endtask
00054 
00055   virtual task get( output T2 t );
00056     ovm_report_error("get", `TASK_ERROR);
00057   endtask
00058 
00059   virtual task peek( output T2 t );
00060     ovm_report_error("peek", `TASK_ERROR);
00061   endtask
00062 
00063   virtual function bit try_put( input T1 t );
00064     ovm_report_error("try_put", `FUNCTION_ERROR);
00065     return 0;
00066   endfunction
00067 
00068   virtual function bit can_put();
00069     ovm_report_error("can_put", `FUNCTION_ERROR);
00070     return 0;
00071   endfunction
00072 
00073   virtual function bit try_get( output T2 t );
00074     ovm_report_error("try_get", `FUNCTION_ERROR);
00075     return 0;
00076   endfunction
00077 
00078   virtual function bit can_get();
00079     ovm_report_error("can_get", `FUNCTION_ERROR);
00080     return 0;
00081   endfunction
00082 
00083   virtual function bit try_peek( output T2 t );
00084     ovm_report_error("try_peek", `FUNCTION_ERROR);
00085     return 0;
00086   endfunction
00087 
00088   virtual function bit can_peek();
00089     ovm_report_error("can_ppeek", `FUNCTION_ERROR);
00090     return 0;
00091   endfunction
00092 
00093   virtual task transport( input T1 req , output T2 rsp );
00094     ovm_report_error("transport", `TASK_ERROR);
00095   endtask
00096 
00097   virtual function bit nb_transport(input T1 req, output T2 rsp);
00098     ovm_report_error("nb_transport", `FUNCTION_ERROR);
00099     return 0;
00100   endfunction
00101 
00102   virtual function void write( input T1 t );
00103     ovm_report_error("write", `FUNCTION_ERROR);
00104   endfunction
00105 
00106 endclass
00107 
00108 // primtive interfaces
00109 `define TLM_BLOCKING_PUT_MASK          (1<<0)
00110 `define TLM_BLOCKING_GET_MASK          (1<<1)
00111 `define TLM_BLOCKING_PEEK_MASK         (1<<2)
00112 `define TLM_BLOCKING_TRANSPORT_MASK    (1<<3)
00113 
00114 `define TLM_NONBLOCKING_PUT_MASK       (1<<4)
00115 `define TLM_NONBLOCKING_GET_MASK       (1<<5)
00116 `define TLM_NONBLOCKING_PEEK_MASK      (1<<6)
00117 `define TLM_NONBLOCKING_TRANSPORT_MASK (1<<7)
00118 
00119 `define TLM_ANALYSIS_MASK              (1<<8)
00120 
00121 // combination interfaces
00122 `define TLM_PUT_MASK                  (`TLM_BLOCKING_PUT_MASK    | `TLM_NONBLOCKING_PUT_MASK)
00123 `define TLM_GET_MASK                  (`TLM_BLOCKING_GET_MASK    | `TLM_NONBLOCKING_GET_MASK)
00124 `define TLM_PEEK_MASK                 (`TLM_BLOCKING_PEEK_MASK   | `TLM_NONBLOCKING_PEEK_MASK)
00125 
00126 `define TLM_BLOCKING_GET_PEEK_MASK    (`TLM_BLOCKING_GET_MASK    | `TLM_BLOCKING_PEEK_MASK)
00127 `define TLM_BLOCKING_MASTER_MASK      (`TLM_BLOCKING_PUT_MASK       | `TLM_BLOCKING_GET_MASK | `TLM_BLOCKING_PEEK_MASK)
00128 `define TLM_BLOCKING_SLAVE_MASK       (`TLM_BLOCKING_PUT_MASK       | `TLM_BLOCKING_GET_MASK | `TLM_BLOCKING_PEEK_MASK)
00129 
00130 `define TLM_NONBLOCKING_GET_PEEK_MASK (`TLM_NONBLOCKING_GET_MASK | `TLM_NONBLOCKING_GET_MASK)
00131 `define TLM_NONBLOCKING_MASTER_MASK   (`TLM_NONBLOCKING_PUT_MASK    | `TLM_NONBLOCKING_GET_MASK | `TLM_NONBLOCKING_PEEK_MASK)
00132 `define TLM_NONBLOCKING_SLAVE_MASK    (`TLM_NONBLOCKING_PUT_MASK    | `TLM_NONBLOCKING_GET_MASK | `TLM_NONBLOCKING_PEEK_MASK)
00133 
00134 `define TLM_GET_PEEK_MASK             (`TLM_GET_MASK | `TLM_PEEK_MASK)
00135 `define TLM_MASTER_MASK               (`TLM_BLOCKING_MASTER_MASK    | `TLM_NONBLOCKING_MASTER_MASK)
00136 `define TLM_SLAVE_MASK                (`TLM_BLOCKING_MASTER_MASK    | `TLM_NONBLOCKING_MASTER_MASK)
00137 `define TLM_TRANSPORT_MASK            (`TLM_BLOCKING_TRANSPORT_MASK | `TLM_NONBLOCKING_TRANSPORT_MASK)
00138 

Intelligent Design Verification
Intelligent Design Verification
Project: OVM, Revision: 1.1.0
Copyright (c) 2008 Intelligent Design Verification.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included here:
http://www.intelligentdv.com/licenses/fdl.txt
doxygen
Doxygen Version: 1.4.6
Mon Sep 29 14:23:30 2008
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV