-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed NDA spice file, fixed tech json generation scripts (#740)
- Loading branch information
Showing
7 changed files
with
357 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 45 additions & 9 deletions
54
hammer/technology/sky130/extra/sky130-tech-gen-files/cells.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,54 @@ | ||
{ | ||
"physical only cells list": [ | ||
"physical_only_cells_list": [ | ||
"sky130_fd_sc_hd__tap_1", "sky130_fd_sc_hd__tap_2", "sky130_fd_sc_hd__tapvgnd_1", "sky130_fd_sc_hd__tapvpwrvgnd_1", | ||
"sky130_fd_sc_hd__fill_1", "sky130_fd_sc_hd__fill_2", "sky130_fd_sc_hd__fill_4", "sky130_fd_sc_hd__fill_8", | ||
"sky130_fd_sc_hd__diode_2" | ||
], | ||
"dont use list": [ | ||
"dont_use_list": [ | ||
"*sdf*", | ||
"sky130_fd_sc_hd__probe_p_8" | ||
"sky130_fd_sc_hd__probe_p_*", | ||
"sky130_fd_sc_hd__probec_p_*" | ||
], | ||
"special cells": [ | ||
{"cell_type": "tiehilocell", "name": ["sky130_fd_sc_hd__conb_1"]}, | ||
{"cell_type": "endcap", "name": ["sky130_fd_sc_hd__tap_1"]}, | ||
{"cell_type": "tapcell", "name": ["sky130_fd_sc_hd__tapvpwrvgnd_1"]}, | ||
{"cell_type": "stdfiller", "name": ["sky130_fd_sc_hd__fill_1", "sky130_fd_sc_hd__fill_2", "sky130_fd_sc_hd__fill_4", "sky130_fd_sc_hd__fill_8"]}, | ||
{"cell_type": "decap", "name": ["sky130_fd_sc_hd__decap_3", "sky130_fd_sc_hd__decap_4", "sky130_fd_sc_hd__decap_6", "sky130_fd_sc_hd__decap_8", "sky130_fd_sc_hd__decap_12"]} | ||
"special_cells": [ | ||
{ | ||
"cell_type": "tiehilocell", | ||
"name": ["sky130_fd_sc_hd__conb_1"] | ||
}, | ||
{ | ||
"cell_type": "tiehicell", | ||
"name": ["sky130_fd_sc_hd__conb_1"], | ||
"output_ports": ["HI"] | ||
}, | ||
{ | ||
"cell_type": "tielocell", | ||
"name": ["sky130_fd_sc_hd__conb_1"], | ||
"output_ports": ["LO"] | ||
}, | ||
{ | ||
"cell_type": "endcap", | ||
"name": ["sky130_fd_sc_hd__tap_1"] | ||
}, | ||
{ | ||
"cell_type": "tapcell", | ||
"name": ["sky130_fd_sc_hd__tapvpwrvgnd_1"] | ||
}, | ||
{ | ||
"cell_type": "stdfiller", | ||
"name": ["sky130_fd_sc_hd__fill_1", "sky130_fd_sc_hd__fill_2", "sky130_fd_sc_hd__fill_4", "sky130_fd_sc_hd__fill_8"] | ||
}, | ||
{ | ||
"cell_type": "decap", | ||
"name": ["sky130_fd_sc_hd__decap_3", "sky130_fd_sc_hd__decap_4", "sky130_fd_sc_hd__decap_6", "sky130_fd_sc_hd__decap_8", "sky130_fd_sc_hd__decap_12"] | ||
}, | ||
{ | ||
"cell_type": "driver", | ||
"name": ["sky130_fd_sc_hd__buf_4"], | ||
"input_ports": ["A"], | ||
"output_ports": ["X"] | ||
}, | ||
{ | ||
"cell_type": "ctsbuffer", | ||
"name": ["sky130_fd_sc_hd__clkbuf_1"] | ||
} | ||
] | ||
} |
95 changes: 95 additions & 0 deletions
95
hammer/technology/sky130/extra/sky130-tech-gen-files/stackups-gen.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/env python3 | ||
# type: ignore | ||
# tell mypy to ignore this file during typechecking | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Generate Hammer Sky130 tech plugin file: sky130.tech.json | ||
# | ||
# See LICENSE for licence details. | ||
import sys | ||
import json | ||
import os | ||
|
||
library='sky130_fd_sc_hd' | ||
|
||
def main(args) -> int: | ||
if len(args) != 3: | ||
print("Usage: ./stackups-gen.py /path/to/sky130A stackups.json") | ||
return 1 | ||
|
||
SKY130A = sys.argv[1] | ||
|
||
stackup = {} | ||
stackup["name"] = library | ||
stackup["grid_unit"] = 0.001 | ||
stackup["metals"] = [] | ||
|
||
def is_float(string): | ||
try: | ||
float(string) | ||
return True | ||
except ValueError: | ||
return False | ||
|
||
def get_min_from_line(line): | ||
words = line.split() | ||
nums = [float(w) for w in words if is_float(w)] | ||
return min(nums) | ||
|
||
|
||
tlef_path = os.path.join(SKY130A, 'libs.ref', library, 'techlef', f"{library}__min.tlef") | ||
with open(tlef_path, 'r') as f: | ||
metal_name = None | ||
metal_index = 0 | ||
lines = f.readlines() | ||
idx = -1 | ||
while idx < len(lines): | ||
idx += 1 | ||
if idx == len(lines) - 1: break | ||
line = lines[idx] | ||
if '#' in line: line = line[:line.index('#')] | ||
words = line.split() | ||
if line.startswith('LAYER') and len(words) > 1: | ||
if words[1].startswith('li') or words[1].startswith('met'): | ||
metal_name = words[1] | ||
metal_index += 1 | ||
metal = {} | ||
metal["name"] = metal_name | ||
metal["index"] = metal_index | ||
|
||
if metal_name is not None: | ||
line = line.strip() | ||
if line.startswith("DIRECTION"): | ||
metal["direction"] = words[1].lower() | ||
if line.startswith("PITCH"): | ||
metal["pitch"] = get_min_from_line(line) | ||
if line.startswith("OFFSET"): | ||
metal["offset"] = get_min_from_line(line) | ||
if line.startswith("WIDTH"): | ||
metal["min_width"] = get_min_from_line(line) | ||
if line.startswith("SPACINGTABLE"): | ||
metal["power_strap_widths_and_spacings"] = [] | ||
while ';' not in line: | ||
idx += 1 | ||
if idx == len(lines) - 1: break | ||
line = lines[idx].strip() | ||
if '#' in line: line = line[:line.index('#')] | ||
words = line.split() | ||
d = {} | ||
if line.startswith("WIDTH"): | ||
d["width_at_least"] = float(words[1]) | ||
d["min_spacing"] = float(words[2]) | ||
metal["power_strap_widths_and_spacings"].append(d.copy()) | ||
if line.startswith("END"): | ||
metal["grid_unit"] = 0.001 | ||
stackup["metals"].append(metal.copy()) | ||
metal_name = None | ||
|
||
|
||
with open(sys.argv[2], 'w') as f: | ||
json.dump(stackup, f, indent=2) | ||
|
||
return 0 | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv)) |
119 changes: 110 additions & 9 deletions
119
hammer/technology/sky130/extra/sky130-tech-gen-files/stackups.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,112 @@ | ||
{ | ||
"name": "sky130_fd_sc_hd", | ||
"grid_unit": 0.001, | ||
"metals": [ | ||
{ | ||
"name" : "sky130_fd_sc_hd", | ||
"metals": [ | ||
{"name": "li1", "index": 1, "direction": "vertical", "min_width": 0.17, "max_width": 2147483.647, "pitch": 0.34, "offset": 0.23, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.17}]}, | ||
{"name": "met1", "index": 2, "direction": "horizontal", "min_width": 0.14, "max_width": 2147483.647, "pitch": 0.28, "offset": 0.17, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.14}, {"width_at_least": 3.0, "min_spacing": 0.28}]}, | ||
{"name": "met2", "index": 3, "direction": "vertical", "min_width": 0.14, "max_width": 2147483.647, "pitch": 0.28, "offset": 0.23, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.14}, {"width_at_least": 3.0, "min_spacing": 0.28}]}, | ||
{"name": "met3", "index": 4, "direction": "horizontal", "min_width": 0.3, "max_width": 2147483.647, "pitch": 0.6, "offset": 0.34, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.3}, {"width_at_least": 3.0, "min_spacing": 0.4}]}, | ||
{"name": "met4", "index": 5, "direction": "vertical", "min_width": 0.3, "max_width": 2147483.647, "pitch": 0.6, "offset": 0.46, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.3}, {"width_at_least": 3.0, "min_spacing": 0.4}]}, | ||
{"name": "met5", "index": 6, "direction": "horizontal", "min_width": 1.6, "max_width": 2147483.647, "pitch": 3.2, "offset": 1.7, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 1.6}]} | ||
] | ||
"name": "li1", | ||
"index": 1, | ||
"direction": "vertical", | ||
"pitch": 0.34, | ||
"offset": 0.17, | ||
"min_width": 0.17, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 0.17 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
}, | ||
{ | ||
"name": "met1", | ||
"index": 2, | ||
"direction": "horizontal", | ||
"pitch": 0.34, | ||
"offset": 0.17, | ||
"min_width": 0.14, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 0.14 | ||
}, | ||
{ | ||
"width_at_least": 3.0, | ||
"min_spacing": 0.28 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
}, | ||
{ | ||
"name": "met2", | ||
"index": 3, | ||
"direction": "vertical", | ||
"pitch": 0.46, | ||
"offset": 0.23, | ||
"min_width": 0.14, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 0.14 | ||
}, | ||
{ | ||
"width_at_least": 3.0, | ||
"min_spacing": 0.28 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
}, | ||
{ | ||
"name": "met3", | ||
"index": 4, | ||
"direction": "horizontal", | ||
"pitch": 0.68, | ||
"offset": 0.34, | ||
"min_width": 0.3, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 0.3 | ||
}, | ||
{ | ||
"width_at_least": 3.0, | ||
"min_spacing": 0.4 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
}, | ||
{ | ||
"name": "met4", | ||
"index": 5, | ||
"direction": "vertical", | ||
"pitch": 0.92, | ||
"offset": 0.46, | ||
"min_width": 0.3, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 0.3 | ||
}, | ||
{ | ||
"width_at_least": 3.0, | ||
"min_spacing": 0.4 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
}, | ||
{ | ||
"name": "met5", | ||
"index": 6, | ||
"direction": "horizontal", | ||
"pitch": 3.4, | ||
"offset": 1.7, | ||
"min_width": 1.6, | ||
"power_strap_widths_and_spacings": [ | ||
{ | ||
"width_at_least": 0.0, | ||
"min_spacing": 1.6 | ||
} | ||
], | ||
"grid_unit": 0.001 | ||
} | ||
] | ||
} |
Oops, something went wrong.