NAPA Compiler V4.50
Author: Yves Leduc, yves.leduc.be@gmail.com
|
Go to the source code of this file.
Macros | |
#define | EXTERN extern |
Functions | |
void | print_limits (void) |
char * | get_a_line (char *buf, unsigned long *nl, FILE *fp, unsigned long *mlin, const unsigned long *mfil) |
long | f2printf (FILE *fp1, FILE *fp2, char *fmt,...) |
void | default_control_variables (void) |
void | complete_directives (void) |
void | expand_string_variables (void) |
void | expand_records (void) |
void | check_array_usage (void) |
void | check_record_usage (void) |
void | check_directive_usage (void) |
void | collect_export_definitions (void) |
void | expand_update_definitions (void) |
void | expand_IO_definitions (void) |
void | expand_dump_definitions (void) |
long | process_condition (char *str, const unsigned long *mlin, const unsigned long *mfil) |
void | build_condition (char *cond, const unsigned long *mlin, const unsigned long *mfil) |
void | build_to_be_delayed_node_list (void) |
void | determine_simulation_rate (void) |
void | determine_segment_processing_rate (void) |
void | determine_output_segment_rate (void) |
void | compact_segment (void) |
void | process_aliases (void) |
double | GCD (double a, double b) |
double | LCM (double n1, double n2) |
int | verify_rshift (void) |
void | cat_file (const char *fnam, const char *type, long command, const unsigned long *mlin, const unsigned long *mfil) |
void | process_error_if_any (void) |
void | print_error_location (const char *type, const unsigned long *mlin, const unsigned long *mfil) |
void | print_warning_location (const char *type, const unsigned long *mlin, const unsigned long *mfil) |
void | print_info_location (const char *type, const unsigned long *mlin, const unsigned long *mfil) |
void | print_problem_location (const char *type, const unsigned long *mlin, const unsigned long *mfil, const char *kind) |
void | print_location (const unsigned long *mlin, const unsigned long *mfil) |
int | test_endianness (void) |
void | wall_clock (void) |
void | last_message (void) |
void build_condition | ( | char * | cond, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 958 of file fc.c.
References build_name(), clean_parentheses(), get_sign_and_token(), ISEMPTY, ISNOTEMPTY, LINLENGTH, print_error_location(), RIGHT_VALUE, STDERR, STDOUT, STRLENGTH, UNDEFINED, and var_id().
Referenced by build_main_loop_block1(), build_main_loop_dump1(), build_output(), and print_output_banner_function().
void build_to_be_delayed_node_list | ( | void | ) |
Definition at line 998 of file fc.c.
References DELAY1_KIND, DELAY2_KIND, DELAY3_KIND, Delay_Input, DELAY_KIND, get_sign_and_token(), node_id(), Node_List, Num_Delays, Num_Nodes, and STRLENGTH.
Referenced by main().
void cat_file | ( | const char * | fnam, |
const char * | type, | ||
long | command, | ||
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 1411 of file fc.c.
References EXPAND, LENGTH, LINLENGTH, print_error_banner_and_exit(), print_error_location(), STDERR, and STDOUT.
Referenced by include_napa_header_files(), and load_function().
void check_array_usage | ( | void | ) |
Definition at line 503 of file fc.c.
References ALGEBRA_KIND, Array_Flag, array_id(), Array_List, array_name_id(), CONST_KIND, DALGEBRA_KIND, DC_KIND, DTOOL_KIND, DUSER_KIND, get_sign_and_token(), get_token(), IALGEBRA_KIND, ISEMPTY, ITOOL_KIND, IUSER_KIND, Node_List, Num_Arrays, Num_Nodes, RAM2_KIND, RAM_KIND, ROM2_KIND, ROM_KIND, STRLENGTH, TEST_KIND, UNDEFINED, and UNKNOWN_KIND.
Referenced by main().
void check_directive_usage | ( | void | ) |
Definition at line 631 of file fc.c.
References Assert_Flag, Cmdline_Flag, Directive_Flag, Directive_List, Dump_Flag, mark_directives(), and Num_Directives.
Referenced by main().
void check_record_usage | ( | void | ) |
Definition at line 560 of file fc.c.
References ALGEBRA_KIND, CONST_KIND, DALGEBRA_KIND, DC_KIND, DTOOL_KIND, DUSER_KIND, get_sign_and_token(), get_token(), IALGEBRA_KIND, ISEMPTY, ITOOL_KIND, IUSER_KIND, Node_List, Num_Nodes, Num_Records, Pointer_Flag, record_id(), Record_List, STRLENGTH, TEST_KIND, UNDEFINED, var_id(), and Var_List.
Referenced by main().
void collect_export_definitions | ( | void | ) |
Definition at line 671 of file fc.c.
References ANALOG_DATA_TYPE, build_name(), DIGITAL_DATA_TYPE, E_Format, Export0_Head_String, Export0_List_String, Export1_Head_String, Export1_List_String, Export_Flag, Export_List, get_sign_and_token(), get_type(), I_FORMAT_V, is_an_identifier(), ISEMPTY, ISNOTEMPTY, LENGTH, node_id(), Node_List, Num_Exports, print_error_location(), process_node_error(), process_variable_error(), R_FORMAT_V, RIGHT_VALUE, S_FORMAT_V, STDERR, STRLENGTH, UNDEFINED, V_Format, var_id(), and Var_List.
Referenced by main().
void compact_segment | ( | void | ) |
Definition at line 1273 of file fc.c.
References DROP_SEGMENT_TYPE, Dump_List, Gateway_List, IO_List, ISEQUAL, MAXSEGMENTS, Node_List, Num_IOs, Num_Nodes, Num_Posts, Num_Segments, Num_Updates, Num_UserTools, Num_Vars, Post_List, Sampling_List, Segment_List, Update_List, UserTool_List, and Var_List.
Referenced by main().
void complete_directives | ( | void | ) |
Definition at line 310 of file fc.c.
References directive_id(), Directive_List, increment_directive_number(), Num_Directives, strcpy_alloc(), and UNDEFINED.
Referenced by main().
void default_control_variables | ( | void | ) |
Definition at line 184 of file fc.c.
References Antithetic_Flag, Array_Flag, Assert_Flag, Call_Flag, Cmdline_Flag, Cmdline_String, Comment_Flag, Comment_String, Condition_Assign, Debug_Flag, DEFAULT_I_FORMAT, DEFAULT_R_FORMAT, DEFAULT_S_FORMAT, DEFAULT_X_FORMAT, Delayed_Flag, Directive_Flag, Drop_Flag, Dump_Flag, Error_Flag, Export0_Head_String, Export0_List_String, Export_Flag, Fs_Ext_Flag, Fs_Flag, Function_Flag, Gateway_Flag, Hierarchy_Flag, I_Format, I_String_Format, Inject_Flag, Input_Flag, Interlude_Flag1, Interlude_Flag2, Interlude_Flag3, Interlude_List, Interpolate_Flag, Last_Instruction, last_message(), Last_Postprocess, LENGTH, LINLENGTH, Load_Flag, Loop_Flag, Max_Depth, MAXCOMMENTS, Multdelay_Flag, NAPA_ANALOG_TYPE, NAPA_Compile_Start, NAPA_DIGITAL_TYPE, Num_Aliases, Num_Arrays, Num_Asserts, Num_Calls, Num_Cells, Num_Cmdlines, Num_Comments, Num_Consts, Num_Creates, Num_Debugs, Num_Declare_Commons, Num_Declares, Num_Delays, Num_Directives, Num_Exports, Num_FileCells, Num_Functions, Num_Generators, Num_Groups, Num_Headers, Num_Inits, Num_Injects, Num_Instances, Num_IOs, Num_Macros, Num_Nodes, Num_Nulls, Num_Opcodes, Num_Posts, Num_Records, Num_Redefs, Num_Restarts, Num_Segments, Num_Stucks, Num_Tools, Num_Updates, Num_UserTools, Num_Vars, Num_Voids, Option_Flag, Output_Flag, Periodic_Flag, Ping_Flag, Pointer_Flag, Post_Flag, print_error_location(), R_Format, R_String_Format, S_Format, S_String_Format, Sampling_List, Seed_Flag, Seed_List, STDERR, STRLENGTH, Stuck_Flag, Synchro_Flag, Terminate_Flag, Title_Flag, Title_String, Tool_Flag, Tool_Index_Flag, Ts_Ext_Flag, Ts_Flag, Update_Flag, User_Flag, UserTool_Flag, Warning_Flag, X_Format, and X_String_Format.
Referenced by main().
void determine_output_segment_rate | ( | void | ) |
Definition at line 1135 of file fc.c.
References CONST_KIND, DC_KIND, DECIMATE_SEGMENT_TYPE, get_sign_and_token(), increment_segment_number(), IO_List, ISEMPTY, ISEQUAL, LINLENGTH, MAXDEPTH, MAXSEGMENTS, node_id(), Node_List, Num_IOs, Num_Segments, OUTPUT_TYPE, Segment_List, strcpy_realloc(), STRLENGTH, UNDEFINED, update_id(), and Update_List.
Referenced by main().
void determine_segment_processing_rate | ( | void | ) |
Definition at line 1080 of file fc.c.
References DECIMATE_SEGMENT_TYPE, DROP_SEGMENT_TYPE, INTERPOLATE_SEGMENT_TYPE, NOMINAL_SEGMENT_TYPE, Num_Segments, Sampling_List, Segment_List, and Simulation_Rate.
Referenced by main().
void determine_simulation_rate | ( | void | ) |
Definition at line 1025 of file fc.c.
References DECIMATE_SEGMENT_TYPE, DROP_SEGMENT_TYPE, GCD(), INTERPOLATE_SEGMENT_TYPE, LCM(), MAXSEGMENTS, NOMINAL_SEGMENT_TYPE, Num_Segments, Segment_List, and Simulation_Rate.
Referenced by main().
void expand_dump_definitions | ( | void | ) |
Definition at line 887 of file fc.c.
References Dump_Flag, Dump_List, get_token(), ISEMPTY, print_error_location(), process_condition(), STDERR, strcpy_alloc(), and STRLENGTH.
Referenced by main().
void expand_IO_definitions | ( | void | ) |
Definition at line 844 of file fc.c.
References get_token(), INPUT_TYPE, IO_List, ISNOTEMPTY, Num_IOs, OUTPUT_TYPE, print_error_location(), process_condition(), STDERR, strcpy_alloc(), and STRLENGTH.
Referenced by main().
void expand_records | ( | void | ) |
Definition at line 377 of file fc.c.
References clean_line(), get_sign_and_token(), ISEMPTY, LINLENGTH, Num_Records, print_error_location(), record_id(), Record_List, STDERR, strcpy_realloc(), STRLENGTH, and UNDEFINED.
Referenced by main().
void expand_string_variables | ( | void | ) |
Definition at line 323 of file fc.c.
References Comment_Flag, Comment_String, expand_indirections(), get_token(), ISNOTEMPTY, LENGTH, LINLENGTH, MAX, Num_Comments, Num_Vars, print_error_location(), Short_Title_String, STDERR, strcpy_realloc(), STRING_DATA_TYPE, Title_String, and Var_List.
Referenced by main().
void expand_update_definitions | ( | void | ) |
Definition at line 777 of file fc.c.
References clean_line(), get_token(), ISEMPTY, ISNOTEMPTY, Num_Updates, print_error_location(), process_condition(), process_variable_error(), STDERR, strcpy_alloc(), strcpy_realloc(), STRING_DATA_TYPE, STRLENGTH, UNDEFINED, Update_List, var_id(), and Var_List.
Referenced by main().
long f2printf | ( | FILE * | fp1, |
FILE * | fp2, | ||
char * | fmt, | ||
... ) |
Definition at line 157 of file fc.c.
References MAX.
Referenced by build_cross_reference(), get_data(), and line_parsing().
double GCD | ( | double | a, |
double | b ) |
Definition at line 1378 of file fc.c.
References _SMALL_, and GCD().
Referenced by declare_global_values(), determine_simulation_rate(), GCD(), LCM(), and reset_simulator_variables().
char * get_a_line | ( | char * | buf, |
unsigned long * | nl, | ||
FILE * | fp, | ||
unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 100 of file fc.c.
References clean_line(), expand_iterative_identifiers(), LENGTH, LINLENGTH, print_error_banner_and_exit(), print_error_location(), print_limits(), and STDERR.
Referenced by get_data(), line_parsing(), and process_cell().
void last_message | ( | void | ) |
Definition at line 1552 of file fc.c.
References Error_Flag, f1flush(), and STDERR.
Referenced by default_control_variables().
double LCM | ( | double | n1, |
double | n2 ) |
Definition at line 1392 of file fc.c.
References GCD().
Referenced by determine_simulation_rate().
void print_error_location | ( | const char * | type, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 1476 of file fc.c.
References Error_Flag, print_problem_location(), and STDERR.
Referenced by authorize_option(), build_condition(), build_input(), build_main_loop_inject(), build_name(), build_node(), build_node_dependencies(), build_output(), build_pathname(), build_record_dependencies(), build_update(), build_update_dependencies(), build_usage_comment(), build_var_dependencies(), C_syntax_checker(), cat_file(), check_option_function(), check_syntax(), check_types(), check_version(), collect_export_definitions(), collect_string_of_options(), create_automatic_node(), create_nodes(), declaration_type_A(), declaration_type_B(), declare_a_digital_node(), declare_an_analog_node(), declare_vars(), default_control_variables(), dump_function(), expand_dump_definitions(), expand_IO_definitions(), expand_iterative_identifiers(), expand_nodeset(), expand_records(), expand_string_variables(), expand_update_definitions(), f1flush(), get_a_line(), get_alias(), get_array(), get_assert(), get_call(), get_command_line(), get_comment(), get_data(), get_debug(), get_decimate(), get_declare(), get_directive(), get_drop(), get_dump(), get_export(), get_format(), get_fs_ts(), get_gateway(), get_header(), get_init(), get_inject(), get_input(), get_interlude(), get_interpolate(), get_load(), get_node(), get_nominal(), get_opcode(), get_output(), get_ping(), get_post(), get_random_seed(), get_restart(), get_sampling(), get_stuck(), get_synchronize(), get_terminate(), get_update(), get_var(), get_void(), include_napa_header_files(), inject_nodes(), inspect_short_form(), line_parsing(), node_determination(), node_id(), open_IO_files(), open_ping_file(), print_adc(), print_algebra(), print_alu(), print_bshift(), print_btoi(), print_C_code_banner_b(), print_dac(), print_delay(), print_dyadic7(), print_mux(), print_output_banner_2(), print_quant(), print_rip(), print_rlshift(), print_rshift1(), print_rshift2(), print_test(), print_uadc(), print_udac(), print_usertool(), print_zero(), process_aliases(), process_cell(), process_cell_line(), process_condition(), process_gen(), process_width(), purge_constants_in_options(), read_doub_format(), read_hex_format(), read_int_format(), read_str_format(), rearrange_data_interfaces(), record_cell_nam(), record_file_nam(), record_function_identifier(), redefine_node_segments(), redefine_nodes(), reset_a_dc_node(), reset_a_digital_node(), reset_an_analog_node(), reset_arrays_function(), reset_user_variables(), sanity_check(), something_else(), strcpy_alloc(), strcpy_realloc(), stuck_nodes(), syntax_command_line(), syntax_directives(), syntax_nodes(), syntax_records(), syntax_segment_value(), syntax_terminate(), syntax_updates(), syntax_variables(), trap_unconsistencies(), and var_id().
void print_info_location | ( | const char * | type, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 1491 of file fc.c.
References print_problem_location().
void print_limits | ( | void | ) |
Definition at line 56 of file fc.c.
References LINLENGTH, MAXALIASES, MAXARRAYS, MAXCMDLINES, MAXDECLARECOMMONS, MAXDECLARES, MAXDEPTH, MAXDIRS, MAXEXPORTS, MAXFILECELLS, MAXFILES, MAXFUNCTIONS, MAXHEADERS, MAXINJECTS, MAXINSTANCES, MAXIOS, MAXNODES, MAXOPCODES, MAXOPTIONS, MAXPARMS, MAXPOSTS, MAXRECORDS, MAXSEGMENTS, MAXSTUCKS, MAXUPDATES, MAXUSERTOOLS, MAXVARS, STDERR, and STRLENGTH.
Referenced by build_name(), get_a_line(), get_data(), increment_alias_number(), increment_array_number(), increment_assert_number(), increment_call_number(), increment_cmdline_number(), increment_comment_number(), increment_common_number(), increment_debug_number(), increment_declare_number(), increment_directive_number(), increment_export_number(), increment_filecell_number(), increment_function_number(), increment_group_number(), increment_header_number(), increment_init_number(), increment_inject_number(), increment_instance_number(), increment_IO_number(), increment_node_number(), increment_opcode_number(), increment_post_number(), increment_record_number(), increment_restart_number(), increment_segment_number(), increment_stuck_number(), increment_tool_number(), increment_update_number(), increment_usertool_number(), increment_var_number(), process_cell(), process_cell_line(), process_command_line(), and process_gen().
void print_location | ( | const unsigned long * | mlin, |
const unsigned long * | mfil ) |
Definition at line 1510 of file fc.c.
References f1flush(), MAXDEPTH, Record_Cell_File_Table, and STDERR.
Referenced by declaration_type_A(), get_alias(), get_array(), get_command_line(), get_directive(), get_fs_ts(), get_node(), get_sampling(), get_var(), print_problem_location(), reset_a_digital_node(), reset_an_analog_node(), and syntax_command_line().
void print_problem_location | ( | const char * | type, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil, | ||
const char * | kind ) |
Definition at line 1497 of file fc.c.
References print_location(), STDERR, and STRLENGTH.
Referenced by print_error_location(), print_info_location(), and print_warning_location().
void print_warning_location | ( | const char * | type, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 1484 of file fc.c.
References print_problem_location(), and Warning_Flag.
Referenced by build_input(), build_main_loop(), build_update(), check_types(), check_version(), declare_vars(), get_alias(), get_assert(), get_command_line(), get_debug(), get_decimate(), get_declare(), get_directive(), get_drop(), get_dump(), get_format(), get_fs_ts(), get_gateway(), get_header(), get_interlude(), get_interpolate(), get_load(), get_node(), get_nominal(), get_ping(), get_post(), get_random_seed(), get_restart(), get_sampling(), get_synchronize(), get_terminate(), get_title(), get_var(), get_void(), line_parsing(), node_determination(), print_dyadic0(), print_dyadic7(), print_ram(), print_rom(), print_wsum(), read_doub_format(), read_hex_format(), read_int_format(), read_str_format(), redefine_nodes(), reset_user_variables(), syntax_command_line(), syntax_fs(), and trap_unconsistencies().
void process_aliases | ( | void | ) |
Definition at line 1328 of file fc.c.
References Alias_List, Cmdline_List, node_id(), Node_List, Num_Aliases, Num_Cmdlines, print_error_location(), process_node_error(), process_variable_error(), STDERR, strcpy_realloc(), STRLENGTH, UNDEFINED, var_id(), and Var_List.
Referenced by main().
long process_condition | ( | char * | str, |
const unsigned long * | mlin, | ||
const unsigned long * | mfil ) |
Definition at line 916 of file fc.c.
References C_syntax_checker(), get_sign_and_token(), get_token_between_braces(), ISEMPTY, ISNOTEMPTY, LINLENGTH, node_id(), print_error_location(), STDERR, UNDEFINED, var_id(), and Var_List.
Referenced by expand_dump_definitions(), expand_IO_definitions(), and expand_update_definitions().
void process_error_if_any | ( | void | ) |
Definition at line 1467 of file fc.c.
References Error_Flag, f1flush(), and print_error_banner_and_exit().
Referenced by main().
int test_endianness | ( | void | ) |
Definition at line 1537 of file fc.c.
References BIG_ENDIAN, and LITTLE_ENDIAN.
Referenced by define_macros().
int verify_rshift | ( | void | ) |
Definition at line 1400 of file fc.c.
Referenced by print_C_code_banner_a(), and syntax_nodes().
void wall_clock | ( | void | ) |
Definition at line 1544 of file fc.c.
References f1flush(), NAPA_Compile_Start, NAPA_Compile_Stop, and STDERR.