mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
Add vpi_chk_error and vpi_control functions.
This commit is contained in:
+23
-3
@@ -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.21 2002/07/19 01:12:50 steve Exp $"
|
||||
#ident "$Id: vpi_priv.cc,v 1.22 2002/07/19 01:57:26 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vpi_priv.h"
|
||||
@@ -33,6 +33,9 @@
|
||||
|
||||
vpi_mode_t vpi_mode_flag = VPI_MODE_NONE;
|
||||
|
||||
static s_vpi_vlog_info vpi_vlog_info;
|
||||
static s_vpi_error_info vpip_last_error = { 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/*
|
||||
* The vpip_string function creates a constant string from the pass
|
||||
* input. This constant string is permanently allocate from an
|
||||
@@ -66,6 +69,22 @@ const char *vpip_string(const char*str)
|
||||
return res;
|
||||
}
|
||||
|
||||
int vpi_chk_error(p_vpi_error_info info)
|
||||
{
|
||||
if (vpip_last_error.state = 0)
|
||||
return 0;
|
||||
|
||||
info->state = vpip_last_error.state;
|
||||
info->level = vpip_last_error.level;
|
||||
info->message = vpip_last_error.message;
|
||||
info->product = vpi_vlog_info.product;
|
||||
info->code = "";
|
||||
info->file = 0;
|
||||
info->line = 0;
|
||||
|
||||
return info->level;
|
||||
}
|
||||
|
||||
/*
|
||||
* When a task is called, this value is set so that vpi_handle can
|
||||
* fathom the vpi_handle(vpiSysTfCall,0) function.
|
||||
@@ -131,8 +150,6 @@ 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) {
|
||||
@@ -346,6 +363,9 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap)
|
||||
|
||||
/*
|
||||
* $Log: vpi_priv.cc,v $
|
||||
* Revision 1.22 2002/07/19 01:57:26 steve
|
||||
* Add vpi_chk_error and vpi_control functions.
|
||||
*
|
||||
* Revision 1.21 2002/07/19 01:12:50 steve
|
||||
* vpi_iterate returns 0 on error.
|
||||
*
|
||||
|
||||
@@ -30,4 +30,5 @@ void vvp_vpi_init()
|
||||
vvpt.vpi_put_value = vpi_put_value;
|
||||
vvpt.vpi_free_object= vpi_free_object;
|
||||
vvpt.vpi_get_vlog_info = vpi_get_vlog_info;
|
||||
vvpt.vpi_chk_error = vpi_chk_error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user