1 /*
2  * Copyright (c) 2012-2015 Picture Elements, Inc.
3  *    Stephen Williams (steve@icarus.com)
4  *
5  *    This source code is free software; you can redistribute it
6  *    and/or modify it in source code form under the terms of the GNU
7  *    General Public License as published by the Free Software
8  *    Foundation; either version 2 of the License, or (at your option)
9  *    any later version.
10  *
11  *    This program is distributed in the hope that it will be useful,
12  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *    GNU General Public License for more details.
15  *
16  *    You should have received a copy of the GNU General Public License
17  *    along with this program; if not, write to the Free Software
18  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 # include  "compile.h"
22 # include  "vpi_priv.h"
23 # include  "config.h"
24 #ifdef CHECK_WITH_VALGRIND
25 # include  "vvp_cleanup.h"
26 #endif
27 
__vpiCobjectVar(__vpiScope * sc,const char * na,vvp_net_t * ne)28 __vpiCobjectVar::__vpiCobjectVar(__vpiScope*sc, const char*na, vvp_net_t*ne)
29 : __vpiBaseVar(sc, na, ne)
30 {
31 }
32 
get_type_code(void) const33 int __vpiCobjectVar::get_type_code(void) const
34 { return vpiClassVar; }
35 
vpi_get(int)36 int __vpiCobjectVar::vpi_get(int)
37 {
38       return 0;
39 }
40 
vpi_get_value(p_vpi_value val)41 void __vpiCobjectVar::vpi_get_value(p_vpi_value val)
42 {
43       val->format = vpiSuppressVal;
44 }
45 
vpip_make_cobject_var(const char * name,vvp_net_t * net)46 vpiHandle vpip_make_cobject_var(const char*name, vvp_net_t*net)
47 {
48       __vpiScope*scope = vpip_peek_current_scope();
49       const char*use_name = name ? vpip_name_string(name) : 0;
50 
51       __vpiCobjectVar*obj = new __vpiCobjectVar(scope, use_name, net);
52 
53       return obj;
54 }
55 
56 #ifdef CHECK_WITH_VALGRIND
class_delete(vpiHandle item)57 void class_delete(vpiHandle item)
58 {
59       __vpiCobjectVar*obj = dynamic_cast<__vpiCobjectVar*>(item);
60       delete obj;
61 }
62 #endif
63