@@ -2456,15 +2456,15 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2456
2456
{
2457
2457
int port_size = 0 ;
2458
2458
// VAR_DECLARE_LIST(child[i])->VAR_DECLARE_PORT(child[0])->VAR_DECLARE_input-or-output(child[0])
2459
- ast_node_t *module_var_node = module_list->children [i]-> children [ 0 ] ;
2459
+ ast_node_t *module_var_node = module_list->children [i];
2460
2460
// MODULE_CONNECT_LIST(child[i])->MODULE_CONNECT(child[1]) // child[0] is for aliasing
2461
2461
ast_node_t *module_instance_var_node = module_instance_list->children [i]->children [1 ];
2462
2462
2463
2463
if (
2464
2464
// skip inputs on pass 1
2465
- ((PASS == INSTANTIATE_DRIVERS) && (module_list->children [i]->children [ 0 ]-> types .variable .is_input ))
2465
+ ((PASS == INSTANTIATE_DRIVERS) && (module_list->children [i]->types .variable .is_input ))
2466
2466
// skip outputs on pass 2
2467
- || ((PASS == ALIAS_INPUTS) && (module_list->children [i]->children [ 0 ]-> types .variable .is_output ))
2467
+ || ((PASS == ALIAS_INPUTS) && (module_list->children [i]->types .variable .is_output ))
2468
2468
)
2469
2469
{
2470
2470
continue ;
@@ -2520,7 +2520,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2520
2520
for (j = 0 ; j < port_size; j++)
2521
2521
{
2522
2522
2523
- if (module_list-> children [i]-> children [ 0 ] ->types .variable .is_input )
2523
+ if (module_var_node ->types .variable .is_input )
2524
2524
{
2525
2525
/* IF - this spot in the module list is an input, then we need to find it in the
2526
2526
* string cache (as its old name), check if the new_name (the instantiation name)
@@ -2539,7 +2539,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2539
2539
vtr::free (name_of_module_instance_of_input);
2540
2540
2541
2541
/* make the new string for the alias name - has to be a identifier in the instantiated modules old names */
2542
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , j);
2542
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , j);
2543
2543
alias_name = make_full_ref_name (instance_name_prefix,
2544
2544
module_instance->children [0 ]->types .identifier ,
2545
2545
module_instance->children [1 ]->children [0 ]->types .identifier ,
@@ -2556,7 +2556,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2556
2556
full_name = make_full_ref_name (instance_name_prefix, NULL , NULL , name_of_module_instance_of_input, -1 );
2557
2557
vtr::free (name_of_module_instance_of_input);
2558
2558
2559
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , 0 );
2559
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , 0 );
2560
2560
alias_name = make_full_ref_name (instance_name_prefix,
2561
2561
module_instance->children [0 ]->types .identifier ,
2562
2562
module_instance->children [1 ]->children [0 ]->types .identifier ,
@@ -2636,21 +2636,21 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2636
2636
if (module_instance_list->children [i]->children [0 ] != NULL )
2637
2637
{
2638
2638
if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier ,
2639
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier ) != 0
2639
+ module_var_node ->children [0 ]->types .identifier ) != 0
2640
2640
)
2641
2641
{
2642
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
2642
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
2643
2643
" This module entry does not match up correctly (%s != %s). Odin expects the order of ports to be the same\n " ,
2644
2644
module_instance_list->children [i]->children [0 ]->types .identifier ,
2645
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier
2645
+ module_var_node ->children [0 ]->types .identifier
2646
2646
);
2647
2647
}
2648
2648
}
2649
2649
2650
2650
vtr::free (full_name);
2651
2651
vtr::free (alias_name);
2652
2652
}
2653
- else if (module_list-> children [i]-> children [ 0 ] ->types .variable .is_output )
2653
+ else if (module_var_node ->types .variable .is_output )
2654
2654
{
2655
2655
/* ELSE IF - this is an output pin from the module. We need to alias this output
2656
2656
* pin with it's calling name here so that everyone can see it at this level */
@@ -2667,7 +2667,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2667
2667
full_name = make_full_ref_name (instance_name_prefix, NULL , NULL , name_of_module_instance_of_input, -1 );
2668
2668
vtr::free (name_of_module_instance_of_input);
2669
2669
2670
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , j);
2670
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , j);
2671
2671
alias_name = make_full_ref_name (instance_name_prefix,
2672
2672
module_instance->children [0 ]->types .identifier ,
2673
2673
module_instance->children [1 ]->children [0 ]->types .identifier , name_of_module_instance_of_input, -1 );
@@ -2681,7 +2681,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2681
2681
full_name = make_full_ref_name (instance_name_prefix, NULL , NULL , name_of_module_instance_of_input, -1 );
2682
2682
vtr::free (name_of_module_instance_of_input);
2683
2683
2684
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , 0 );
2684
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , 0 );
2685
2685
alias_name = make_full_ref_name (instance_name_prefix,
2686
2686
module_instance->children [0 ]->types .identifier ,
2687
2687
module_instance->children [1 ]->children [0 ]->types .identifier , name_of_module_instance_of_input, -1 );
@@ -2692,7 +2692,7 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2692
2692
/* check if the instantiation pin exists. */
2693
2693
if ((sc_spot_output = sc_lookup_string (output_nets_sc, alias_name)) == -1 )
2694
2694
{
2695
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
2695
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
2696
2696
" This output (%s) must exist...must be an error\n " , alias_name);
2697
2697
}
2698
2698
@@ -2726,12 +2726,12 @@ void connect_module_instantiation_and_alias(short PASS, ast_node_t* module_insta
2726
2726
/* IF the designer users port names then make sure they line up */
2727
2727
if (module_instance_list->children [i]->children [0 ] != NULL )
2728
2728
{
2729
- if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier , module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier ) != 0 )
2729
+ if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier , module_var_node ->children [0 ]->types .identifier ) != 0 )
2730
2730
{
2731
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
2731
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
2732
2732
" This module entry does not match up correctly (%s != %s). Odin expects the order of ports to be the same\n " ,
2733
2733
module_instance_list->children [i]->children [0 ]->types .identifier ,
2734
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier
2734
+ module_var_node ->children [0 ]->types .identifier
2735
2735
);
2736
2736
}
2737
2737
}
@@ -2785,16 +2785,16 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
2785
2785
2786
2786
int port_size = 0 ;
2787
2787
// VAR_DECLARE_LIST(child[i])->VAR_DECLARE_PORT(child[0])->VAR_DECLARE_input-or-output(child[0])
2788
- ast_node_t *module_var_node = module_list->children [i]-> children [ 0 ] ;
2789
- ast_node_t *module_instance_var_node = NULL ;
2788
+ ast_node_t *module_var_node = module_list->children [i];
2789
+ ast_node_t *module_instance_var_node = NULL ;
2790
2790
2791
2791
if (i > 0 ) module_instance_var_node = module_instance_list->children [i]->children [1 ];
2792
2792
2793
2793
if (
2794
2794
// skip inputs on pass 1
2795
- ((PASS == INSTANTIATE_DRIVERS) && (module_list-> children [i]-> children [ 0 ] ->types .variable .is_input ))
2795
+ ((PASS == INSTANTIATE_DRIVERS) && (module_var_node ->types .variable .is_input ))
2796
2796
// skip outputs on pass 2
2797
- || ((PASS == ALIAS_INPUTS) && (module_list-> children [i]-> children [ 0 ] ->types .variable .is_output ))
2797
+ || ((PASS == ALIAS_INPUTS) && (module_var_node ->types .variable .is_output ))
2798
2798
)
2799
2799
{
2800
2800
continue ;
@@ -2853,7 +2853,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
2853
2853
}
2854
2854
for (j = 0 ; j < port_size; j++)
2855
2855
{
2856
- if (i > 0 && module_list-> children [i]-> children [ 0 ] ->types .variable .is_input )
2856
+ if (i > 0 && module_var_node ->types .variable .is_input )
2857
2857
{
2858
2858
/* IF - this spot in the module list is an input, then we need to find it in the
2859
2859
* string cache (as its old name), check if the new_name (the instantiation name)
@@ -2872,7 +2872,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
2872
2872
vtr::free (name_of_module_instance_of_input);
2873
2873
2874
2874
/* make the new string for the alias name - has to be a identifier in the instantiated modules old names */
2875
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , j);
2875
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , j);
2876
2876
alias_name = make_full_ref_name (instance_name_prefix,
2877
2877
module_instance->children [0 ]->types .identifier ,
2878
2878
module_instance->children [1 ]->children [0 ]->types .identifier ,
@@ -2891,7 +2891,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
2891
2891
full_name = make_full_ref_name (instance_name_prefix, NULL , NULL , name_of_module_instance_of_input, -1 );
2892
2892
vtr::free (name_of_module_instance_of_input);
2893
2893
2894
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , 0 );
2894
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , 0 );
2895
2895
alias_name = make_full_ref_name (instance_name_prefix,
2896
2896
module_instance->children [0 ]->types .identifier ,
2897
2897
module_instance->children [1 ]->children [0 ]->types .identifier ,
@@ -2974,21 +2974,21 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
2974
2974
if (module_instance_list->children [i]->children [0 ] != NULL )
2975
2975
{
2976
2976
if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier ,
2977
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier ) != 0
2977
+ module_var_node ->children [0 ]->types .identifier ) != 0
2978
2978
)
2979
2979
{
2980
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
2980
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
2981
2981
" This module entry does not match up correctly (%s != %s). Odin expects the order of ports to be the same\n " ,
2982
2982
module_instance_list->children [i]->children [0 ]->types .identifier ,
2983
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier
2983
+ module_var_node ->children [0 ]->types .identifier
2984
2984
);
2985
2985
}
2986
2986
}
2987
2987
2988
2988
vtr::free (full_name);
2989
2989
vtr::free (alias_name);
2990
2990
}
2991
- else if (i == 0 && module_list-> children [i]-> children [ 0 ] ->types .variable .is_output )
2991
+ else if (i == 0 && module_var_node ->types .variable .is_output )
2992
2992
{
2993
2993
/* ELSE IF - this is an output pin from the module. We need to alias this output
2994
2994
* pin with it's calling name here so that everyone can see it at this level */
@@ -3009,7 +3009,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
3009
3009
// vtr::free(name_of_module_instance_of_input);
3010
3010
3011
3011
3012
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , j);
3012
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , j);
3013
3013
3014
3014
alias_name = make_full_ref_name (instance_name_prefix,
3015
3015
module_instance->children [0 ]->types .identifier ,
@@ -3030,7 +3030,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
3030
3030
3031
3031
// vtr::free(name_of_module_instance_of_input);
3032
3032
3033
- name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_list-> children [i]-> children [ 0 ] , 0 );
3033
+ name_of_module_instance_of_input = get_name_of_var_declare_at_bit (module_var_node , 0 );
3034
3034
3035
3035
alias_name = make_full_ref_name (instance_name_prefix,
3036
3036
module_instance->children [0 ]->types .identifier ,
@@ -3042,7 +3042,7 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
3042
3042
/* check if the instantiation pin exists. */
3043
3043
if ((sc_spot_output = sc_lookup_string (output_nets_sc, alias_name)) == -1 )
3044
3044
{
3045
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
3045
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
3046
3046
" This output (%s) must exist...must be an error\n " , alias_name);
3047
3047
}
3048
3048
@@ -3079,12 +3079,12 @@ signal_list_t *connect_function_instantiation_and_alias(short PASS, ast_node_t*
3079
3079
/* IF the designer users port names then make sure they line up */
3080
3080
if (i > 0 && module_instance_list->children [i]->children [0 ] != NULL )
3081
3081
{
3082
- if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier , module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier ) != 0 )
3082
+ if (strcmp (module_instance_list->children [i]->children [0 ]->types .identifier , module_var_node ->children [0 ]->types .identifier ) != 0 )
3083
3083
{
3084
- error_message (NETLIST_ERROR, module_list-> children [i]-> children [ 0 ]-> line_number , module_list-> children [i]-> children [ 0 ] ->file_number ,
3084
+ error_message (NETLIST_ERROR, module_var_node-> line_number , module_var_node ->file_number ,
3085
3085
" This module entry does not match up correctly (%s != %s). Odin expects the order of ports to be the same\n " ,
3086
3086
module_instance_list->children [i]->children [0 ]->types .identifier ,
3087
- module_list-> children [i]-> children [ 0 ] ->children [0 ]->types .identifier
3087
+ module_var_node ->children [0 ]->types .identifier
3088
3088
);
3089
3089
}
3090
3090
}
@@ -3624,7 +3624,7 @@ void terminate_registered_assignment(ast_node_t *always_node, signal_list_t* ass
3624
3624
int i;
3625
3625
for (i = 0 ; i < potential_clocks->count ; i++)
3626
3626
{
3627
- nnet_t *temp_net;
3627
+ nnet_t *temp_net = NULL ;
3628
3628
/* searching for the clock with no net */
3629
3629
long sc_spot = sc_lookup_string (output_nets_sc, potential_clocks->pins [i]->name );
3630
3630
if (sc_spot == -1 )
@@ -3697,7 +3697,7 @@ void terminate_registered_assignment(ast_node_t *always_node, signal_list_t* ass
3697
3697
3698
3698
/* clean up non-blocking */
3699
3699
if (pin->node && pin->node ->related_ast_node ->type == NON_BLOCKING_STATEMENT) {
3700
- free_nnode (pin->node );
3700
+ pin-> node = free_nnode (pin->node );
3701
3701
}
3702
3702
3703
3703
/* HERE create the ff node and hookup everything */
0 commit comments