-
Notifications
You must be signed in to change notification settings - Fork 14
/
cells.py
44 lines (32 loc) · 918 Bytes
/
cells.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import json
import os
from typing import Dict, List, Optional, TypedDict
class Port(TypedDict):
kind: str
name: str
direction: str
description: str
class Sky130Cell(TypedDict):
description: str
file_prefix: str
library: str
name: str
parameters: List[str]
ports: List[Port]
type: str
verilog_name: str
equation: Optional[str]
class IHPCell(TypedDict):
description: str
doc_name: str
doc_ref: int
Sky130Cells = Dict[str, Sky130Cell]
IHPCells = Dict[str, IHPCell]
def load_sky130_cells() -> Sky130Cells:
script_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(script_dir, "cells.json")) as fh:
return json.load(fh)
def load_ihp_cells() -> IHPCells:
script_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(script_dir, "ihp/cells.json")) as fh:
return json.load(fh)