#include <stdio.h>
#include <string.h>
#include "util.h"
#include "vpr_types.h"
#include "globals.h"
#include "hash.h"
#include "vpr_utils.h"
#include "check_netlist.h"
#include "assert.h"
#include "read_xml_arch_file.h"
Go to the source code of this file.
#define ERROR_THRESHOLD 100 |
static int check_clb_conn |
( |
int |
iblk, |
|
|
int |
num_conn |
|
) |
| |
|
static |
Definition at line 150 of file check_netlist.c.
154 int iclass, ipin, error;
169 }
else if (num_conn < 2) {
170 vpr_printf(TIO_MESSAGE_WARNING,
"Logic block #%d (%s) has only %d pin.\n",
171 iblk,
block[iblk].name, num_conn);
179 for (ipin = 0; ipin < type->
num_pins; ipin++) {
184 vpr_printf(TIO_MESSAGE_INFO,
"Pin is an input -- this whole block is hanging logic that should be swept in logic synthesis.\n");
185 vpr_printf(TIO_MESSAGE_INFO,
"\tNon-fatal, but check this.\n");
187 vpr_printf(TIO_MESSAGE_INFO,
"Pin is an output -- may be a constant generator.\n");
188 vpr_printf(TIO_MESSAGE_INFO,
"\tNon-fatal, but check this.\n");
201 vpr_printf(TIO_MESSAGE_ERROR,
"logic block #%d with output %s has %d pins.\n",
202 iblk,
block[iblk].name, num_conn);
struct s_class * class_inf
static int check_clb_internal_nets |
( |
int |
iblk | ) |
|
|
static |
TODO: Check if the internal CLB nets makes sense and are connected properly Consists of 3 main loops
- a) Check name uniqueness b) Check all net connections are to CLB pins or subblock pins and that they match the net examined
- Check all connected CLB pins are connected to valid internal nets
- Check all connected subblock pins are connected to valid internal nets and that these match the net indexes
Definition at line 209 of file check_netlist.c.
static int check_connections_to_global_clb_pins |
( |
int |
inet | ) |
|
|
static |
Definition at line 102 of file check_netlist.c.
108 int ipin, num_pins, iblk, node_block_pin, error;
118 for (ipin = 0; ipin < num_pins; ipin++) {
123 if (
block[iblk].type->is_global_pin[node_block_pin]
129 vpr_printf(TIO_MESSAGE_WARNING,
"in check_connections_to_global_clb_pins:\n");
130 vpr_printf(TIO_MESSAGE_WARNING,
"\tnet #%d (%s) is driven by CLB output pin (#%d) on block #%d (%s).\n",
131 inet,
clb_net[inet].name, node_block_pin, iblk,
block[iblk].name);
133 vpr_printf(TIO_MESSAGE_ERROR,
"in check_connections_to_global_clb_pins:\n");
134 vpr_printf(TIO_MESSAGE_ERROR,
"\tpin %d on net #%d (%s) connects to CLB input pin (#%d) on block #%d (%s).\n",
135 ipin, inet,
clb_net[inet].name, node_block_pin, iblk,
block[iblk].name);
140 vpr_printf(TIO_MESSAGE_INFO,
"Net is global, but CLB pin is not.\n");
142 vpr_printf(TIO_MESSAGE_INFO,
"CLB pin is global, but net is not.\n");
static int check_for_duplicated_names |
( |
void |
| ) |
|
|
static |
Definition at line 250 of file check_netlist.c.
252 int iblk, isub, iprim, error;
253 int clb_count, sub_count, prim_count;
254 struct s_hash **clb_hash_table, *clb_h_ptr;
255 struct s_hash **sub_hash_table, *sub_h_ptr;
256 struct s_hash **prim_hash_table, *prim_h_ptr;
262 error = clb_count = sub_count = prim_count = 0;
267 if (clb_h_ptr->
count > 1) {
268 vpr_printf(TIO_MESSAGE_ERROR,
"Block %s has duplicated name.\n",
274 for (isub = 0; isub <
block[iblk].num_subblocks; isub++)
277 if (sub_h_ptr->
count > 1) {
278 vpr_printf(TIO_MESSAGE_ERROR,
"Subblock %s has duplicated name.\n",
284 for (iprim = 0; iprim <
block[iblk].subblocks[isub].num_primitives; iprim++)
287 if (prim_h_ptr->
count > 1) {
288 vpr_printf(TIO_MESSAGE_ERROR,
"Primitive %s has duplicated name.\n",
289 block[iblk].subblocks[isub].primitives[iprim].
name);
struct s_hash ** alloc_hash_table(void)
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
void check_netlist |
( |
void |
| ) |
|
Definition at line 37 of file check_netlist.c.
38 int i, error, num_conn;
39 struct s_hash **net_hash_table, *h_net_ptr;
49 vpr_printf(TIO_MESSAGE_INFO,
"Please go to the check_netlist() function in check_netlist.c and remove the first section as needed.");
60 if (h_net_ptr->
count != 1) {
66 vpr_printf(TIO_MESSAGE_ERROR,
"Too many errors in netlist, exiting.\n");
78 vpr_printf(TIO_MESSAGE_ERROR,
"Too many errors in netlist, exiting.\n");
86 vpr_printf(TIO_MESSAGE_ERROR,
"Found %d fatal Errors in the input netlist.\n", error);
96 }
else if (strcmp(
clb_net[i].name,
"gnd") == 0) {
struct s_hash ** alloc_hash_table(void)
static int check_subblock_internal_nets(int iblk, int isub)
void free_hash_table(struct s_hash **hash_table)
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)
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
static int check_clb_internal_nets(int iblk)
static int check_clb_conn(int iblk, int num_conn)
static int check_primitives |
( |
int |
iblk, |
|
|
int |
isub |
|
) |
| |
|
static |
static int check_subblock_internal_nets |
( |
int |
iblk, |
|
|
int |
isub |
|
) |
| |
|
static |
TODO Check if the internal CLB nets makes sense and are connected properly Consists of 3 main checks
- a) Check name uniqueness b) Check all net connections are to CLB pins or subblock pins and that they match the net examined
- Check all connected CLB pins are connected to valid internal nets
- Check all connected subblock pins are connected to valid internal nets and that these match the net indexes
Definition at line 221 of file check_netlist.c.
static int check_subblocks |
( |
int |
iblk | ) |
|
|
static |
static int get_num_conn |
( |
int |
bnum | ) |
|
|
static |