/*---------------------------------------------------------------------------------------------
 * (function: allocate_npin)
 *-------------------------------------------------------------------------------------------*/
npin_t* allocate_npin() {
	npin_t *new_pin;

	new_pin = (npin_t *)my_malloc_struct(sizeof(npin_t));
	
	new_pin->name = NULL;
	new_pin->type = NO_ID;
	new_pin->net = NULL;
	new_pin->pin_net_idx = -1;
	new_pin->node = NULL;
	new_pin->pin_node_idx = -1;
	new_pin->mapping = NULL;
	
	new_pin->cycle  = NULL;
	new_pin->values = NULL;

	new_pin->coverage = 0;

	new_pin->is_default = FALSE;
	new_pin->is_implied = FALSE;

	new_pin->ace_info = NULL;

	return new_pin;
}
Beispiel #2
0
chain_information_t* allocate_chain_info()
{
	chain_information_t *new_node;

	new_node = (chain_information_t *)my_malloc_struct(sizeof(chain_information_t));

	new_node->name = NULL;
	new_node->count = 0;

	return new_node;
}
/*---------------------------------------------------------------------------------------------
 * (function: allocate_nnode)
 *-------------------------------------------------------------------------------------------*/
nnode_t* allocate_nnode() {
	nnode_t *new_node;

	new_node = (nnode_t *)my_malloc_struct(sizeof(nnode_t));
	
	new_node->name = NULL;
	new_node->type = NO_OP;
	new_node->bit_width = 0;
	new_node->related_ast_node = NULL;
	new_node->traverse_visited = -1;

	new_node->input_pins = NULL;
	new_node->num_input_pins = 0;
	new_node->output_pins = NULL;
	new_node->num_output_pins = 0;
	
	new_node->input_port_sizes = NULL;
	new_node->num_input_port_sizes = 0;
	new_node->output_port_sizes = NULL;
	new_node->num_output_port_sizes = 0;

	new_node->node_data = NULL;
	new_node->unique_node_data_id = -1;

	new_node->forward_level = -1;
	new_node->backward_level = -1;
	new_node->sequential_level = -1;
	new_node->sequential_terminator = FALSE;

	new_node->internal_netlist = NULL;

	new_node->associated_function = NULL;

	new_node->simulate_block_cycle = NULL;
	new_node->memory_data = NULL;
	
	new_node->bit_map= NULL;
	new_node->bit_map_line_count=0;

	new_node->in_queue = FALSE;

	new_node->undriven_pins = 0;
	new_node->num_undriven_pins = 0;

	new_node->ratio = 1;
	
	new_node->has_initial_value = FALSE;
	new_node->initial_value = 0;
	

	return new_node;
}
Beispiel #4
0
/*---------------------------------------------------------------------------------------------
 * (function: allocate_nnet)
 *-------------------------------------------------------------------------------------------*/
nnet_t* allocate_nnet()
{
	nnet_t *new_net;

	new_net = (nnet_t*)my_malloc_struct(sizeof(nnet_t));
	
	new_net->name = NULL;
	new_net->driver_pin = NULL;
	new_net->fanout_pins = NULL;
	new_net->num_fanout_pins = 0;
	new_net->combined = FALSE;

	new_net->net_data = NULL;
	new_net->unique_net_data_id = -1;

	return new_net;
}
Beispiel #5
0
/*---------------------------------------------------------------------------------------------
 * (function:  allocate_netlist)
 *-------------------------------------------------------------------------------------------*/
netlist_t* allocate_netlist()
{
	netlist_t *new_netlist;

	new_netlist = (netlist_t *)my_malloc_struct(sizeof(netlist_t));

	new_netlist->gnd_node = NULL;
	new_netlist->vcc_node = NULL;
	new_netlist->pad_node = NULL;
	new_netlist->zero_net = NULL;
	new_netlist->one_net = NULL;
	new_netlist->pad_net = NULL;
	new_netlist->top_input_nodes = NULL;
	new_netlist->num_top_input_nodes = 0;
	new_netlist->top_output_nodes = NULL;
	new_netlist->num_top_output_nodes = 0;
	new_netlist->ff_nodes = NULL;
	new_netlist->num_ff_nodes = 0;
	new_netlist->internal_nodes = NULL;
	new_netlist->num_internal_nodes = 0;
	new_netlist->clocks = NULL;
	new_netlist->num_clocks = 0;

	new_netlist->forward_levels = NULL;
	new_netlist->num_forward_levels = 0;
	new_netlist->num_at_forward_level = NULL;
	new_netlist->backward_levels = NULL; 
	new_netlist->num_backward_levels = 0;
	new_netlist->num_at_backward_level = NULL;
	new_netlist->sequential_level_nodes = NULL; 
	new_netlist->num_sequential_levels = 0;
	new_netlist->num_at_sequential_level = NULL;
	new_netlist->sequential_level_combinational_termination_node = NULL;
	new_netlist->num_sequential_level_combinational_termination_nodes = 0;
	new_netlist->num_at_sequential_level_combinational_termination_node = NULL;

	/* initialize the string chaches */
	new_netlist->nets_sc = sc_new_string_cache();
	new_netlist->out_pins_sc = sc_new_string_cache();
	new_netlist->nodes_sc = sc_new_string_cache();

	new_netlist->stats = NULL;

	return new_netlist;
}