00001 #ifndef __DB_H__
00002 #define __DB_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00027 #include "defines.h"
00028
00029
00031 db* db_create();
00032
00034 void db_close();
00035
00037 bool db_check_for_top_module();
00038
00040 void db_write(
00041 const char* file,
00042 bool parse_mode,
00043 bool issue_ids,
00044 bool report_save
00045 );
00046
00048 void db_read(
00049 const char* file,
00050 int read_mode
00051 );
00052
00054 void db_merge_instance_trees();
00055
00057 uint64 db_scale_to_precision( uint64 value, func_unit* funit );
00058
00060 void db_set_timescale( int unit, int precision );
00061
00063 func_unit* db_get_curr_funit();
00064
00066 unsigned int db_get_exclusion_id_size();
00067
00069 char* db_gen_exclusion_id(
00070 char type,
00071 int id
00072 );
00073
00075 char* db_create_unnamed_scope();
00076
00078 bool db_is_unnamed_scope( char* scope );
00079
00081 void db_add_file_version(
00082 const char* file,
00083 const char* version
00084 );
00085
00087 void db_output_dumpvars( FILE* vfile );
00088
00090 func_unit* db_add_instance( char* scope, char* name, int type, vector_width* range );
00091
00093 void db_add_module( char* name, char* file, int start_line );
00094
00096 bool db_add_function_task_namedblock( int type, char* name, char* file, int start_line );
00097
00099 void db_end_function_task_namedblock( int end_line );
00100
00102 void db_add_declared_param( bool is_signed, static_expr* msb, static_expr* lsb, char* name, expression* expr, bool local );
00103
00105 void db_add_override_param( char* inst_name, expression* expr, char* param_name );
00106
00108 void db_add_defparam( char* name, expression* expr );
00109
00111 void db_add_signal( char* name, int type, sig_range* prange, sig_range* urange, bool is_signed, bool mba, int line, int col, bool handled );
00112
00114 statement* db_add_fork_join( statement* stmt );
00115
00117 void db_add_enum( vsignal* enum_sig, static_expr* value );
00118
00120 void db_end_enum_list();
00121
00123 void db_add_typedef( const char* name, bool is_signed, bool is_handled, bool is_sizable, sig_range* prange, sig_range* urange );
00124
00126 void db_end_module( int end_line );
00127
00129 void db_end_function_task( int end_line );
00130
00132 vsignal* db_find_signal( char* name, bool okay_if_not_found );
00133
00135 void db_add_gen_item_block( gen_item* gi );
00136
00138 gen_item* db_find_gen_item( gen_item* root, gen_item* gi );
00139
00141 typedef_item* db_find_typedef( const char* name );
00142
00144 gen_item* db_get_curr_gen_block();
00145
00147 expression* db_create_expression( expression* right, expression* left, exp_op_type op, bool lhs, int line, int first, int last, char* sig_name );
00148
00150 void db_bind_expr_tree( expression* root, char* sig_name );
00151
00153 expression* db_create_expr_from_static( static_expr* se, int line, int first_col, int last_col );
00154
00156 void db_add_expression( expression* root );
00157
00159 expression* db_create_sensitivity_list( statement* stmt );
00160
00162 statement* db_parallelize_statement( statement* stmt );
00163
00165 statement* db_create_statement( expression* exp, unsigned int ppline );
00166
00168 void db_add_statement( statement* stmt, statement* start );
00169
00171 void db_remove_statement_from_current_funit( statement* stmt );
00172
00174 void db_remove_statement( statement* stmt );
00175
00177 void db_gen_item_connect_true( gen_item* gi1, gen_item* gi2 );
00178
00180 void db_gen_item_connect_false( gen_item* gi1, gen_item* gi2 );
00181
00183 void db_gen_item_connect( gen_item* gi1, gen_item* gi2 );
00184
00186 bool db_statement_connect( statement* curr_stmt, statement* next_stmt );
00187
00189 void db_connect_statement_true( statement* stmt, statement* exp_true );
00190
00192 void db_connect_statement_false( statement* stmt, statement* exp_false );
00193
00195 attr_param* db_create_attr_param( char* name, expression* expr );
00196
00198 void db_parse_attribute( attr_param* ap );
00199
00201 void db_remove_stmt_blks_calling_statement( statement* stmt );
00202
00204 void db_sync_curr_instance();
00205
00207 void db_set_vcd_scope( const char* scope );
00208
00210 void db_vcd_upscope();
00211
00213 void db_assign_symbol( const char* name, const char* symbol, int msb, int lsb );
00214
00216 void db_set_symbol_char( const char* sym, char value );
00217
00219 void db_set_symbol_string( const char* sym, const char* value );
00220
00222 bool db_do_timestep( uint64 time, bool final );
00223
00224 #endif
00225