Add ability to put a string value to a SV string (from plusargs)
This commit is contained in:
parent
3c38b2972d
commit
ae629f8c41
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002-2014 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2002-2015 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -118,6 +118,7 @@ static PLI_INT32 sys_value_plusargs_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
|
||||||
case vpiLongIntVar:
|
case vpiLongIntVar:
|
||||||
case vpiRealVar:
|
case vpiRealVar:
|
||||||
case vpiTimeVar:
|
case vpiTimeVar:
|
||||||
|
case vpiStringVar:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef IVL_vpi_priv_H
|
#ifndef IVL_vpi_priv_H
|
||||||
#define IVL_vpi_priv_H
|
#define IVL_vpi_priv_H
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -531,6 +531,7 @@ class __vpiStringVar : public __vpiBaseVar {
|
||||||
int get_type_code(void) const;
|
int get_type_code(void) const;
|
||||||
int vpi_get(int code);
|
int vpi_get(int code);
|
||||||
void vpi_get_value(p_vpi_value val);
|
void vpi_get_value(p_vpi_value val);
|
||||||
|
vpiHandle vpi_put_value(p_vpi_value val, int flags);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern vpiHandle vpip_make_string_var(const char*name, vvp_net_t*net);
|
extern vpiHandle vpip_make_string_var(const char*name, vvp_net_t*net);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2012-2015 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -79,6 +79,16 @@ void __vpiStringVar::vpi_get_value(p_vpi_value val)
|
||||||
val->format = vpiSuppressVal;
|
val->format = vpiSuppressVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vpiHandle __vpiStringVar::vpi_put_value(p_vpi_value val, int)
|
||||||
|
{
|
||||||
|
vvp_fun_signal_string*fun = dynamic_cast<vvp_fun_signal_string*> (get_net()->fun);
|
||||||
|
assert(fun);
|
||||||
|
assert(val->format == vpiStringVal);
|
||||||
|
vvp_net_ptr_t dest (get_net(), 0);
|
||||||
|
vvp_send_string(dest, val->value.str, vthread_get_wt_context());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
vpiHandle vpip_make_string_var(const char*name, vvp_net_t*net)
|
vpiHandle vpip_make_string_var(const char*name, vvp_net_t*net)
|
||||||
{
|
{
|
||||||
struct __vpiScope*scope = vpip_peek_current_scope();
|
struct __vpiScope*scope = vpip_peek_current_scope();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue