Read a circuit netlist in XML format and populate the netlist data structures for VPR
Initializes the block_list with info from a netlist net_file - Name of the netlist file to read num_blocks - number of CLBs in netlist block_list - array of blocks in netlist [0..num_blocks - 1] num_nets - number of nets in netlist net_list - nets in netlist [0..num_nets - 1]
81 struct s_net *ext_nlist;
82 struct s_hash **vpack_net_hash, **logical_block_hash, *temp_hash;
83 char **circuit_inputs, **circuit_outputs, **circuit_clocks;
86 int num_primitives = 0;
89 vpr_printf(TIO_MESSAGE_INFO,
"Begin parsing packed FPGA netlist file.\n");
92 vpr_printf(TIO_MESSAGE_ERROR,
"Unable to load netlist file '%s'.\n", net_file);
95 vpr_printf(TIO_MESSAGE_INFO,
"Finished parsing packed FPGA netlist file.\n");
102 vpr_printf(TIO_MESSAGE_INFO,
"Netlist generated from file '%s'.\n", Prop);
106 if (strcmp(Prop,
"FPGA_packed_netlist[0]") != 0) {
107 vpr_printf(TIO_MESSAGE_ERROR,
"[Line %d] Expected instance to be \"FPGA_packed_netlist[0]\", found %s.",
126 circuit_clocks = NULL;
141 assert(temp_hash->
count == 1);
146 assert(temp_hash->
count == 1);
154 if (0 == strcmp(Cur->
name,
"block")) {
156 processComplexBlock(Cur, blist, i, &num_primitives, arch, vpack_net_hash, logical_block_hash);
166 assert(num_primitives == num_logical_blocks);
171 vpr_printf(TIO_MESSAGE_ERROR,
".blif file and .net file do not match, .net file missing atom %s.\n",
181 &ext_nlist, circuit_clocks);
201 for (i = 0; i < ext_ncount; i++) {
203 assert(temp_hash != NULL);
209 *L_num_blocks = bcount;
211 *L_num_nets = ext_ncount;
212 *net_list = ext_nlist;
struct s_hash ** alloc_hash_table(void)
void FreeTokens(INOUTP char ***TokensPtr)
int * clb_to_vpack_net_mapping
struct s_hash * get_hash_entry(struct s_hash **hash_table, char *name)
void * my_calloc(size_t nelem, size_t size)
static void processComplexBlock(INOUTP ezxml_t Parent, INOUTP t_block *cb, INP int index, INOUTP int *num_primitives, INP const t_arch *arch, INP struct s_hash **vpack_net_hash, INP struct s_hash **logical_block_hash)
void free_hash_table(struct s_hash **hash_table)
ezxml_t ezxml_set_attr(ezxml_t xml, char *name, char *value)
static void * my_malloc(int ibytes)
ezxml_t FindElement(INP ezxml_t Parent, INP const char *Name, INP boolean Required)
int * vpack_to_clb_net_mapping
void FreeNode(INOUTP ezxml_t Node)
static void load_external_nets_and_cb(INP int L_num_blocks, INP struct s_block block_list[], INP int ncount, INP struct s_net nlist[], OUTP int *ext_ncount, OUTP struct s_net **ext_nets, INP char **circuit_clocks)
void CountTokensInString(INP const char *Str, OUTP int *Num, OUTP int *Len)
char ** GetNodeTokens(INP ezxml_t Node)
static void mark_constant_generators(INP int L_num_blocks, INP struct s_block block_list[], INP int ncount, INOUTP struct s_net nlist[])
ezxml_t ezxml_parse_file(const char *file)
int CountChildren(INP ezxml_t Node, INP const char *Name, INP int min_count)
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
void CheckElement(INP ezxml_t Node, INP const char *Name)
const char * FindProperty(INP ezxml_t Parent, INP const char *Name, INP boolean)
struct s_logical_block * logical_block