Go to the source code of this file.
Functions | |
void | netlist_stats (netlist_t *netlist, char *path, char *name) |
void netlist_stats | ( | netlist_t * | netlist, | |
char * | path, | |||
char * | name | |||
) |
Definition at line 50 of file netlist_stats.c.
00051 { 00052 FILE *fp; 00053 char path_and_file[4096]; 00054 00055 /* open the file */ 00056 sprintf(path_and_file, "%s/%s", path, name); 00057 fp = fopen(path_and_file, "w"); 00058 00059 /* allocate the stat structure */ 00060 netlist->stats = (netlist_stats_t*)malloc(sizeof(netlist_stats_t)); 00061 netlist->stats->fanin_distribution = NULL; 00062 netlist->stats->num_fanin_distribution = 0; 00063 netlist->stats->fanout_distribution = NULL; 00064 netlist->stats->num_fanout_distribution = 0; 00065 00066 /* collect high-lelve stats */ 00067 netlist->stats->num_inputs = netlist->num_top_input_nodes; 00068 netlist->stats->num_outputs = netlist->num_top_output_nodes; 00069 netlist->stats->num_ff_nodes = netlist->num_ff_nodes; 00070 netlist->stats->num_logic_nodes = netlist->num_internal_nodes; 00071 netlist->stats->num_nodes = netlist->stats->num_inputs + netlist->stats->num_outputs + netlist->stats->num_ff_nodes + netlist->stats->num_logic_nodes; 00072 00073 /* calculate the average fanout */ 00074 calculate_avg_fanout(netlist); 00075 /* calculate the average fanin */ 00076 calculate_avg_fanin(netlist); 00077 /* calculate combinational shape of each sequential level */ 00078 calculate_combinational_shapes(netlist); 00079 00080 /* traverse the netlist looking for the stats */ 00081 depth_first_traverse_stats(fp, STATS, netlist); 00082 00083 display_per_node_stats(fp, netlist); 00084 00085 fclose(fp); 00086 }