VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
output_clustering.h File Reference
+ This graph shows which files directly or indirectly include this file:

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)
 

Function Documentation

void output_clustering ( t_block clb,
int  num_clusters,
boolean  global_clocks,
boolean is_clock,
char *  out_fname,
boolean  skip_clustering 
)

Definition at line 530 of file output_clustering.c.

531  {
532 
533  /*
534  * This routine dumps out the output netlist in a format suitable for *
535  * input to vpr. This routine also dumps out the internal structure of *
536  * the cluster, in essentially a graph based format. */
537 
538  FILE *fpout;
539  int bnum, netnum, column;
540 
541  fpout = fopen(out_fname, "w");
542 
543  fprintf(fpout, "<block name=\"%s\" instance=\"FPGA_packed_netlist[0]\">\n",
544  out_fname);
545  fprintf(fpout, "\t<inputs>\n\t\t");
546 
547  column = 2 * TAB_LENGTH; /* Organize whitespace to ident data inside block */
548  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
549  if (logical_block[bnum].type == VPACK_INPAD) {
550  print_string(logical_block[bnum].name, &column, 2, fpout);
551  }
552  }
553  fprintf(fpout, "\n\t</inputs>\n");
554  fprintf(fpout, "\n\t<outputs>\n\t\t");
555 
556  column = 2 * TAB_LENGTH;
557  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
558  if (logical_block[bnum].type == VPACK_OUTPAD) {
559  print_string(logical_block[bnum].name, &column, 2, fpout);
560  }
561  }
562  fprintf(fpout, "\n\t</outputs>\n");
563 
564  column = 2 * TAB_LENGTH;
565  if (global_clocks) {
566  fprintf(fpout, "\n\t<clocks>\n\t\t");
567 
568  for (netnum = 0; netnum < num_logical_nets; netnum++) {
569  if (is_clock[netnum]) {
570  print_string(vpack_net[netnum].name, &column, 2, fpout);
571  }
572  }
573  fprintf(fpout, "\n\t</clocks>\n\n");
574  }
575 
576  /* Print out all input and output pads. */
577 
578  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
579  switch (logical_block[bnum].type) {
580  case VPACK_INPAD:
581  case VPACK_OUTPAD:
582  case VPACK_COMB:
583  case VPACK_LATCH:
584  if (skip_clustering) {
585  assert(0);
586  }
587  break;
588 
589  case VPACK_EMPTY:
590  vpr_printf(TIO_MESSAGE_ERROR, "in output_netlist: logical_block %d is VPACK_EMPTY.\n",
591  bnum);
592  exit(1);
593  break;
594 
595  default:
596  vpr_printf(TIO_MESSAGE_ERROR, "in output_netlist: Unexpected type %d for logical_block %d.\n",
597  logical_block[bnum].type, bnum);
598  }
599  }
600 
601  if (skip_clustering == FALSE)
602  print_clusters(clb, num_clusters, fpout);
603 
604  fprintf(fpout, "</block>\n\n");
605 
606  fclose(fpout);
607 
608  print_stats(clb, num_clusters);
609 }
static void print_clusters(t_block *clb, int num_clusters, FILE *fpout)
static void print_string(const char *str_ptr, int *column, int num_tabs, FILE *fpout)
int num_logical_nets
Definition: globals.c:17
static void print_stats(t_block *clb, int num_clusters)
Definition: util.h:12
int num_logical_blocks
Definition: globals.c:17
struct s_net * vpack_net
Definition: globals.c:19
messagelogger vpr_printf
Definition: util.c:17
#define TAB_LENGTH
struct s_logical_block * logical_block
Definition: globals.c:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function: