Skip to content

Commit

Permalink
more fixes/access methods for tech info
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jun 4, 2020
1 parent b127e58 commit 94acabc
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 35 deletions.
80 changes: 57 additions & 23 deletions act/tech.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,28 +233,41 @@ void Technology::Init (const char *s)
} \
} while (0)

#define ADDGDSBL_TEMPL(mat) \
do { \
if (config_exists (buf)) { \
mat->addGDSBloat (config_get_table_int (buf), \
config_get_table_size (buf)); \
} \
#define ADDGDSBL_TEMPL(mat) \
do { \
if (config_exists (buf)) { \
mat->addGDSBloat (config_get_table_int (buf), \
config_get_table_size (buf)); \
} \
else { \
warning ("No GDS bloat information: `%s'", buf); \
} \
} while (0)

#define ADDGDS(mat,name) \
do { \
if (T->gdsH) { \
snprintf (buf+k, BUF_SZ-k-1, "%s.gds", name); \
if (name) { \
snprintf (buf+k, BUF_SZ-k-1, "%s.gds", name); \
} \
else { \
snprintf (buf+k, BUF_SZ-k-1, "gds"); \
} \
ADDGDS_TEMPL(mat); \
} \
} while (0)

#define ADDGDSBL(mat,name) \
do { \
if (T->gdsH) { \
snprintf (buf+k, BUF_SZ-k-1, "%s.gds_bloat", name);\
ADDGDSBL_TEMPL(mat); \
} \
#define ADDGDSBL(mat,name) \
do { \
if (T->gdsH) { \
if (name) { \
snprintf (buf+k, BUF_SZ-k-1, "%s.gds_bloat", name); \
} \
else { \
snprintf (buf+k, BUF_SZ-k-1, "gds_bloat"); \
} \
ADDGDSBL_TEMPL(mat); \
} \
} while (0)

/* now: check materials! */
Expand Down Expand Up @@ -521,8 +534,8 @@ void Technology::Init (const char *s)

PolyMat *pmat = new PolyMat (Strdup ("polysilicon"));
T->poly = pmat;
ADDGDS (T->poly, "polysilicon");
ADDGDSBL (T->poly, "polysilicon");
ADDGDS (T->poly, (char *)NULL);
ADDGDSBL (T->poly, (char *)NULL);

snprintf (buf+k, BUF_SZ-k-1, "width");
if (config_get_int (buf) < 1) {
Expand Down Expand Up @@ -672,19 +685,19 @@ void Technology::Init (const char *s)
mat = new RoutingMat (Strdup (buf+k));
T->metal[i-1] = mat;

if (T->gdsH) {
snprintf (buf+k, BUF_SZ-k-1, "m%d_gds", i);
ADDGDS_TEMPL(mat);
snprintf (buf+k, BUF_SZ-k-1, "m%d_gds_bloat", i);
ADDGDSBL_TEMPL(mat);
}

if (i != T->nmetals) {
A_NEW (contacts, char *);
A_NEXT (contacts) = Strdup (buf+k);
A_INC (contacts);
}

if (T->gdsH) {
snprintf (buf+k, BUF_SZ-k-1, "m%d_gds", i);
ADDGDS_TEMPL(mat);
snprintf (buf+k, BUF_SZ-k-1, "m%d_gds_bloat", i);
ADDGDSBL_TEMPL(mat);
}

/* now look for materials.metal.t */
snprintf (buf+k, BUF_SZ-k-1, "%s.", t);
j = strlen (buf);
Expand Down Expand Up @@ -1084,7 +1097,9 @@ void Material::addGDS (char **layers, int sz)
if (!b) {
fatal_error ("Could not find GDS layer `%s'", layers[i]);
}
list_append (gds, b->v);
GDSLayer *gl = (GDSLayer *)b->v;
list_append (gds, gl);
gl->addMat (this);
}
}

Expand All @@ -1099,3 +1114,22 @@ void Material::addGDSBloat (int *table, int sz)
}
}


void GDSLayer::addMat (Material *m)
{
if (!mats) {
mats = list_new ();
}
list_append (mats, m);
}

GDSLayer *Technology::GDSlookup (const char *s)
{
hash_bucket_t *b;
if (!gdsH) return NULL;
b = hash_lookup (gdsH, s);
if (!b) {
return NULL;
}
return (GDSLayer *) b->v;
}
11 changes: 10 additions & 1 deletion act/tech.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,25 @@ class RangeTable {
};

class Contact;

class Material;

class GDSLayer {
private:
const char *name;
int major, minor;
list_t *mats; // link back to materials
public:
GDSLayer (char *nm, int maj, int min) {
name = string_cache (nm);
major = maj;
minor = min;
mats = NULL;
}
void addMat (Material *m);
listitem_t *matList () { if (mats) { return list_first (mats); } else { return NULL; } }
int getMajor() { return major; }
int getMinor() { return minor; }

};


Expand Down Expand Up @@ -332,6 +339,8 @@ class Technology {

int welltap_adjust; /* adjustment for welltap y-center */

GDSLayer *GDSlookup (const char *name); // return gds layer

/* indexed by EDGE_PFET, EDGE_NFET */
int num_devs; /* # of device types */
DiffMat **diff[2]; /* diffusion for p/n devices */
Expand Down
89 changes: 80 additions & 9 deletions tech/layout.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ begin general
int metals 3
end

begin gds
string_table layers "NW" "PW" "CO" "OD" "PO" "M1" "M2" "M3" "PP" "NN" "V1" "V2"
int_table major 0 1 2 3 4 5 6 7 8 9 10 11
int_table minor 0 0 0 0 0 0 0 0 0 0 0 0
end

begin diff
string_table types "svt" # only svt devices
string_table ptype "pdiff" # p diffusion
Expand All @@ -37,6 +43,8 @@ begin materials
int edge 1
int fet 2
end
string_table gds "NW" "OD"
int_table gds_bloat 6 0
end

begin ppdiff
Expand All @@ -45,6 +53,8 @@ begin materials
int_table oppspacing 12
int polyspacing 1
int diffspacing 3
string_table gds "OD" "PP" "PW"
int_table gds_bloat 0 0 3
end


Expand All @@ -60,6 +70,8 @@ begin materials
int edge 1
int fet 2
end
string_table gds "OD" "PW"
int_table gds_bloat 0 6
end

begin nndiff
Expand All @@ -68,17 +80,36 @@ begin materials
int_table oppspacing 12
int polyspacing 1
int diffspacing 3
string_table gds "OD" "NN" "PW"
int_table gds_bloat 0 0 3
end

begin nplus
int width 3
int_table spacing 3
string_table gds "NN"
int_table gds_bloat 0
end

begin pplus
int width 3
int_table spacing 3
string_table gds "PP"
int_table gds_bloat 0
end

begin ptransistor
int width 2
int_table spacing 3
string_table gds "OD" "PO" "NW"
int_table gds_bloat 0 0 6
end

begin ntransistor
int width 2
int_table spacing 3
string_table gds "OD" "PO" "PW"
int_table gds_bloat 0 0 6
end

begin nwell
Expand All @@ -88,6 +119,8 @@ begin materials
int overhang 6
int overhang_welldiff 3
int plug_dist 500
string_table gds "NW"
int_table gds_bloat 0
end

begin pwell
Expand All @@ -97,6 +130,8 @@ begin materials
int overhang 6
int overhang_welldiff 3
int plug_dist 500
string_table gds "PW"
int_table gds_bloat 0
end


Expand All @@ -117,6 +152,8 @@ begin materials
int_table nspacing 2
int_table pspacing 2
end
string_table gds "PO"
int_table gds_bloat 0
end

begin metal
Expand All @@ -141,10 +178,17 @@ begin materials
end

string m1 "thin"
string_table m1_gds "M1"
int_table m1_gds_bloat 0

string m2 "thin"
string_table m2_gds "M2"
int_table m2_gds_bloat 0

string m3 "thick"
string m4 "thin"
string m5 "thick"
string_table m3_gds "M3"
int_table m3_gds_bloat 0

end
end

Expand Down Expand Up @@ -178,24 +222,51 @@ begin vias
end

string polysilicon "ct_to_active"
string polysilicon_name "gc"
string polysilicon_name "pc"
string_table polysilicon_gds "PO" "CO" "M1"
int_table polysilicon_gds_bloat 0 0 0

string ndiff "ct_to_active"
string ndiff_name "gc"
string ndiff_name "ndc"
string_table ndiff_gds "OD" "CO" "M1" "PW"
int_table ndiff_gds_bloat 0 0 0 6

string pdiff "ct_to_active"
string pdiff_name "gc"
string pdiff_name "pdc"
string_table pdiff_gds "OD" "CO" "M1" "NW"
int_table pdiff_gds_bloat 0 0 0 6

string nwell "ct_to_active"
string nwell_name "gc"
string nwell_name "nwc"
string_table nwell_gds "OD" "CO" "M1" "NW"
int_table nwell_gds_bloat 0 0 0 0


string pwell "ct_to_active"
string pwell_name "gc"
string pwell_name "pwc"
string_table pwell_gds "OD" "CO" "M1" "PW"
int_table pwell_gds_bloat 0 0 0 0

string nndiff "ct_to_active"
string nndiff_name "gc"
string nndiff_name "nsc"
string_table nndiff_gds "OD" "CO" "M1" "NW" "NN"
int_table nndiff_gds_bloat 0 0 0 0 0


string ppdiff "ct_to_active"
string ppdiff_name "gc"
string ppdiff_name "psc"
string_table ppdiff_gds "OD" "CO" "M1" "PW" "PP"
int_table ppdiff_gds_bloat 0 0 0 0 0

string m1 "via_sm"
string m1_name "v1"
string_table m1_gds "M1" "V1" "M2"
int_table m1_gds_bloat 0 0 0

string m2 "via_sm"
string m2_name "v2"
string_table m2_gds "M2" "V2" "M3"
int_table m2_gds_bloat 0 0 0

end

Expand Down
Loading

0 comments on commit 94acabc

Please sign in to comment.