79 {
80 char *tok;
81 char buf[1024];
82 const char *DELIMITERS = " \n\t:";
83 int id = 0;
84 int t;
86
87 FILE *netsFile = fopen(
filename,
"r");
88 if (!netsFile) {
89 printf("ERROR: Could not open .nets file\n");
91 }
92
93
94 while (fgets(buf, 1024, netsFile) && (buf[0] == '\n' || buf[0] == '#'));
95
96
97 while (fgets(buf, 1024, netsFile) && (buf[0] == '\n' || buf[0] == '#'));
98 tok =
strtok(buf, DELIMITERS);
99 tok =
strtok(NULL, DELIMITERS);
101 printf(
"READ-20 : number of nets = %d\n",
numNets);
103
104
105 while (fgets(buf, 1024, netsFile) && (buf[0] == '\n' || buf[0] == '#'));
106
107
108 while(fgets(buf, 1024, netsFile)) {
109 if (buf[0] == '\n' || buf[0] == '#') continue;
110
113
114 tok =
strtok(buf, DELIMITERS);
115 if (!!
strcmp(tok,
"NetDegree")) {
116 printf("%s\n",buf);
117 printf("ERROR: Incorrect format in .nets file\n");
119 }
120
121 tok =
strtok(NULL, DELIMITERS);
125 printf("ERROR: Bad net degree\n");
127 }
130
131
132 t = 0;
134 fgets(buf, 1024, netsFile)) {
135 if (buf[0] == '\n' || buf[0] == '#') continue;
136
137
138 tok =
strtok(buf, DELIMITERS);
140 if (!cell) {
141 printf("ERROR: Could not find cell %s in .nodes file\n", tok);
143 }
145 t++;
146 }
147
148
150
151 id++;
152 }
153
154 fclose(netsFile);
155}
void addConcreteNet(ConcreteNet *net)
Adds a net to the placement database.
ConcreteCell * hash_find(struct hash_element **hash, int hash_max, const char *str)
ConcreteNet * concreteNets