Esempio n. 1
0
/*---------------------------------------------------------------------------------------------
 * (function: combine_nets)
 * 	// output net is a net with a driver
 * 	// input net is a net with all the fanouts
 * 	The lasting one is input, and output disappears
 *-------------------------------------------------------------------------------------------*/
void combine_nets(nnet_t *output_net, nnet_t* input_net, netlist_t *netlist)
{

	/* copy the driver over to the new_net */	
	if (output_net->driver_pin)
	{
		/* IF - there is a pin assigned to this net, then copy it */
		add_driver_pin_to_net(input_net, output_net->driver_pin);
	}
	/* in case there are any fanouts in output net (should only be zero and one nodes */
	join_nets(input_net, output_net);
	/* mark that this is combined */
	input_net->combined = TRUE;
	
	/* special cases for global nets */
	if (output_net == netlist->zero_net) 
	{
		netlist->zero_net = input_net;
	}
	else if (output_net == netlist->one_net)
	{
		netlist->one_net = input_net;
	}

	/* free the driver net */	
	free_nnet(output_net);
}
Esempio n. 2
0
/*---------------------------------------------------------------------------------------------
 * (function: instantiate_buffer )
 * 	Buffers just pass through signals
 *-------------------------------------------------------------------------------------------*/
void instantiate_buffer(nnode_t *node, short mark, netlist_t *netlist)
{
	int width = node->num_input_pins;
	int i;

	/* for now we just pass the signals dierectly through */
	for (i = 0; i < width; i++)
	{
		int idx_2_buffer = node->input_pins[i]->pin_net_idx;

		/* join all fanouts of the output net with the input pins net */
		join_nets(node->input_pins[i]->net, node->output_pins[i]->net);

		/* erase the pointer to this buffer */
		node->input_pins[i]->net->fanout_pins[idx_2_buffer] = NULL;
	}
}