Skip to content

Commit

Permalink
basic width/spacing rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jun 15, 2020
1 parent a572954 commit acf4c7c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
23 changes: 19 additions & 4 deletions act/tech.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ void Technology::Init (const char *s)
fatal_error ("Table `%s' has to be the same size as the # of types", buf);
}
mat->spacing = config_get_table_int (buf);

wt = new int[1];
wt[0] = mat->spacing[j];
mat->spacing_w = new RangeTable (1, wt);


snprintf (buf+k, BUF_SZ-k-1, "%s.oppspacing", diff[j]);
if (config_get_table_size (buf) != sz) {
Expand Down Expand Up @@ -419,6 +424,9 @@ void Technology::Init (const char *s)
fatal_error ("Table `%s' has to be the same size as the # of types", buf);
}
mat->spacing = config_get_table_int (buf);
wt = new int[1];
wt[0] = mat->spacing[j];
mat->spacing_w = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.oppspacing", diff[j]+ik+1);
if (config_get_table_size (buf) != sz) {
Expand Down Expand Up @@ -481,6 +489,9 @@ void Technology::Init (const char *s)
fatal_error ("Table `%s' has to be the same size as the # of types", buf);
}
mat->spacing = config_get_table_int (buf);
wt = new int[1];
wt[0] = mat->spacing[j];
mat->spacing_w = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.oppspacing", ldiff);
if (config_get_table_size (buf) != sz) {
Expand Down Expand Up @@ -931,13 +942,17 @@ void Technology::Init (const char *s)
if (config_get_int (buf) < 1) {
fatal_error ("%s: has to be at least 1", buf);
}
cmat->width_int = config_get_int (buf);
int *wt = new int[1];
wt[0] = config_get_int (buf);
cmat->width = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.spacing", t);
if (config_get_int (buf) < 1) {
fatal_error ("%s: has to be at least 1", buf);
}
cmat->spacing = config_get_int (buf);
wt = new int[1];
wt[0] = config_get_int (buf);
cmat->spacing_w = new RangeTable (1, wt);

snprintf (buf+k, BUF_SZ-k-1, "%s.surround.up", t);
if (config_get_int (buf) < 0) {
Expand Down Expand Up @@ -1037,13 +1052,13 @@ int RangeTable::range_threshold (int x)
int DiffMat::viaSpaceEdge ()
{
Assert (viaup, "Hmm");
return via_edge + via_fet + viaup->getWidth();
return via_edge + via_fet + viaup->minWidth();
}

int DiffMat::viaSpaceMid ()
{
Assert (viaup, "Hmm");
return 2*via_fet + viaup->getWidth();
return 2*via_fet + viaup->minWidth();
}

int DiffMat::effOverhang (int w, int hasvia)
Expand Down
3 changes: 0 additions & 3 deletions act/tech.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ class Contact : public Material {
asym_surround_dn = 0;
name = s;
}
int getWidth() { return width_int; }
int getSpacing() { return spacing; }
int isSym() { return (asym_surround_up == 0) && (asym_surround_dn == 0); }
int isAsym() { return !isSym(); }
int getSym() { return sym_surround_dn; }
Expand All @@ -296,7 +294,6 @@ class Contact : public Material {
int viaGenY() { return spc_y; }

protected:
int width_int, spacing;
Material *lower, *upper;

int sym_surround_dn;
Expand Down
59 changes: 54 additions & 5 deletions tech/techgen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,27 @@ void emit_cif (pp_t *pp)
pp_SPACE;
}

void emit_width_spacing (pp_t *pp, Material *mat)
void emit_width_spacing (pp_t *pp, Material *mat, char *nm = NULL)
{
const char *name;
if (!mat) return;
if (!nm) {
name = mat->getName();
}
else {
name = nm;
}

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

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

Expand All @@ -487,7 +501,9 @@ void emit_drc (pp_t *pp)

/* metal */
for (int i=0; i < Technology::T->nmetals; i++) {
emit_width_spacing (pp, Technology::T->metal[i]);
char buf[1024];
sprintf (buf, "(allm%d)/m%d", i+1, i+1);
emit_width_spacing (pp, Technology::T->metal[i], buf);
}


Expand Down Expand Up @@ -607,7 +623,39 @@ void emit_plot (pp_t *pp)
}
pp_UNTAB;
pp_UNTAB;
pp_printf (pp, "end:");
pp_printf (pp, "end");
pp_SPACE;
}


void emit_aliases (pp_t *pp)
{
pp_printf (pp, "aliases"); pp_TAB;

for (int i=0; i < Technology::T->nmetals; i++) {
pp_printf (pp, "allm%d *m%d", i+1, i+1); pp_nl;
}

/*
allnfets nfet
allpfets pfet
allfets allnfets,allpfets,varactor
allnactivenonfet *ndiff,*nsd
allnactive allnactivenonfet,allnfets
allpactivenonfet *pdiff,*psd
allpactive allpactivenonfet,allpfets
allactivenonfet allnactivenonfet,allpactivenonfet
allactive allactivenonfet,allfets
allpolynonfet *poly
allpoly allpolynonfet,allfets
*/

pp_UNTAB;
pp_printf (pp, "end");
pp_SPACE;
}

Expand All @@ -629,6 +677,7 @@ int main (int argc, char **argv)
emit_planes (pp);
emit_tiletypes (pp);
emit_contacts (pp);
emit_aliases (pp);
emit_styles (pp);
emit_compose (pp);
emit_connect (pp);
Expand Down

0 comments on commit acf4c7c

Please sign in to comment.