Skip to content

Commit

Permalink
more tech file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Aug 31, 2021
1 parent 6099133 commit aa8da39
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 17 deletions.
1 change: 1 addition & 0 deletions act/tech.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class DiffMat : public Material {
int getOppDiffSpacing (int flavor) { return oppspacing[flavor]; }
int getSpacing (int flavor) { return spacing[flavor]; }
int getWdiffToDiffSpacing() { return diffspacing; }
int getViaFet() { return via_fet; }
Contact *getUpC() { return viaup; }

protected:
Expand Down
60 changes: 43 additions & 17 deletions tech/techgen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ void emit_cif (pp_t *pp)
void emit_spacing (pp_t *pp, const char *nm1, const char *nm2, int amt, int touching_ok = 0)
{
pp_printf (pp, "spacing %s %s %d %s\\", nm1, nm2, amt,
touching_ok ? "touching_ok" : "");
touching_ok ? "touching_ok" : "touching_illegal");
pp_nl;
pp_printf (pp, " \"%s to %s spacing < %d \"", nm1, nm2, amt);
pp_nl;
Expand Down Expand Up @@ -517,6 +517,9 @@ void emit_width_spacing (pp_t *pp, Material *mat, char *nm = NULL)



/*
Emit overhang of mat1 over nm by amt
*/
void emit_overhang (pp_t *pp, Material *mat1, const char *nm, int amt)
{
if (!mat1) return;
Expand Down Expand Up @@ -576,14 +579,28 @@ void emit_drc (pp_t *pp)
emit_width_spacing (pp, Technology::T->welldiff[j][i], buf);
emit_width_spacing (pp, Technology::T->well[j][i]);
emit_width_spacing (pp, Technology::T->welldiff[j][i]->getUpC());
}

/*-- well to oppdiff spacing --*/

/*-- fet / diff spacing, touching_ok --*/
if (Technology::T->fet[j][i] && Technology::T->diff[j][i]) {
pp_printf (pp, "# diff to contact spacing"); pp_nl;
emit_spacing (pp, Technology::T->fet[j][i]->getName(),
Technology::T->diff[j][i]->getName(),
Technology::T->diff[j][i]->getSpacing (i), 1);
emit_spacing (pp, Technology::T->fet[j][i]->getName(),
Technology::T->diff[j][i]->getUpC()->getName(),
Technology::T->diff[j][i]->getViaFet () -
(Technology::T->diff[j][i]->getUpC()->minWidth()+1)/2);
}

/* ndc to fet */
if (Technology::T->well[j][i]) {
WellMat *well = Technology::T->well[j][i];
emit_overhang (pp, well, Technology::T->diff[j][i]->getName(),
well->getOverhang());

emit_spacing (pp, well->getName(),
Technology::T->diff[1-j][i]->getName(),
well->getOverhang() + well->oppSpacing (i));
}
}
}

emit_spacing (pp, "allndiff", "allpdiff",
Expand Down Expand Up @@ -616,10 +633,9 @@ void emit_drc (pp_t *pp)
}
}

/* poly spacing to active */
emit_spacing (pp, "allpolynonfet", "allactivenonfet,allfet", pspacing, 0);

/* poly spacing to active */

/*-- other poly rules --*/


Expand Down Expand Up @@ -659,16 +675,26 @@ void emit_extract (pp_t *pp)
}

pp_printf (pp, "planeorder comment %d", order++);

/* -- devices --
fet pfet pdiff,pdc 2 pfet Vdd! nwell 50 46
fet pfet pdiff,pdc 1 pfet Vdd! nwell 50 46
fet nfet ndiff,ndc 2 nfet GND! pwell 56 48
fet nfet ndiff,ndc 1 nfet GND! pwell 56 48
*/
pp_nl;

char **act_flav = config_get_table_string ("act.dev_flavors");

for (int i=0; i < Technology::T->num_devs; i++) {
/* j = 0 : nfet */
pp_printf (pp, "device mosfet nfet_%s %s allndiff %s,space Gnd!",
act_flav[i],
Technology::T->fet[0][i]->getName(),
Technology::T->well[0][i] ?
Technology::T->well[0][i]->getName() : "space/w");
pp_nl;

pp_printf (pp, "device mosfet pfet_%s %s allpdiff %s,space Vdd!",
act_flav[i],
Technology::T->fet[1][i]->getName(),
Technology::T->well[1][i] ?
Technology::T->well[1][i]->getName() : "space/w");
pp_nl;
}
pp_UNTAB;
pp_printf (pp, "end");
pp_SPACE;
Expand Down

0 comments on commit aa8da39

Please sign in to comment.