#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "place_base.h"
Go to the source code of this file.
Definition at line 294 of file place_test.c.
295 int n, t, t2, count = 0;
302 if (net->
m_terms[t] == cell) count++;
309 if (old[t] != cell) net->
m_terms[t2++] = old[t];
ConcreteNet ** g_place_concreteNets
ABC_NAMESPACE_IMPL_START int g_place_numCells
Definition at line 38 of file place_test.c.
struct hash_element * next
int hash_string(int hash_max, const char *str)
Definition at line 49 of file place_test.c.
struct hash_element * next
int hash_string(int hash_max, const char *str)
int hash_string |
( |
int |
hash_max, |
|
|
const char * |
str |
|
) |
| |
Definition at line 30 of file place_test.c.
31 unsigned int hash = 0;
33 for(p = 0; p<
strlen(str); p++)
35 return hash % hash_max;
static uint32_t hash(uint32_t x)
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 316 of file place_test.c.
319 printf(
"Usage: %s [nodes] [nets] [pl]\n", argv[0]);
void readBookshelfNodes(char *filename)
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
struct hash_element ** hash_cellname
void readBookshelfNets(char *filename)
void globalIncremental()
Performs analytic placement using a GORDIAN-like algorithm.
void globalPreplace(float utilization)
Place pad ring, leaving a core area to meet a desired utilization.
void readBookshelfPlacement(char *filename)
void writeBookshelfPlacement(char *filename)
void readBookshelfNets |
( |
char * |
filename | ) |
|
Definition at line 79 of file place_test.c.
82 const char *DELIMITERS =
" \n\t:";
87 FILE *netsFile = fopen(
filename,
"r");
89 printf(
"ERROR: Could not open .nets file\n");
94 while (fgets(buf, 1024, netsFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
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);
105 while (fgets(buf, 1024, netsFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
108 while(fgets(buf, 1024, netsFile)) {
109 if (buf[0] ==
'\n' || buf[0] ==
'#')
continue;
114 tok =
strtok(buf, DELIMITERS);
115 if (!!
strcmp(tok,
"NetDegree")) {
117 printf(
"ERROR: Incorrect format in .nets file\n");
121 tok =
strtok(NULL, DELIMITERS);
125 printf(
"ERROR: Bad net degree\n");
134 fgets(buf, 1024, netsFile)) {
135 if (buf[0] ==
'\n' || buf[0] ==
'#')
continue;
138 tok =
strtok(buf, DELIMITERS);
141 printf(
"ERROR: Could not find cell %s in .nodes file\n", tok);
ConcreteNet * concreteNets
ConcreteCell * hash_find(struct hash_element **hash, int hash_max, const char *str)
void addConcreteNet(ConcreteNet *net)
Adds a net to the placement database.
struct hash_element ** hash_cellname
void readBookshelfNodes |
( |
char * |
filename | ) |
|
Definition at line 157 of file place_test.c.
160 const char *DELIMITERS =
" \n\t:";
163 FILE *nodesFile = fopen(
filename,
"r");
165 printf(
"ERROR: Could not open .nodes file\n");
170 while (fgets(buf, 1024, nodesFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
173 while (fgets(buf, 1024, nodesFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
174 tok =
strtok(buf, DELIMITERS);
175 tok =
strtok(NULL, DELIMITERS);
177 printf(
"READ-10 : number of cells = %d\n",
numCells);
183 while (fgets(buf, 1024, nodesFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
186 while(fgets(buf, 1024, nodesFile)) {
187 if (buf[0] ==
'\n' || buf[0] ==
'#')
continue;
189 tok =
strtok(buf, DELIMITERS);
201 tok =
strtok(NULL, DELIMITERS);
203 tok =
strtok(NULL, DELIMITERS);
205 tok =
strtok(NULL, DELIMITERS);
struct hash_element ** hash_cellname
AbstractCell * abstractCells
void addConcreteCell(ConcreteCell *cell)
ConcreteCell * concreteCells
void hash_add(struct hash_element **hash, int hash_max, ConcreteCell *cell)
void readBookshelfPlacement |
( |
char * |
filename | ) |
|
Definition at line 224 of file place_test.c.
227 const char *DELIMITERS =
" \n\t:";
230 FILE *plFile = fopen(
filename,
"r");
231 FILE *netsFile = fopen(
filename,
"r");
233 printf(
"ERROR: Could not open .pl file\n");
237 printf(
"ERROR: Could not open .nets file\n");
242 while (fgets(buf, 1024, plFile) && (buf[0] ==
'\n' || buf[0] ==
'#'));
245 while(fgets(buf, 1024, plFile)) {
246 if (buf[0] ==
'\n' || buf[0] ==
'#')
continue;
248 tok =
strtok(buf, DELIMITERS);
253 printf(
"ERROR: Could not find cell %s in .nodes file\n",tok);
258 tok =
strtok(NULL, DELIMITERS);
260 tok =
strtok(NULL, DELIMITERS);
265 (tok =
strtok(NULL, DELIMITERS)) &&
ConcreteCell * hash_find(struct hash_element **hash, int hash_max, const char *str)
struct hash_element ** hash_cellname
void writeBookshelfPlacement |
( |
char * |
filename | ) |
|
Definition at line 272 of file place_test.c.
275 FILE *plFile = fopen(
filename,
"w");
277 printf(
"ERROR: Could not open .pl file\n");
281 fprintf(plFile,
"UCLA pl 1.0\n");
283 fprintf(plFile,
"%s %f %f : N %s\n",
ConcreteCell * concreteCells