⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 struct.h

📁 用C实现的基于O-tree的ic设计布图布线工具源代码,有相关文档
💻 H
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <malloc.h>#include <math.h>#define MAXLINE 1024#define MAXfloat 214748364700.0#define MAXINT 2147483647#define MININT -2147483647#define HOR 0#define VER 1#define CO1 (double)2.0/* data structures */struct L { /* library entry */  char *name; /* module name */  int w, /* width of module */      h, /* height of module */      n; /* number of pins */  struct LP *lp; /* array of pins */};struct LP { /* pins for library entry */  char *name; /* pin name */  int x, /* x-offset of pin originated to module */      y; /* y-offset of pin originated to module */};struct V { /* block entry (vertex) */  int x, /* x-coordinate of block */      y, /* y-coordinate of block */      n, /* number of pins */      orient, /* orientation of block */      placed; /* flag */  char *name; /* block name */  char *type;  int L;  int w;  int h;  struct L *l; /* pointer to library entry */  struct P **p; /* array of pins */  struct V *contour_next, /* pointer to next contour element */           *contour_prev; /* pointer to previous contour element */  struct V *ot_child, /* pointer to children list */           *ot_tail, /* pointer to last child */           *ot_sibling; /* pointer to sibling */}; struct E { /* net entry (edge) */  int n, /* number of pins */      x, /* y-coordinate of center net */      y, /* x-coordinate of center net */      m, /* number of placed pins */      x1, /* min x in net */      x2, /* max x in net */      y1, /* min y in net */      y2; /* max y in net */  char *name; /* net name */  struct P *p; /* array of pins */};struct P { /* pin entry */  int x, /* x-coordinate of pin */      y; /* y-coordinate of pin */  struct V *v; /* pointer to block */  struct E *e; /* pointer to net */  struct LP *lp; /* pointer to library pin */};struct OT { /* O-Tree structure */  int n, /* number of nodes */      dir, /* tree direction - vertical/horizontal */     *code, /* binary encoding */     *perm, /* permutation */     *orient, /* orientation of nodes */     feasible,     *x, /* x-coordinate of node */     *y; /* y-coordinate of node */};struct Lshape{ int a, b;};struct NodeList{int x, y,w,h;struct V * block;struct NodeList *next;struct NodeList *prev;struct NodeList *child;struct NodeList *parent;struct NodeList *tail;};struct snode{int value;struct snode *next;struct snode *prev;};/* global variables */#ifdef GLOBALint cell_count, pin_count, net_count, lib_count; /* netlist */struct L *lib, *parent;struct LP *lpin;struct V *ver;struct E *edg;struct P *ep, **vp;int nots;struct OT *Hot, *Vot, **ots, *bestOT; /* o-tree */int normArea, normWL;float cost, pCost;int *rtable;int  Ksize, Width, Gap, xybound ;int Korient, Kinsert, area, real_area, wirelen;float Kcost, newp ;struct Lshape *LR, *LL;struct NodeList  froot, *fcurrent, *ccurrent, *HeadFloor, *HeadCeil;int Ainsert, Cinsert;int LR_count, LL_count;#elseextern cell_count, pin_count, net_count, lib_count; /* netlist */extern struct L *lib, *parent;extern struct LP *lpin;extern struct V *ver;extern struct E *edg;extern struct P *ep, **vp;extern int nots;extern struct OT *Hot, *Vot, **ots, *bestOT; /* o-tree */extern int normArea, normWL;extern float cost, pCost;extern int *rtable;extern int  Ksize, Width, Gap, xybound ;extern int Korient, Kinsert, area, real_area, wirelen;extern float Kcost, newp ;extern struct Lshape *LR, *LL;extern struct NodeList  froot, *fcurrent, *ccurrent, *HeadFloor, *HeadCeil;extern int Ainsert, Cinsert;extern int LR_count, LL_count;#endif /* prototypes used cross modules */void read(char *);		/* read.c */int floorplan(struct OT *ot);void rebuild(int delet, int bestindex, int bestinsert, int bestorient);void init();			/* init.c */void compactOts();struct OT *selectBestOts();void freeOts();void compute_area(struct OT *ot);	/* cost.c */void compute_wirelen(struct OT *ot);void compute_wirelen_fix(struct OT *ot);void compute_cost(struct OT *ot );struct OT *otCreate(int);	/* otree.c */struct OT *otCopy(struct OT *);void otDismiss(struct OT *);int otCompact(struct OT *);void delOt(struct OT *ot, int index);int perturb(int b, float pCost);void codeit(struct OT *ot, struct V *v);void pushCeil(struct OT *ot);void peelCeil(int jj, struct OT *ot);int placeCell(struct OT *ot, int j);void placeX(struct OT *ot);int place(struct OT *ot);void createVfloor();void floorCell(struct OT *ot, int j);void Csibling(struct OT *ot);void replaceOts(int a,int c, struct OT *ot);void LLinsert(struct OT *ot, int a, int b);void InsertIIB(int a, int c, struct OT *ot, int index);struct NodeList * Inivfloor();void changeOT(struct OT *ot);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -