Skip to content

Commit 9a8d358

Browse files
committed
Add support for sky130_fd_sc_hs stdcell library
1 parent 813fdf7 commit 9a8d358

File tree

1 file changed

+54
-51
lines changed

1 file changed

+54
-51
lines changed

pdks/sky130_common_pdk/src/stdcells.rs

+54-51
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,62 @@ use crate::Sky130Pdk;
44

55
impl Sky130Pdk {
66
pub fn std_cells(&self) -> substrate::error::Result<StdCellDb> {
7-
let lib = "sky130_fd_sc_hd";
8-
let mut hd = StdCellLibData::new(lib);
9-
let cells = vec![
10-
("and2", Function::And2, vec![0, 1, 2, 4]),
11-
("and3", Function::And3, vec![1, 2, 4]),
12-
("buf", Function::Buf, vec![1, 2, 4, 6, 8, 12, 16]),
13-
("bufbuf", Function::Buf, vec![8, 16]),
14-
("inv", Function::Inv, vec![1, 2, 4, 6, 8]),
15-
("tap", Function::Tap, vec![1, 2]),
16-
("mux2", Function::Mux2, vec![1, 2, 4, 8]),
17-
("mux4", Function::Mux4, vec![1, 2, 4]),
18-
("nand2", Function::Nand2, vec![1, 2, 4, 8]),
19-
("nand3", Function::Nand3, vec![1, 2, 4]),
20-
("nor2", Function::Nor2, vec![1, 2, 4, 8]),
21-
("nor3", Function::Nor3, vec![1, 2, 4]),
22-
("or2", Function::Or2, vec![0, 1, 2, 4]),
23-
("or3", Function::Or3, vec![1, 2, 4]),
24-
("xnor2", Function::Xnor2, vec![1, 2, 4]),
25-
("xnor3", Function::Xnor3, vec![1, 2, 4]),
26-
("xor2", Function::Xor2, vec![1, 2, 4]),
27-
("xor3", Function::Xor3, vec![1, 2, 4]),
28-
("diode", Function::Other("diode".to_string()), vec![2]),
29-
(
30-
"dfxtp",
31-
Function::Other("pos_ff".to_string()),
32-
vec![1, 2, 4],
33-
),
34-
(
35-
"dfrtp",
36-
Function::Other("pos_ff".to_string()),
37-
vec![1, 2, 4],
38-
),
39-
];
40-
for (name, function, strengths) in cells {
41-
for strength in strengths {
42-
let cell = StdCellData::builder()
43-
.name(arcstr::format!("{lib}__{name}_{strength}"))
44-
.layout_source(self.pdk_root.join(format!(
45-
"libraries/{lib}/latest/cells/{name}/{lib}__{name}_{strength}.gds"
46-
)))
47-
.schematic_source(self.pdk_root.join(format!(
48-
"libraries/{lib}/latest/cells/{name}/{lib}__{name}_{strength}.spice"
49-
)))
50-
.function(function.clone())
51-
.strength(strength)
52-
.build()
53-
.unwrap();
54-
hd.add_cell(cell);
7+
let mut db = StdCellDb::new();
8+
for lib in ["sky130_fd_sc_hd", "sky130_fd_sc_hs"] {
9+
let mut hd = StdCellLibData::new(lib);
10+
let cells = vec![
11+
("and2", Function::And2, vec![0, 1, 2, 4]),
12+
("and3", Function::And3, vec![1, 2, 4]),
13+
("buf", Function::Buf, vec![1, 2, 4, 6, 8, 12, 16]),
14+
("bufbuf", Function::Buf, vec![8, 16]),
15+
("inv", Function::Inv, vec![1, 2, 4, 6, 8, 16]),
16+
("tap", Function::Tap, vec![1, 2]),
17+
("mux2", Function::Mux2, vec![1, 2, 4, 8]),
18+
("mux4", Function::Mux4, vec![1, 2, 4]),
19+
("nand2", Function::Nand2, vec![1, 2, 4, 8]),
20+
("nand3", Function::Nand3, vec![1, 2, 4]),
21+
("nor2", Function::Nor2, vec![1, 2, 4, 8]),
22+
("nor3", Function::Nor3, vec![1, 2, 4]),
23+
("or2", Function::Or2, vec![0, 1, 2, 4]),
24+
("or3", Function::Or3, vec![1, 2, 4]),
25+
("xnor2", Function::Xnor2, vec![1, 2, 4]),
26+
("xnor3", Function::Xnor3, vec![1, 2, 4]),
27+
("xor2", Function::Xor2, vec![1, 2, 4]),
28+
("xor3", Function::Xor3, vec![1, 2, 4]),
29+
("diode", Function::Other("diode".to_string()), vec![2]),
30+
(
31+
"dfxtp",
32+
Function::Other("pos_ff".to_string()),
33+
vec![1, 2, 4],
34+
),
35+
(
36+
"dfrtp",
37+
Function::Other("pos_ff".to_string()),
38+
vec![1, 2, 4],
39+
),
40+
];
41+
for (name, function, strengths) in cells {
42+
for strength in strengths {
43+
let cell = StdCellData::builder()
44+
.name(arcstr::format!("{lib}__{name}_{strength}"))
45+
.layout_source(self.pdk_root.join(format!(
46+
"libraries/{lib}/latest/cells/{name}/{lib}__{name}_{strength}.gds"
47+
)))
48+
.schematic_source(self.pdk_root.join(format!(
49+
"libraries/{lib}/latest/cells/{name}/{lib}__{name}_{strength}.spice"
50+
)))
51+
.function(function.clone())
52+
.strength(strength)
53+
.build()
54+
.unwrap();
55+
hd.add_cell(cell);
56+
}
57+
}
58+
let key = db.add_lib(hd);
59+
if lib == "sky130_fd_sc_hd" {
60+
db.set_default_lib(key);
5561
}
5662
}
57-
let mut db = StdCellDb::new();
58-
let key = db.add_lib(hd);
59-
db.set_default_lib(key);
6063
Ok(db)
6164
}
6265
}

0 commit comments

Comments
 (0)