mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(tt_tool): cell/category definitions for gf180mcuD
Enables the --print-cell-summary and --print-cell-category commands for gf projects
This commit is contained in:
@@ -994,9 +994,7 @@ class Project:
|
|||||||
if m is not None:
|
if m is not None:
|
||||||
total += 1
|
total += 1
|
||||||
gd = m.groupdict()
|
gd = m.groupdict()
|
||||||
cell_lib = gd.get("cell_lib", "")
|
|
||||||
cell_name = gd["cell_name"]
|
cell_name = gd["cell_name"]
|
||||||
assert cell_lib in ["fd_sc_hd", "ef_sc_hd", ""]
|
|
||||||
try:
|
try:
|
||||||
cell_count[cell_name] += 1
|
cell_count[cell_name] += 1
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -179,12 +179,13 @@ class GF180MCUDTech(Tech):
|
|||||||
return parse_openpdks_pdk_version(pdk_sources_file)
|
return parse_openpdks_pdk_version(pdk_sources_file)
|
||||||
|
|
||||||
def load_cell_definitions(self) -> Dict[str, CellDefinition]:
|
def load_cell_definitions(self) -> Dict[str, CellDefinition]:
|
||||||
URL_FORMAT = "https://skywater-pdk.readthedocs.io/en/main/contents/libraries/sky130_fd_sc_hd/cells/{name}/README.html"
|
URL_FORMAT = "https://gf180mcu-pdk.readthedocs.io/en/latest/digital/standard_cells/gf180mcu_fd_sc_mcu7t5v0/cells/{name}/gf180mcu_fd_sc_mcu7t5v0__{name}{variant}.html"
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
with open(os.path.join(script_dir, "tech/sky130A/cells.json")) as fh:
|
with open(os.path.join(script_dir, "tech/gf180mcuD/cells.json")) as fh:
|
||||||
cells = json.load(fh)
|
cells = json.load(fh)
|
||||||
for name, cell in cells.items():
|
for name, cell in cells.items():
|
||||||
cell["url"] = URL_FORMAT.format(name=name)
|
variant = cell["variants"][0] if cell["variants"] else ""
|
||||||
|
cell["url"] = URL_FORMAT.format(name=name, variant=variant)
|
||||||
return cells
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"categories": [
|
||||||
|
"AND",
|
||||||
|
"OR",
|
||||||
|
"NAND",
|
||||||
|
"NOR",
|
||||||
|
"Clock",
|
||||||
|
"Flip Flops",
|
||||||
|
"Multiplexer",
|
||||||
|
"Latch",
|
||||||
|
"Inverter",
|
||||||
|
"Buffer",
|
||||||
|
"Fill",
|
||||||
|
"Tap",
|
||||||
|
"Diode",
|
||||||
|
"Combo Logic",
|
||||||
|
"Misc",
|
||||||
|
"Adder"
|
||||||
|
],
|
||||||
|
"map": {
|
||||||
|
"addf": 15,
|
||||||
|
"addh": 15,
|
||||||
|
"and2": 0,
|
||||||
|
"and3": 0,
|
||||||
|
"and4": 0,
|
||||||
|
"antenna": 12,
|
||||||
|
"aoi21": 13,
|
||||||
|
"aoi211": 13,
|
||||||
|
"aoi22": 13,
|
||||||
|
"aoi221": 13,
|
||||||
|
"aoi222": 13,
|
||||||
|
"buf": 9,
|
||||||
|
"bufz": 14,
|
||||||
|
"clkbuf": 9,
|
||||||
|
"clkinv": 4,
|
||||||
|
"dffnq": 5,
|
||||||
|
"dffnrnq": 5,
|
||||||
|
"dffnrsnq": 5,
|
||||||
|
"dffnsnq": 5,
|
||||||
|
"dffq": 5,
|
||||||
|
"dffrnq": 5,
|
||||||
|
"dffrsnq": 5,
|
||||||
|
"dffsnq": 5,
|
||||||
|
"dlya": 9,
|
||||||
|
"dlyb": 9,
|
||||||
|
"dlyc": 9,
|
||||||
|
"dlyd": 9,
|
||||||
|
"endcap": 14,
|
||||||
|
"fill": 10,
|
||||||
|
"fillcap": 10,
|
||||||
|
"filltie": 10,
|
||||||
|
"hold": 14,
|
||||||
|
"icgtn": 4,
|
||||||
|
"icgtp": 4,
|
||||||
|
"inv": 8,
|
||||||
|
"invz": 8,
|
||||||
|
"latq": 7,
|
||||||
|
"latrnq": 7,
|
||||||
|
"latrsnq": 7,
|
||||||
|
"latsnq": 7,
|
||||||
|
"mux2": 6,
|
||||||
|
"mux4": 6,
|
||||||
|
"nand2": 2,
|
||||||
|
"nand3": 2,
|
||||||
|
"nand4": 2,
|
||||||
|
"nor2": 3,
|
||||||
|
"nor3": 3,
|
||||||
|
"nor4": 3,
|
||||||
|
"oai21": 13,
|
||||||
|
"oai211": 13,
|
||||||
|
"oai22": 13,
|
||||||
|
"oai221": 13,
|
||||||
|
"oai222": 13,
|
||||||
|
"oai31": 13,
|
||||||
|
"oai32": 13,
|
||||||
|
"oai33": 13,
|
||||||
|
"or2": 1,
|
||||||
|
"or3": 1,
|
||||||
|
"or4": 1,
|
||||||
|
"sdffq": 5,
|
||||||
|
"sdffrnq": 5,
|
||||||
|
"sdffrsnq": 5,
|
||||||
|
"sdffsnq": 5,
|
||||||
|
"tieh": 14,
|
||||||
|
"tiel": 14,
|
||||||
|
"xnor2": 3,
|
||||||
|
"xnor3": 3,
|
||||||
|
"xor2": 1,
|
||||||
|
"xor3": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
|||||||
|
# Create a JSON file with cell definitions from the gf180mcu_fd_sc_mcu7t5v0 standard cell library.
|
||||||
|
# To run this script, first clone the standard cell library by running:
|
||||||
|
#
|
||||||
|
# git clone --depth 1 https://github.com/google/globalfoundries-pdk-libs-gf180mcu_fd_sc_mcu7t5v0 gf180mcu_fd_sc_mcu7t5v0
|
||||||
|
|
||||||
|
import glob
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from typing import Dict, List, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class GF180Cell(TypedDict):
|
||||||
|
description: str
|
||||||
|
file_prefix: str
|
||||||
|
library: str
|
||||||
|
name: str
|
||||||
|
parameters: List[str]
|
||||||
|
ports: List[List[str]] # kind, name, direction, description
|
||||||
|
type: str
|
||||||
|
verilog_name: str
|
||||||
|
"""
|
||||||
|
Each variant is a different drive strength (e.g. _1, _2, _4, etc.).
|
||||||
|
Cells with a single drive strength have the empty string as variant.
|
||||||
|
"""
|
||||||
|
variants: List[str]
|
||||||
|
|
||||||
|
|
||||||
|
def create_cell_defs():
|
||||||
|
json_files = glob.glob("gf180mcu_fd_sc_mcu7t5v0/cells/*/definition.json")
|
||||||
|
definitions: Dict[str, GF180Cell] = {}
|
||||||
|
for json_file in json_files:
|
||||||
|
with open(json_file) as fh:
|
||||||
|
definition: GF180Cell = json.load(fh)
|
||||||
|
definitions[definition["name"]] = definition
|
||||||
|
variants = []
|
||||||
|
for item in os.listdir(os.path.dirname(json_file)):
|
||||||
|
if item.startswith(definition["file_prefix"]) and item.endswith(".gds"):
|
||||||
|
variants.append(item[len(definition["file_prefix"]) : -4])
|
||||||
|
variants.sort()
|
||||||
|
definition["variants"] = variants
|
||||||
|
print(definition["name"], variants)
|
||||||
|
|
||||||
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
with open(f"{script_dir}/cells.json", "w") as fh:
|
||||||
|
json.dump(definitions, fh, indent=2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
create_cell_defs()
|
||||||
Reference in New Issue
Block a user