#include "types.h"
Go to the source code of this file.
Functions | |
nnode_t * | make_not_gate_with_input (npin_t *input_pin, nnode_t *node, short mark) |
nnode_t * | make_1port_logic_gate_with_inputs (operation_list type, int width, signal_list_t *pin_list, nnode_t *node, short mark) |
nnode_t * | make_2port_logic_gates_with_inputs (operation_list type, int width_port1, signal_list_t *pin_list1, int width_port2, signal_list_t *pin_list2, nnode_t *node, short mark) |
nnode_t * | make_not_gate (nnode_t *node, short mark) |
nnode_t * | make_1port_logic_gate (operation_list type, int width, nnode_t *node, short mark) |
nnode_t * | make_1port_gate (operation_list type, int width_input, int width_output, nnode_t *node, short mark) |
nnode_t * | make_2port_gate (operation_list type, int width_port1, int width_port2, int width_output, nnode_t *node, short mark) |
nnode_t * | make_3port_gate (operation_list type, int width_port1, int width_port2, int width_port3, int width_output, nnode_t *node, short mark) |
npin_t * | get_a_zero_pin () |
npin_t * | get_a_one_pin () |
char * | node_name_based_on_op (nnode_t *node) |
char * | node_name (nnode_t *node, char *instance_prefix_name) |
char * | hard_node_name (nnode_t *node, char *instance_name_prefix, char *hb_name, char *hb_inst) |
nnode_t * | make_mult_block (nnode_t *node, short mark) |
npin_t* get_a_one_pin | ( | ) |
npin_t* get_a_zero_pin | ( | ) |
char* hard_node_name | ( | nnode_t * | node, | |
char * | instance_name_prefix, | |||
char * | hb_name, | |||
char * | hb_inst | |||
) |
Definition at line 409 of file node_creation_library.c.
00410 { 00411 char *return_node_name; 00412 00413 /* create the unique name for this node */ 00414 return_node_name = make_full_ref_name(instance_name_prefix, hb_name, hb_inst, NULL, -1); 00415 00416 unique_node_name_id ++; 00417 00418 return return_node_name; 00419 }
nnode_t* make_1port_gate | ( | operation_list | type, | |
int | width_input, | |||
int | width_output, | |||
nnode_t * | node, | |||
short | mark | |||
) |
Definition at line 115 of file node_creation_library.c.
00116 { 00117 nnode_t *logic_node; 00118 00119 logic_node = allocate_nnode(); 00120 logic_node->traverse_visited = mark; 00121 logic_node->type = type; 00122 logic_node->name = node_name(logic_node, node->name); 00123 logic_node->related_ast_node = node->related_ast_node; 00124 00125 /* add the input ports as needed */ 00126 allocate_more_node_input_pins(logic_node, width_input); 00127 add_input_port_information(logic_node, width_input); 00128 /* add output */ 00129 allocate_more_node_output_pins(logic_node, width_output); 00130 add_output_port_information(logic_node, width_output); 00131 00132 return logic_node; 00133 }
nnode_t* make_1port_logic_gate | ( | operation_list | type, | |
int | width, | |||
nnode_t * | node, | |||
short | mark | |||
) |
Definition at line 138 of file node_creation_library.c.
00139 { 00140 nnode_t *logic_node; 00141 00142 logic_node = make_1port_gate(type, width, 1, node, mark); 00143 00144 return logic_node; 00145 }
nnode_t* make_1port_logic_gate_with_inputs | ( | operation_list | type, | |
int | width, | |||
signal_list_t * | pin_list, | |||
nnode_t * | node, | |||
short | mark | |||
) |
Definition at line 151 of file node_creation_library.c.
00152 { 00153 nnode_t *logic_node; 00154 int i; 00155 00156 logic_node = make_1port_gate(type, width, 1, node, mark); 00157 00158 /* hookup all the pins */ 00159 for (i = 0; i < width; i++) 00160 { 00161 add_a_input_pin_to_node_spot_idx(logic_node, pin_list->signal_list[i], i); 00162 } 00163 00164 return logic_node; 00165 }
nnode_t* make_2port_gate | ( | operation_list | type, | |
int | width_port1, | |||
int | width_port2, | |||
int | width_output, | |||
nnode_t * | node, | |||
short | mark | |||
) |
Definition at line 198 of file node_creation_library.c.
00199 { 00200 nnode_t *logic_node = allocate_nnode(); 00201 logic_node->traverse_visited = mark; 00202 logic_node->type = type; 00203 logic_node->name = node_name(logic_node, node->name); 00204 logic_node->related_ast_node = node->related_ast_node; 00205 00206 /* add the input ports as needed */ 00207 allocate_more_node_input_pins(logic_node, width_port1); 00208 add_input_port_information(logic_node, width_port1); 00209 allocate_more_node_input_pins(logic_node, width_port2); 00210 add_input_port_information(logic_node, width_port2); 00211 /* add output */ 00212 allocate_more_node_output_pins(logic_node, width_output); 00213 add_output_port_information(logic_node, width_output); 00214 00215 return logic_node; 00216 }
nnode_t* make_2port_logic_gates_with_inputs | ( | operation_list | type, | |
int | width_port1, | |||
signal_list_t * | pin_list1, | |||
int | width_port2, | |||
signal_list_t * | pin_list2, | |||
nnode_t * | node, | |||
short | mark | |||
) |
nnode_t* make_3port_gate | ( | operation_list | type, | |
int | width_port1, | |||
int | width_port2, | |||
int | width_port3, | |||
int | width_output, | |||
nnode_t * | node, | |||
short | mark | |||
) |
Definition at line 171 of file node_creation_library.c.
00172 { 00173 nnode_t *logic_node = allocate_nnode(); 00174 logic_node->traverse_visited = mark; 00175 logic_node->type = type; 00176 logic_node->name = node_name(logic_node, node->name); 00177 logic_node->related_ast_node = node->related_ast_node; 00178 00179 /* add the input ports as needed */ 00180 allocate_more_node_input_pins(logic_node, width_port1); 00181 add_input_port_information(logic_node, width_port1); 00182 allocate_more_node_input_pins(logic_node, width_port2); 00183 add_input_port_information(logic_node, width_port2); 00184 allocate_more_node_input_pins(logic_node, width_port3); 00185 add_input_port_information(logic_node, width_port3); 00186 /* add output */ 00187 allocate_more_node_output_pins(logic_node, width_output); 00188 add_output_port_information(logic_node, width_output); 00189 00190 return logic_node; 00191 }
Definition at line 441 of file node_creation_library.c.
00442 { 00443 nnode_t *logic_node; 00444 00445 logic_node = allocate_nnode(); 00446 logic_node->traverse_visited = mark; 00447 logic_node->type = MULTIPLY; 00448 logic_node->name = node_name(logic_node, node->name); 00449 logic_node->related_ast_node = node->related_ast_node; 00450 logic_node->input_port_sizes = node->input_port_sizes; 00451 logic_node->num_input_port_sizes = node->num_input_port_sizes; 00452 logic_node->output_port_sizes = node->output_port_sizes; 00453 logic_node->num_output_port_sizes = node->num_output_port_sizes; 00454 00455 allocate_more_node_input_pins(logic_node, node->num_input_pins); 00456 allocate_more_node_output_pins(logic_node, node->num_output_pins); 00457 00458 return logic_node; 00459 }
Definition at line 94 of file node_creation_library.c.
00095 { 00096 nnode_t *logic_node; 00097 00098 logic_node = allocate_nnode(); 00099 logic_node->traverse_visited = mark; 00100 logic_node->type = LOGICAL_NOT; 00101 logic_node->name = node_name(logic_node, node->name); 00102 logic_node->related_ast_node = node->related_ast_node; 00103 00104 allocate_more_node_input_pins(logic_node, 1); 00105 allocate_more_node_output_pins(logic_node, 1); 00106 00107 return logic_node; 00108 00109 }
Definition at line 77 of file node_creation_library.c.
00078 { 00079 nnode_t *logic_node; 00080 00081 logic_node = make_not_gate(node, mark); 00082 00083 /* add the input ports as needed */ 00084 add_a_input_pin_to_node_spot_idx(logic_node, input_pin, 0); 00085 00086 return logic_node; 00087 00088 }
char* node_name | ( | nnode_t * | node, | |
char * | instance_prefix_name | |||
) |
Definition at line 425 of file node_creation_library.c.
00426 { 00427 char *return_node_name; 00428 00429 /* create the unique name for this node */ 00430 return_node_name = make_full_ref_name(instance_name_prefix, NULL, NULL, node_name_based_on_op(node), unique_node_name_id); 00431 00432 unique_node_name_id ++; 00433 00434 return return_node_name; 00435 }
char* node_name_based_on_op | ( | nnode_t * | node | ) |
Definition at line 266 of file node_creation_library.c.
00267 { 00268 char *return_string; 00269 00270 switch(node->type) 00271 { 00272 case MULTI_PORT_MUX: 00273 return_string = MULTI_PORT_MUX_string; 00274 break; 00275 case FF_NODE: 00276 return_string = FF_NODE_string; 00277 break; 00278 case BUF_NODE: 00279 return_string = BUF_NODE_string; 00280 break; 00281 case CLOCK_NODE: 00282 return_string = CLOCK_NODE_string; 00283 break; 00284 case INPUT_NODE: 00285 return_string = INPUT_NODE_string; 00286 break; 00287 case OUTPUT_NODE: 00288 return_string = OUTPUT_NODE_string; 00289 break; 00290 case GND_NODE: 00291 return_string = GND_NODE_string; 00292 break; 00293 case VCC_NODE: 00294 return_string = VCC_NODE_string; 00295 break; 00296 case ADD: 00297 return_string = ADD_string; 00298 break; 00299 case MINUS: 00300 return_string = MINUS_string; 00301 break; 00302 case BITWISE_NOT: 00303 return_string = BITWISE_NOT_string; 00304 break; 00305 case BITWISE_AND: 00306 return_string = BITWISE_AND_string; 00307 break; 00308 case BITWISE_OR: 00309 return_string = BITWISE_OR_string; 00310 break; 00311 case BITWISE_NAND: 00312 return_string = BITWISE_NAND_string; 00313 break; 00314 case BITWISE_NOR: 00315 return_string = BITWISE_NOR_string; 00316 break; 00317 case BITWISE_XNOR: 00318 return_string = BITWISE_XNOR_string; 00319 break; 00320 case BITWISE_XOR: 00321 return_string = BITWISE_XOR_string; 00322 break; 00323 case LOGICAL_NOT: 00324 return_string = LOGICAL_NOT_string; 00325 break; 00326 case LOGICAL_OR: 00327 return_string = LOGICAL_OR_string; 00328 break; 00329 case LOGICAL_AND: 00330 return_string = LOGICAL_AND_string; 00331 break; 00332 case LOGICAL_NOR: 00333 return_string = LOGICAL_NOR_string; 00334 break; 00335 case LOGICAL_NAND: 00336 return_string = LOGICAL_NAND_string; 00337 break; 00338 case LOGICAL_XOR: 00339 return_string = LOGICAL_XOR_string; 00340 break; 00341 case LOGICAL_XNOR: 00342 return_string = LOGICAL_XNOR_string; 00343 break; 00344 case MULTIPLY: 00345 return_string = MULTIPLY_string; 00346 break; 00347 case DIVIDE: 00348 return_string = DIVIDE_string; 00349 break; 00350 case MODULO: 00351 return_string = MODULO_string; 00352 break; 00353 case LT: 00354 return_string = LT_string; 00355 break; 00356 case GT: 00357 return_string = GT_string; 00358 break; 00359 case LOGICAL_EQUAL: 00360 return_string = LOGICAL_EQUAL_string; 00361 break; 00362 case NOT_EQUAL: 00363 return_string = NOT_EQUAL_string; 00364 break; 00365 case LTE: 00366 return_string = LTE_string; 00367 break; 00368 case GTE: 00369 return_string = GTE_string; 00370 break; 00371 case SR: 00372 return_string = SR_string; 00373 break; 00374 case SL: 00375 return_string = SL_string; 00376 break; 00377 case CASE_EQUAL: 00378 return_string = CASE_EQUAL_string; 00379 break; 00380 case CASE_NOT_EQUAL: 00381 return_string = CASE_NOT_EQUAL_string; 00382 break; 00383 case ADDER_FUNC: 00384 return_string = ADDER_FUNC_string; 00385 break; 00386 case CARRY_FUNC: 00387 return_string = CARRY_FUNC_string; 00388 break; 00389 case MUX_2: 00390 return_string = MUX_2_string; 00391 break; 00392 case MEMORY: 00393 return_string = MEMORY_string; 00394 break; 00395 case HARD_IP: 00396 return_string = HARD_IP_string; 00397 break; 00398 default: 00399 oassert(FALSE); 00400 break; 00401 } 00402 return return_string; 00403 }