defines.h

Go to the documentation of this file.
00001 #ifndef __DEFINES_H__
00002 #define __DEFINES_H__
00003 
00004 /*
00005  Copyright (c) 2006-2010 Trevor Williams
00006 
00007  This program is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by the Free Software
00009  Foundation; either version 2 of the License, or (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00012  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00013  See the GNU General Public License for more details.
00014 
00015  You should have received a copy of the GNU General Public License along with this program;
00016  if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00030 #include "../config.h"
00031 
00032 #ifdef HAVE_SYS_TIME_H
00033 #include <sys/time.h>
00034 #endif
00035 
00036 #ifdef HAVE_STRING_H
00037 #include <string.h>
00038 #endif
00039 #include <float.h>
00040 
00041 #include <stdio.h>
00042 #include <stdlib.h>
00043 #include <assert.h>
00044 #include "cexcept.h"
00045 
00049 #define COVERED_VERSION    VERSION
00050 
00055 #define CDD_VERSION        24
00056 
00060 #define COVERED_HEADER     "\nCovered %s -- Verilog Code Coverage Utility\nWritten by Trevor Williams  (phase1geo@gmail.com)\nFreely distributable under the GPL license\n", COVERED_VERSION
00061 
00065 #define DFLT_OUTPUT_CDD    "cov.cdd"
00066 
00070 #define PROFILING_OUTPUT_NAME "covered.prof"
00071 
00076 #define DFLT_VPI_NAME      "covered_vpi.v"
00077 
00081 #define DFLT_DUMPVARS_NAME "covered_dump.v"
00082 
00086 #define INTEGER_WIDTH      (SIZEOF_INT * 8)
00087 
00091 #define MAX_BIT_WIDTH      65536
00092 
00097 #define MAX_MALLOC_SIZE    (MAX_BIT_WIDTH * 2)
00098 
00102 #define USER_MSG_LENGTH    (MAX_BIT_WIDTH * 2)
00103 
00108 #define DEFAULT_LINE_WIDTH 105
00109 
00119 #define GENERATION_1995         0
00120 
00122 #define GENERATION_2001         1
00123 
00125 #define GENERATION_SV           2
00126 
00138 #define DUMP_FMT_NONE      0
00139 
00141 #define DUMP_FMT_VCD       1
00142 
00144 #define DUMP_FMT_LXT       2
00145 
00147 #define DUMP_FMT_FST       3
00148 
00165 #define FATAL        1
00166 
00172 #define FATAL_WRAP   2
00173 
00179 #define WARNING      3
00180 
00186 #define WARNING_WRAP 4
00187 
00193 #define NORMAL       5
00194 
00199 #define DEBUG        6
00200 
00205 #define HEADER       7
00206 
00221 #define DB_TYPE_SIGNAL        1
00222 
00226 #define DB_TYPE_EXPRESSION    2
00227 
00231 #define DB_TYPE_FUNIT         3
00232 
00236 #define DB_TYPE_STATEMENT     4
00237 
00241 #define DB_TYPE_INFO          5
00242 
00246 #define DB_TYPE_FSM           6
00247 
00251 #define DB_TYPE_RACE          7
00252 
00256 #define DB_TYPE_SCORE_ARGS    8
00257 
00262 #define DB_TYPE_SU_START      9
00263 
00267 #define DB_TYPE_SU_END        10
00268 
00272 #define DB_TYPE_MESSAGE       11
00273 
00277 #define DB_TYPE_MERGED_CDD    12
00278 
00282 #define DB_TYPE_EXCLUDE       13
00283 
00287 #define DB_TYPE_FUNIT_VERSION 14
00288 
00292 #define DB_TYPE_INST_ONLY     15
00293 
00306 #define FUNIT_MODULE         0
00307 
00309 #define FUNIT_NAMED_BLOCK    1
00310 
00312 #define FUNIT_FUNCTION       2
00313 
00315 #define FUNIT_TASK           3
00316 
00318 #define FUNIT_NO_SCORE       4
00319 
00321 #define FUNIT_AFUNCTION      5
00322 
00324 #define FUNIT_ATASK          6
00325 
00327 #define FUNIT_ANAMED_BLOCK   7
00328 
00330 #define FUNIT_TYPES          8
00331 
00343 #define MERGE_ER_NONE    0
00344 
00346 #define MERGE_ER_FIRST   1
00347 
00349 #define MERGE_ER_LAST    2
00350 
00352 #define MERGE_ER_ALL     3
00353 
00355 #define MERGE_ER_NEW     4
00356 
00358 #define MERGE_ER_OLD     5
00359 
00373 #define REPORT_SUMMARY       0x0
00374 
00381 #define REPORT_DETAILED      0x2
00382 
00390 #define REPORT_VERBOSE       0xffffffff
00391 
00403 #define VECTOR_MERGE_MASK    0x6c
00404 
00416 #define ESUPPL_MERGE_MASK            0x3fffff
00417 
00427 #define ESUPPL_BITS_TO_STORE         5
00428 
00434 #define ESUPPL_WAS_SWAPPED(x)        x.part.swapped
00435 
00441 #define ESUPPL_IS_ROOT(x)            x.part.root
00442 
00447 #define ESUPPL_IS_TRUE(x)            x.part.eval_t
00448 
00453 #define ESUPPL_IS_FALSE(x)           x.part.eval_f
00454 
00459 #define ESUPPL_WAS_TRUE(x)           x.part.true
00460 
00465 #define ESUPPL_WAS_FALSE(x)          x.part.false
00466 
00471 #define ESUPPL_IS_LEFT_CHANGED(x)    x.part.left_changed
00472 
00477 #define ESUPPL_IS_RIGHT_CHANGED(x)   x.part.right_changed
00478 
00483 #define ESUPPL_WAS_COMB_COUNTED(x)   x.part.comb_cntd
00484 
00489 #define ESUPPL_IS_LHS(x)             x.part.lhs
00490 
00494 #define ESUPPL_IS_IN_FUNC(x)         x.part.in_func
00495 
00500 #define ESUPPL_OWNS_VEC(x)           x.part.owns_vec
00501 
00506 #define ESUPPL_EXCLUDED(x)           x.part.excluded
00507 
00512 #define ESUPPL_TYPE(x)               x.part.type
00513 
00518 #define ESUPPL_STATIC_BASE(x)        x.part.base
00519 
00531 #define SSUPPL_TYPE_INPUT_NET      0
00532 
00534 #define SSUPPL_TYPE_INPUT_REG      1
00535 
00537 #define SSUPPL_TYPE_OUTPUT_NET     2
00538 
00540 #define SSUPPL_TYPE_OUTPUT_REG     3
00541 
00543 #define SSUPPL_TYPE_INOUT_NET      4
00544 
00546 #define SSUPPL_TYPE_INOUT_REG      5
00547 
00549 #define SSUPPL_TYPE_DECL_NET       6
00550 
00552 #define SSUPPL_TYPE_DECL_REG       7
00553 
00555 #define SSUPPL_TYPE_EVENT          8
00556 
00558 #define SSUPPL_TYPE_IMPLICIT       9
00559 
00561 #define SSUPPL_TYPE_IMPLICIT_POS   10
00562 
00564 #define SSUPPL_TYPE_IMPLICIT_NEG   11
00565 
00567 #define SSUPPL_TYPE_PARAM          12
00568 
00570 #define SSUPPL_TYPE_GENVAR         13
00571 
00573 #define SSUPPL_TYPE_ENUM           14
00574 
00576 #define SSUPPL_TYPE_MEM            15
00577 
00579 #define SSUPPL_TYPE_DECL_SREAL     16
00580 
00582 #define SSUPPL_TYPE_DECL_REAL      17
00583 
00585 #define SSUPPL_TYPE_PARAM_REAL     18
00586 
00588 #define SSUPPL_TYPE_IMPLICIT_REAL  19
00589 
00591 #define SSUPPL_TYPE_IMPLICIT_SREAL 20 
00592 
00598 #define SIGNAL_IS_NET(x)          ((x->suppl.part.type == SSUPPL_TYPE_INPUT_NET)    || \
00599                                    (x->suppl.part.type == SSUPPL_TYPE_OUTPUT_NET)   || \
00600                                    (x->suppl.part.type == SSUPPL_TYPE_INOUT_NET)    || \
00601                                    (x->suppl.part.type == SSUPPL_TYPE_EVENT)        || \
00602                                    (x->suppl.part.type == SSUPPL_TYPE_DECL_NET)     || \
00603                                    (x->suppl.part.type == SSUPPL_TYPE_IMPLICIT)     || \
00604                                    (x->suppl.part.type == SSUPPL_TYPE_IMPLICIT_POS) || \
00605                                    (x->suppl.part.type == SSUPPL_TYPE_IMPLICIT_NEG))
00606 
00610 #define SIGNAL_ASSIGN_FROM_DUMPFILE(x)  ((x->suppl.part.assigned == 0)                  && \
00611                                          (x->suppl.part.type != SSUPPL_TYPE_PARAM)      && \
00612                                          (x->suppl.part.type != SSUPPL_TYPE_PARAM_REAL) && \
00613                                          (x->suppl.part.type != SSUPPL_TYPE_ENUM)       && \
00614                                          (x->suppl.part.type != SSUPPL_TYPE_MEM)        && \
00615                                          (x->suppl.part.type != SSUPPL_TYPE_GENVAR)     && \
00616                                          (x->suppl.part.type != SSUPPL_TYPE_EVENT))
00617      
00631 #define READ_MODE_NO_MERGE                0
00632 
00638 #define READ_MODE_MERGE_NO_MERGE          1
00639 
00645 #define READ_MODE_REPORT_NO_MERGE         2
00646 
00653 #define READ_MODE_MERGE_INST_MERGE        3
00654 
00661 #define READ_MODE_REPORT_MOD_MERGE        4
00662 
00675 #define PARAM_TYPE_DECLARED             0
00676 
00681 #define PARAM_TYPE_OVERRIDE             1
00682 
00687 #define PARAM_TYPE_SIG_LSB              2
00688 
00693 #define PARAM_TYPE_SIG_MSB              3
00694 
00699 #define PARAM_TYPE_INST_LSB             4
00700 
00705 #define PARAM_TYPE_INST_MSB             5
00706 
00711 #define PARAM_TYPE_DECLARED_LOCAL       6
00712 
00725 #define GI_TYPE_EXPR            0
00726 
00728 #define GI_TYPE_SIG             1
00729 
00731 #define GI_TYPE_STMT            2
00732 
00734 #define GI_TYPE_INST            3
00735 
00737 #define GI_TYPE_TFN             4
00738 
00740 #define GI_TYPE_BIND            5
00741 
00757 #define DELAY_EXPR_DEFAULT      0
00758 
00762 #define DELAY_EXPR_MIN          1
00763 
00767 #define DELAY_EXPR_TYP          2
00768 
00772 #define DELAY_EXPR_MAX          3
00773 
00779 typedef enum logic_rm_type_e {
00780   LOGIC_RM_REAL = 0,     
00781   LOGIC_RM_SYSFUNC,      
00782   LOGIC_RM_SYSTASK,      
00783   LOGIC_RM_NUM           
00784 } logic_rm_type;
00785 
00789 typedef enum exp_op_type_e {
00790   EXP_OP_STATIC = 0,      
00791   EXP_OP_SIG,             
00792   EXP_OP_XOR,             
00793   EXP_OP_MULTIPLY,        
00794   EXP_OP_DIVIDE,          
00795   EXP_OP_MOD,             
00796   EXP_OP_ADD,             
00797   EXP_OP_SUBTRACT,        
00798   EXP_OP_AND,             
00799   EXP_OP_OR,              
00800   EXP_OP_NAND,            
00801   EXP_OP_NOR,             
00802   EXP_OP_NXOR,            
00803   EXP_OP_LT,              
00804   EXP_OP_GT,              
00805   EXP_OP_LSHIFT,          
00806   EXP_OP_RSHIFT,          
00807   EXP_OP_EQ,              
00808   EXP_OP_CEQ,             
00809   EXP_OP_LE,              
00810   EXP_OP_GE,              
00811   EXP_OP_NE,              
00812   EXP_OP_CNE,             
00813   EXP_OP_LOR,             
00814   EXP_OP_LAND,            
00815   EXP_OP_COND,            
00816   EXP_OP_COND_SEL,        
00817   EXP_OP_UINV,            
00818   EXP_OP_UAND,            
00819   EXP_OP_UNOT,            
00820   EXP_OP_UOR,             
00821   EXP_OP_UXOR,            
00822   EXP_OP_UNAND,           
00823   EXP_OP_UNOR,            
00824   EXP_OP_UNXOR,           
00825   EXP_OP_SBIT_SEL,        
00826   EXP_OP_MBIT_SEL,        
00827   EXP_OP_EXPAND,          
00828   EXP_OP_CONCAT,          
00829   EXP_OP_PEDGE,           
00830   EXP_OP_NEDGE,           
00831   EXP_OP_AEDGE,           
00832   EXP_OP_LAST,            
00833   EXP_OP_EOR,             
00834   EXP_OP_DELAY,           
00835   EXP_OP_CASE,            
00836   EXP_OP_CASEX,           
00837   EXP_OP_CASEZ,           
00838   EXP_OP_DEFAULT,         
00839   EXP_OP_LIST,            
00840   EXP_OP_PARAM,           
00841   EXP_OP_PARAM_SBIT,      
00842   EXP_OP_PARAM_MBIT,      
00843   EXP_OP_ASSIGN,          
00844   EXP_OP_DASSIGN,         
00845   EXP_OP_BASSIGN,         
00846   EXP_OP_NASSIGN,         
00847   EXP_OP_IF,              
00848   EXP_OP_FUNC_CALL,       
00849   EXP_OP_TASK_CALL,       
00850   EXP_OP_TRIGGER,         
00851   EXP_OP_NB_CALL,         
00852   EXP_OP_FORK,            
00853   EXP_OP_JOIN,            
00854   EXP_OP_DISABLE,         
00855   EXP_OP_REPEAT,          
00856   EXP_OP_WHILE,           
00857   EXP_OP_ALSHIFT,         
00858   EXP_OP_ARSHIFT,         
00859   EXP_OP_SLIST,           
00860   EXP_OP_EXPONENT,        
00861   EXP_OP_PASSIGN,         
00862   EXP_OP_RASSIGN,         
00863   EXP_OP_MBIT_POS,        
00864   EXP_OP_MBIT_NEG,        
00865   EXP_OP_PARAM_MBIT_POS,  
00866   EXP_OP_PARAM_MBIT_NEG,  
00867   EXP_OP_NEGATE,          
00868   EXP_OP_NOOP,            
00869   EXP_OP_ALWAYS_COMB,     
00870   EXP_OP_ALWAYS_LATCH,    
00871   EXP_OP_IINC,            
00872   EXP_OP_PINC,            
00873   EXP_OP_IDEC,            
00874   EXP_OP_PDEC,            
00875   EXP_OP_DLY_ASSIGN,      
00876   EXP_OP_DLY_OP,          
00877   EXP_OP_RPT_DLY,         
00878   EXP_OP_DIM,             
00879   EXP_OP_WAIT,            
00880   EXP_OP_SFINISH,         
00881   EXP_OP_SSTOP,           
00882   EXP_OP_ADD_A,           
00883   EXP_OP_SUB_A,           
00884   EXP_OP_MLT_A,           
00885   EXP_OP_DIV_A,           
00886   EXP_OP_MOD_A,           
00887   EXP_OP_AND_A,           
00888   EXP_OP_OR_A,            
00889   EXP_OP_XOR_A,           
00890   EXP_OP_LS_A,            
00891   EXP_OP_RS_A,            
00892   EXP_OP_ALS_A,           
00893   EXP_OP_ARS_A,           
00894   EXP_OP_FOREVER,         
00895   EXP_OP_STIME,           
00896   EXP_OP_SRANDOM,         
00897   EXP_OP_PLIST,           
00898   EXP_OP_SASSIGN,         
00899   EXP_OP_SSRANDOM,        
00900   EXP_OP_SURANDOM,        
00901   EXP_OP_SURAND_RANGE,    
00902   EXP_OP_SR2B,            
00903   EXP_OP_SB2R,            
00904   EXP_OP_SSR2B,           
00905   EXP_OP_SB2SR,           
00906   EXP_OP_SI2R,            
00907   EXP_OP_SR2I,            
00908   EXP_OP_STESTARGS,       
00909   EXP_OP_SVALARGS,        
00910   EXP_OP_SSIGNED,         
00911   EXP_OP_SUNSIGNED,       
00912   EXP_OP_SCLOG2,          
00913   EXP_OP_SREALTIME,       
00914   EXP_OP_NUM              
00915 } exp_op_type;
00916 
00920 #define EXPR_IS_MEASURABLE(x)      (((exp_op_info[x->op].suppl.measurable == 1) && \
00921                                      (ESUPPL_IS_LHS( x->suppl ) == 0) && \
00922                                      (x->value->suppl.part.data_type != VDATA_R64) && \
00923                                      (x->value->suppl.part.data_type != VDATA_R32) && \
00924                                      !((ESUPPL_IS_ROOT( x->suppl ) == 0) && \
00925                                        ((x->op == EXP_OP_SIG) || \
00926                                         (x->op == EXP_OP_SBIT_SEL) || \
00927                                         (x->op == EXP_OP_MBIT_SEL) || \
00928                                         (x->op == EXP_OP_MBIT_POS) || \
00929                                         (x->op == EXP_OP_MBIT_NEG)) && \
00930                                        (x->parent->expr->op != EXP_OP_ASSIGN) && \
00931                                        (x->parent->expr->op != EXP_OP_DASSIGN) && \
00932                                        (x->parent->expr->op != EXP_OP_BASSIGN) && \
00933                                        (x->parent->expr->op != EXP_OP_NASSIGN) && \
00934                                        (x->parent->expr->op != EXP_OP_RASSIGN) && \
00935                                        (x->parent->expr->op != EXP_OP_DLY_OP) && \
00936                                        (x->parent->expr->op != EXP_OP_IF) && \
00937                                        (x->parent->expr->op != EXP_OP_WHILE) && \
00938                                        (x->parent->expr->op != EXP_OP_COND)) && \
00939                                      (x->line != 0)) ? 1 : 0)
00940 
00945 #define EXPR_IS_STATIC(x)        exp_op_info[x->op].suppl.is_static
00946 
00951 #define EXPR_IS_COMB(x)          ((exp_op_info[x->op].suppl.is_comb > 0) && \
00952                                   (EXPR_IS_OP_AND_ASSIGN(x) || \
00953                                   (!expression_is_static_only( x->left ) && \
00954                                    !expression_is_static_only( x->right))))
00955 
00960 #define EXPR_IS_EVENT(x)         exp_op_info[x->op].suppl.is_event
00961 
00966 #define EXPR_IS_CONTEXT_SWITCH(x)       ((exp_op_info[x->op].suppl.is_context_switch == 1) || \
00967                                          ((x->op == EXP_OP_NB_CALL) && !ESUPPL_IS_IN_FUNC(x->suppl)))
00968 
00972 #define EXPR_OWNS_VEC(o)                ((o != EXP_OP_SIG)            && \
00973                                          (o != EXP_OP_SBIT_SEL)       && \
00974                                          (o != EXP_OP_MBIT_SEL)       && \
00975                                          (o != EXP_OP_MBIT_POS)       && \
00976                                          (o != EXP_OP_MBIT_NEG)       && \
00977                                          (o != EXP_OP_TRIGGER)        && \
00978                                          (o != EXP_OP_PARAM)          && \
00979                                          (o != EXP_OP_PARAM_SBIT)     && \
00980                                          (o != EXP_OP_PARAM_MBIT)     && \
00981                                          (o != EXP_OP_PARAM_MBIT_POS) && \
00982                                          (o != EXP_OP_PARAM_MBIT_NEG) && \
00983                                          (o != EXP_OP_ASSIGN)         && \
00984                                          (o != EXP_OP_DASSIGN)        && \
00985                                          (o != EXP_OP_BASSIGN)        && \
00986                                          (o != EXP_OP_NASSIGN)        && \
00987                                          (o != EXP_OP_RASSIGN)        && \
00988                                          (o != EXP_OP_IF)             && \
00989                                          (o != EXP_OP_WHILE)          && \
00990                                          (o != EXP_OP_PASSIGN)        && \
00991                                          (o != EXP_OP_DLY_ASSIGN)     && \
00992                                          (o != EXP_OP_DIM))
00993 
00998 #define EXPR_IS_UNARY(x)        exp_op_info[x->op].suppl.is_unary
00999 
01004 #define EXPR_COMB_MISSED(x)     (EXPR_IS_MEASURABLE( x ) && (x->ulid != -1))
01005 
01011 #define EXPR_LEFT_DEALLOCABLE(x)     (((x->op != EXP_OP_CASE)  && \
01012                                        (x->op != EXP_OP_CASEX) && \
01013                                        (x->op != EXP_OP_CASEZ)) || \
01014                                       (x->suppl.part.owned == 1))
01015 
01020 #define EXPR_RIGHT_DEALLOCABLE(x)    (TRUE)
01021 
01025 #define EXPR_IS_OP_AND_ASSIGN(x)     ((x->op == EXP_OP_ADD_A) || \
01026                                       (x->op == EXP_OP_SUB_A) || \
01027                                       (x->op == EXP_OP_MLT_A) || \
01028                                       (x->op == EXP_OP_DIV_A) || \
01029                                       (x->op == EXP_OP_MOD_A) || \
01030                                       (x->op == EXP_OP_AND_A) || \
01031                                       (x->op == EXP_OP_OR_A)  || \
01032                                       (x->op == EXP_OP_XOR_A) || \
01033                                       (x->op == EXP_OP_LS_A)  || \
01034                                       (x->op == EXP_OP_RS_A)  || \
01035                                       (x->op == EXP_OP_ALS_A) || \
01036                                       (x->op == EXP_OP_ARS_A))
01037 
01041 #define EXPR_TMP_VECS(x)             exp_op_info[x].suppl.tmp_vecs
01042 
01046 #define EXPR_OP_HAS_DIM(x)          ((x == EXP_OP_DIM)            || \
01047                                      (x == EXP_OP_SBIT_SEL)       || \
01048                                      (x == EXP_OP_PARAM_SBIT)     || \
01049                                      (x == EXP_OP_MBIT_SEL)       || \
01050                                      (x == EXP_OP_PARAM_MBIT)     || \
01051                                      (x == EXP_OP_MBIT_POS)       || \
01052                                      (x == EXP_OP_MBIT_NEG)       || \
01053                                      (x == EXP_OP_PARAM_MBIT_POS) || \
01054                                      (x == EXP_OP_PARAM_MBIT_NEG))
01055 
01065 #define DECIMAL                 0       
01066 #define BINARY                  1       
01067 #define OCTAL                   2       
01068 #define HEXIDECIMAL             3       
01069 #define QSTRING                 4       
01081 #define ATTRIBUTE_UNKNOWN       0       
01082 #define ATTRIBUTE_FSM           1       
01096 #define RACE_TYPE_SEQ_USES_NON_BLOCK         0
01097 
01099 #define RACE_TYPE_CMB_USES_BLOCK             1
01100 
01102 #define RACE_TYPE_MIX_USES_NON_BLOCK         2
01103 
01105 #define RACE_TYPE_HOMOGENOUS                 3
01106 
01108 #define RACE_TYPE_ASSIGN_IN_ONE_BLOCK1       4
01109 
01111 #define RACE_TYPE_ASSIGN_IN_ONE_BLOCK2       5
01112 
01114 #define RACE_TYPE_STROBE_DISPLAY_NON_BLOCK   6
01115 
01117 #define RACE_TYPE_NO_POUND_0_PROC_ASSIGNS    7
01118 
01120 #define RACE_TYPE_NUM                        8
01121 
01134 #define NOT_COMB        0
01135 
01137 #define AND_COMB        1
01138 
01140 #define OR_COMB         2
01141 
01143 #define OTHER_COMB      3
01144 
01156 #define VTYPE_VAL   0
01157 
01159 #define VTYPE_SIG   1
01160 
01162 #define VTYPE_EXP   2
01163 
01165 #define VTYPE_MEM   3
01166 
01179 #define VDATA_UL      0
01180 
01182 #define VDATA_R64     1
01183 
01185 #define VDATA_R32     2
01186 
01202 typedef enum vtype_val_indices_e {
01203   VTYPE_INDEX_VAL_VALL,
01204   VTYPE_INDEX_VAL_VALH,
01205   VTYPE_INDEX_VAL_NUM
01206 } vtype_val_indices;
01207 
01209 typedef enum vtype_sig_indices_e {
01210   VTYPE_INDEX_SIG_VALL,
01211   VTYPE_INDEX_SIG_VALH,
01212   VTYPE_INDEX_SIG_XHOLD,
01213   VTYPE_INDEX_SIG_TOG01,
01214   VTYPE_INDEX_SIG_TOG10,
01215   VTYPE_INDEX_SIG_MISC,
01216   VTYPE_INDEX_SIG_NUM
01217 } vtype_sig_indices;
01218 
01220 typedef enum vtype_mem_indices_e {
01221   VTYPE_INDEX_MEM_VALL,
01222   VTYPE_INDEX_MEM_VALH,
01223   VTYPE_INDEX_MEM_XHOLD,
01224   VTYPE_INDEX_MEM_TOG01,
01225   VTYPE_INDEX_MEM_TOG10,
01226   VTYPE_INDEX_MEM_WR,
01227   VTYPE_INDEX_MEM_RD,
01228   VTYPE_INDEX_MEM_MISC,
01229   VTYPE_INDEX_MEM_NUM
01230 } vtype_mem_indices;
01231 
01233 typedef enum vtype_exp_indices_e {
01234   VTYPE_INDEX_EXP_VALL,
01235   VTYPE_INDEX_EXP_VALH,
01236   VTYPE_INDEX_EXP_EVAL_A,
01237   VTYPE_INDEX_EXP_EVAL_B,
01238   VTYPE_INDEX_EXP_EVAL_C,
01239   VTYPE_INDEX_EXP_EVAL_D,
01240   VTYPE_INDEX_EXP_NUM
01241 } vtype_exp_indices;
01242 
01248 typedef enum cp_indices_e {
01249   CP_TYPE_LINE,
01250   CP_TYPE_TOGGLE,
01251   CP_TYPE_MEM,
01252   CP_TYPE_LOGIC,
01253   CP_TYPE_FSM,
01254   CP_TYPE_ASSERT,
01255   CP_TYPE_NUM
01256 } cp_indices;
01257 
01261 typedef enum rpt_type_e {
01262   RPT_TYPE_HIT,
01263   RPT_TYPE_MISS,
01264   RPT_TYPE_EXCL
01265 } rpt_type;
01266 
01270 #define VSUPPL_MASK               (unsigned char)0x7f
01271 
01282 #define ETYPE_NONE      0
01283 
01285 #define ETYPE_FUNIT     1
01286 
01288 #define ETYPE_DELAY     2
01289 
01291 #define ETYPE_THREAD    3
01292 
01294 #define ETYPE_VEC1      4
01295 
01297 #define ETYPE_VEC2      5
01298 
01310 #define THR_ST_NONE     0
01311 
01313 #define THR_ST_ACTIVE   1
01314 
01316 #define THR_ST_DELAYED  2
01317 
01319 #define THR_ST_WAITING  3
01320 
01332 #define SU_TYPE_STRUCT        0
01333 
01335 #define SU_TYPE_UNION         1
01336 
01338 #define SU_TYPE_TAGGED_UNION  2
01339 
01351 #define SU_MEMTYPE_VOID      0
01352 
01354 #define SU_MEMTYPE_SIG       1
01355 
01357 #define SU_MEMTYPE_TYPEDEF   2
01358 
01360 #define SU_MEMTYPE_ENUM      3
01361 
01363 #define SU_MEMTYPE_SU        4
01364 
01368 //#define snprintf(x,y,...)     assert( snprintf( x, y, __VA_ARGS__ ) < (y) );
01369 
01371 #define TIME_CMP_LE(x,y)         ((((x).lo <= (y).lo) && ((x).hi <= (y).hi)) || ((x).hi < (y).hi))
01372 #define TIME_CMP_GT(x,y)         (((x).lo > (y).lo) || ((x).hi > (y).hi))
01373 #define TIME_CMP_GE(x,y)         ((((x).lo >= (y).lo) && ((x).hi >= (y).hi)) || ((x).hi > (y).hi))
01374 #define TIME_CMP_NE(x,y)         (((x).lo ^ (y).lo) || ((x).hi ^ (y).hi))
01375 
01377 #define TIME_INC(x,y)           (x).hi+=((0xffffffff-(x).lo)<(y).lo)?((y).hi+1):(y).hi; (x).lo+=(y).lo; (x).full+=(y).full;
01378 
01380 #define FEQ(x,y)           (fabs(x-y) < FLT_EPSILON)
01381       
01383 #define DEQ(x,y)           (fabs(x-y) < DBL_EPSILON)
01384 
01388 typedef enum {
01389   FALSE,   
01390   TRUE     
01391 } bool;
01392 
01396 #if SIZEOF_CHAR == 1
01397 typedef unsigned char uint8;
01398 #define UINT8(x) x
01399 #define ato8(x)  atoi(x)
01400 #define FMT8     "hh"
01401 #elif SIZEOF_SHORT == 1
01402 typedef unsigned short uint8;
01403 #define UINT8(x) x
01404 #define ato8(x)  atoi(x)
01405 #define FMT8     "h"
01406 #elif SIZEOF_INT == 1
01407 typedef unsigned int uint8;
01408 #define UINT8(x) x
01409 #define ato8(x)  atoi(x)
01410 #define FMT8     ""
01411 #elif SIZEOF_LONG == 1
01412 typedef unsigned long uint8;
01413 #define UINT8(x) x
01414 #define ato8(x)  atol(x)
01415 #define FMT8     "l"
01416 #elif SIZEOF_LONG_LONG == 1
01417 typedef unsigned long long uint8;
01418 #define UINT8(x) x ## LL
01419 #define ato8(x)  atoll(x)
01420 #define FMT8     "ll"
01421 #else
01422 #error "Unable to find an 8-bit data type"
01423 #endif
01424 
01428 #if SIZEOF_CHAR == 2
01429 typedef unsigned char uint16;
01430 #define UINT16(x) x
01431 #define ato16(x)  atoi(x)
01432 #define FMT16     "hh"
01433 #elif SIZEOF_SHORT == 2
01434 typedef unsigned short uint16;
01435 #define UINT16(x) x
01436 #define ato16(x)  atoi(x)
01437 #define FMT16     "h"
01438 #elif SIZEOF_INT == 2
01439 typedef unsigned int uint16;
01440 #define UINT16(x) x
01441 #define ato16(x)  atoi(x)
01442 #define FMT16     ""
01443 #elif SIZEOF_LONG == 2
01444 typedef unsigned long uint16;
01445 #define UINT16(x) x
01446 #define ato16(x)  atol(x)
01447 #define FMT16     "l"
01448 #elif SIZEOF_LONG_LONG == 2
01449 typedef unsigned long long uint16;
01450 #define UINT16(x) x ## LL
01451 #define ato16(x)  atoll(x)
01452 #define FMT16     "ll"
01453 #else
01454 #error "Unable to find a 16-bit data type"
01455 #endif
01456 
01460 #if SIZEOF_CHAR == 4
01461 typedef unsigned char uint32;
01462 #define UINT32(x) x
01463 #define ato32(x)  atoi(x)
01464 #define FMT32     "hh"
01465 #elif SIZEOF_SHORT == 4
01466 typedef unsigned short uint32;
01467 #define UINT32(x) x
01468 #define ato32(x)  atoi(x)
01469 #define FMT32     "h"
01470 #elif SIZEOF_INT == 4
01471 typedef unsigned int uint32;
01472 #define UINT32(x) x
01473 #define ato32(x)  atoi(x)
01474 #define FMT32     ""
01475 #elif SIZEOF_LONG == 4
01476 typedef unsigned long uint32;
01477 #define UINT32(x) x
01478 #define ato32(x)  atol(x)
01479 #define FMT32     "l"
01480 #elif SIZEOF_LONG_LONG == 4
01481 typedef unsigned long long uint32;
01482 #define UINT32(x) x ## LL
01483 #define ato32(x)  atoll(x)
01484 #define FMT32     "ll"
01485 #else
01486 #error "Unable to find a 32-bit data type"
01487 #endif
01488 
01492 #if SIZEOF_FLOAT == 4
01493 typedef float real32;
01494 #elif SIZEOF_DOUBLE == 4
01495 typedef double real32;
01496 #else
01497 #error "Unable to find a 32-bit real data type"
01498 #endif
01499 
01503 #if SIZEOF_CHAR == 8
01504 typedef char int64;
01505 typedef unsigned char uint64;
01506 #define UINT64(x) x
01507 #define ato64(x)  atoi(x)
01508 #define FMT64     "hh"
01509 #elif SIZEOF_SHORT == 8
01510 typedef short int64;
01511 typedef unsigned short uint64;
01512 #define UINT64(x) x
01513 #define ato64(x)  atoi(x)
01514 #define FMT64     "h"
01515 #elif SIZEOF_INT == 8
01516 typedef int int64;
01517 typedef unsigned int uint64;
01518 #define UINT64(x) x
01519 #define ato64(x)  atoi(x)
01520 #define FMT64     ""
01521 #elif SIZEOF_LONG == 8
01522 typedef long int64;
01523 typedef unsigned long uint64;
01524 #define UINT64(x) x
01525 #define ato64(x)  atol(x)
01526 #define FMT64     "l"
01527 #elif SIZEOF_LONG_LONG == 8
01528 typedef long long int64;
01529 typedef unsigned long long uint64;
01530 #define UINT64(x) x ## LL
01531 #define ato64(x)  atoll(x)
01532 #define FMT64     "ll"
01533 #else
01534 #error "Unable to find a 64-bit data type"
01535 #endif
01536 
01540 #if SIZEOF_FLOAT == 8
01541 typedef float real64;
01542 #elif SIZEOF_DOUBLE == 8
01543 typedef double real64;
01544 #else
01545 #error "Unable to find a 64-bit real data type"
01546 #endif
01547 
01551 typedef unsigned long ulong;
01552 
01556 #if SIZEOF_LONG == 1
01557 #define UL_SET     (unsigned long)0xff
01558 #define UL_DIV_VAL 3
01559 #define UL_MOD_VAL 0x7
01560 #define UL_BITS    8
01561 #elif SIZEOF_LONG == 2
01562 #define UL_SET     (unsigned long)0xffff
01563 #define UL_DIV_VAL 4
01564 #define UL_MOD_VAL 0xf
01565 #define UL_BITS    16
01566 #elif SIZEOF_LONG == 4
01567 #define UL_SET     (unsigned long)0xffffffff
01568 #define UL_DIV_VAL 5
01569 #define UL_MOD_VAL 0x1f
01570 #define UL_BITS    32
01571 #elif SIZEOF_LONG == 8
01572 #define UL_SET     (unsigned long)0xffffffffffffffffLL
01573 #define UL_DIV_VAL 6
01574 #define UL_MOD_VAL 0x3f
01575 #define UL_BITS    64
01576 #else
01577 #error "Unsigned long is of an unsupported size"
01578 #endif
01579 
01581 #define UL_DIV(x)  (((unsigned int)x) >> UL_DIV_VAL)
01582 
01584 #define UL_MOD(x)  (((unsigned int)x) &  UL_MOD_VAL)
01585 
01586 /*------------------------------------------------------------------------------*/
01587 
01588 union esuppl_u;
01589 
01593 typedef union esuppl_u esuppl;
01594 
01598 union esuppl_u {
01599   uint32   all;               
01600   struct {
01601  
01602     /* MASKED BITS */
01603     uint32 swapped        :1;  
01607     uint32 root           :1;  
01609     uint32 false          :1;  
01611     uint32 true           :1;  
01613     uint32 left_changed   :1;  
01615     uint32 right_changed  :1;  
01617     uint32 eval_00        :1;  
01619     uint32 eval_01        :1;  
01621     uint32 eval_10        :1;  
01623     uint32 eval_11        :1;  
01625     uint32 lhs            :1;  
01627     uint32 in_func        :1;  
01628     uint32 owns_vec       :1;  
01630     uint32 excluded       :1;  
01634     uint32 type           :3;  
01635     uint32 base           :3;  
01637     uint32 clear_changed  :1;  
01641     uint32 parenthesis    :1;  
01644     /* UNMASKED BITS */
01645     uint32 eval_t         :1;  
01647     uint32 eval_f         :1;  
01649     uint32 comb_cntd      :1;  
01652     uint32 exp_added      :1;  
01656     uint32 owned          :1;  
01658     uint32 gen_expr       :1;  
01660     uint32 prev_called    :1;  
01663     uint32 for_cntrl      :1;  
01665     uint32 nba            :1;  
01667   } part;
01668 };
01669 
01670 /*------------------------------------------------------------------------------*/
01671 
01672 union ssuppl_u;
01673 
01677 typedef union ssuppl_u ssuppl;
01678 
01682 union ssuppl_u {
01683   uint32 all;
01684   struct {
01685     uint32 col            :16; 
01686     uint32 type           :5;  
01687     uint32 big_endian     :1;  
01688     uint32 excluded       :1;  
01689     uint32 not_handled    :1;  
01690     uint32 assigned       :1;  
01691     uint32 mba            :1;  
01693     uint32 implicit_size  :1;  
01694   } part;
01695 };
01696 
01697 /*------------------------------------------------------------------------------*/
01698 
01699 union psuppl_u;
01700 
01704 typedef union psuppl_u psuppl;
01705 
01709 union psuppl_u {
01710   uint32 all;
01711   struct {
01712     uint32 order    : 16;      
01713     uint32 type     : 3;       
01714     uint32 owns_expr: 1;       
01715     uint32 dimension: 10;      
01716   } part;
01717 };
01718 
01719 /*------------------------------------------------------------------------------*/
01720 
01721 union isuppl_u;
01722 
01726 typedef union isuppl_u isuppl;
01727 
01731 union isuppl_u {
01732   uint32 all;
01733   struct {
01734     uint32 scored      : 1;    
01735     uint32 excl_assign : 1;    
01736     uint32 excl_always : 1;    
01737     uint32 excl_init   : 1;    
01738     uint32 excl_final  : 1;    
01739     uint32 excl_pragma : 1;    
01740     uint32 assert_ovl  : 1;    
01741     uint32 vec_ul_size : 2;    
01742   } part;
01743 };
01744 
01745 /*------------------------------------------------------------------------------*/
01746 
01747 union vsuppl_u;
01748 
01752 typedef union vsuppl_u vsuppl;
01753 
01757 union vsuppl_u {
01758   uint8   all;                    
01759   struct {
01760     uint8 type      :2;           
01762     uint8 data_type :2;           
01763     uint8 owns_data :1;           
01764     uint8 is_signed :1;           
01765     uint8 is_2state :1;           
01766     uint8 set       :1;           
01767   } part;
01768 };
01769 
01770 /*------------------------------------------------------------------------------*/
01771 
01772 union fsuppl_u;
01773 
01777 typedef union fsuppl_u fsuppl;
01778 
01782 union fsuppl_u {
01783   uint8 all;                      
01784   struct {
01785     uint8 known : 1;              
01786   } part;
01787 };
01788 
01789 /*------------------------------------------------------------------------------*/
01790 
01791 union asuppl_u;
01792 
01796 typedef union asuppl_u asuppl;
01797 
01801 union asuppl_u {
01802   uint8 all;                      
01803   struct {
01804     uint8 hit      : 1;           
01805     uint8 excluded : 1;           
01806   } part;
01807 };
01808 
01809 /*------------------------------------------------------------------------------*/
01810 /*  STRUCTURE/UNION DECLARATIONS  */
01811 
01812 union  expr_stmt_u;
01813 struct exp_info_s;
01814 struct str_link_s;
01815 struct rv64_s;
01816 struct rv32_s;
01817 struct vector_s;
01818 struct const_value_s;
01819 struct vecblk_s;
01820 struct exp_dim_s;
01821 struct expression_s;
01822 struct vsignal_s;
01823 struct fsm_s;
01824 struct fsm_table_arc_s;
01825 struct fsm_table_s;
01826 struct statement_s;
01827 struct sig_link_s;
01828 struct exp_link_s;
01829 struct stmt_link_s;
01830 struct stmt_loop_link_s;
01831 struct statistic_s;
01832 struct mod_parm_s;
01833 struct inst_parm_s;
01834 struct fsm_arc_s;
01835 struct fsm_link_s;
01836 struct race_blk_s;
01837 struct func_unit_s;
01838 struct funit_link_s;
01839 struct inst_link_s;
01840 struct sym_sig_s;
01841 struct symtable_s;
01842 struct static_expr_s;
01843 struct vector_width_s;
01844 struct exp_bind_s;
01845 struct case_stmt_s;
01846 struct case_gitem_s;
01847 struct funit_inst_s;
01848 struct tnode_s;
01849 
01850 #ifdef HAVE_SYS_TIME_H
01851 struct timer_s;
01852 #endif
01853 
01854 struct fsm_var_s;
01855 struct fv_bind_s;
01856 struct attr_param_s;
01857 struct stmt_blk_s;
01858 struct thread_s;
01859 struct thr_link_s;
01860 struct thr_list_s;
01861 struct perf_stat_s;
01862 struct port_info_s;
01863 struct param_oride_s;
01864 struct gen_item_s;
01865 struct gitem_link_s;
01866 struct typedef_item_s;
01867 struct enum_item_s;
01868 struct sig_range_s;
01869 struct dim_range_s;
01870 struct reentrant_s;
01871 struct rstack_entry_s;
01872 struct struct_union_s;
01873 struct su_member_s;
01874 struct profiler_s;
01875 struct db_s;
01876 struct sim_time_s;
01877 struct comp_cdd_cov_s;
01878 struct exclude_reason_s;
01879 struct dim_and_nba_s;
01880 struct nonblock_assign_s;
01881 
01882 /*------------------------------------------------------------------------------*/
01883 /*  STRUCTURE/UNION TYPEDEFS  */
01884 
01888 typedef struct exp_info_s exp_info;
01889 
01893 typedef struct str_link_s str_link;
01894 
01898 typedef struct rv64_s rv64;
01899 
01903 typedef struct rv32_s rv32;
01904 
01908 typedef struct vector_s vector;
01909 
01913 typedef struct const_value_s const_value;
01914 
01918 typedef struct vecblk_s vecblk;
01919 
01923 typedef struct exp_dim_s exp_dim;
01924 
01928 typedef union expr_stmt_u expr_stmt;
01929 
01933 typedef struct expression_s expression;
01934 
01938 typedef struct vsignal_s     vsignal;
01939 
01943 typedef struct fsm_s fsm;
01944 
01948 typedef struct fsm_table_arc_s fsm_table_arc;
01949 
01953 typedef struct fsm_table_s fsm_table;
01954 
01958 typedef struct statement_s statement;
01959 
01963 typedef struct sig_link_s sig_link;
01964 
01968 typedef struct exp_link_s exp_link;
01969 
01973 typedef struct stmt_link_s stmt_link;
01974 
01978 typedef struct stmt_loop_link_s stmt_loop_link;
01979 
01983 typedef struct statistic_s statistic;
01984 
01988 typedef struct mod_parm_s mod_parm;
01989 
01993 typedef struct inst_parm_s inst_parm;
01994 
01998 typedef struct fsm_arc_s fsm_arc;
01999 
02003 typedef struct fsm_link_s fsm_link;
02004 
02008 typedef struct race_blk_s race_blk;
02009 
02013 typedef struct func_unit_s func_unit;
02014 
02018 typedef struct funit_link_s funit_link;
02019 
02023 typedef struct inst_link_s inst_link;
02024 
02028 typedef struct sym_sig_s sym_sig;
02029 
02033 typedef struct symtable_s symtable;
02034 
02038 typedef struct static_expr_s static_expr;
02039 
02043 typedef struct vector_width_s vector_width;
02044 
02048 typedef struct exp_bind_s exp_bind;
02049 
02053 typedef struct case_stmt_s case_statement;
02054 
02058 typedef struct case_gitem_s case_gitem;
02059 
02063 typedef struct funit_inst_s funit_inst;
02064 
02068 typedef struct tnode_s tnode;
02069 
02070 #ifdef HAVE_SYS_TIME_H
02071 
02074 typedef struct timer_s timer;
02075 #endif
02076 
02080 typedef struct fsm_var_s fsm_var;
02081 
02085 typedef struct fv_bind_s fv_bind;
02086 
02090 typedef struct attr_param_s attr_param;
02091 
02095 typedef struct stmt_blk_s stmt_blk;
02096 
02100 typedef struct thread_s thread;
02101 
02105 typedef struct thr_link_s thr_link;
02106 
02110 typedef struct thr_list_s thr_list;
02111 
02115 typedef struct perf_stat_s perf_stat;
02116 
02120 typedef struct port_info_s port_info;
02121 
02125 typedef struct param_oride_s param_oride;
02126 
02130 typedef struct gen_item_s gen_item;
02131 
02135 typedef struct gitem_link_s gitem_link;
02136 
02140 typedef struct typedef_item_s typedef_item;
02141 
02145 typedef struct enum_item_s enum_item;
02146 
02150 typedef struct sig_range_s sig_range;
02151 
02155 typedef struct dim_range_s dim_range;
02156 
02160 typedef struct reentrant_s reentrant;
02161 
02165 typedef struct rstack_entry_s rstack_entry;
02166 
02170 typedef struct struct_union_s struct_union;
02171 
02175 typedef struct su_member_s su_member;
02176 
02180 typedef struct profiler_s profiler;
02181 
02185 typedef struct db_s db;
02186 
02190 typedef struct sim_time_s sim_time;
02191 
02195 typedef struct comp_cdd_cov_s comp_cdd_cov;
02196 
02200 typedef struct exclude_reason_s exclude_reason;
02201 
02205 typedef struct dim_and_nba_s dim_and_nba;
02206 
02210 typedef struct nonblock_assign_s nonblock_assign;
02211 
02212 /*------------------------------------------------------------------------------*/
02213 /*  STRUCTURE/UNION DEFINITIONS  */
02214 
02218 struct sim_time_s {
02219   unsigned int lo;                   
02220   unsigned int hi;                   
02221   uint64       full;                 
02222   bool         final;                
02223 };
02224 
02228 struct exp_info_s {
02229   char* name;                             
02230   char* op_str;                           
02231   bool  (*func)( expression*, thread*, const sim_time* );  
02232   struct {
02233     uint32 is_event:1;                    
02234     uint32 is_static:1;                   
02235     uint32 is_comb:2;                     
02236     uint32 is_unary:1;                    
02237     uint32 measurable:1;                  
02238     uint32 is_context_switch:1;           
02239     uint32 assignable:1;                  
02240     uint32 tmp_vecs:3;                    
02241     uint32 real_op:2;                     
02242   } suppl;                                
02243 };
02244 
02250 struct str_link_s {
02251   char*         str;                 
02252   char*         str2;                
02253   uint32        suppl;               
02254   uint32        suppl2;              
02255   uint8         suppl3;              
02256   vector_width* range;               
02257   str_link*     next;                
02258 };
02259 
02264 struct rv64_s {
02265   char*  str;                        
02266   real64 val;                        
02267 };
02268 
02273 struct rv32_s {
02274   char*  str;                        
02275   real32 val;                        
02276 };
02277 
02283 struct vector_s {
02284   unsigned int width;                
02285   vsuppl       suppl;                
02286   union {
02287     ulong** ul;                      
02288     rv64*   r64;                     
02289     rv32*   r32;                     
02290   } value;
02291 };
02292 
02296 struct const_value_s {
02297   vector* vec;                       
02298   int     base;                      
02299 };
02300 
02304 struct vecblk_s {
02305   vector vec[5];                     
02306   int    index;                      
02307 }; 
02308 
02313 struct exp_dim_s {
02314   int  curr_lsb;                     
02315   int  dim_lsb;                      
02316   bool dim_be;                       
02317   int  dim_width;                    
02318   bool last;                         
02319 };
02320 
02325 union expr_stmt_u {
02326   expression* expr;                  
02327   statement*  stmt;                  
02328 };
02329 
02337 struct expression_s {
02338   vector*      value;              
02339   exp_op_type  op;                 
02340   esuppl       suppl;              
02341   int          id;                 
02342   int          ulid;               
02343   int          line;               
02344   uint32       exec_num;           
02345   union {
02346     uint32 all;
02347     struct {
02348       uint32 last  : 16;           
02349       uint32 first : 16;           
02350     } part;
02351   } col;
02352   vsignal*     sig;                
02353   char*        name;               
02355   expr_stmt*   parent;             
02356   expression*  right;              
02357   expression*  left;               
02358   fsm*         table;              
02359   union {
02360     func_unit*   funit;            
02361     thread*      thr;              
02362     uint64*      scale;            
02363     vecblk*      tvecs;            
02364     exp_dim*     dim;              
02365     dim_and_nba* dim_nba;          
02366   } elem;
02367 };
02368 
02373 struct vsignal_s {
02374   int          id;                   
02375   char*        name;                 
02376   int          line;                 
02377   ssuppl       suppl;                
02378   vector*      value;                
02379   unsigned int pdim_num;             
02380   unsigned int udim_num;             
02381   dim_range*   dim;                  
02382   exp_link*    exp_head;             
02383   exp_link*    exp_tail;             
02384 };
02385 
02389 struct fsm_s {
02390   char*       name;                  
02391   int         line;                  
02392   expression* from_state;            
02393   expression* to_state;              
02394   fsm_arc*    arc_head;              
02395   fsm_arc*    arc_tail;              
02396   fsm_table*  table;                 
02397   bool        exclude;               
02398 };
02399 
02403 struct fsm_table_arc_s {
02404   asuppl       suppl;                
02405   unsigned int from;                 
02406   unsigned int to;                   
02407 };
02408 
02412 struct fsm_table_s {
02413   fsuppl          suppl;             
02414   unsigned int    id;                
02415   vector**        fr_states;         
02416   unsigned int    num_fr_states;     
02417   vector**        to_states;         
02418   unsigned int    num_to_states;     
02419   fsm_table_arc** arcs;              
02420   unsigned int    num_arcs;          
02421 };
02422 
02435 struct statement_s {
02436   expression* exp;                   
02437   statement*  next_true;             
02438   statement*  next_false;            
02439   statement*  head;                  
02440   int         conn_id;               
02442   func_unit*  funit;                 
02443   union {
02444     uint32  all;
02445     struct {
02446       /* Masked bits */
02447       uint32  head      :1;          
02448       uint32  stop_true :1;          
02450       uint32  stop_false:1;          
02452       uint32  cont      :1;          
02455       uint32  is_called :1;          
02458       uint32  excluded  :1;          
02460       uint32  final     :1;          
02462       uint32  ignore_rc :1;          
02465       /* Unmasked bits */
02466       uint32  added     :1;          
02470     } part;
02471   } suppl;                           
02472   unsigned int ppline;               
02473 };
02474 
02478 struct sig_link_s {
02479   vsignal*  sig;                     
02480   sig_link* next;                    
02481 };
02482 
02486 struct exp_link_s {
02487   expression* exp;                   
02488   exp_link*   next;                  
02489 };
02490 
02494 struct stmt_link_s {
02495   statement* stmt;                   
02496   stmt_link* next;                   
02497   bool       rm_stmt;                
02498 };
02499 
02511 struct stmt_loop_link_s {
02512   statement*      stmt;              
02513   int             id;                
02514   int             type;              
02515   stmt_loop_link* next;              
02516 };
02517 
02521 struct statistic_s {
02522   unsigned int line_hit;                    
02523   unsigned int line_excluded;               
02524   unsigned int line_total;                  
02525   unsigned int tog01_hit;                   
02526   unsigned int tog10_hit;                   
02527   unsigned int tog_excluded;                
02528   unsigned int tog_total;                   
02529   bool         tog_cov_found;               
02530   unsigned int comb_hit;                    
02531   unsigned int comb_excluded;               
02532   unsigned int comb_total;                  
02533   int          state_total;                 
02534   int          state_hit;                   
02535   int          arc_total;                   
02536   int          arc_hit;                     
02537   int          arc_excluded;                
02538   unsigned int race_total;                  
02539   unsigned int rtype_total[RACE_TYPE_NUM];  
02540   unsigned int assert_hit;                  
02541   unsigned int assert_excluded;             
02542   unsigned int assert_total;                
02543   unsigned int mem_wr_hit;                  
02544   unsigned int mem_rd_hit;                  
02545   unsigned int mem_ae_total;                
02546   unsigned int mem_tog01_hit;               
02547   unsigned int mem_tog10_hit;               
02548   unsigned int mem_tog_total;               
02549   bool         mem_cov_found;               
02550   unsigned int mem_excluded;                
02551   bool         show;                        
02552 };
02553 
02557 struct mod_parm_s {
02558   char*        name;                 
02559   static_expr* msb;                  
02560   static_expr* lsb;                  
02561   bool         is_signed;            
02562   expression*  expr;                 
02563   psuppl       suppl;                
02564   exp_link*    exp_head;             
02565   exp_link*    exp_tail;             
02566   vsignal*     sig;                  
02567   char*        inst_name;            
02568   mod_parm*    next;                 
02569 };
02570 
02574 struct inst_parm_s {
02575   vsignal*     sig;                  
02576   char*        inst_name;            
02577   mod_parm*    mparm;                
02578   inst_parm*   next;                 
02579 };
02580 
02584 struct fsm_arc_s {
02585   expression* from_state;            
02586   expression* to_state;              
02587   fsm_arc*    next;                  
02588 };
02589 
02593 struct fsm_link_s {
02594   fsm*      table;                   
02595   fsm_link* next;                    
02596 };
02597 
02601 struct race_blk_s {
02602   int       start_line;              
02603   int       end_line;                
02604   int       reason;                  
02605   race_blk* next;                    
02606 };
02607 
02611 struct func_unit_s {
02612   int             type;              
02614   char*           name;              
02615   char*           filename;          
02616   char*           version;           
02617   int             start_line;        
02618   int             end_line;          
02619   int             ts_unit;           
02620   uint64          timescale;         
02621   statistic*      stat;              
02622   sig_link*       sig_head;          
02623   sig_link*       sig_tail;          
02624   exp_link*       exp_head;          
02625   exp_link*       exp_tail;          
02626   statement*      first_stmt;        
02627   stmt_link*      stmt_head;         
02628   stmt_link*      stmt_tail;         
02629   fsm_link*       fsm_head;          
02630   fsm_link*       fsm_tail;          
02631   race_blk*       race_head;         
02632   race_blk*       race_tail;         
02633   mod_parm*       param_head;        
02634   mod_parm*       param_tail;        
02635   gitem_link*     gitem_head;        
02636   gitem_link*     gitem_tail;        
02637   func_unit*      parent;            
02638   funit_link*     tf_head;           
02639   funit_link*     tf_tail;           
02640   typedef_item*   tdi_head;          
02641   typedef_item*   tdi_tail;          
02642   enum_item*      ei_head;           
02643   enum_item*      ei_tail;           
02644   struct_union*   su_head;           
02645   struct_union*   su_tail;           
02646   exclude_reason* er_head;           
02647   exclude_reason* er_tail;           
02648   int             elem_type;         
02650   union {
02651     thread*   thr;                   
02652     thr_list* tlist;                 
02653   } elem;                            
02654 };
02655 
02659 struct funit_link_s {
02660   func_unit*  funit;                 
02661   funit_link* next;                  
02662 };
02663 
02667 struct inst_link_s {
02668   funit_inst* inst;                  
02669   bool        ignore;                
02670   bool        base;                  
02671   inst_link*  next;                  
02672 };
02673 
02680 struct sym_sig_s {
02681   vsignal* sig;                      
02682   int      msb;                      
02683   int      lsb;                      
02684   sym_sig* next;                     
02685 };
02686 
02690 struct symtable_s {
02691   sym_sig*     sig_head;             
02692   sym_sig*     sig_tail;             
02693   char*        value;                
02694   unsigned int size;                 
02695   symtable*    table[256];           
02696 };
02697 
02701 struct static_expr_s {
02702   expression* exp;                   
02703   int         num;                   
02704 };
02705 
02709 struct vector_width_s {
02710   static_expr*  left;                
02711   static_expr*  right;               
02712   bool          implicit;            
02713 };
02714 
02718 struct exp_bind_s {
02719   int              type;             
02720   char*            name;             
02721   int              clear_assigned;   
02722   int              line;             
02723   expression*      exp;              
02724   expression*      fsm;              
02725   func_unit*       funit;            
02726   exp_bind*        next;             
02727 };
02728 
02733 struct case_stmt_s {
02734   expression*     expr;              
02735   statement*      stmt;              
02736   unsigned int    line;              
02737   unsigned int    ppline;            
02738   case_statement* prev;              
02739 };
02740 
02745 struct case_gitem_s {
02746   expression*     expr;              
02747   gen_item*       gi;                
02748   int             line;              
02749   case_gitem*     prev;              
02750 };
02751 
02755 struct funit_inst_s {
02756   char*         name;                
02757   struct {
02758     uint8 name_diff : 1;             
02759     uint8 ignore    : 1;             
02762     uint8 gend_scope: 1;             
02763   } suppl;                           
02764   func_unit*    funit;               
02765   statistic*    stat;                
02766   vector_width* range;               
02767   inst_parm*    param_head;          
02768   inst_parm*    param_tail;          
02769   gitem_link*   gitem_head;          
02770   gitem_link*   gitem_tail;          
02771   funit_inst*   parent;              
02772   funit_inst*   child_head;          
02773   funit_inst*   child_tail;          
02774   funit_inst*   next;                
02775 };
02776 
02781 struct tnode_s {
02782   char*  name;                       
02783   char*  value;                      
02784   tnode* left;                       
02785   tnode* right;                      
02786   tnode* up;                         
02787 };
02788 
02789 #ifdef HAVE_SYS_TIME_H
02790 
02798 struct timer_s {
02799   struct timeval start;              
02800   uint64         total;              
02801 };
02802 #endif
02803 
02807 struct fsm_var_s {
02808   char*       funit;                 
02809   char*       name;                  
02810   expression* ivar;                  
02811   expression* ovar;                  
02812   vsignal*    iexp;                  
02813   fsm*        table;                 
02814   bool        exclude;               
02815   int         line;                  
02816   fsm_var*    next;                  
02817 };
02818 
02822 struct fv_bind_s {
02823   char*       sig_name;              
02824   expression* expr;                  
02825   char*       funit_name;            
02826   statement*  stmt;                  
02827   fv_bind*    next;                  
02828 };
02829 
02833 struct attr_param_s {
02834   char*       name;                  
02835   expression* expr;                  
02836   int         index;                 
02837   attr_param* next;                  
02838   attr_param* prev;                  
02839 };
02840 
02847 struct stmt_blk_s {
02848   statement* stmt;                   
02849   bool       remove;                 
02850   bool       seq;                    
02851   bool       cmb;                    
02852   bool       bassign;                
02853   bool       nassign;                
02854 };
02855 
02861 struct thread_s {
02862   func_unit* funit;                  
02863   thread*    parent;                 
02864   statement* curr;                   
02865   reentrant* ren;                    
02866   union {
02867     uint8 all;
02868     struct {
02869       uint8 state      : 2;          
02870       uint8 kill       : 1;          
02871       uint8 exec_first : 1;          
02872     } part;
02873   } suppl;
02874   unsigned   active_children;        
02875   thread*    queue_prev;             
02876   thread*    queue_next;             
02877   thread*    all_prev;               
02878   thread*    all_next;               
02879   sim_time   curr_time;              
02880 };
02881 
02885 struct thr_link_s {
02886   thread*   thr;                     
02887   thr_link* next;                    
02888 };
02889 
02893 struct thr_list_s {
02894   thr_link* head;                    
02895   thr_link* tail;                    
02896   thr_link* next;                    
02897 };
02898 
02902 struct perf_stat_s {
02903   uint32  op_exec_cnt[EXP_OP_NUM];   
02904   float   op_cnt[EXP_OP_NUM];        
02905 };
02906 
02910 struct port_info_s {
02911   int           type;                
02912   bool          is_signed;           
02913   sig_range*    prange;              
02914   sig_range*    urange;              
02915 };
02916 
02920 struct param_oride_s {
02921   char*        name;                 
02922   expression*  expr;                 
02923   param_oride* next;                 
02924 };
02925 
02929 struct gen_item_s {
02930   union {
02931     expression* expr;                
02932     vsignal*    sig;                 
02933     statement*  stmt;                
02934     funit_inst* inst;                
02935   } elem;                            
02936   union {
02937     uint32      all;                 
02938     struct {
02939       uint32    type       : 3;      
02940       uint32    conn_id    : 16;     
02941       uint32    stop_true  : 1;      
02942       uint32    stop_false : 1;      
02943       uint32    resolved   : 1;      
02944       uint32    removed    : 1;      
02945     } part;
02946   } suppl;
02947   char*         varname;             
02948   gen_item*     next_true;           
02949   gen_item*     next_false;          
02950 };
02951 
02955 struct gitem_link_s {
02956   gen_item*   gi;                    
02957   gitem_link* next;                  
02958 };
02959 
02964 struct typedef_item_s {
02965   char*         name;                
02966   bool          is_signed;           
02967   bool          is_handled;          
02968   bool          is_sizeable;         
02969   sig_range*    prange;              
02970   sig_range*    urange;              
02971   typedef_item* next;                
02972 };
02973 
02977 struct enum_item_s {
02978   vsignal*      sig;                 
02979   static_expr*  value;               
02980   bool          last;                
02981   enum_item*    next;                
02982 };
02983 
02987 struct sig_range_s {
02988   int           dim_num;             
02989   vector_width* dim;                 
02990   bool          clear;               
02991   bool          exp_dealloc;         
02992 };
02993 
02997 struct dim_range_s {
02998   int        msb;                    
02999   int        lsb;                    
03000 };
03001 
03005 struct reentrant_s {
03006   uint8*        data;                
03007   int           data_size;           
03008 };
03009 
03013 struct struct_union_s {
03014   char*         name;                
03015   int           type;                
03016   bool          packed;              
03017   bool          is_signed;           
03018   bool          owns_data;           
03019   int           tag_pos;             
03020   vector*       data;                
03021   su_member*    mem_head;            
03022   su_member*    mem_tail;            
03023   struct_union* next;                
03024 };
03025 
03029 struct su_member_s {
03030   int             type;              
03031   int             pos;               
03032   union {
03033     vsignal*      sig;               
03034     struct_union* su;                
03035     enum_item*    ei;                
03036     typedef_item* tdi;               
03037   } elem;                            
03038   su_member*      parent;            
03039   su_member*      next;              
03040 };
03041 
03045 struct profiler_s {
03046   char*  func_name;                  
03047 #ifdef HAVE_SYS_TIME_H
03048   /*@null@*/ timer* time_in;         
03049 #endif
03050   int    calls;                      
03051   int    mallocs;                    
03052   int    frees;                      
03053   bool   timed;                      
03054 };
03055 
03059 struct db_s {
03060   char*       top_module;            
03061   char**      leading_hierarchies;   
03062   int         leading_hier_num;      
03063   bool        leading_hiers_differ;  
03064   inst_link*  inst_head;             
03065   inst_link*  inst_tail;             
03066   funit_link* funit_head;            
03067   funit_link* funit_tail;            
03068   str_link*   fver_head;             
03069   str_link*   fver_tail;             
03070 };
03071 
03076 struct comp_cdd_cov_s {
03077   char*        cdd_name;                
03078   uint64       timesteps;               
03079   uint64       total_cps;               
03080   uint64       unique_cps;              
03081   uint64       score;                   
03082   bool         required;                
03083   ulong*       cps[CP_TYPE_NUM];        
03084   unsigned int cps_index[CP_TYPE_NUM];  
03085 };
03086 
03091 struct exclude_reason_s {
03092   char            type;                 
03093   int             id;                   
03094   time_t          timestamp;            
03095   char*           reason;               
03096   exclude_reason* next;                 
03097 };
03098 
03103 struct dim_and_nba_s {
03104   exp_dim*         dim;                 
03105   nonblock_assign* nba;                 
03106 };
03107 
03111 struct nonblock_assign_s {
03112   vsignal*        lhs_sig;              
03113   int             lhs_lsb;              
03114   int             lhs_msb;              
03115   vector*         rhs_vec;              
03116   int             rhs_lsb;              
03117   int             rhs_msb;              
03118   struct {
03119     uint8         is_signed : 1;        
03120     uint8         added     : 1;        
03121   } suppl;                              
03122 };
03123 
03127 define_exception_type(int);
03128 
03129 extern struct exception_context the_exception_context[1];
03130 
03131 #endif
03132 
Generated on Sun Nov 21 00:55:34 2010 for Covered by  doxygen 1.6.3