Better array statistics.
Allocation counters for arrays and array words of various types.
This commit is contained in:
parent
aeaf8e8433
commit
6f9643df79
16
vvp/array.cc
16
vvp/array.cc
|
|
@ -30,6 +30,13 @@
|
|||
# include "compile.h"
|
||||
# include <assert.h>
|
||||
|
||||
unsigned long count_net_arrays = 0;
|
||||
unsigned long count_net_array_words = 0;
|
||||
unsigned long count_var_arrays = 0;
|
||||
unsigned long count_var_array_words = 0;
|
||||
unsigned long count_real_arrays = 0;
|
||||
unsigned long count_real_array_words = 0;
|
||||
|
||||
static symbol_map_s<struct __vpiArray>* array_table =0;
|
||||
|
||||
class vvp_fun_arrayport;
|
||||
|
|
@ -801,6 +808,9 @@ void compile_var_array(char*label, char*name, int last, int first,
|
|||
vpip_make_dec_const(&arr->msb, msb);
|
||||
vpip_make_dec_const(&arr->lsb, lsb);
|
||||
|
||||
count_var_arrays += 1;
|
||||
count_var_array_words += arr->array_count;
|
||||
|
||||
free(label);
|
||||
free(name);
|
||||
}
|
||||
|
|
@ -820,6 +830,9 @@ void compile_real_array(char*label, char*name, int last, int first,
|
|||
compile_varw_real(strdup(buf), array, idx, msb, lsb);
|
||||
}
|
||||
|
||||
count_real_arrays += 1;
|
||||
count_real_array_words += arr->array_count;
|
||||
|
||||
free(label);
|
||||
free(name);
|
||||
}
|
||||
|
|
@ -831,6 +844,9 @@ void compile_net_array(char*label, char*name, int last, int first)
|
|||
struct __vpiArray*arr = ARRAY_HANDLE(obj);
|
||||
arr->nets = (vpiHandle*)calloc(arr->array_count, sizeof(vpiHandle));
|
||||
|
||||
count_net_arrays += 1;
|
||||
count_net_array_words += arr->array_count;
|
||||
|
||||
free(label);
|
||||
free(name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,14 @@ int main(int argc, char*argv[])
|
|||
vpi_mcd_printf(1, " ... %8lu nets\n", count_vpi_nets);
|
||||
vpi_mcd_printf(1, " ... %8lu vvp_nets (%zu bytes)\n",
|
||||
count_vvp_nets, size_vvp_nets);
|
||||
vpi_mcd_printf(1, " ... %8lu memories\n", count_vpi_memories);
|
||||
vpi_mcd_printf(1, " ... %8lu arrays (%lu words)\n",
|
||||
count_net_arrays, count_net_array_words);
|
||||
vpi_mcd_printf(1, " ... %8lu memories\n",
|
||||
count_var_arrays+count_real_arrays);
|
||||
vpi_mcd_printf(1, " %8lu logic (%lu words)\n",
|
||||
count_var_arrays, count_var_array_words);
|
||||
vpi_mcd_printf(1, " %8lu real (%lu words)\n",
|
||||
count_real_arrays, count_real_array_words);
|
||||
vpi_mcd_printf(1, " ... %8lu scopes\n", count_vpi_scopes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ unsigned long count_functors_sig = 0;
|
|||
|
||||
unsigned long count_vpi_nets = 0;
|
||||
|
||||
unsigned long count_vpi_memories = 0;
|
||||
|
||||
unsigned long count_vpi_scopes = 0;
|
||||
|
||||
size_t size_opcodes = 0;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,14 @@ extern unsigned long count_functors_sig;
|
|||
extern unsigned long count_vvp_nets;
|
||||
extern unsigned long count_vpi_nets;
|
||||
extern unsigned long count_vpi_scopes;
|
||||
extern unsigned long count_vpi_memories;
|
||||
|
||||
extern unsigned long count_net_arrays;
|
||||
extern unsigned long count_net_array_words;
|
||||
extern unsigned long count_var_arrays;
|
||||
extern unsigned long count_var_array_words;
|
||||
extern unsigned long count_real_arrays;
|
||||
extern unsigned long count_real_array_words;
|
||||
|
||||
|
||||
extern unsigned long count_time_events;
|
||||
extern unsigned long count_time_pool(void);
|
||||
|
|
|
|||
|
|
@ -393,18 +393,12 @@ compile_scope_decl(char*label, char*type, char*name, const char*tname,
|
|||
scope->time_units = vpip_get_time_precision();
|
||||
scope->time_precision = vpip_get_time_precision();
|
||||
}
|
||||
#if 0
|
||||
functor_set_scope(¤t_scope->base);
|
||||
#endif
|
||||
}
|
||||
|
||||
void compile_scope_recall(char*symbol)
|
||||
{
|
||||
compile_vpi_lookup((vpiHandle*)¤t_scope, symbol);
|
||||
assert(current_scope);
|
||||
#if 0
|
||||
functor_set_scope(¤t_scope->base);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue