@@ -554,7 +554,7 @@ void instantiate_bitwise_logic(nnode_t *node, operation_list op, short mark, net
554
554
int i, j;
555
555
556
556
operation_list cell_op;
557
-
557
+ if (!node) return ;
558
558
oassert (node->num_input_pins > 0 );
559
559
oassert (node->num_input_port_sizes >= 2 );
560
560
@@ -778,7 +778,7 @@ void instantiate_GT(nnode_t *node, operation_list type, short mark, netlist_t *n
778
778
int port_A_index;
779
779
int port_B_index;
780
780
int index = 0 ;
781
- nnode_t *xor_gate;
781
+ nnode_t *xor_gate= NULL ;
782
782
nnode_t *logical_or_gate;
783
783
nnode_t **or_cells;
784
784
nnode_t **gt_cells;
@@ -816,8 +816,12 @@ void instantiate_GT(nnode_t *node, operation_list type, short mark, netlist_t *n
816
816
node_name_based_on_op (node));
817
817
}
818
818
819
- /* xor gate identifies if any bits don't match */
820
- xor_gate = make_2port_gate (LOGICAL_XOR, width_a-1 , width_b-1 , width_max-1 , node, mark);
819
+ if (width_max>1 )
820
+ {
821
+ /* xor gate identifies if any bits don't match */
822
+ xor_gate = make_2port_gate (LOGICAL_XOR, width_a-1 , width_b-1 , width_max-1 , node, mark);
823
+ }
824
+
821
825
/* collects all the GT signals and determines if gt */
822
826
logical_or_gate = make_1port_logic_gate (LOGICAL_OR, width_max, node, mark);
823
827
/* collects a chain if any 1 happens than the GT cells output 0 */
@@ -882,9 +886,12 @@ void instantiate_GT(nnode_t *node, operation_list type, short mark, netlist_t *n
882
886
/* deal with the first greater than test which autom gets a zero */
883
887
add_input_pin_to_node (or_cells[i], get_zero_pin (netlist), 1 );
884
888
}
889
+ if (width_max>1 )
890
+ {
891
+ /* get all the equals with the or gates */
892
+ connect_nodes (xor_gate, i, or_cells[i], 0 );
893
+ }
885
894
886
- /* get all the equals with the or gates */
887
- connect_nodes (xor_gate, i, or_cells[i], 0 );
888
895
connect_nodes (or_cells[i], 0 , gt_cells[i], 2 );
889
896
890
897
}
@@ -906,9 +913,12 @@ void instantiate_GT(nnode_t *node, operation_list type, short mark, netlist_t *n
906
913
/* join that gate to the output */
907
914
remap_pin_to_new_node (node->output_pins [0 ], logical_or_gate, 0 );
908
915
oassert (logical_or_gate->num_output_pins == 1 );
909
-
910
- instantiate_bitwise_logic (xor_gate, BITWISE_XOR, mark, netlist);
911
- vtr::free (xor_gate);
916
+ if (xor_gate!= NULL )
917
+ {
918
+ instantiate_bitwise_logic (xor_gate, BITWISE_XOR, mark, netlist);
919
+ vtr::free (xor_gate);
920
+ }
921
+
912
922
vtr::free (gt_cells);
913
923
vtr::free (or_cells);
914
924
}
0 commit comments