db.h

Go to the documentation of this file.
00001 #ifndef __DB_H__
00002 #define __DB_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 
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 );
00045 
00047 bool db_read(
00048   const char* file,
00049   int         read_mode
00050 );
00051 
00053 void db_merge_instance_trees();
00054 
00056 uint64 db_scale_to_precision( uint64 value, func_unit* funit );
00057 
00059 void db_set_timescale( int unit, int precision );
00060 
00062 func_unit* db_get_curr_funit();
00063 
00065 unsigned int db_get_exclusion_id_size();
00066 
00068 char* db_gen_exclusion_id(
00069   char type,
00070   int  id
00071 );
00072 
00074 char* db_create_unnamed_scope();
00075 
00077 bool db_is_unnamed_scope( char* scope );
00078 
00080 void db_add_file_version(
00081   const char* file,
00082   const char* version
00083 );
00084 
00086 void db_output_dumpvars( FILE* vfile );
00087 
00089 func_unit* db_add_instance( char* scope, char* name, int type, vector_width* range );
00090 
00092 void db_add_module( char* name, char* file, int start_line );
00093 
00095 bool db_add_function_task_namedblock( int type, char* name, char* file, int start_line );
00096 
00098 void db_end_function_task_namedblock( int end_line );
00099 
00101 void db_add_declared_param( bool is_signed, static_expr* msb, static_expr* lsb, char* name, expression* expr, bool local );
00102 
00104 void db_add_override_param( char* inst_name, expression* expr, char* param_name );
00105 
00107 void db_add_defparam( char* name, expression* expr );
00108 
00110 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 );
00111 
00113 statement* db_add_fork_join( statement* stmt );
00114 
00116 void db_add_enum( vsignal* enum_sig, static_expr* value );
00117 
00119 void db_end_enum_list();
00120 
00122 void db_add_typedef( const char* name, bool is_signed, bool is_handled, bool is_sizable, sig_range* prange, sig_range* urange );
00123 
00125 void db_end_module( int end_line );
00126 
00128 void db_end_function_task( int end_line );
00129 
00131 vsignal* db_find_signal( char* name, bool okay_if_not_found );
00132 
00134 void db_add_gen_item_block( gen_item* gi );
00135 
00137 gen_item* db_find_gen_item( gen_item* root, gen_item* gi );
00138 
00140 typedef_item* db_find_typedef( const char* name );
00141 
00143 gen_item* db_get_curr_gen_block();
00144 
00146 expression* db_create_expression( expression* right, expression* left, exp_op_type op, bool lhs, int line, int first, int last, char* sig_name );
00147 
00149 void db_bind_expr_tree( expression* root, char* sig_name );
00150 
00152 expression* db_create_expr_from_static( static_expr* se, int line, int first_col, int last_col );
00153 
00155 void db_add_expression( expression* root );
00156 
00158 expression* db_create_sensitivity_list( statement* stmt );
00159 
00161 statement* db_parallelize_statement( statement* stmt );
00162 
00164 statement* db_create_statement( expression* exp, unsigned int ppline );
00165 
00167 void db_add_statement( statement* stmt, statement* start );
00168 
00170 void db_remove_statement_from_current_funit( statement* stmt );
00171 
00173 void db_remove_statement( statement* stmt );
00174 
00176 void db_gen_item_connect_true( gen_item* gi1, gen_item* gi2 );
00177 
00179 void db_gen_item_connect_false( gen_item* gi1, gen_item* gi2 );
00180 
00182 void db_gen_item_connect( gen_item* gi1, gen_item* gi2 );
00183 
00185 bool db_statement_connect( statement* curr_stmt, statement* next_stmt );
00186 
00188 void db_connect_statement_true( statement* stmt, statement* exp_true );
00189 
00191 void db_connect_statement_false( statement* stmt, statement* exp_false );
00192 
00194 attr_param* db_create_attr_param( char* name, expression* expr );
00195 
00197 void db_parse_attribute(
00198   attr_param* ap,
00199   int         line
00200 );
00201 
00203 void db_remove_stmt_blks_calling_statement( statement* stmt );
00204 
00206 void db_sync_curr_instance();
00207 
00209 void db_set_vcd_scope( const char* scope );
00210 
00212 void db_vcd_upscope();
00213 
00215 void db_assign_symbol( const char* name, const char* symbol, int msb, int lsb );
00216 
00218 void db_set_symbol_char( const char* sym, char value );
00219 
00221 void db_set_symbol_string( const char* sym, const char* value );
00222 
00224 bool db_do_timestep( uint64 time, bool final ); 
00225 
00228 void db_check_dumpfile_scopes();
00229 
00230 #endif
00231 
Generated on Sun Nov 21 00:55:34 2010 for Covered by  doxygen 1.6.3