Skip to content

Commit aa8da39

Browse files
committed
more tech file generation
1 parent 6099133 commit aa8da39

File tree

2 files changed

+44
-17
lines changed

2 files changed

+44
-17
lines changed

act/tech.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ class DiffMat : public Material {
258258
int getOppDiffSpacing (int flavor) { return oppspacing[flavor]; }
259259
int getSpacing (int flavor) { return spacing[flavor]; }
260260
int getWdiffToDiffSpacing() { return diffspacing; }
261+
int getViaFet() { return via_fet; }
261262
Contact *getUpC() { return viaup; }
262263

263264
protected:

tech/techgen.cc

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void emit_cif (pp_t *pp)
475475
void emit_spacing (pp_t *pp, const char *nm1, const char *nm2, int amt, int touching_ok = 0)
476476
{
477477
pp_printf (pp, "spacing %s %s %d %s\\", nm1, nm2, amt,
478-
touching_ok ? "touching_ok" : "");
478+
touching_ok ? "touching_ok" : "touching_illegal");
479479
pp_nl;
480480
pp_printf (pp, " \"%s to %s spacing < %d \"", nm1, nm2, amt);
481481
pp_nl;
@@ -517,6 +517,9 @@ void emit_width_spacing (pp_t *pp, Material *mat, char *nm = NULL)
517517

518518

519519

520+
/*
521+
Emit overhang of mat1 over nm by amt
522+
*/
520523
void emit_overhang (pp_t *pp, Material *mat1, const char *nm, int amt)
521524
{
522525
if (!mat1) return;
@@ -576,14 +579,28 @@ void emit_drc (pp_t *pp)
576579
emit_width_spacing (pp, Technology::T->welldiff[j][i], buf);
577580
emit_width_spacing (pp, Technology::T->well[j][i]);
578581
emit_width_spacing (pp, Technology::T->welldiff[j][i]->getUpC());
579-
}
580-
581-
/*-- well to oppdiff spacing --*/
582582

583-
/*-- fet / diff spacing, touching_ok --*/
583+
if (Technology::T->fet[j][i] && Technology::T->diff[j][i]) {
584+
pp_printf (pp, "# diff to contact spacing"); pp_nl;
585+
emit_spacing (pp, Technology::T->fet[j][i]->getName(),
586+
Technology::T->diff[j][i]->getName(),
587+
Technology::T->diff[j][i]->getSpacing (i), 1);
588+
emit_spacing (pp, Technology::T->fet[j][i]->getName(),
589+
Technology::T->diff[j][i]->getUpC()->getName(),
590+
Technology::T->diff[j][i]->getViaFet () -
591+
(Technology::T->diff[j][i]->getUpC()->minWidth()+1)/2);
592+
}
584593

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

599+
emit_spacing (pp, well->getName(),
600+
Technology::T->diff[1-j][i]->getName(),
601+
well->getOverhang() + well->oppSpacing (i));
602+
}
603+
}
587604
}
588605

589606
emit_spacing (pp, "allndiff", "allpdiff",
@@ -616,10 +633,9 @@ void emit_drc (pp_t *pp)
616633
}
617634
}
618635

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

621-
/* poly spacing to active */
622-
623639
/*-- other poly rules --*/
624640

625641

@@ -659,16 +675,26 @@ void emit_extract (pp_t *pp)
659675
}
660676

661677
pp_printf (pp, "planeorder comment %d", order++);
662-
663-
/* -- devices --
664-
665-
fet pfet pdiff,pdc 2 pfet Vdd! nwell 50 46
666-
fet pfet pdiff,pdc 1 pfet Vdd! nwell 50 46
667-
fet nfet ndiff,ndc 2 nfet GND! pwell 56 48
668-
fet nfet ndiff,ndc 1 nfet GND! pwell 56 48
669-
670-
*/
678+
pp_nl;
671679

680+
char **act_flav = config_get_table_string ("act.dev_flavors");
681+
682+
for (int i=0; i < Technology::T->num_devs; i++) {
683+
/* j = 0 : nfet */
684+
pp_printf (pp, "device mosfet nfet_%s %s allndiff %s,space Gnd!",
685+
act_flav[i],
686+
Technology::T->fet[0][i]->getName(),
687+
Technology::T->well[0][i] ?
688+
Technology::T->well[0][i]->getName() : "space/w");
689+
pp_nl;
690+
691+
pp_printf (pp, "device mosfet pfet_%s %s allpdiff %s,space Vdd!",
692+
act_flav[i],
693+
Technology::T->fet[1][i]->getName(),
694+
Technology::T->well[1][i] ?
695+
Technology::T->well[1][i]->getName() : "space/w");
696+
pp_nl;
697+
}
672698
pp_UNTAB;
673699
pp_printf (pp, "end");
674700
pp_SPACE;

0 commit comments

Comments
 (0)