VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
output_blif.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_blif (t_block *clb, int num_clusters, boolean global_clocks, boolean *is_clock, const char *out_fname, boolean skip_clustering)
 

Function Documentation

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

Definition at line 489 of file output_blif.c.

490  {
491 
492  /*
493  * This routine dumps out the output netlist in a format suitable for *
494  * input to vpr. This routine also dumps out the internal structure of *
495  * the cluster, in essentially a graph based format. */
496 
497  FILE *fpout;
498  int bnum, column;
499  struct s_linked_vptr *p_io_removed;
500  int i;
501 
502  fpout = my_fopen(out_fname, "w", 0);
503 
504  column = 0;
505  fprintf(fpout, ".model %s\n", blif_circuit_name);
506 
507  /* Print out all input and output pads. */
508  fprintf(fpout, "\n.inputs ");
509  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
510  if (logical_block[bnum].type == VPACK_INPAD) {
511  print_string(logical_block[bnum].name, &column, fpout);
512  }
513  }
514  p_io_removed = circuit_p_io_removed;
515  while (p_io_removed) {
516  print_string((char*) p_io_removed->data_vptr, &column, fpout);
517  p_io_removed = p_io_removed->next;
518  }
519 
520  column = 0;
521  fprintf(fpout, "\n.outputs ");
522  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
523  if (logical_block[bnum].type == VPACK_OUTPAD) {
524  /* remove output prefix "out:" */
525  print_string(logical_block[bnum].name + 4, &column, fpout);
526  }
527  }
528 
529  column = 0;
530 
531  fprintf(fpout, "\n\n");
532 
533  /* print logic of clusters */
534  print_clusters(clb, num_clusters, fpout);
535 
536  /* handle special case: input goes straight to output without going through any logic */
537  for (bnum = 0; bnum < num_logical_blocks; bnum++) {
538  if (logical_block[bnum].type == VPACK_INPAD) {
539  for (i = 1;
540  i
542  i++) {
543  if (logical_block[vpack_net[logical_block[bnum].output_nets[0][0]].node_block[i]].type
544  == VPACK_OUTPAD) {
545  fprintf(fpout, ".names ");
546  print_string(logical_block[bnum].name, &column, fpout);
547  print_string(
548  logical_block[vpack_net[logical_block[bnum].output_nets[0][0]].node_block[i]].name
549  + 4, &column, fpout);
550  fprintf(fpout, "\n1 1\n");
551  }
552  }
553  }
554  }
555 
556  fprintf(fpout, "\n.end\n");
557 
558  fclose(fpout);
559 }
FILE * my_fopen(const char *fname, const char *flag, int prompt)
Definition: util.c:54
struct s_linked_vptr * circuit_p_io_removed
Definition: globals.c:90
char * blif_circuit_name
Definition: globals.c:21
static void print_clusters(t_block *clb, int num_clusters, FILE *fpout)
Definition: output_blif.c:475
static void print_string(const char *str_ptr, int *column, FILE *fpout)
Definition: output_blif.c:25
struct s_linked_vptr * next
Definition: util.h:36
void * data_vptr
Definition: util.h:35
int num_logical_blocks
Definition: globals.c:17
struct s_net * vpack_net
Definition: globals.c:19
int ** output_nets
Definition: vpr_types.h:212
int num_sinks
Definition: vpr_types.h:506
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: