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

Go to the source code of this file.

Functions

void check_netlist (void)
 

Function Documentation

void check_netlist ( void  )

Definition at line 37 of file check_netlist.c.

37  {
38  int i, error, num_conn;
39  struct s_hash **net_hash_table, *h_net_ptr;
40 
41  /* TODO: Remove the following the function calls after these functions have
42  been fleshed and are legitimately used in the code!!! They are called here so that
43  the compiler will not throw an error for an unused function */
44 
45  int unused_var;
46  unused_var = check_subblock_internal_nets(0, 0);
47  unused_var = check_primitives(0, 0);
48  if (unused_var)
49  vpr_printf(TIO_MESSAGE_INFO, "Please go to the check_netlist() function in check_netlist.c and remove the first section as needed.");
50 
51  /* This routine checks that the netlist makes sense */
52 
53  net_hash_table = alloc_hash_table();
54 
55  error = 0;
56 
57  /* Check that nets fanout and have a driver. */
58  for (i = 0; i < num_nets; i++) {
59  h_net_ptr = insert_in_hash_table(net_hash_table, clb_net[i].name, i);
60  if (h_net_ptr->count != 1) {
61  vpr_printf(TIO_MESSAGE_ERROR, "Net %s has multiple drivers.\n", clb_net[i].name);
62  error++;
63  }
65  if (error >= ERROR_THRESHOLD) {
66  vpr_printf(TIO_MESSAGE_ERROR, "Too many errors in netlist, exiting.\n");
67  }
68  }
69  free_hash_table(net_hash_table);
70 
71  /* Check that each block makes sense. */
72  for (i = 0; i < num_blocks; i++) {
73  num_conn = get_num_conn(i);
74  error += check_clb_conn(i, num_conn);
75  error += check_clb_internal_nets(i);
76  error += check_subblocks(i);
77  if (error >= ERROR_THRESHOLD) {
78  vpr_printf(TIO_MESSAGE_ERROR, "Too many errors in netlist, exiting.\n");
79  exit(1);
80  }
81  }
82 
83  error += check_for_duplicated_names();
84 
85  if (error != 0) {
86  vpr_printf(TIO_MESSAGE_ERROR, "Found %d fatal Errors in the input netlist.\n", error);
87  exit(1);
88  }
89 
90  /* HACK: Jason Luu January 17, 2011 Do not route common constants gnd and vcc
91  Todo: Need to make architecture driven.
92  */
93  for (i = 0; i < num_nets; i++) {
94  if (strcmp(clb_net[i].name, "vcc") == 0) {
95  clb_net[i].is_global = TRUE;
96  } else if (strcmp(clb_net[i].name, "gnd") == 0) {
97  clb_net[i].is_global = TRUE;
98  }
99  }
100 }
struct s_hash ** alloc_hash_table(void)
Definition: hash.c:7
int count
Definition: hash.h:6
static int check_subblock_internal_nets(int iblk, int isub)
char * name
Definition: hash.h:4
int num_nets
Definition: globals.c:27
int num_blocks
Definition: globals.c:30
#define ERROR_THRESHOLD
Definition: check_netlist.c:15
void free_hash_table(struct s_hash **hash_table)
Definition: hash.c:18
struct s_net * clb_net
Definition: globals.c:28
boolean is_global
Definition: vpr_types.h:510
static int check_subblocks(int iblk)
static int check_for_duplicated_names(void)
static int check_connections_to_global_clb_pins(int inet)
static int get_num_conn(int bnum)
static int check_primitives(int iblk, int isub)
messagelogger vpr_printf
Definition: util.c:17
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
Definition: hash.c:76
static int check_clb_internal_nets(int iblk)
Definition: hash.h:3
Definition: util.h:12
static int check_clb_conn(int iblk, int num_conn)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: