Add vpi_get_vlog_info support.

This commit is contained in:
steve 2002-01-09 03:15:23 +00:00
parent 8aef782411
commit 4291866b9f
3 changed files with 34 additions and 3 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: main.cc,v 1.21 2001/10/20 01:03:42 steve Exp $"
#ident "$Id: main.cc,v 1.22 2002/01/09 03:15:23 steve Exp $"
#endif
# include "config.h"
@ -125,6 +125,7 @@ int main(int argc, char*argv[])
struct rusage cycles[3];
const char *logfile_name = 0x0;
FILE *logfile = 0x0;
extern void vpi_set_vlog_info(int, char**);
#ifdef __MINGW32__
/* In the Windows world, we get the first module path
@ -206,9 +207,11 @@ int main(int argc, char*argv[])
}
vpi_mcd_init(logfile);
vvp_vpi_init();
vpi_set_vlog_info(argc, argv);
compile_init();
for (unsigned idx = 0 ; idx < module_cnt ; idx += 1)
@ -256,6 +259,9 @@ int main(int argc, char*argv[])
/*
* $Log: main.cc,v $
* Revision 1.22 2002/01/09 03:15:23 steve
* Add vpi_get_vlog_info support.
*
* Revision 1.21 2001/10/20 01:03:42 steve
* Print memory usage information if requested (Stephan Boettcher)
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vpi_priv.cc,v 1.11 2002/01/06 00:48:39 steve Exp $"
#ident "$Id: vpi_priv.cc,v 1.12 2002/01/09 03:15:23 steve Exp $"
#endif
# include "vpi_priv.h"
@ -87,6 +87,27 @@ void vpi_get_time(vpiHandle obj, s_vpi_time*vp)
vp->low = schedule_simtime();
}
static s_vpi_vlog_info vpi_vlog_info;
int vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p)
{
if (vlog_info_p != 0)
{
*vlog_info_p = vpi_vlog_info;
return 1;
}
else
return 0;
}
void vpi_set_vlog_info(int argc, char** argv)
{
vpi_vlog_info.product = "Icarus Verilog";
vpi_vlog_info.version = "$Name: $";
vpi_vlog_info.argc = argc;
vpi_vlog_info.argv = argv;
}
void vpi_get_value(vpiHandle expr, s_vpi_value*vp)
{
if (expr->vpi_type->vpi_get_value_) {
@ -170,6 +191,9 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap)
/*
* $Log: vpi_priv.cc,v $
* Revision 1.12 2002/01/09 03:15:23 steve
* Add vpi_get_vlog_info support.
*
* Revision 1.11 2002/01/06 00:48:39 steve
* VPI access to root module scopes.
*

View File

@ -29,4 +29,5 @@ void vvp_vpi_init()
vvpt.vpi_get_value = vpi_get_value;
vvpt.vpi_put_value = vpi_put_value;
vvpt.vpi_free_object= vpi_free_object;
vvpt.vpi_get_vlog_info = vpi_get_vlog_info;
}