VPR-6.0
|
Go to the source code of this file.
Functions | |
void | output_clustering (t_block *clb, int num_clusters, boolean global_clocks, boolean *is_clock, char *out_fname, boolean skip_clustering) |
void output_clustering | ( | t_block * | clb, |
int | num_clusters, | ||
boolean | global_clocks, | ||
boolean * | is_clock, | ||
char * | out_fname, | ||
boolean | skip_clustering | ||
) |
This routine dumps out the output netlist in a format suitable for input to vpr. This routine also dumps out the internal structure of the cluster, in essentially a graph based format.
Definition at line 556 of file output_clustering.c.
{ FILE *fpout; int bnum, netnum, column; fpout = fopen(out_fname, "w"); fprintf(fpout, "<block name=\"%s\" instance=\"FPGA_packed_netlist[0]\">\n", out_fname); fprintf(fpout, "\t<inputs>\n\t\t"); column = 2*TAB_LENGTH; /* Organize whitespace to ident data inside block */ for(bnum = 0; bnum < num_logical_blocks; bnum++) { if(logical_block[bnum].type == VPACK_INPAD) { print_string(logical_block[bnum].name, &column, 2, fpout); } } fprintf(fpout, "\n\t</inputs>\n"); fprintf(fpout, "\n\t<outputs>\n\t\t"); column = 2*TAB_LENGTH; for(bnum = 0; bnum < num_logical_blocks; bnum++) { if(logical_block[bnum].type == VPACK_OUTPAD) { print_string(logical_block[bnum].name, &column, 2, fpout); } } fprintf(fpout, "\n\t</outputs>\n"); column = 2*TAB_LENGTH; if(global_clocks) { fprintf(fpout, "\n\t<globals>\n\t\t"); for(netnum = 0; netnum < num_logical_nets; netnum++) { if(is_clock[netnum]) { print_string(vpack_net[netnum].name, &column, 2, fpout); } } fprintf(fpout, "\n\t</globals>\n\n"); } /* Print out all input and output pads. */ for(bnum = 0; bnum < num_logical_blocks; bnum++) { switch (logical_block[bnum].type) { case VPACK_INPAD: case VPACK_OUTPAD: case VPACK_COMB: case VPACK_LATCH: if(skip_clustering) { assert(0); } break; case VPACK_EMPTY: printf("Error in output_netlist -- logical_block %d is VPACK_EMPTY.\n", bnum); exit(1); break; default: printf ("Error in output_netlist. Unexpected type %d for logical_block" "%d.\n", logical_block[bnum].type, bnum); } } if(skip_clustering == FALSE) print_clusters(clb, num_clusters, fpout); fprintf(fpout, "</block>\n\n"); fclose(fpout); print_stats(clb, num_clusters); }