Skip to content

Commit

Permalink
Replace data references with function calls. (Venkat)
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Oct 6, 2000
1 parent 20d07a7 commit 8ba1fac
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 26 deletions.
7 changes: 5 additions & 2 deletions t-vvm.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-vvm.cc,v 1.178 2000/10/06 02:21:35 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.179 2000/10/06 23:11:39 steve Exp $"
#endif

# include <iostream>
Expand Down Expand Up @@ -3170,7 +3170,7 @@ void target_vvm::proc_stask(const NetSTask*net)
val = emit_parm_rval(this, net->parm(idx));

} else {
val = string("&vpip_null.base");
val = string("&(vpip_get_null()->base)");
}

defn << " " << ptmp << "[" << idx << "] = " << val << ";"
Expand Down Expand Up @@ -3385,6 +3385,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.179 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.178 2000/10/06 02:21:35 steve
* sfuncs are char* and are compared with strcmp
*
Expand Down
6 changes: 4 additions & 2 deletions vpi/Makefile.in
Expand Up @@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.16 2000/10/04 17:08:31 steve Exp $"
#ident "$Id: Makefile.in,v 1.17 2000/10/06 23:11:39 steve Exp $"
#
#
SHELL = /bin/sh
Expand Down Expand Up @@ -58,11 +58,13 @@ sys_readmem.o sys_readmem_lex.o sys_vcd.o

ifeq (@CYGWIN@,yes)
SYSTEM_VPI_LDFLAGS=-Wl,--enable-auto-image-base -L../vvm -lvvm -lvpip
VPI_DEPLIBS=../vvm/libvpip.a
else
SYSTEM_VPI_LDFLAGS=
VPI_DEPLIBS=
endif

system.vpi: $O
system.vpi: $O $(VPI_DEPLIBS)
$(CC) -shared -o $@ $O $(SYSTEM_VPI_LDFLAGS)

sys_readmem_lex.c: sys_readmem_lex.lex
Expand Down
4 changes: 2 additions & 2 deletions vvm/Makefile.in
Expand Up @@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.36 2000/10/04 17:08:31 steve Exp $"
#ident "$Id: Makefile.in,v 1.37 2000/10/06 23:11:39 steve Exp $"
#
#
SHELL = /bin/sh
Expand Down Expand Up @@ -67,7 +67,7 @@ libvvm.a: $O
rm -f $@
ar cvq $@ $O

libvpip.a vpip.dll: $P
libvpip.a vpip.dll: $P vpip.def
$(CC) -shared -Wl,--enable-auto-image-base,--out-implib,libvpip.a -o vpip.dll vpip.def $P

else
Expand Down
12 changes: 10 additions & 2 deletions vvm/vpi_null.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_null.c,v 1.3 2000/02/23 02:56:56 steve Exp $"
#ident "$Id: vpi_null.c,v 1.4 2000/10/06 23:11:39 steve Exp $"
#endif

# include "vpi_priv.h"
Expand All @@ -32,12 +32,20 @@ static const struct __vpirt vpip_null_rt = {
0
};

struct __vpiNull vpip_null = {
static struct __vpiNull vpip_null = {
{ &vpip_null_rt }
};

extern struct __vpiNull *vpip_get_null(void)
{
return &vpip_null;
}

/*
* $Log: vpi_null.c,v $
* Revision 1.4 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.3 2000/02/23 02:56:56 steve
* Macintosh compilers do not support ident.
*
Expand Down
11 changes: 7 additions & 4 deletions vvm/vpi_priv.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_priv.c,v 1.9 2000/08/20 17:49:05 steve Exp $"
#ident "$Id: vpi_priv.c,v 1.10 2000/10/06 23:11:39 steve Exp $"
#endif

# include "vpi_priv.h"
Expand Down Expand Up @@ -48,7 +48,7 @@ void vpip_calltask(const char*fname, unsigned nparms, vpiHandle*parms)
{
struct systf_entry*idx;
struct __vpiSysTaskCall cur_task;
cur_task.base.vpi_type = &vpip_systask_rt;
cur_task.base.vpi_type = vpip_get_systask_rt();
cur_task.args = parms;
cur_task.nargs = nparms;
cur_task.res = 0;
Expand Down Expand Up @@ -80,7 +80,7 @@ void vpip_callfunc(const char*fname, unsigned nres, vpip_bit_t*res,
{
struct systf_entry*idx;
struct __vpiSysTaskCall cur_task;
cur_task.base.vpi_type = &vpip_sysfunc_rt;
cur_task.base.vpi_type = vpip_get_sysfunc_rt();
cur_task.args = parms;
cur_task.nargs = nparms;
cur_task.res = res;
Expand Down Expand Up @@ -114,7 +114,7 @@ static int vpip_get_global(int property)
{
switch (property) {
case vpiTimePrecision:
return vpip_simulation_obj.time_precision;
return vpip_get_simulation_obj()->time_precision;

default:
assert(0);
Expand Down Expand Up @@ -233,6 +233,9 @@ void vpi_register_systf(const struct t_vpi_systf_data*systf)

/*
* $Log: vpi_priv.c,v $
* Revision 1.10 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.9 2000/08/20 17:49:05 steve
* Clean up warnings and portability issues.
*
Expand Down
14 changes: 9 additions & 5 deletions vvm/vpi_priv.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_priv.h,v 1.27 2000/10/04 02:37:44 steve Exp $"
#ident "$Id: vpi_priv.h,v 1.28 2000/10/06 23:11:39 steve Exp $"
#endif

/*
Expand Down Expand Up @@ -203,7 +203,7 @@ struct __vpiNull {
struct __vpiHandle base;
};

extern struct __vpiNull vpip_null;
extern struct __vpiNull *vpip_get_null(void);

/*
* This type represents the handle to a Verilog scope. These include
Expand Down Expand Up @@ -241,8 +241,9 @@ struct __vpiSignal {
};


extern const struct __vpirt vpip_systask_rt;
extern const struct __vpirt vpip_sysfunc_rt;
extern const struct __vpirt *vpip_get_systask_rt(void);
extern const struct __vpirt *vpip_get_sysfunc_rt(void);

struct __vpiSysTaskCall {
struct __vpiHandle base;

Expand Down Expand Up @@ -347,7 +348,7 @@ struct vpip_simulation {
short time_precision;
};

extern struct vpip_simulation vpip_simulation_obj;
extern struct vpip_simulation *vpip_get_simulation_obj(void);

extern void vpip_set_vlog_info(int argc, char**argv);
extern void vpip_init_simulation();
Expand Down Expand Up @@ -388,6 +389,9 @@ extern int vpip_finished();

/*
* $Log: vpi_priv.h,v $
* Revision 1.28 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.27 2000/10/04 02:37:44 steve
* Use .def file instead of _dllexport.
*
Expand Down
14 changes: 12 additions & 2 deletions vvm/vpi_simulation.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_simulation.c,v 1.4 2000/08/20 17:49:05 steve Exp $"
#ident "$Id: vpi_simulation.c,v 1.5 2000/10/06 23:11:39 steve Exp $"
#endif

# include "vpi_priv.h"
Expand All @@ -30,7 +30,14 @@ struct vpip_event {
struct vpip_event*next;
};

struct vpip_simulation vpip_simulation_obj;
static struct vpip_simulation vpip_simulation_obj;

struct vpip_simulation *vpip_get_simulation_obj(void)
{
return &vpip_simulation_obj;
}



void vpi_sim_control(int func, ...)
{
Expand Down Expand Up @@ -203,6 +210,9 @@ void vpip_simulation_run()

/*
* $Log: vpi_simulation.c,v $
* Revision 1.5 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.4 2000/08/20 17:49:05 steve
* Clean up warnings and portability issues.
*
Expand Down
19 changes: 16 additions & 3 deletions vvm/vpi_systask.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_systask.c,v 1.6 2000/09/30 03:20:48 steve Exp $"
#ident "$Id: vpi_systask.c,v 1.7 2000/10/06 23:11:39 steve Exp $"
#endif

# include "vpi_priv.h"
Expand All @@ -40,7 +40,7 @@ static vpiHandle systask_iter(int type, vpiHandle ref)
return vpip_make_iterator(rfp->nargs, rfp->args);
}

const struct __vpirt vpip_systask_rt = {
static const struct __vpirt vpip_systask_rt = {
vpiSysTaskCall,
0,
0,
Expand All @@ -50,6 +50,11 @@ const struct __vpirt vpip_systask_rt = {
systask_iter
};

const struct __vpirt *vpip_get_systask_rt(void)
{
return &vpip_systask_rt;
}

/*
* A value *can* be put to a vpiSysFuncCall object. This is how the
* return value is set. The value that is given should be converted to
Expand Down Expand Up @@ -81,7 +86,7 @@ static vpiHandle sysfunc_put_value(vpiHandle ref, p_vpi_value val,
return 0;
}

const struct __vpirt vpip_sysfunc_rt = {
static const struct __vpirt vpip_sysfunc_rt = {
vpiSysFuncCall,
0,
0,
Expand All @@ -91,13 +96,21 @@ const struct __vpirt vpip_sysfunc_rt = {
systask_iter
};

const struct __vpirt *vpip_get_sysfunc_rt(void)
{
return &vpip_sysfunc_rt;
}

#ifdef __CYGWIN32__
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif

/*
* $Log: vpi_systask.c,v $
* Revision 1.7 2000/10/06 23:11:39 steve
* Replace data references with function calls. (Venkat)
*
* Revision 1.6 2000/09/30 03:20:48 steve
* Cygwin port changes from Venkat
*
Expand Down
8 changes: 4 additions & 4 deletions vvm/vpip.def
Expand Up @@ -38,15 +38,15 @@ EXPORTS
vpip_make_scope
vpip_make_string_const
vpip_make_time_var
vpip_null DATA
vpip_get_null
vpip_pair_resolve
vpip_run_value_changes
vpip_set_vlog_info
vpip_sim_cancel_event
vpip_sim_insert_event
vpip_sim_time
vpip_simulation_obj DATA
vpip_get_simulation_obj
vpip_simulation_run
vpip_sysfunc_rt DATA
vpip_systask_rt DATA
vpip_get_sysfunc_rt
vpip_get_systask_rt
vpip_time_scale

0 comments on commit 8ba1fac

Please sign in to comment.