Get the vvp code to compile with the valgrind hooks again.
This patch updates the vvp code so it will compile with the valgrind hooks again. There are still new constructs that need to be cleaned up correctly and some old constructs were changed enough that the old code no longer works, but the rest of this can be done as an incremental improvement.
This commit is contained in:
parent
e0f82981e7
commit
f957deeca7
26
vvp/array.cc
26
vvp/array.cc
|
|
@ -92,10 +92,10 @@ struct __vpiArray : public __vpiHandle {
|
||||||
struct __vpiScope*scope;
|
struct __vpiScope*scope;
|
||||||
const char*name; /* Permanently allocated string */
|
const char*name; /* Permanently allocated string */
|
||||||
unsigned array_count;
|
unsigned array_count;
|
||||||
struct __vpiDecConst first_addr;
|
__vpiDecConst first_addr;
|
||||||
struct __vpiDecConst last_addr;
|
__vpiDecConst last_addr;
|
||||||
struct __vpiDecConst msb;
|
__vpiDecConst msb;
|
||||||
struct __vpiDecConst lsb;
|
__vpiDecConst lsb;
|
||||||
unsigned vals_width;
|
unsigned vals_width;
|
||||||
// If this is a net array, nets lists the handles.
|
// If this is a net array, nets lists the handles.
|
||||||
vpiHandle*nets;
|
vpiHandle*nets;
|
||||||
|
|
@ -127,7 +127,7 @@ struct __vpiArrayIndex : public __vpiHandle {
|
||||||
vpiHandle vpi_index(int idx);
|
vpiHandle vpi_index(int idx);
|
||||||
free_object_fun_t free_object_fun(void);
|
free_object_fun_t free_object_fun(void);
|
||||||
|
|
||||||
struct __vpiDecConst *index;
|
__vpiDecConst *index;
|
||||||
unsigned done;
|
unsigned done;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -716,7 +716,7 @@ static void vpi_array_var_index_get_value(vpiHandle ref, p_vpi_value vp)
|
||||||
|
|
||||||
vpiHandle array_index_iterate(int code, vpiHandle ref)
|
vpiHandle array_index_iterate(int code, vpiHandle ref)
|
||||||
{
|
{
|
||||||
struct __vpiDecConst*obj = dynamic_cast<__vpiDecConst*>(ref);
|
__vpiDecConst *obj = dynamic_cast<__vpiDecConst*>(ref);
|
||||||
assert(obj);
|
assert(obj);
|
||||||
|
|
||||||
if (code == vpiIndex) {
|
if (code == vpiIndex) {
|
||||||
|
|
@ -1884,7 +1884,7 @@ void compile_array_cleanup(void)
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
void memory_delete(vpiHandle item)
|
void memory_delete(vpiHandle item)
|
||||||
{
|
{
|
||||||
struct __vpiArray*arr = ARRAY_HANDLE(item);
|
struct __vpiArray*arr = (struct __vpiArray*) item;
|
||||||
if (arr->vals_words) delete [] (arr->vals_words-1);
|
if (arr->vals_words) delete [] (arr->vals_words-1);
|
||||||
|
|
||||||
// if (arr->vals4) {}
|
// if (arr->vals4) {}
|
||||||
|
|
@ -1905,13 +1905,13 @@ void memory_delete(vpiHandle item)
|
||||||
constant_delete(sig->id.index);
|
constant_delete(sig->id.index);
|
||||||
/* These should only be the real words. */
|
/* These should only be the real words. */
|
||||||
} else {
|
} else {
|
||||||
assert(arr->nets[idx]->vpi_type->type_code ==
|
assert(arr->nets[idx]->get_type_code() ==
|
||||||
vpiRealVar);
|
vpiRealVar);
|
||||||
struct __vpiRealVar *sigr = (struct __vpiRealVar *)
|
struct __vpiRealVar *sigr = (struct __vpiRealVar *)
|
||||||
arr->nets[idx];
|
arr->nets[idx];
|
||||||
constant_delete(sigr->id.index);
|
constant_delete(sigr->id.index);
|
||||||
// Why are only the real words still here?
|
// Why are only the real words still here?
|
||||||
free(arr->nets[idx]);
|
delete arr->nets[idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(arr->nets);
|
free(arr->nets);
|
||||||
|
|
@ -1919,18 +1919,18 @@ void memory_delete(vpiHandle item)
|
||||||
|
|
||||||
while (arr->vpi_callbacks) {
|
while (arr->vpi_callbacks) {
|
||||||
struct __vpiCallback*tmp = arr->vpi_callbacks->next;
|
struct __vpiCallback*tmp = arr->vpi_callbacks->next;
|
||||||
delete_vpi_callback(arr->vpi_callbacks);
|
delete arr->vpi_callbacks;
|
||||||
arr->vpi_callbacks = tmp;
|
arr->vpi_callbacks = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(arr);
|
delete arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A_delete(vpiHandle item)
|
void A_delete(vpiHandle item)
|
||||||
{
|
{
|
||||||
struct __vpiArrayVthrA*obj = (struct __vpiArrayVthrA*) item;
|
struct __vpiArrayVthrA*obj = (struct __vpiArrayVthrA*) item;
|
||||||
if (obj->address_handle) {
|
if (obj->address_handle) {
|
||||||
switch (obj->address_handle->vpi_type->type_code) {
|
switch (obj->address_handle->get_type_code()) {
|
||||||
case vpiMemoryWord:
|
case vpiMemoryWord:
|
||||||
if (vpi_get(_vpiFromThr, obj->address_handle) == _vpi_at_A) {
|
if (vpi_get(_vpiFromThr, obj->address_handle) == _vpi_at_A) {
|
||||||
A_delete(obj->address_handle);
|
A_delete(obj->address_handle);
|
||||||
|
|
@ -1944,6 +1944,6 @@ void A_delete(vpiHandle item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(obj);
|
delete obj;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1054,7 +1054,7 @@ struct __vpiModPath* vpip_make_modpath(vvp_net_t *net)
|
||||||
void modpath_delete()
|
void modpath_delete()
|
||||||
{
|
{
|
||||||
for (unsigned idx = 0; idx < mp_count; idx += 1) {
|
for (unsigned idx = 0; idx < mp_count; idx += 1) {
|
||||||
free(mp_list[idx]);
|
delete mp_list[idx];
|
||||||
}
|
}
|
||||||
free(mp_list);
|
free(mp_list);
|
||||||
mp_list = 0;
|
mp_list = 0;
|
||||||
|
|
|
||||||
13
vvp/event.cc
13
vvp/event.cc
|
|
@ -23,9 +23,6 @@
|
||||||
# include "schedule.h"
|
# include "schedule.h"
|
||||||
# include "vpi_priv.h"
|
# include "vpi_priv.h"
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
|
||||||
# include "vvp_cleanup.h"
|
|
||||||
#endif
|
|
||||||
# include <cstring>
|
# include <cstring>
|
||||||
# include <cassert>
|
# include <cassert>
|
||||||
# include <cstdlib>
|
# include <cstdlib>
|
||||||
|
|
@ -855,14 +852,6 @@ void compile_named_event(char*label, char*name)
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
void named_event_delete(__vpiHandle*handle)
|
void named_event_delete(__vpiHandle*handle)
|
||||||
{
|
{
|
||||||
__vpiNamedEvent *obj = (__vpiNamedEvent *) handle;
|
delete dynamic_cast<__vpiNamedEvent *>(handle);
|
||||||
|
|
||||||
while (obj->callbacks) {
|
|
||||||
struct __vpiCallback*tmp = obj->callbacks->next;
|
|
||||||
delete_vpi_callback(obj->callbacks);
|
|
||||||
obj->callbacks = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(obj);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -639,8 +639,9 @@ void vvp_vpi_callback::add_vpi_callback(value_callback*cb)
|
||||||
void vvp_vpi_callback::clear_all_callbacks()
|
void vvp_vpi_callback::clear_all_callbacks()
|
||||||
{
|
{
|
||||||
while (vpi_callbacks_) {
|
while (vpi_callbacks_) {
|
||||||
struct __vpiCallback*tmp = vpi_callbacks_->next;
|
value_callback *tmp = dynamic_cast<value_callback*>
|
||||||
delete_vpi_callback(vpi_callbacks_);
|
(vpi_callbacks_->next);
|
||||||
|
delete vpi_callbacks_;
|
||||||
vpi_callbacks_ = tmp;
|
vpi_callbacks_ = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ void __vpiStringConst::process_string_(void)
|
||||||
|
|
||||||
__vpiStringConst::~__vpiStringConst()
|
__vpiStringConst::~__vpiStringConst()
|
||||||
{
|
{
|
||||||
delete[]value_;
|
delete[] value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __vpiStringConst::get_type_code(void) const
|
int __vpiStringConst::get_type_code(void) const
|
||||||
|
|
@ -650,7 +650,7 @@ int __vpiRealConst::vpi_get(int code)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "vvp error: get %d not supported "
|
fprintf(stderr, "vvp error: get %d not supported "
|
||||||
"by vpiDecConst\n", code);
|
"by vpiRealConst\n", code);
|
||||||
assert(0);
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -754,25 +754,20 @@ vpiHandle vpip_make_real_param(char*name, double value,
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
void constant_delete(vpiHandle item)
|
void constant_delete(vpiHandle item)
|
||||||
{
|
{
|
||||||
assert(item->vpi_type->type_code == vpiConstant);
|
assert(item->get_type_code() == vpiConstant);
|
||||||
switch(vpi_get(vpiConstType, item)) {
|
switch(vpi_get(vpiConstType, item)) {
|
||||||
case vpiStringConst: {
|
case vpiStringConst:
|
||||||
struct __vpiStringConst*rfp = dynamic_cast<__vpiStringConst*>(item);
|
delete dynamic_cast<__vpiStringConst*>(item);
|
||||||
delete [] rfp->value;
|
break;
|
||||||
free(rfp);
|
case vpiDecConst:
|
||||||
break; }
|
delete dynamic_cast<__vpiDecConst*>(item);
|
||||||
case vpiDecConst: {
|
break;
|
||||||
struct __vpiDecConst*rfp = dynamic_cast<__vpiDecConst*>(item);
|
case vpiBinaryConst:
|
||||||
free(rfp);
|
delete dynamic_cast<__vpiBinaryConst*>(item);
|
||||||
break; }
|
break;
|
||||||
case vpiBinaryConst: {
|
case vpiRealConst:
|
||||||
struct __vpiBinaryConst*rfp = dynamic_cast<__vpiBinaryConst*>(item);
|
delete dynamic_cast<__vpiRealConst*>(item);
|
||||||
delete rfp;
|
break;
|
||||||
break; }
|
|
||||||
case vpiRealConst: {
|
|
||||||
struct __vpiRealConst*rfp = dynamic_cast<__vpiRealConst*>(item);
|
|
||||||
free(rfp);
|
|
||||||
break; }
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,15 @@ inline __vpiNamedEvent::__vpiNamedEvent(__vpiScope*sc, const char*nam)
|
||||||
callbacks_ = 0;
|
callbacks_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__vpiNamedEvent::~__vpiNamedEvent()
|
||||||
|
{
|
||||||
|
while (callbacks_) {
|
||||||
|
struct __vpiCallback *tmp = callbacks_->next;
|
||||||
|
delete callbacks_;
|
||||||
|
callbacks_ = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int __vpiNamedEvent::get_type_code(void) const
|
int __vpiNamedEvent::get_type_code(void) const
|
||||||
{ return vpiNamedEvent; }
|
{ return vpiNamedEvent; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -273,9 +273,6 @@ struct __vpiSignal : public __vpiHandle {
|
||||||
vpiHandle vpi_handle(int code);
|
vpiHandle vpi_handle(int code);
|
||||||
vpiHandle vpi_iterate(int code);
|
vpiHandle vpi_iterate(int code);
|
||||||
|
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
|
||||||
struct __vpiSignal *pool;
|
|
||||||
#endif
|
|
||||||
union { // The scope or parent array that contains me.
|
union { // The scope or parent array that contains me.
|
||||||
vpiHandle parent;
|
vpiHandle parent;
|
||||||
struct __vpiScope* scope;
|
struct __vpiScope* scope;
|
||||||
|
|
@ -414,6 +411,7 @@ class __vpiNamedEvent : public __vpiHandle {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__vpiNamedEvent(__vpiScope*scope, const char*name);
|
__vpiNamedEvent(__vpiScope*scope, const char*name);
|
||||||
|
~__vpiNamedEvent();
|
||||||
int get_type_code(void) const;
|
int get_type_code(void) const;
|
||||||
int vpi_get(int code);
|
int vpi_get(int code);
|
||||||
char* vpi_get_str(int code);
|
char* vpi_get_str(int code);
|
||||||
|
|
@ -599,7 +597,8 @@ vpiHandle vpip_make_binary_param(char*name, const vvp_vector4_t&bits,
|
||||||
bool signed_flag, bool local_flag,
|
bool signed_flag, bool local_flag,
|
||||||
long file_idx, long lineno);
|
long file_idx, long lineno);
|
||||||
|
|
||||||
struct __vpiDecConst : public __vpiHandle {
|
class __vpiDecConst : public __vpiHandle {
|
||||||
|
public:
|
||||||
__vpiDecConst(int val =0);
|
__vpiDecConst(int val =0);
|
||||||
int get_type_code(void) const;
|
int get_type_code(void) const;
|
||||||
int vpi_get(int code);
|
int vpi_get(int code);
|
||||||
|
|
@ -614,7 +613,7 @@ class __vpiRealConst : public __vpiHandle {
|
||||||
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);
|
||||||
public:
|
|
||||||
double value;
|
double value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,13 @@ void vpip_make_root_iterator(__vpiHandle**&table, unsigned&ntable)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
void port_delete(__vpiHandle*handle);
|
||||||
|
|
||||||
static void delete_sub_scopes(struct __vpiScope *scope)
|
static void delete_sub_scopes(struct __vpiScope *scope)
|
||||||
{
|
{
|
||||||
for (unsigned idx = 0; idx < scope->nintern; idx += 1) {
|
for (unsigned idx = 0; idx < scope->nintern; idx += 1) {
|
||||||
struct __vpiScope*lscope = (__vpiScope*)(scope->intern)[idx];
|
struct __vpiScope*lscope = (__vpiScope*)(scope->intern)[idx];
|
||||||
switch(scope->intern[idx]->vpi_type->type_code) {
|
switch(scope->intern[idx]->get_type_code()) {
|
||||||
case vpiFunction:
|
case vpiFunction:
|
||||||
case vpiTask:
|
case vpiTask:
|
||||||
contexts_delete(lscope);
|
contexts_delete(lscope);
|
||||||
|
|
@ -70,7 +72,7 @@ static void delete_sub_scopes(struct __vpiScope *scope)
|
||||||
break;
|
break;
|
||||||
case vpiModPath:
|
case vpiModPath:
|
||||||
/* The destination ModPath is cleaned up later. */
|
/* The destination ModPath is cleaned up later. */
|
||||||
free((scope->intern)[idx]);
|
delete (scope->intern)[idx];
|
||||||
break;
|
break;
|
||||||
case vpiNamedEvent:
|
case vpiNamedEvent:
|
||||||
named_event_delete((scope->intern)[idx]);
|
named_event_delete((scope->intern)[idx]);
|
||||||
|
|
@ -94,9 +96,15 @@ static void delete_sub_scopes(struct __vpiScope *scope)
|
||||||
case vpiEnumTypespec:
|
case vpiEnumTypespec:
|
||||||
enum_delete((scope->intern)[idx]);
|
enum_delete((scope->intern)[idx]);
|
||||||
break;
|
break;
|
||||||
|
case vpiPort:
|
||||||
|
port_delete((scope->intern)[idx]);
|
||||||
|
break;
|
||||||
|
case vpiStringVar:
|
||||||
|
case vpiRegArray:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Need support for type: %d\n",
|
fprintf(stderr, "Need support for type: %d\n",
|
||||||
scope->intern[idx]->vpi_type->type_code);
|
scope->intern[idx]->get_type_code());
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -528,13 +536,14 @@ unsigned vpip_add_item_to_context(automatic_hooks_s*item,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct vpiPortInfo : public __vpiHandle {
|
class vpiPortInfo : public __vpiHandle {
|
||||||
|
public:
|
||||||
vpiPortInfo( __vpiScope *parent,
|
vpiPortInfo( __vpiScope *parent,
|
||||||
unsigned index,
|
unsigned index,
|
||||||
int vpi_direction,
|
int vpi_direction,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
const char *name );
|
const char *name );
|
||||||
|
~vpiPortInfo();
|
||||||
|
|
||||||
int get_type_code(void) const { return vpiPort; }
|
int get_type_code(void) const { return vpiPort; }
|
||||||
|
|
||||||
|
|
@ -542,7 +551,7 @@ struct vpiPortInfo : public __vpiHandle {
|
||||||
char* vpi_get_str(int code);
|
char* vpi_get_str(int code);
|
||||||
vpiHandle vpi_handle(int code);
|
vpiHandle vpi_handle(int code);
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
__vpiScope *parent_;
|
__vpiScope *parent_;
|
||||||
unsigned index_;
|
unsigned index_;
|
||||||
int direction_;
|
int direction_;
|
||||||
|
|
@ -563,6 +572,18 @@ vpiPortInfo::vpiPortInfo( __vpiScope *parent,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vpiPortInfo::~vpiPortInfo()
|
||||||
|
{
|
||||||
|
delete[] name_;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
void port_delete(__vpiHandle *handle)
|
||||||
|
{
|
||||||
|
delete dynamic_cast<vpiPortInfo *>(handle);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int vpiPortInfo::vpi_get(int code)
|
int vpiPortInfo::vpi_get(int code)
|
||||||
{
|
{
|
||||||
switch( code ) {
|
switch( code ) {
|
||||||
|
|
|
||||||
|
|
@ -980,7 +980,7 @@ vpiHandle vpip_make_var4(const char*name, int msb, int lsb,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
static struct __vpiSignal **signal_pool = 0;
|
static struct vpiSignal_plug **signal_pool = 0;
|
||||||
static unsigned signal_pool_count = 0;
|
static unsigned signal_pool_count = 0;
|
||||||
static unsigned long signal_count = 0;
|
static unsigned long signal_count = 0;
|
||||||
static unsigned long signal_dels = 0;
|
static unsigned long signal_dels = 0;
|
||||||
|
|
@ -988,11 +988,18 @@ static unsigned long signal_dels = 0;
|
||||||
|
|
||||||
struct vpiSignal_plug {
|
struct vpiSignal_plug {
|
||||||
unsigned char space[sizeof (struct __vpiSignal)];
|
unsigned char space[sizeof (struct __vpiSignal)];
|
||||||
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
struct vpiSignal_plug *pool;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void* __vpiSignal::operator new(size_t siz)
|
void* __vpiSignal::operator new(size_t siz)
|
||||||
{
|
{
|
||||||
assert(siz == sizeof(struct vpiSignal_plug));
|
assert(siz == sizeof(struct vpiSignal_plug)
|
||||||
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
- sizeof(struct vpiSignal_plug *)
|
||||||
|
#endif
|
||||||
|
);
|
||||||
static struct vpiSignal_plug*alloc_array = 0;
|
static struct vpiSignal_plug*alloc_array = 0;
|
||||||
static unsigned alloc_index = 0;
|
static unsigned alloc_index = 0;
|
||||||
const unsigned alloc_count = 512;
|
const unsigned alloc_count = 512;
|
||||||
|
|
@ -1035,7 +1042,7 @@ void signal_delete(vpiHandle item)
|
||||||
obj->node->fil->clear_all_callbacks();
|
obj->node->fil->clear_all_callbacks();
|
||||||
vvp_net_delete(obj->node);
|
vvp_net_delete(obj->node);
|
||||||
signal_dels += 1;
|
signal_dels += 1;
|
||||||
VALGRIND_MEMPOOL_FREE(obj->pool, obj);
|
VALGRIND_MEMPOOL_FREE(reinterpret_cast<vpiSignal_plug *>(obj)->pool, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void signal_pool_delete()
|
void signal_pool_delete()
|
||||||
|
|
@ -1426,7 +1433,7 @@ void PV_delete(vpiHandle item)
|
||||||
{
|
{
|
||||||
struct __vpiPV *obj = dynamic_cast<__vpiPV*>(item);
|
struct __vpiPV *obj = dynamic_cast<__vpiPV*>(item);
|
||||||
if (obj->sbase) {
|
if (obj->sbase) {
|
||||||
switch (obj->sbase->vpi_type->type_code) {
|
switch (obj->sbase->get_type_code()) {
|
||||||
case vpiMemoryWord:
|
case vpiMemoryWord:
|
||||||
if (vpi_get(_vpiFromThr, obj->sbase) == _vpi_at_A) {
|
if (vpi_get(_vpiFromThr, obj->sbase) == _vpi_at_A) {
|
||||||
A_delete(obj->sbase);
|
A_delete(obj->sbase);
|
||||||
|
|
|
||||||
|
|
@ -711,12 +711,14 @@ void print_vpi_call_errors()
|
||||||
#ifdef CHECK_WITH_VALGRIND
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
static void cleanup_vpi_call_args(unsigned argc, vpiHandle*argv)
|
static void cleanup_vpi_call_args(unsigned argc, vpiHandle*argv)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
if (argc) {
|
if (argc) {
|
||||||
struct __vpiSysTaskCall*obj = new struct __vpiSysTaskCall;
|
struct __vpiSysTaskCall*obj = new struct __vpiSysTaskCall;
|
||||||
obj->nargs = argc;
|
obj->nargs = argc;
|
||||||
obj->args = argv;
|
obj->args = argv;
|
||||||
vpi_call_delete(&obj->base);
|
vpi_call_delete(&obj->base);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -837,7 +839,7 @@ void vpi_call_delete(vpiHandle item)
|
||||||
/* The object can be NULL if there was an error. */
|
/* The object can be NULL if there was an error. */
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
for (unsigned arg = 0; arg < obj->nargs; arg += 1) {
|
for (unsigned arg = 0; arg < obj->nargs; arg += 1) {
|
||||||
switch (obj->args[arg]->vpi_type->type_code) {
|
switch (obj->args[arg]->get_type_code()) {
|
||||||
case vpiConstant:
|
case vpiConstant:
|
||||||
switch (vpi_get(_vpiFromThr, obj->args[arg])) {
|
switch (vpi_get(_vpiFromThr, obj->args[arg])) {
|
||||||
case _vpiNoThr:
|
case _vpiNoThr:
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ void vvp_net_pool_delete()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned idx = 0; idx < vvp_net_pool_count; idx += 1) {
|
for (unsigned idx = 0; idx < vvp_net_pool_count; idx += 1) {
|
||||||
VALGRIND_DESTROY_MEMPOOL(vvp_net_pool[idx])
|
VALGRIND_DESTROY_MEMPOOL(vvp_net_pool[idx]);
|
||||||
::delete [] vvp_net_pool[idx];
|
::delete [] vvp_net_pool[idx];
|
||||||
}
|
}
|
||||||
free(vvp_net_pool);
|
free(vvp_net_pool);
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,13 @@ vvp_fun_signal_string_sa::vvp_fun_signal_string_sa()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
void vvp_fun_signal_string_aa::free_instance(vvp_context_t context)
|
||||||
|
{
|
||||||
|
// Never knew how to do this!
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void vvp_fun_signal_string_sa::recv_string(vvp_net_ptr_t ptr, const std::string&bit,
|
void vvp_fun_signal_string_sa::recv_string(vvp_net_ptr_t ptr, const std::string&bit,
|
||||||
vvp_context_t)
|
vvp_context_t)
|
||||||
{
|
{
|
||||||
|
|
@ -671,6 +678,13 @@ vvp_fun_signal_object_sa::vvp_fun_signal_object_sa()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CHECK_WITH_VALGRIND
|
||||||
|
void vvp_fun_signal_object_aa::free_instance(vvp_context_t context)
|
||||||
|
{
|
||||||
|
// Never knew how to do this!
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void vvp_fun_signal_object_sa::recv_object(vvp_net_ptr_t ptr, vvp_object_t bit,
|
void vvp_fun_signal_object_sa::recv_object(vvp_net_ptr_t ptr, vvp_object_t bit,
|
||||||
vvp_context_t)
|
vvp_context_t)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-2011 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2003-2012 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
|
||||||
|
|
@ -105,7 +105,7 @@ static void __compile_var_string(char*label, char*name,
|
||||||
assert(!name);
|
assert(!name);
|
||||||
array_attach_word(array, array_addr, obj);
|
array_attach_word(array, array_addr, obj);
|
||||||
}
|
}
|
||||||
delete[]label;
|
free(label);
|
||||||
delete[] name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,7 +141,7 @@ static void __compile_var_darray(char*label, char*name,
|
||||||
assert(!name);
|
assert(!name);
|
||||||
array_attach_word(array, array_addr, obj);
|
array_attach_word(array, array_addr, obj);
|
||||||
}
|
}
|
||||||
delete[]label;
|
free(label);
|
||||||
delete[] name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue