mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
refactor: add types to project.py
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
from typing import List, Dict, TypedDict, Optional
|
||||
import json
|
||||
|
||||
class Port(TypedDict):
|
||||
kind: str
|
||||
name: str
|
||||
direction: str
|
||||
description: str
|
||||
|
||||
class Cell(TypedDict):
|
||||
description: str
|
||||
file_prefix: str
|
||||
library: str
|
||||
name: str
|
||||
parameters: List[str]
|
||||
ports: List[Port]
|
||||
type: str
|
||||
verilog_name: str
|
||||
equation: Optional[str]
|
||||
|
||||
Cells = Dict[str, Cell]
|
||||
|
||||
def load_cells() -> Cells:
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
with open(os.path.join(script_dir, 'cells.json')) as fh:
|
||||
return json.load(fh)
|
||||
|
||||
Reference in New Issue
Block a user