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.extraso 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.Via[source]¶
Bases:
objectOne
<via>descriptor connecting two metal layers.- __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>)¶
- class reasitic.tech.Tech[source]¶
Bases:
objectComplete tech-file contents.
- exception reasitic.tech.TechParseError[source]¶
Bases:
ValueErrorRaised when a
.tekfile is malformed.
- reasitic.tech.parse_tech(source)[source]¶
Parse a tech file from a string or text stream.
- Parameters:
source (str | TextIOBase)
- Return type:
- reasitic.tech.write_tech_file(tech, path)[source]¶
Serialise a Tech object back to a
.tektext file.The output format matches the parser:
<chip>/<layer>/<metal>/<via>sections withkey = valuebody lines. Round-trips losslessly throughparse_tech_file()for the canonical fields;extradicts are preserved.