From 626f418ab035634cdfd0e4de0e66894f439264bf Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 5 Jul 2002 03:46:43 +0000 Subject: [PATCH] Track opcode memory space. --- vvp/codes.cc | 9 ++++++++- vvp/main.cc | 8 ++++++-- vvp/statistics.cc | 11 ++++++++++- vvp/statistics.h | 9 ++++++++- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/vvp/codes.cc b/vvp/codes.cc index 21f3fd1ba..4de954661 100644 --- a/vvp/codes.cc +++ b/vvp/codes.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: codes.cc,v 1.10 2002/07/05 02:50:58 steve Exp $" +#ident "$Id: codes.cc,v 1.11 2002/07/05 03:46:43 steve Exp $" #endif # include "codes.h" @@ -56,6 +56,8 @@ void codespace_init(void) cp->opcode = &of_ZOMBIE; code_count = 1; + size_opcodes += sizeof(struct code_index1); + size_opcodes += sizeof(struct code_index0); } vvp_cpoint_t codespace_allocate(void) @@ -72,12 +74,14 @@ vvp_cpoint_t codespace_allocate(void) if (code_table[idx] == 0) { code_table[idx] = new struct code_index1; memset(code_table[idx], 0, sizeof(struct code_index1)); + size_opcodes += sizeof(struct code_index1); } if (code_table[idx]->table[index1] == 0) { code_table[idx]->table[index1] = new struct code_index0; memset(code_table[idx]->table[index1], 0, sizeof(struct code_index0)); + size_opcodes += sizeof(struct code_index0); } vvp_cpoint_t res = code_count; @@ -112,6 +116,9 @@ vvp_code_t codespace_index(vvp_cpoint_t point) /* * $Log: codes.cc,v $ + * Revision 1.11 2002/07/05 03:46:43 steve + * Track opcode memory space. + * * Revision 1.10 2002/07/05 02:50:58 steve * Remove the vpi object symbol table after compile. * diff --git a/vvp/main.cc b/vvp/main.cc index 3f351a3ec..e1685f649 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: main.cc,v 1.25 2002/07/05 02:50:58 steve Exp $" +#ident "$Id: main.cc,v 1.26 2002/07/05 03:47:06 steve Exp $" #endif # include "config.h" @@ -239,7 +239,8 @@ int main(int argc, char*argv[]) if (verbose_flag) { fprintf(stderr, " ... %8lu functors\n", count_functors); - fprintf(stderr, " ... %8lu opcodes\n", count_opcodes); + fprintf(stderr, " ... %8lu opcodes (%lu bytes)\n", + count_opcodes, size_opcodes); fprintf(stderr, " ... %8lu nets\n", count_vpi_nets); } @@ -272,6 +273,9 @@ int main(int argc, char*argv[]) /* * $Log: main.cc,v $ + * Revision 1.26 2002/07/05 03:47:06 steve + * Track opcode memory space. + * * Revision 1.25 2002/07/05 02:50:58 steve * Remove the vpi object symbol table after compile. * diff --git a/vvp/statistics.cc b/vvp/statistics.cc index 53ba85456..9963a50dc 100644 --- a/vvp/statistics.cc +++ b/vvp/statistics.cc @@ -17,9 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: statistics.cc,v 1.1 2002/07/05 02:50:58 steve Exp $" +#ident "$Id: statistics.cc,v 1.2 2002/07/05 03:46:43 steve Exp $" #endif +# include "statistics.h" + /* * This is a count of the instruction opcodes that were created. */ @@ -29,8 +31,15 @@ unsigned long count_functors = 0; unsigned long count_vpi_nets = 0; + +size_t size_opcodes = 0; + + /* * $Log: statistics.cc,v $ + * Revision 1.2 2002/07/05 03:46:43 steve + * Track opcode memory space. + * * Revision 1.1 2002/07/05 02:50:58 steve * Remove the vpi object symbol table after compile. * diff --git a/vvp/statistics.h b/vvp/statistics.h index 3dd5cde58..73cc937aa 100644 --- a/vvp/statistics.h +++ b/vvp/statistics.h @@ -19,15 +19,22 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: statistics.h,v 1.1 2002/07/05 02:50:58 steve Exp $" +#ident "$Id: statistics.h,v 1.2 2002/07/05 03:46:43 steve Exp $" #endif +# include extern unsigned long count_opcodes; extern unsigned long count_functors; extern unsigned long count_vpi_nets; + +extern size_t size_opcodes; + /* * $Log: statistics.h,v $ + * Revision 1.2 2002/07/05 03:46:43 steve + * Track opcode memory space. + * * Revision 1.1 2002/07/05 02:50:58 steve * Remove the vpi object symbol table after compile. *