Technology files

Parser for ASITIC technology files (.tek).

The file format is a free-form, line-oriented text format with four section markers (<chip>, <layer>, <metal>, <via>), key = value body lines, and ; line comments. The original parser lives in techfile_* functions of asitic_repl.c; the recognised key set was recovered from those functions plus the sample tech files at run/tek/{BiCMOS,CMOS}.tek.

Parser design notes:

  • Sections are delimited by their opening token <name>; sections may include a numeric index on the same line (<layer> 0) which is the position the entry occupies in the per-kind table.

  • Keys are case-insensitive and matched ignoring whitespace. The value runs to end-of-line or the first ; (line comment).

  • Numeric values use Python’s float parser. The rsh (sheet- resistance) field is in mΩ/sq in the file and gets converted to Ω/sq here.

  • Unknown keys are accepted and stored in Section.extra so downstream code can distinguish “we don’t model this yet” from “the file is malformed”. The original treats unknown keys as a warning, not an error.

class reasitic.tech.Chip[source]

Bases: object

Top-level <chip> section.

chipx: float = 0.0
chipy: float = 0.0
fftx: int = 0
ffty: int = 0
tech_file: str = ''
tech_path: str = '.'
freq: float = 1.0
eddy: bool = False
extra: dict[str, str]
__init__(chipx=0.0, chipy=0.0, fftx=0, ffty=0, tech_file='', tech_path='.', freq=1.0, eddy=False, extra=<factory>)
Parameters:
Return type:

None

class reasitic.tech.Layer[source]

Bases: object

One substrate <layer> (silicon, oxide, …).

index: int
rho: float = 0.0
t: float = 0.0
eps: float = 1.0
extra: dict[str, str]
__init__(index, rho=0.0, t=0.0, eps=1.0, extra=<factory>)
Parameters:
Return type:

None

class reasitic.tech.Metal[source]

Bases: object

One <metal> layer descriptor.

index: int
layer: int = 0
rsh: float = 0.0
t: float = 0.0
d: float = 0.0
name: str = ''
color: str = 'white'
extra: dict[str, str]
__init__(index, layer=0, rsh=0.0, t=0.0, d=0.0, name='', color='white', extra=<factory>)
Parameters:
Return type:

None

class reasitic.tech.Via[source]

Bases: object

One <via> descriptor connecting two metal layers.

index: int
top: int = 0
bottom: int = 0
r: float = 0.0
width: float = 0.0
space: float = 0.0
overplot1: float = 0.0
overplot2: float = 0.0
name: str = ''
color: str = 'white'
extra: dict[str, str]
__init__(index, top=0, bottom=0, r=0.0, width=0.0, space=0.0, overplot1=0.0, overplot2=0.0, name='', color='white', extra=<factory>)
Parameters:
Return type:

None

class reasitic.tech.Tech[source]

Bases: object

Complete tech-file contents.

chip: Chip
layers: list[Layer]
metals: list[Metal]
vias: list[Via]
metal_by_name(name)[source]

Look up a metal layer by its tech-file name. Raises KeyError.

Parameters:

name (str)

Return type:

Metal

via_by_name(name)[source]

Look up a via descriptor by its tech-file name. Raises KeyError.

Parameters:

name (str)

Return type:

Via

__init__(chip, layers, metals, vias)
Parameters:
Return type:

None

exception reasitic.tech.TechParseError[source]

Bases: ValueError

Raised when a .tek file is malformed.

reasitic.tech.parse_tech_file(path)[source]

Parse a tech file at path and return a Tech instance.

Parameters:

path (str | PathLike[str])

Return type:

Tech

reasitic.tech.parse_tech(source)[source]

Parse a tech file from a string or text stream.

Parameters:

source (str | TextIOBase)

Return type:

Tech

reasitic.tech.write_tech_file(tech, path)[source]

Serialise a Tech object back to a .tek text file.

The output format matches the parser: <chip> /<layer> / <metal> / <via> sections with key = value body lines. Round-trips losslessly through parse_tech_file() for the canonical fields; extra dicts are preserved.

Parameters:
Return type:

None

reasitic.tech.write_tech(tech)[source]

Render a Tech object as .tek-format text.

Parameters:

tech (Tech)

Return type:

str