Skip to content

Commit

Permalink
more tech updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jun 15, 2020
1 parent 10c397a commit a572954
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 33 deletions.
35 changes: 23 additions & 12 deletions act/tech.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ void Technology::Init (const char *s)
ADDGDSBL(mat, diff[j]);

snprintf (buf+k, BUF_SZ-k-1, "%s.width", diff[j]);
mat->width = config_get_int (buf);
int *wt;
wt = new int[1];
wt[0] = config_get_int (buf);
mat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.spacing", diff[j]);
if (config_get_table_size (buf) != sz) {
Expand Down Expand Up @@ -350,7 +353,9 @@ void Technology::Init (const char *s)
if (config_get_int (buf) < 1) {
fatal_error ("`%s': minimum width has to be at least 1", buf);
}
mat->width = config_get_int (buf);
int *wt = new int[1];
wt[0] = config_get_int (buf);
mat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.dummy_poly", diff[j]);
if (config_exists (buf)) {
Expand All @@ -365,7 +370,7 @@ void Technology::Init (const char *s)

snprintf (buf+k, BUF_SZ-k-1, "%s.spacing", diff[j]);
verify_range_table (buf);
mat->spacing = new RangeTable (config_get_table_size (buf),
mat->spacing_w = new RangeTable (config_get_table_size (buf),
config_get_table_int (buf));
}
else if (i < 6) {
Expand Down Expand Up @@ -405,7 +410,9 @@ void Technology::Init (const char *s)
ADDGDSBL(mat, diff[j]+ik+1);

snprintf (buf+k, BUF_SZ-k+1, "%s.width", diff[j]+ik+1);
mat->width = config_get_int (buf);
int *wt = new int[1];
wt[0] = config_get_int (buf);
mat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.spacing", diff[j]+ik+1);
if (config_get_table_size (buf) != sz) {
Expand Down Expand Up @@ -450,7 +457,9 @@ void Technology::Init (const char *s)
if (config_get_int (buf) < 1) {
fatal_error ("`%s': minimum width has to be at least 1", buf);
}
mat->width = config_get_int (buf);
int *wt = new int[1];
wt[0] = config_get_int (buf);
mat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.overhang", ldiff);
if (config_get_int (buf) < 1) {
Expand Down Expand Up @@ -541,11 +550,13 @@ void Technology::Init (const char *s)
if (config_get_int (buf) < 1) {
fatal_error ("%s: minimum width has to be at least 1", buf);
}
pmat->width = config_get_int (buf);
int *wt = new int[1];
wt[0] = config_get_int (buf);
pmat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "spacing");
verify_range_table (buf);
pmat->spacing = new RangeTable (config_get_table_size (buf),
pmat->spacing_w = new RangeTable (config_get_table_size (buf),
config_get_table_int (buf));

/* might need this for gridded technologies */
Expand All @@ -557,7 +568,7 @@ void Technology::Init (const char *s)
pmat->pitch = config_get_int (buf);
}
else {
pmat->pitch = pmat->spacing->min() + pmat->width;
pmat->pitch = pmat->minSpacing() + pmat->minWidth();
}

snprintf (buf+k, BUF_SZ-k-1, "direction");
Expand Down Expand Up @@ -613,10 +624,10 @@ void Technology::Init (const char *s)
snprintf (buf+k, BUF_SZ-k-1, "endofline_width");
if (config_exists (buf)) {
pmat->r.endofline_width = config_get_int (buf);
Assert (pmat->r.endofline_width >= pmat->width, "What?");
Assert (pmat->r.endofline_width >= pmat->minWidth(), "What?");
}
else {
pmat->r.endofline_width = pmat->width;
pmat->r.endofline_width = pmat->minWidth();
}
}
else {
Expand Down Expand Up @@ -710,7 +721,7 @@ void Technology::Init (const char *s)
/* spacing */
snprintf (buf+j, BUF_SZ-j-1, "spacing");
verify_range_table (buf);
mat->spacing = new RangeTable (config_get_table_size (buf),
mat->spacing_w = new RangeTable (config_get_table_size (buf),
config_get_table_int (buf));

/* extra spacing rules */
Expand Down Expand Up @@ -759,7 +770,7 @@ void Technology::Init (const char *s)
mat->pitch = config_get_int (buf);
}
else {
mat->pitch = mat->width->min() + mat->spacing->min();
mat->pitch = mat->width->min() + mat->minSpacing();
}

snprintf (buf+j, BUF_SZ-j-1, "direction");
Expand Down
27 changes: 9 additions & 18 deletions act/tech.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Material {
name = NULL;
}
width = NULL;
spacing = NULL;
spacing_w = NULL;
minarea = 0;
maxarea = 0;
xgrid = 0;
Expand All @@ -114,12 +114,15 @@ class Material {
void addGDSBloat (int *table, int sz);

const char *viaUpName();
int minArea() { return minarea; }
int minWidth () { return width->min(); }
int minSpacing() { return spacing_w->min(); }

protected:
const char *name; /* drawing name in magic */

RangeTable *width; /* min width (indexed by length) */
RangeTable *spacing; /* min spacing (indexed by width) */
RangeTable *spacing_w; /* min spacing (indexed by width) */

int runlength_mode; // 0 = parallelrunlength, 1 = twowidths
int runlength; // negative if it doesn't exist;
Expand Down Expand Up @@ -160,22 +163,19 @@ struct RoutingRules {
class RoutingMat : public Material {
public:
RoutingMat (char *s) { name = s; r.influence = NULL; r.inf_sz = 0; }
int minWidth () { return width->min(); }
int minArea() { return minarea; }
int minSpacing() { return spacing->min(); }
int getPitch() { return pitch; }
Contact *getUpC() { return viaup; }
int getSpacing(int w) { return (*spacing)[w]; }
int getSpacing(int w) { return (*spacing_w)[w]; }
int isComplexSpacing() {
if (runlength != -1) return 1;
if (spacing->size() > 1) return 1;
if (spacing_w->size() > 1) return 1;
return 0;
}
int complexSpacingMode() { return runlength_mode; }
int numRunLength() { return runlength; }
int getRunLength(int w) { return parallelrunlength[w]; }
RangeTable *getRunTable (int w) {
if (w == 0) { return spacing; }
if (w == 0) { return spacing_w; }
else { return spacing_aux[w-1]; }
}
int getEol() { return r.endofline; }
Expand Down Expand Up @@ -203,8 +203,6 @@ class PolyMat : public RoutingMat {


protected:
int width;

RangeTable *overhang; /* poly overhang beyond diffusion */
RangeTable *notch_overhang; /* overhang for a notch */
int *via_n; /* spacing of poly via to n-type diff */
Expand All @@ -217,10 +215,9 @@ class FetMat : public Material {
public:
FetMat (char *s) { name = s; }
int getSpacing (int w) {
return (*spacing)[w];
return (*spacing_w)[w];
}
protected:
int width;
int num_dummy; /* # of dummy poly needed */

friend class Technology;
Expand All @@ -232,14 +229,11 @@ class WellMat : public Material {
WellMat (char *s) { name = s; }
int getOverhang () { return overhang; }
int getOverhangWelldiff () { return overhang_welldiff; }
int minArea () { return minarea; }
int minSpacing(int dev) { return spacing[dev]; }
int oppSpacing(int dev) { return oppspacing[dev]; }
int minWidth() { return width; }
int maxPlugDist() { return plug_dist; }

protected:
int width;
int *spacing; /* to other wells of the same type */
int *oppspacing; /* to other wells of a different type */
int overhang; /* overhang from diffusion */
Expand All @@ -259,17 +253,14 @@ class DiffMat : public Material {
int effOverhang(int w, int hasvia = 0);
int viaSpaceEdge ();
int viaSpaceMid ();
int minArea () { return minarea; }
int getPolySpacing () { return polyspacing; }
int getNotchSpacing () { return notchspacing; }
int getOppDiffSpacing (int flavor) { return oppspacing[flavor]; }
int getSpacing (int flavor) { return spacing[flavor]; }
int getWidth () { return width; }
int getWdiffToDiffSpacing() { return diffspacing; }
Contact *getUpC() { return viaup; }

protected:
int width;
int diffspacing;
int *spacing;
int *oppspacing;
Expand Down
32 changes: 29 additions & 3 deletions tech/techgen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ static void emit_planes (pp_t *pp)
for (int i=0; i < Technology::T->nmetals; i++) {
pp_printf (pp, "metal%d,m%d", i+1, i+1); pp_nl;
if (i != Technology::T->nmetals-1) {
pp_printf (pp, "via%d,v%d", i+1, i+1); pp_nl;
pp_printf (pp, "via%d,%s", i+1,
Technology::T->metal[i]->viaUpName()); pp_nl;
}
}
pp_printf (pp, "comment");
Expand Down Expand Up @@ -132,7 +133,8 @@ static void emit_tiletypes (pp_t *pp)
pp_printf (pp, "metal%d m%d", i+1, i+1); pp_nl;
pp_printf (pp, "metal%d m%dpin", i+1, i+1); pp_nl;
if (i != Technology::T->nmetals-1) {
pp_printf (pp, "metal%d m%dc,v%d", i+1, i+2, i+1); pp_nl;
pp_printf (pp, "metal%d m%dc,%s", i+1, i+2,
Technology::T->metal[i]->viaUpName()); pp_nl;
}
}
pp_printf (pp, "comment comment");
Expand Down Expand Up @@ -459,11 +461,35 @@ void emit_cif (pp_t *pp)
pp_SPACE;
}

void emit_width_spacing (pp_t *pp, Material *mat)
{
if (!mat) return;

pp_printf (pp, "width %s %d \\", mat->getName(), mat->minWidth());
pp_nl;
pp_printf (pp, " \"%s width < %d\"", mat->getName(), mat->minWidth());
pp_nl;
}

void emit_drc (pp_t *pp)
{
pp_printf (pp, "drc"); pp_TAB;

// width, spacing, overhang, rect_only
/* base layers */
for (int i=0; i < Technology::T->num_devs; i++) {
for (int j=0; j < 2; j++) {
emit_width_spacing (pp, Technology::T->diff[j][i]);
emit_width_spacing (pp, Technology::T->well[j][i]);
emit_width_spacing (pp, Technology::T->fet[j][i]);
emit_width_spacing (pp, Technology::T->welldiff[j][i]);
}
}

/* metal */
for (int i=0; i < Technology::T->nmetals; i++) {
emit_width_spacing (pp, Technology::T->metal[i]);
}


pp_UNTAB;
pp_printf (pp, "end");
Expand Down

0 comments on commit a572954

Please sign in to comment.