Move all vpirt functions to __vpiHandle virtual methods.

This takes care of all the functions accept the delete methood, which
will need special treatment.
This commit is contained in:
Stephen Williams 2012-01-20 11:39:48 -08:00
parent ac2b68fc1b
commit c07c4509e4
14 changed files with 838 additions and 231 deletions

View File

@ -83,6 +83,11 @@ vvp_array_t array_find(const char*label)
struct __vpiArray : public __vpiHandle {
__vpiArray();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
struct __vpiScope*scope;
const char*name; /* Permanently allocated string */
@ -108,6 +113,9 @@ struct __vpiArray : public __vpiHandle {
struct __vpiArrayIterator : public __vpiHandle {
__vpiArrayIterator();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
vpiHandle vpi_index(int idx);
struct __vpiArray*array;
unsigned next;
@ -116,6 +124,10 @@ struct __vpiArrayIterator : public __vpiHandle {
struct __vpiArrayIndex : public __vpiHandle {
__vpiArrayIndex();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
struct __vpiDecConst *index;
unsigned done;
@ -125,6 +137,11 @@ struct __vpiArrayVthrA : public __vpiHandle {
__vpiArrayVthrA();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
struct __vpiArray*array;
// If this is set, then use it to get the index value.
@ -195,6 +212,9 @@ struct __vpiArrayVthrA : public __vpiHandle {
struct __vpiArrayVthrAPV : public __vpiHandle {
__vpiArrayVthrAPV();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
struct __vpiArray*array;
unsigned word_sel;
@ -259,11 +279,19 @@ struct __vpiArrayWord {
struct as_word_t : public __vpiHandle {
as_word_t();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
} as_word;
struct as_index_t : public __vpiHandle {
as_index_t();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
} as_index;
union {
@ -305,13 +333,13 @@ static void vpi_array_vthr_APV_get_value(vpiHandle ref, p_vpi_value vp);
static const struct __vpirt vpip_arraymem_rt = {
vpiMemory,
vpi_array_get,
vpi_array_get_str,
0, //vpi_array_get,
0, //vpi_array_get_str,
0,
0,
vpi_array_get_handle,
vpi_array_iterate,
vpi_array_index,
0, //vpi_array_get_handle,
0, //vpi_array_iterate,
0, //vpi_array_index,
0,
0,
0
@ -324,6 +352,21 @@ inline __vpiArray::__vpiArray()
int __vpiArray::get_type_code(void) const
{ return vpiMemory; }
int __vpiArray::vpi_get(int code)
{ return vpi_array_get(code, this); }
char* __vpiArray::vpi_get_str(int code)
{ return vpi_array_get_str(code, this); }
vpiHandle __vpiArray::vpi_handle(int code)
{ return vpi_array_get_handle(code, this); }
vpiHandle __vpiArray::vpi_iterate(int code)
{ return vpi_array_iterate(code, this); }
vpiHandle __vpiArray::vpi_index(int idx)
{ return vpi_array_index(this, idx); }
static const struct __vpirt vpip_array_iterator_rt = {
vpiIterator,
0,
@ -332,7 +375,7 @@ static const struct __vpirt vpip_array_iterator_rt = {
0,
0,
0,
array_iterator_scan,
0, //array_iterator_scan,
&array_iterator_free_object,
0,
0
@ -346,6 +389,14 @@ inline __vpiArrayIterator::__vpiArrayIterator()
int __vpiArrayIterator::get_type_code(void) const
{ return vpiIterator; }
int __vpiArrayIterator::vpi_get(int)
{ return vpiUndefined; }
char* __vpiArrayIterator::vpi_get_str(int)
{ return 0; }
vpiHandle __vpiArrayIterator::vpi_index(int code)
{ return array_iterator_scan(this, code); }
/* This should look a bit odd since it provides a fake iteration on
* this object. This trickery is used to implement the two forms of
@ -357,8 +408,8 @@ static const struct __vpirt vpip_array_index_rt = {
0,
0,
0,
array_index_iterate,
array_index_scan,
0, //array_index_iterate,
0, //array_index_scan,
array_index_free_object,
0,
0
@ -372,13 +423,25 @@ inline __vpiArrayIndex::__vpiArrayIndex()
int __vpiArrayIndex::get_type_code(void) const
{ return vpiIterator; }
int __vpiArrayIndex::vpi_get(int)
{ return vpiUndefined; }
char* __vpiArrayIndex::vpi_get_str(int)
{ return 0; }
vpiHandle __vpiArrayIndex::vpi_iterate(int code)
{ return array_index_iterate(code, this); }
vpiHandle __vpiArrayIndex::vpi_index(int idx)
{ return array_index_scan(this, idx); }
static const struct __vpirt vpip_array_var_word_rt = {
vpiMemoryWord,
&vpi_array_var_word_get,
&vpi_array_var_word_get_str,
&vpi_array_var_word_get_value,
&vpi_array_var_word_put_value,
&vpi_array_var_word_get_handle,
0, //&vpi_array_var_word_get,
0, //&vpi_array_var_word_get_str,
0, //&vpi_array_var_word_get_value,
0, //&vpi_array_var_word_put_value,
0, //&vpi_array_var_word_get_handle,
0,
0,
0,
@ -393,6 +456,21 @@ inline __vpiArrayWord::as_word_t::as_word_t()
int __vpiArrayWord::as_word_t::get_type_code(void) const
{ return vpiMemoryWord; }
int __vpiArrayWord::as_word_t::vpi_get(int code)
{ return vpi_array_var_word_get(code, this); }
char* __vpiArrayWord::as_word_t::vpi_get_str(int code)
{ return vpi_array_var_word_get_str(code, this); }
void __vpiArrayWord::as_word_t::vpi_get_value(p_vpi_value val)
{ vpi_array_var_word_get_value(this, val); }
vpiHandle __vpiArrayWord::as_word_t::vpi_put_value(p_vpi_value val, int flags)
{ return vpi_array_var_word_put_value(this, val, flags); }
vpiHandle __vpiArrayWord::as_word_t::vpi_handle(int code)
{ return vpi_array_var_word_get_handle(code, this); }
static const struct __vpirt vpip_array_var_index_rt = {
vpiIndex,
0,
@ -414,13 +492,22 @@ inline __vpiArrayWord::as_index_t::as_index_t()
int __vpiArrayWord::as_index_t::get_type_code(void) const
{ return vpiIndex; }
int __vpiArrayWord::as_index_t::vpi_get(int)
{ return vpiUndefined; }
char* __vpiArrayWord::as_index_t::vpi_get_str(int)
{ return 0; }
void __vpiArrayWord::as_index_t::vpi_get_value(p_vpi_value val)
{ vpi_array_var_index_get_value(this, val); }
static const struct __vpirt vpip_array_vthr_A_rt = {
vpiMemoryWord,
&vpi_array_vthr_A_get,
&vpi_array_vthr_A_get_str,
&vpi_array_vthr_A_get_value,
&vpi_array_vthr_A_put_value,
&vpi_array_vthr_A_get_handle,
0, //&vpi_array_vthr_A_get,
0, //&vpi_array_vthr_A_get_str,
0, //&vpi_array_vthr_A_get_value,
0, //&vpi_array_vthr_A_put_value,
0, //&vpi_array_vthr_A_get_handle,
0,
0,
0,
@ -436,11 +523,26 @@ inline __vpiArrayVthrA::__vpiArrayVthrA()
int __vpiArrayVthrA::get_type_code(void) const
{ return vpiMemoryWord; }
int __vpiArrayVthrA::vpi_get(int code)
{ return vpi_array_vthr_A_get(code, this); }
char* __vpiArrayVthrA::vpi_get_str(int code)
{ return vpi_array_vthr_A_get_str(code, this); }
void __vpiArrayVthrA::vpi_get_value(p_vpi_value val)
{ vpi_array_vthr_A_get_value(this, val); }
vpiHandle __vpiArrayVthrA::vpi_put_value(p_vpi_value val, int flags)
{ return vpi_array_vthr_A_put_value(this, val, flags); }
vpiHandle __vpiArrayVthrA::vpi_handle(int code)
{ return vpi_array_vthr_A_get_handle(code, this); }
static const struct __vpirt vpip_array_vthr_APV_rt = {
vpiMemoryWord,
&vpi_array_vthr_APV_get,
&vpi_array_vthr_APV_get_str,
&vpi_array_vthr_APV_get_value,
0, //&vpi_array_vthr_APV_get,
0, //&vpi_array_vthr_APV_get_str,
0, //&vpi_array_vthr_APV_get_value,
0, //&vpi_array_vthr_A_put_value,
0, //&vpi_array_vthr_A_get_handle,
0,
@ -458,6 +560,15 @@ inline __vpiArrayVthrAPV::__vpiArrayVthrAPV()
int __vpiArrayVthrAPV::get_type_code(void) const
{ return vpiMemoryWord; }
int __vpiArrayVthrAPV::vpi_get(int code)
{ return vpi_array_vthr_APV_get(code, this); }
char* __vpiArrayVthrAPV::vpi_get_str(int code)
{ return vpi_array_vthr_APV_get_str(code, this); }
void __vpiArrayVthrAPV::vpi_get_value(p_vpi_value val)
{ vpi_array_vthr_APV_get_value(this, val); }
static struct __vpiArrayWord* array_var_word_from_handle(vpiHandle ref)
{
if (ref == 0)

View File

@ -973,16 +973,16 @@ static vpiHandle pathterm_get_handle(int code, vpiHandle ref)
*/
static const struct __vpirt vpip_modpath_src_rt = {
vpiModPath,
modpath_src_get,
0, //modpath_src_get,
0, /* vpi_get_str */
modpath_src_get_value,
modpath_src_put_value,
modpath_src_get_handle,
modpath_src_iterate,
modpath_src_index,
0, //modpath_src_get_value,
0, //modpath_src_put_value,
0, //modpath_src_get_handle,
0, //modpath_src_iterate,
0, //modpath_src_index,
modpath_src_free_object,
modpath_src_get_delays,
modpath_src_put_delays
0, //modpath_src_get_delays,
0, //modpath_src_put_delays
};
inline __vpiModPathSrc::__vpiModPathSrc()
@ -993,13 +993,38 @@ inline __vpiModPathSrc::__vpiModPathSrc()
int __vpiModPathSrc::get_type_code(void) const
{ return vpiModPath; }
int __vpiModPathSrc::vpi_get(int code)
{ return modpath_src_get(code, this); }
void __vpiModPathSrc::vpi_get_value(p_vpi_value val)
{ modpath_src_get_value(this, val); }
vpiHandle __vpiModPathSrc::vpi_put_value(p_vpi_value val, int flags)
{ return modpath_src_put_value(this, val, flags); }
vpiHandle __vpiModPathSrc::vpi_handle(int code)
{ return modpath_src_get_handle(code, this); }
vpiHandle __vpiModPathSrc::vpi_iterate(int code)
{ return modpath_src_iterate(code, this); }
vpiHandle __vpiModPathSrc:: vpi_index(int idx)
{ return modpath_src_index(this, idx); }
void __vpiModPathSrc::vpi_get_delays(p_vpi_delay del)
{ modpath_src_get_delays(this, del); }
void __vpiModPathSrc::vpi_put_delays(p_vpi_delay del)
{ modpath_src_put_delays(this, del); }
static const struct __vpirt vpip_modpath_term_rt = {
vpiPathTerm,
pathterm_get,
0,
0, // vpi_get_str
0, // vpi_get_value,
0, // vpi_put_value,
pathterm_get_handle,
0, //pathterm_get_handle,
0, // vpi_iterate,
0, // vpi_index,
0, // vpi_free_object,
@ -1015,6 +1040,12 @@ inline __vpiModPathTerm::__vpiModPathTerm()
int __vpiModPathTerm::get_type_code(void) const
{ return vpiPathTerm; }
int __vpiModPathTerm::vpi_get(int code)
{ return pathterm_get(code, this); }
vpiHandle __vpiModPathTerm::vpi_handle(int code)
{ return pathterm_get_handle(code, this); }
static void initialize_path_term(struct __vpiModPathTerm&obj)
{
obj.expr = 0;

View File

@ -28,6 +28,9 @@
struct enumconst_s : public __vpiHandle {
enumconst_s();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
const char*name;
vvp_vector2_t val2;
@ -37,6 +40,9 @@ struct enumconst_s : public __vpiHandle {
struct __vpiEnumTypespec : public __vpiHandle {
__vpiEnumTypespec();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
vpiHandle vpi_iterate(int code);
std::vector<enumconst_s> names;
int base_type_code;
@ -89,12 +95,12 @@ static vpiHandle enum_type_iterate(int code, vpiHandle obj)
static const struct __vpirt enum_type_rt = {
vpiEnumTypespec,
enum_type_get,
0, //enum_type_get,
0, //enum_type_get_str,
0, //enum_type_get_value,
0, //enum_type_put_value,
0, //enum_type_handle,
enum_type_iterate,
0, //enum_type_iterate,
0, //enum_type_index,
0, //enum_type_free_object,
0, //enum_type_get_delays,
@ -109,6 +115,15 @@ inline __vpiEnumTypespec::__vpiEnumTypespec()
int __vpiEnumTypespec::get_type_code(void) const
{ return vpiEnumTypespec; }
int __vpiEnumTypespec::vpi_get(int code)
{ return enum_type_get(code, this); }
char* __vpiEnumTypespec::vpi_get_str(int)
{ return 0; }
vpiHandle __vpiEnumTypespec::vpi_iterate(int code)
{ return enum_type_iterate(code, this); }
static int enum_name_get(int code, vpiHandle obj)
{
struct enumconst_s*ref = dynamic_cast<enumconst_s*>(obj);
@ -148,9 +163,9 @@ static void enum_name_get_value(vpiHandle obj, p_vpi_value value)
static const struct __vpirt enum_name_rt = {
vpiEnumConst,
enum_name_get,
enum_name_get_str,
enum_name_get_value,
0, //enum_name_get,
0, //enum_name_get_str,
0, //enum_name_get_value,
0, //enum_name_put_value,
0, //enum_name_handle,
0, //enum_name_iterate,
@ -168,6 +183,15 @@ inline enumconst_s::enumconst_s()
int enumconst_s::get_type_code(void) const
{ return vpiEnumConst; }
int enumconst_s::vpi_get(int code)
{ return enum_name_get(code, this); }
char* enumconst_s::vpi_get_str(int code)
{ return enum_name_get_str(code, this); }
void enumconst_s::vpi_get_value(p_vpi_value val)
{ enum_name_get_value(this, val); }
void compile_enum2_type(char*label, long width, bool signed_flag,
std::list<struct enum_name_s>*names)
{

View File

@ -22,6 +22,8 @@
struct __vpiFileLine : public __vpiHandle {
__vpiFileLine();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
const char *description;
unsigned file_idx;
@ -63,8 +65,8 @@ static char *file_line_get_str(int type, vpiHandle ref)
static const struct __vpirt vpip_file_line_rt = {
_vpiFileLine,
file_line_get,
file_line_get_str,
0, //file_line_get,
0, //file_line_get_str,
0,
0,
0,
@ -83,6 +85,13 @@ inline __vpiFileLine::__vpiFileLine()
int __vpiFileLine::get_type_code(void) const
{ return _vpiFileLine; }
int __vpiFileLine::vpi_get(int code)
{ return file_line_get(code, this); }
char* __vpiFileLine::vpi_get_str(int code)
{ return file_line_get_str(code, this); }
vpiHandle vpip_build_file_line(char*description, long file_idx, long lineno)
{
struct __vpiFileLine*obj = new struct __vpiFileLine;

View File

@ -168,9 +168,9 @@ static void string_value(vpiHandle ref, p_vpi_value vp)
static const struct __vpirt vpip_string_rt = {
vpiConstant,
string_get,
0,
string_value,
0,
0, //string_value,
0,
0,
0,
@ -187,6 +187,33 @@ inline __vpiStringConst::__vpiStringConst()
int __vpiStringConst::get_type_code(void) const
{ return vpiConstant; }
int __vpiStringConst::vpi_get(int code)
{ return string_get(code, this); }
char*__vpiStringConst::vpi_get_str(int)
{ return 0; }
void __vpiStringConst::vpi_get_value(p_vpi_value val)
{ string_value(this, val); }
vpiHandle __vpiStringConst::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiStringConst::vpi_handle(int)
{ return 0; }
vpiHandle __vpiStringConst::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiStringConst::vpi_index(int)
{ return 0; }
void __vpiStringConst::vpi_get_delays(p_vpi_delay)
{ }
void __vpiStringConst::vpi_put_delays(p_vpi_delay)
{ }
struct __vpiStringConstTEMP : public __vpiStringConst {
__vpiStringConstTEMP();
};
@ -201,10 +228,10 @@ static int free_temp_string(vpiHandle obj)
}
static const struct __vpirt vpip_string_temp_rt = {
vpiConstant,
string_get,
0,
string_value,
vpiConstant, // Inherit from __vpiStringConst
0, // Inherit from __vpiStringConst
0, // Inherit from __vpiStringConst
0, // Inherit from __vpiStringConst: string_value,
0,
0,
0,
@ -266,6 +293,9 @@ vpiHandle vpip_make_string_const(char*text, bool persistent_flag)
struct __vpiStringParam : public __vpiStringConst {
__vpiStringParam();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
vpiHandle vpi_handle(int code);
const char*basename;
struct __vpiScope* scope;
@ -316,11 +346,11 @@ static vpiHandle string_param_handle(int code, vpiHandle obj)
static const struct __vpirt vpip_string_param_rt = {
vpiParameter,
string_param_get,
string_param_get_str,
string_value,
0,
string_param_handle,
0,
0, // Inherit from __vpiStringConst string_value,
0,
0, //string_param_handle,
0,
0,
0,
@ -336,6 +366,15 @@ inline __vpiStringParam::__vpiStringParam()
int __vpiStringParam::get_type_code(void) const
{ return vpiParameter; }
int __vpiStringParam::vpi_get(int code)
{ return string_param_get(code, this); }
char*__vpiStringParam::vpi_get_str(int code)
{ return string_param_get_str(code, this); }
vpiHandle __vpiStringParam::vpi_handle(int code)
{ return string_param_handle(code, this); }
vpiHandle vpip_make_string_param(char*name, char*text,
long file_idx, long lineno)
{
@ -416,9 +455,9 @@ static void binary_value(vpiHandle ref, p_vpi_value vp)
static const struct __vpirt vpip_binary_rt = {
vpiConstant,
binary_get,
0,
binary_value,
0,
0, //binary_value,
0,
0,
0,
@ -436,6 +475,33 @@ inline __vpiBinaryConst::__vpiBinaryConst()
int __vpiBinaryConst::get_type_code(void) const
{ return vpiConstant; }
int __vpiBinaryConst::vpi_get(int code)
{ return binary_get(code, this); }
char* __vpiBinaryConst::vpi_get_str(int)
{ return 0; }
void __vpiBinaryConst::vpi_get_value(p_vpi_value val)
{ binary_value(this, val); }
vpiHandle __vpiBinaryConst::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiBinaryConst::vpi_handle(int)
{ return 0; }
vpiHandle __vpiBinaryConst::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiBinaryConst::vpi_index(int)
{ return 0; }
void __vpiBinaryConst::vpi_get_delays(p_vpi_delay)
{ }
void __vpiBinaryConst::vpi_put_delays(p_vpi_delay)
{ }
/*
* Make a VPI constant from a vector string. The string is normally a
* ASCII string, with each letter a 4-value bit. The first character
@ -489,6 +555,9 @@ vvp_vector4_t vector4_from_text(const char*bits, unsigned wid)
struct __vpiBinaryParam : public __vpiBinaryConst {
__vpiBinaryParam();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
vpiHandle vpi_handle(int code);
const char*basename;
struct __vpiScope*scope;
@ -536,11 +605,11 @@ static vpiHandle binary_param_handle(int code, vpiHandle obj)
static const struct __vpirt vpip_binary_param_rt = {
vpiParameter,
binary_param_get,
binary_param_get_str,
binary_value,
0,
binary_param_handle,
0,
0, //Inherit from __vpiBinaryConst: binary_value,
0,
0, //binary_param_handle,
0,
0,
0,
@ -555,6 +624,15 @@ inline __vpiBinaryParam::__vpiBinaryParam()
int __vpiBinaryParam::get_type_code(void) const
{ return vpiParameter; }
int __vpiBinaryParam::vpi_get(int code)
{ return binary_param_get(code, this); }
char*__vpiBinaryParam::vpi_get_str(int code)
{ return binary_param_get_str(code, this); }
vpiHandle __vpiBinaryParam::vpi_handle(int code)
{ return binary_param_handle(code, this); }
vpiHandle vpip_make_binary_param(char*name, const vvp_vector4_t&bits,
bool signed_flag,
long file_idx, long lineno)
@ -654,9 +732,9 @@ static void dec_value(vpiHandle ref, p_vpi_value vp)
static const struct __vpirt vpip_dec_rt = {
vpiConstant,
dec_get,
0,
dec_value,
0,
0, //dec_value,
0,
0,
0,
@ -674,6 +752,33 @@ __vpiDecConst::__vpiDecConst(int val)
int __vpiDecConst::get_type_code(void) const
{ return vpiConstant; }
int __vpiDecConst::vpi_get(int code)
{ return dec_get(code, this); }
char* __vpiDecConst::vpi_get_str(int)
{ return 0; }
void __vpiDecConst::vpi_get_value(p_vpi_value val)
{ dec_value(this, val); }
vpiHandle __vpiDecConst::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiDecConst::vpi_handle(int)
{ return 0; }
vpiHandle __vpiDecConst::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiDecConst::vpi_index(int)
{ return 0; }
void __vpiDecConst::vpi_get_delays(p_vpi_delay)
{ }
void __vpiDecConst::vpi_put_delays(p_vpi_delay)
{ }
static int real_get(int code, vpiHandle)
{
@ -714,9 +819,9 @@ static void real_value(vpiHandle ref, p_vpi_value vp)
static const struct __vpirt vpip_real_rt = {
vpiConstant,
real_get,
0,
real_value,
0,
0, //real_value,
0,
0,
0,
@ -733,6 +838,32 @@ inline __vpiRealConst::__vpiRealConst()
int __vpiRealConst::get_type_code(void) const
{ return vpiConstant; }
int __vpiRealConst::vpi_get(int code)
{ return real_get(code, this); }
char* __vpiRealConst::vpi_get_str(int)
{ return 0; }
void __vpiRealConst::vpi_get_value(p_vpi_value val)
{ real_value(this, val); }
vpiHandle __vpiRealConst::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiRealConst::vpi_handle(int)
{ return 0; }
vpiHandle __vpiRealConst::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiRealConst::vpi_index(int)
{ return 0; }
void __vpiRealConst::vpi_get_delays(p_vpi_delay)
{ }
void __vpiRealConst::vpi_put_delays(p_vpi_delay)
{ }
vpiHandle vpip_make_real_const(double value)
{
@ -744,7 +875,10 @@ vpiHandle vpip_make_real_const(double value)
struct __vpiRealParam : public __vpiRealConst {
__vpiRealParam();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
vpiHandle vpi_handle(int code);
const char*basename;
struct __vpiScope* scope;
unsigned file_idx;
@ -791,11 +925,11 @@ static vpiHandle real_param_handle(int code, vpiHandle obj)
static const struct __vpirt vpip_real_param_rt = {
vpiParameter,
real_param_get,
real_param_get_str,
real_value,
0,
real_param_handle,
0,
0, //Inherited from __vpiRealConst: real_value,
0,
0, //real_param_handle,
0,
0,
0,
@ -810,6 +944,15 @@ inline __vpiRealParam::__vpiRealParam()
int __vpiRealParam::get_type_code(void) const
{ return vpiParameter; }
int __vpiRealParam::vpi_get(int code)
{ return real_param_get(code, this); }
char* __vpiRealParam::vpi_get_str(int code)
{ return real_param_get_str(code, this); }
vpiHandle __vpiRealParam::vpi_handle(int code)
{ return real_param_handle(code, this); }
vpiHandle vpip_make_real_param(char*name, double value,
long file_idx, long lineno)

View File

@ -69,11 +69,11 @@ static vpiHandle named_event_get_handle(int code, vpiHandle ref)
static const struct __vpirt vpip_named_event_rt = {
vpiNamedEvent,
named_event_get,
named_event_get_str,
0, //named_event_get,
0, //named_event_get_str,
0,
0,
named_event_get_handle,
0, //named_event_get_handle,
0,
0,
0,
@ -88,6 +88,14 @@ inline __vpiNamedEvent::__vpiNamedEvent()
int __vpiNamedEvent::get_type_code(void) const
{ return vpiNamedEvent; }
int __vpiNamedEvent::vpi_get(int code)
{ return named_event_get(code, this); }
char* __vpiNamedEvent::vpi_get_str(int code)
{ return named_event_get_str(code, this); }
vpiHandle __vpiNamedEvent::vpi_handle(int code)
{ return named_event_get_handle(code, this); }
vpiHandle vpip_make_named_event(const char*name, vvp_net_t*funct)
{

View File

@ -34,6 +34,37 @@ FILE*vpi_trace = 0;
static s_vpi_vlog_info vpi_vlog_info;
static s_vpi_error_info vpip_last_error = { 0, 0, 0, 0, 0, 0, 0 };
__vpiHandle::~__vpiHandle()
{ }
int __vpiHandle::vpi_get(int)
{ return vpiUndefined; }
char* __vpiHandle::vpi_get_str(int)
{ return 0; }
void __vpiHandle::vpi_get_value(p_vpi_value)
{ }
vpiHandle __vpiHandle::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiHandle::vpi_handle(int)
{ return 0; }
vpiHandle __vpiHandle::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiHandle::vpi_index(int)
{ return 0; }
void __vpiHandle::vpi_get_delays(p_vpi_delay)
{ }
void __vpiHandle::vpi_put_delays(p_vpi_delay)
{ }
/*
* The vpip_string function creates a constant string from the pass
* input. This constant string is permanently allocated from an
@ -919,9 +950,6 @@ vpiHandle vpi_put_value(vpiHandle obj, s_vpi_value*vp,
{
assert(obj);
if (! obj->can_put_value())
return 0;
flags &= ~vpiReturnEvent;
if (flags!=vpiNoDelay && flags!=vpiForceFlag && flags!=vpiReleaseFlag) {

View File

@ -122,44 +122,23 @@ class __vpiHandle {
public:
inline __vpiHandle(const struct __vpirt *tp) : vpi_type_(tp) { }
// The descructor is virtual so that dynamic types will work.
virtual ~__vpiHandle() { }
virtual ~__vpiHandle();
virtual int get_type_code(void) const =0;
virtual int vpi_get(int code);
virtual char* vpi_get_str(int code);
inline int vpi_get(int code)
{ return vpi_type_->vpi_get_? vpi_type_->vpi_get_(code,this) : vpiUndefined; }
inline char* vpi_get_str(int code)
{ return vpi_type_->vpi_get_str_? vpi_type_->vpi_get_str_(code, this) : 0; }
inline void vpi_get_value(p_vpi_value val)
{ if (vpi_type_->vpi_get_value_) vpi_type_->vpi_get_value_(this, val);
else val->format = vpiSuppressVal;
}
inline bool can_put_value() const { return vpi_type_->vpi_put_value_ != 0; }
inline vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return vpi_type_->vpi_put_value_? vpi_type_->vpi_put_value_(this, val, flags) : 0; }
inline vpiHandle vpi_handle(int code)
{ return vpi_type_->handle_? vpi_type_->handle_(code, this) : 0; }
inline vpiHandle vpi_iterate(int code)
{ return vpi_type_->iterate_? vpi_type_->iterate_(code, this) : 0; }
inline vpiHandle vpi_index(int idx)
{ return vpi_type_->index_? vpi_type_->index_(this, idx) : 0; }
virtual void vpi_get_value(p_vpi_value val);
virtual vpiHandle vpi_put_value(p_vpi_value val, int flags);
virtual vpiHandle vpi_handle(int code);
virtual vpiHandle vpi_iterate(int code);
virtual vpiHandle vpi_index(int idx);
virtual void vpi_get_delays(p_vpi_delay del);
virtual void vpi_put_delays(p_vpi_delay del);
static inline int vpi_free_object(vpiHandle ref)
{ return ref->vpi_type_->vpi_free_object_? ref->vpi_type_->vpi_free_object_(ref) : 1; }
inline void vpi_get_delays(p_vpi_delay del)
{ if (vpi_type_->vpi_get_delays_) vpi_type_->vpi_get_delays_(this, del); }
inline void vpi_put_delays(p_vpi_delay del)
{ if (vpi_type_->vpi_put_delays_) vpi_type_->vpi_put_delays_(this, del); }
private:
const struct __vpirt *vpi_type_;
};
@ -220,6 +199,15 @@ extern void callback_execute(struct __vpiCallback*cur);
struct __vpiSystemTime : public __vpiHandle {
__vpiSystemTime();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
struct __vpiScope*scope;
protected:
@ -228,12 +216,21 @@ struct __vpiSystemTime : public __vpiHandle {
struct __vpiScopedTime : public __vpiSystemTime {
__vpiScopedTime();
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
};
struct __vpiScopedSTime : public __vpiSystemTime {
__vpiScopedSTime();
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
};
struct __vpiScopedRealtime : public __vpiSystemTime {
__vpiScopedRealtime();
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
};
@ -243,6 +240,11 @@ struct __vpiScopedRealtime : public __vpiSystemTime {
* scope.
*/
struct __vpiScope : public __vpiHandle {
int vpi_get(int code);
char* vpi_get_str(int code);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
struct __vpiScope *scope;
/* The scope has a name. */
const char*name;
@ -293,6 +295,12 @@ extern void vpip_make_root_iterator(struct __vpiHandle**&table,
* a declared name and declaration indices.
*/
struct __vpiSignal : public __vpiHandle {
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
#ifdef CHECK_WITH_VALGRIND
struct __vpiSignal *pool;
@ -341,6 +349,11 @@ extern vpiHandle vpip_make_net4(const char*name, int msb, int lsb,
struct __vpiPV : public __vpiHandle {
__vpiPV();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle parent;
vvp_net_t*net;
@ -361,6 +374,8 @@ extern void vpip_part_select_value_change(struct __vpiCallback*cbh, vpiHandle ob
struct __vpiModPathTerm : public __vpiHandle {
__vpiModPathTerm();
int get_type_code(void) const;
int vpi_get(int code);
vpiHandle vpi_handle(int code);
vpiHandle expr;
/* The value returned by vpi_get(vpiEdge, ...); */
@ -370,6 +385,14 @@ struct __vpiModPathTerm : public __vpiHandle {
struct __vpiModPathSrc : public __vpiHandle {
__vpiModPathSrc();
int get_type_code(void) const;
int vpi_get(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
struct __vpiModPath *dest;
int type;
@ -421,6 +444,9 @@ extern struct __vpiModPath* vpip_make_modpath(vvp_net_t *net) ;
struct __vpiNamedEvent : public __vpiHandle {
__vpiNamedEvent();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
vpiHandle vpi_handle(int code);
/* base name of the event object */
const char*name;
@ -452,6 +478,12 @@ extern bool is_net_array(vpiHandle obj);
struct __vpiRealVar : public __vpiHandle {
__vpiRealVar();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
union { // The scope or parent array that contains me.
vpiHandle parent;
@ -532,6 +564,15 @@ extern struct __vpiSysTaskCall*vpip_cur_task;
struct __vpiStringConst : public __vpiHandle {
__vpiStringConst();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
char*value;
size_t value_len;
@ -546,6 +587,15 @@ vpiHandle vpip_make_string_param(char*name, char*value,
struct __vpiBinaryConst : public __vpiHandle {
__vpiBinaryConst();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
vvp_vector4_t bits;
/* TRUE if this constant is signed. */
@ -564,6 +614,15 @@ vpiHandle vpip_make_binary_param(char*name, const vvp_vector4_t&bits,
struct __vpiDecConst : public __vpiHandle {
__vpiDecConst(int val =0);
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
int value;
};
@ -571,6 +630,15 @@ struct __vpiDecConst : public __vpiHandle {
struct __vpiRealConst : public __vpiHandle {
__vpiRealConst();
int get_type_code(void) const;
int vpi_get(int code);
char*vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
vpiHandle vpi_handle(int code);
vpiHandle vpi_iterate(int code);
vpiHandle vpi_index(int idx);
void vpi_get_delays(p_vpi_delay del);
void vpi_put_delays(p_vpi_delay del);
double value;
protected:

View File

@ -138,13 +138,13 @@ static vpiHandle real_var_put_value(vpiHandle ref, p_vpi_value vp, int)
static const struct __vpirt vpip_real_var_rt = {
vpiRealVar,
real_var_get,
real_var_get_str,
real_var_get_value,
real_var_put_value,
0, //real_var_get,
0, //real_var_get_str,
0, //real_var_get_value,
0, //real_var_put_value,
real_var_get_handle,
real_var_iterate,
0, //real_var_get_handle,
0, //real_var_iterate,
0,
0,
0,
@ -158,6 +158,23 @@ inline __vpiRealVar::__vpiRealVar()
int __vpiRealVar::get_type_code(void) const
{ return vpiRealVar; }
int __vpiRealVar::vpi_get(int code)
{ return real_var_get(code, this); }
char* __vpiRealVar::vpi_get_str(int code)
{ return real_var_get_str(code, this); }
void __vpiRealVar::vpi_get_value(p_vpi_value val)
{ real_var_get_value(this, val); }
vpiHandle __vpiRealVar::vpi_put_value(p_vpi_value val, int flags)
{ return real_var_put_value(this, val, flags); }
vpiHandle __vpiRealVar::vpi_handle(int code)
{ return real_var_get_handle(code, this); }
vpiHandle __vpiRealVar::vpi_iterate(int code)
{ return real_var_iterate(code, this); }
void vpip_real_value_change(struct __vpiCallback*cbh,
vpiHandle ref)

View File

@ -306,14 +306,26 @@ static vpiHandle module_iter(int code, vpiHandle obj)
}
int __vpiScope::vpi_get(int code)
{ return scope_get(code, this); }
char*__vpiScope::vpi_get_str(int code)
{ return scope_get_str(code, this); }
vpiHandle __vpiScope::vpi_handle(int code)
{ return scope_get_handle(code, this); }
vpiHandle __vpiScope::vpi_iterate(int code)
{ return module_iter(code, this); }
static const struct __vpirt vpip_scope_module_rt = {
vpiModule,
scope_get,
scope_get_str,
0, // Inherit from__vpiScope: scope_get,
0, // Inherit from __vpiScope: scope_get_str,
0,
0,
scope_get_handle,
module_iter,
0, // Inherit from__vpiScope: scope_get_handle,
0, // Inherit from__vpiScope: module_iter,
0,
0,
0,
@ -327,12 +339,12 @@ struct vpiScopeModule : public __vpiScope {
static const struct __vpirt vpip_scope_task_rt = {
vpiTask,
scope_get,
scope_get_str,
0, // Inherit from__vpiScope: scope_get,
0, // Inherit from __vpiScope: scope_get_str,
0,
0,
scope_get_handle,
module_iter,
0, // Inherit from__vpiScope: scope_get_handle,
0, // Inherit from__vpiScope: module_iter,
0,
0,
0,
@ -346,12 +358,12 @@ struct vpiScopeTask : public __vpiScope {
static const struct __vpirt vpip_scope_function_rt = {
vpiFunction,
scope_get,
scope_get_str,
0, // Inherit from__vpiScope: scope_get,
0, // Inherit from __vpiScope: scope_get_str,
0,
0,
scope_get_handle,
module_iter,
0, // Inherit from__vpiScope: scope_get_handle,
0, // Inherit from__vpiScope: module_iter,
0,
0,
0,
@ -365,12 +377,12 @@ struct vpiScopeFunction : public __vpiScope {
static const struct __vpirt vpip_scope_begin_rt = {
vpiNamedBegin,
scope_get,
scope_get_str,
0, // Inherit from__vpiScope: scope_get,
0, // Inherit from __vpiScope: scope_get_str,
0,
0,
scope_get_handle,
module_iter,
0, // Inherit from__vpiScope: scope_get_handle,
0, // Inherit from__vpiScope: module_iter,
0,
0,
0,
@ -384,12 +396,12 @@ struct vpiScopeBegin : public __vpiScope {
static const struct __vpirt vpip_scope_fork_rt = {
vpiNamedFork,
scope_get,
scope_get_str,
0, // Inherit from__vpiScope: scope_get,
0, // Inherit from __vpiScope: scope_get_str,
0,
0,
scope_get_handle,
module_iter,
0, // Inherit from__vpiScope: scope_get_handle,
0, // Inherit from__vpiScope: module_iter,
0,
0,
0,

View File

@ -860,14 +860,32 @@ vvp_vector4_t vec4_from_vpi_value(s_vpi_value*vp, unsigned wid)
return val;
}
int __vpiSignal::vpi_get(int code)
{ return signal_get(code, this); }
char* __vpiSignal::vpi_get_str(int code)
{ return signal_get_str(code, this); }
void __vpiSignal::vpi_get_value(p_vpi_value val)
{ signal_get_value(this, val); }
vpiHandle __vpiSignal::vpi_put_value(p_vpi_value val, int flags)
{ return signal_put_value(this, val, flags); }
vpiHandle __vpiSignal::vpi_handle(int code)
{ return signal_get_handle(code, this); }
vpiHandle __vpiSignal::vpi_iterate(int code)
{ return signal_iterate(code, this); }
static const struct __vpirt vpip_reg_rt = {
vpiReg,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -880,12 +898,12 @@ struct signal_reg : public __vpiSignal {
static const struct __vpirt vpip_integer_rt = {
vpiIntegerVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -898,12 +916,12 @@ struct signal_integer : public __vpiSignal {
static const struct __vpirt vpip_net_rt = {
vpiNet,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -916,12 +934,12 @@ struct signal_net : public __vpiSignal {
static const struct __vpirt vpip_byte_rt = {
vpiByteVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -934,12 +952,12 @@ struct signal_byte : public __vpiSignal {
static const struct __vpirt vpip_bitvar_rt = {
vpiBitVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -952,12 +970,12 @@ struct signal_bitvar : public __vpiSignal {
static const struct __vpirt vpip_shortint_rt = {
vpiShortIntVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -970,12 +988,12 @@ struct signal_shortint : public __vpiSignal {
static const struct __vpirt vpip_int_rt = {
vpiIntVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -988,12 +1006,12 @@ struct signal_int : public __vpiSignal {
static const struct __vpirt vpip_longint_rt = {
vpiLongIntVar,
signal_get,
signal_get_str,
signal_get_value,
signal_put_value,
signal_get_handle,
signal_iterate,
0, //Inherit from __vpiSignal: signal_get,
0, //Inherit from __vpiSignal: signal_get_str,
0, //Inherit from __vpiSignal: signal_get_value,
0, //Inherit from __vpiSignal: signal_put_value,
0, //Inherit from __vpiSignal: signal_get_handle,
0, //Inherit from __vpiSignal: signal_iterate,
0,
0,
0,
@ -1378,6 +1396,7 @@ static vpiHandle PV_put_value(vpiHandle ref, p_vpi_value vp, int)
vvp_vector4_t val = vec4_from_vpi_value(vp, width);
fprintf(stderr, "XXXX PV_put_value(..)\n");
/*
* If the base is less than zero then trim off any unneeded
* lower bits.
@ -1429,11 +1448,11 @@ static vpiHandle PV_get_handle(int code, vpiHandle ref)
static const struct __vpirt vpip_PV_rt = {
vpiPartSelect,
PV_get,
PV_get_str,
PV_get_value,
PV_put_value,
PV_get_handle,
0, //PV_get,
0, //PV_get_str,
0, //PV_get_value,
0, //PV_put_value,
0, //PV_get_handle,
0,
0,
0,
@ -1448,6 +1467,21 @@ inline __vpiPV::__vpiPV()
int __vpiPV::get_type_code(void) const
{ return vpiPartSelect; }
int __vpiPV::vpi_get(int code)
{ return PV_get(code, this); }
char* __vpiPV::vpi_get_str(int code)
{ return PV_get_str(code, this); }
void __vpiPV::vpi_get_value(p_vpi_value val)
{ PV_get_value(this, val); }
vpiHandle __vpiPV::vpi_put_value(p_vpi_value val, int flags)
{ return PV_put_value(this, val, flags); }
vpiHandle __vpiPV::vpi_handle(int code)
{ return PV_get_handle(code, this); }
vpiHandle vpip_make_PV(char*var, int base, int width)
{
struct __vpiPV*obj = new __vpiPV;

View File

@ -156,12 +156,12 @@ static vpiHandle systask_iter(int, vpiHandle ref)
static const struct __vpirt vpip_systask_rt = {
vpiSysTaskCall,
systask_get,
systask_get_str,
0, //systask_get,
0, //systask_get_str,
0,
0,
systask_handle,
systask_iter,
0, //systask_handle,
0, //systask_iter,
0,
0,
0,
@ -170,6 +170,10 @@ static const struct __vpirt vpip_systask_rt = {
struct systask_def : public __vpiSysTaskCall {
inline systask_def() : __vpiSysTaskCall(&vpip_systask_rt) { }
int get_type_code(void) const { return vpiSysTaskCall; }
int vpi_get(int code) { return systask_get(code, this); }
char*vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_handle(int code) { return systask_handle(code, this); }
vpiHandle vpi_iterate(int code){ return systask_iter(code, this); }
};
/*
@ -467,12 +471,12 @@ static vpiHandle sysfunc_put_no_value(vpiHandle, p_vpi_value, int)
static const struct __vpirt vpip_sysfunc_rt = {
vpiSysFuncCall,
sysfunc_get,
systask_get_str,
0, //sysfunc_get,
0, //systask_get_str,
0,
sysfunc_put_value,
systask_handle,
systask_iter,
0, //sysfunc_put_value,
0, //systask_handle,
0, //systask_iter,
0,
0,
0,
@ -481,16 +485,24 @@ static const struct __vpirt vpip_sysfunc_rt = {
struct sysfunc_def : public __vpiSysTaskCall {
inline sysfunc_def() : __vpiSysTaskCall(&vpip_sysfunc_rt) { }
int get_type_code(void) const { return vpiSysFuncCall; }
int vpi_get(int code) { return sysfunc_get(code, this); }
char* vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return sysfunc_put_value(this, val, flags); }
vpiHandle vpi_handle(int code)
{ return systask_handle(code, this); }
vpiHandle vpi_iterate(int code)
{ return systask_iter(code, this); }
};
static const struct __vpirt vpip_sysfunc_real_rt = {
vpiSysFuncCall,
sysfunc_get,
systask_get_str,
0, //sysfunc_get,
0, //systask_get_str,
0,
sysfunc_put_real_value,
systask_handle,
systask_iter,
0, //sysfunc_put_real_value,
0, //systask_handle,
0, //systask_iter,
0,
0,
0,
@ -499,16 +511,24 @@ static const struct __vpirt vpip_sysfunc_real_rt = {
struct sysfunc_real : public __vpiSysTaskCall {
inline sysfunc_real() : __vpiSysTaskCall(&vpip_sysfunc_real_rt) { }
int get_type_code(void) const { return vpiSysFuncCall; }
int vpi_get(int code) { return sysfunc_get(code, this); }
char* vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return sysfunc_put_real_value(this, val, flags); }
vpiHandle vpi_handle(int code)
{ return systask_handle(code, this); }
vpiHandle vpi_iterate(int code)
{ return systask_iter(code, this); }
};
static const struct __vpirt vpip_sysfunc_4net_rt = {
vpiSysFuncCall,
sysfunc_get,
systask_get_str,
0, //sysfunc_get,
0, //systask_get_str,
0,
sysfunc_put_4net_value,
systask_handle,
systask_iter,
0, //sysfunc_put_4net_value,
0, //systask_handle,
0, //systask_iter,
0,
0,
0,
@ -517,16 +537,24 @@ static const struct __vpirt vpip_sysfunc_4net_rt = {
struct sysfunc_4net : public __vpiSysTaskCall {
inline sysfunc_4net() : __vpiSysTaskCall(&vpip_sysfunc_4net_rt) { }
int get_type_code(void) const { return vpiSysFuncCall; }
int vpi_get(int code) { return sysfunc_get(code, this); }
char* vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return sysfunc_put_4net_value(this, val, flags); }
vpiHandle vpi_handle(int code)
{ return systask_handle(code, this); }
vpiHandle vpi_iterate(int code)
{ return systask_iter(code, this); }
};
static const struct __vpirt vpip_sysfunc_rnet_rt = {
vpiSysFuncCall,
sysfunc_get,
systask_get_str,
0, //sysfunc_get,
0, //systask_get_str,
0,
sysfunc_put_rnet_value,
systask_handle,
systask_iter,
0, //sysfunc_put_rnet_value,
0, //systask_handle,
0, //systask_iter,
0,
0,
0,
@ -535,12 +563,20 @@ static const struct __vpirt vpip_sysfunc_rnet_rt = {
struct sysfunc_rnet : public __vpiSysTaskCall {
inline sysfunc_rnet() : __vpiSysTaskCall(&vpip_sysfunc_rnet_rt) { }
int get_type_code(void) const { return vpiSysFuncCall; }
int vpi_get(int code) { return sysfunc_get(code, this); }
char* vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return sysfunc_put_rnet_value(this, val, flags); }
vpiHandle vpi_handle(int code)
{ return systask_handle(code, this); }
vpiHandle vpi_iterate(int code)
{ return systask_iter(code, this); }
};
static const struct __vpirt vpip_sysfunc_no_rt = {
vpiSysFuncCall,
sysfunc_get,
systask_get_str,
0, //sysfunc_get,
0, //systask_get_str,
0,
sysfunc_put_no_value,
systask_handle,
@ -553,6 +589,14 @@ static const struct __vpirt vpip_sysfunc_no_rt = {
struct sysfunc_no : public __vpiSysTaskCall {
inline sysfunc_no() : __vpiSysTaskCall(&vpip_sysfunc_no_rt) { }
int get_type_code(void) const { return vpiSysFuncCall; }
int vpi_get(int code) { return sysfunc_get(code, this); }
char* vpi_get_str(int code) { return systask_get_str(code, this); }
vpiHandle vpi_put_value(p_vpi_value val, int flags)
{ return sysfunc_put_no_value(this, val, flags); }
vpiHandle vpi_handle(int code)
{ return systask_handle(code, this); }
vpiHandle vpi_iterate(int code)
{ return systask_iter(code, this); }
};
/* **** Manipulate the internal data structures. **** */
@ -603,6 +647,7 @@ void def_table_delete(void)
struct __vpiSystfIterator : public __vpiHandle {
__vpiSystfIterator();
int get_type_code(void) const;
vpiHandle vpi_index(int idx);
unsigned next;
};
@ -644,7 +689,7 @@ static const struct __vpirt vpip_systf_iterator_rt = {
0,
0,
0,
systf_iterator_scan,
0, //systf_iterator_scan,
systf_iterator_free_object,
0,
0
@ -657,6 +702,9 @@ inline __vpiSystfIterator::__vpiSystfIterator()
int __vpiSystfIterator::get_type_code(void) const
{ return vpiIterator; }
vpiHandle __vpiSystfIterator::vpi_index(int idx)
{ return systf_iterator_scan(this, idx); }
vpiHandle vpip_make_systf_iterator(void)
{
/* Check to see if there are any user defined functions. */

View File

@ -313,11 +313,11 @@ static void timevar_get_rvalue(vpiHandle ref, s_vpi_value*vp)
static const struct __vpirt vpip_system_time_rt = {
vpiSysFuncCall,
timevar_time_get,
timevar_time_get_str,
timevar_get_ivalue,
0,
timevar_handle,
0, //timevar_time_get_str,
0, //timevar_get_ivalue,
0,
0, //Inherit from __vpiSystemTime: timevar_handle,
0,
0,
0,
@ -329,13 +329,22 @@ __vpiScopedTime::__vpiScopedTime()
{
}
int __vpiScopedTime::vpi_get(int code)
{ return timevar_time_get(code, this); }
char* __vpiScopedTime::vpi_get_str(int code)
{ return timevar_time_get_str(code, this); }
void __vpiScopedTime::vpi_get_value(p_vpi_value val)
{ timevar_get_ivalue(this, val); }
static const struct __vpirt vpip_system_stime_rt = {
vpiSysFuncCall,
timevar_stime_get,
timevar_stime_get_str,
timevar_get_svalue,
0,
timevar_handle,
0,
0, //timevar_get_svalue,
0,
0, //Inherit from __vpiSystemTime: timevar_handle,
0,
0,
0,
@ -347,13 +356,22 @@ __vpiScopedSTime::__vpiScopedSTime()
{
}
int __vpiScopedSTime::vpi_get(int code)
{ return timevar_stime_get(code, this); }
char* __vpiScopedSTime::vpi_get_str(int code)
{ return timevar_stime_get_str(code, this); }
void __vpiScopedSTime::vpi_get_value(p_vpi_value val)
{ timevar_get_svalue(this, val); }
static const struct __vpirt vpip_system_simtime_rt = {
vpiSysFuncCall,
timevar_time_get,
timevar_simtime_get_str,
timevar_get_ivalue,
0,
timevar_handle,
0,
0, //timevar_get_ivalue,
0,
0, //timevar_handle,
0,
0,
0,
@ -367,17 +385,42 @@ __vpiSystemTime::__vpiSystemTime()
}
int __vpiSystemTime::get_type_code(void) const
{
return vpiSysFuncCall;
}
{ return vpiSysFuncCall; }
int __vpiSystemTime::vpi_get(int code)
{ return timevar_time_get(code, this); }
char* __vpiSystemTime::vpi_get_str(int code)
{ return timevar_simtime_get_str(code, this); }
void __vpiSystemTime::vpi_get_value(p_vpi_value val)
{ timevar_get_ivalue(this, val); }
vpiHandle __vpiSystemTime::vpi_put_value(p_vpi_value, int)
{ return 0; }
vpiHandle __vpiSystemTime::vpi_handle(int code)
{ return timevar_handle(code, this); }
vpiHandle __vpiSystemTime::vpi_iterate(int)
{ return 0; }
vpiHandle __vpiSystemTime::vpi_index(int)
{ return 0; }
void __vpiSystemTime::vpi_get_delays(p_vpi_delay)
{ }
void __vpiSystemTime::vpi_put_delays(p_vpi_delay)
{ }
static const struct __vpirt vpip_system_realtime_rt = {
vpiSysFuncCall,
timevar_realtime_get,
timevar_realtime_get_str,
timevar_get_rvalue,
0,
timevar_handle,
0,
0, //timevar_get_rvalue,
0,
0, //Inherit from __vpiSystemTime: timevar_handle,
0,
0,
0,
@ -389,6 +432,14 @@ __vpiScopedRealtime::__vpiScopedRealtime()
{
}
int __vpiScopedRealtime::vpi_get(int code)
{ return timevar_realtime_get(code, this); }
char* __vpiScopedRealtime::vpi_get_str(int code)
{ return timevar_realtime_get_str(code, this); }
void __vpiScopedRealtime::vpi_get_value(p_vpi_value val)
{ timevar_get_rvalue(this, val); }
/*
* Create a handle to represent a call to $time/$stime/$simtime. The

View File

@ -38,6 +38,10 @@
struct __vpiVThrVec : public __vpiHandle {
__vpiVThrVec();
int get_type_code(void) const;
int vpi_get(int code);
char* vpi_get_str(int code);
void vpi_get_value(p_vpi_value val);
vpiHandle vpi_put_value(p_vpi_value val, int flags);
unsigned bas;
unsigned wid;
@ -436,10 +440,10 @@ static vpiHandle vthr_vec_put_value(vpiHandle ref, s_vpi_value*vp, int)
static const struct __vpirt vpip_vthr_const_rt = {
vpiConstant,
vthr_vec_get,
vthr_vec_get_str,
vthr_vec_get_value,
vthr_vec_put_value,
0, //vthr_vec_get,
0, //vthr_vec_get_str,
0, //vthr_vec_get_value,
0, //vthr_vec_put_value,
0,
0,
0,
@ -455,6 +459,17 @@ inline __vpiVThrVec::__vpiVThrVec()
int __vpiVThrVec::get_type_code(void) const
{ return vpiConstant; }
int __vpiVThrVec::vpi_get(int code)
{ return vthr_vec_get(code, this); }
char* __vpiVThrVec::vpi_get_str(int code)
{ return vthr_vec_get_str(code, this); }
void __vpiVThrVec::vpi_get_value(p_vpi_value val)
{ vthr_vec_get_value(this, val); }
vpiHandle __vpiVThrVec::vpi_put_value(p_vpi_value val, int flags)
{ return vthr_vec_put_value(this, val, flags); }
/*
* Construct a vpiReg object. Give the object specified dimensions,
@ -491,6 +506,8 @@ static void thread_vthr_delete_real(vpiHandle item)
struct __vpiVThrWord : public __vpiHandle {
__vpiVThrWord();
int get_type_code(void) const;
int vpi_get(int code);
void vpi_get_value(p_vpi_value val);
const char* name;
int subtype;
@ -588,9 +605,9 @@ static void vthr_real_get_value(vpiHandle ref, s_vpi_value*vp)
static const struct __vpirt vpip_vthr_const_real_rt = {
vpiConstant,
vthr_word_get,
0, //vthr_word_get,
0,
vthr_real_get_value,
0, //vthr_real_get_value,
0,
0,
0,
@ -607,6 +624,12 @@ inline __vpiVThrWord::__vpiVThrWord()
int __vpiVThrWord::get_type_code(void) const
{ return vpiConstant; }
int __vpiVThrWord::vpi_get(int code)
{ return vthr_word_get(code, this); }
void __vpiVThrWord::vpi_get_value(p_vpi_value val)
{ vthr_real_get_value(this, val); }
vpiHandle vpip_make_vthr_word(unsigned base, const char*type)
{
struct __vpiVThrWord*obj = new __vpiVThrWord;