Exemplo n.º 1
0
def primitives():
    # parse subckts
    parser = SpiceParser()
    with open((pathlib.Path(__file__).parent.parent / 'files' /
               'basic_template.sp').resolve()) as fp:
        parser.parse(fp.read())
    return [v for v in parser.library.values() if isinstance(v, SubCircuit)]
Exemplo n.º 2
0
def ota():
    parser = SpiceParser()
    with open((pathlib.Path(__file__).parent.parent / 'files' /
               'ota.cir').resolve()) as fp:
        parser.parse(fp.read())
    # Extract ckt
    return parser.library['OTA']
Exemplo n.º 3
0
def get_parser():
    parser = SpiceParser()
    model_statemenets = ALIGN_HOME / "align" / "config" / "model.txt"
    with open(model_statemenets) as f:
        lines = f.read()
    parser.parse(lines)
    return parser
Exemplo n.º 4
0
def library():
    parser = SpiceParser()
    align_home = pathlib.Path(__file__).resolve().parent.parent / "files"
    basic_lib_path = align_home / "basic_template.sp"
    with open(basic_lib_path) as f:
        lines = f.read()
    parser.parse(lines)
    user_lib_path = align_home / "user_template.sp"
    with open(user_lib_path) as f:
        lines = f.read()
    parser.parse(lines)
    return parser.library
Exemplo n.º 5
0
def get_parser():
    parser = SpiceParser()
    with open(model_statemenets) as f:
        lines = f.read()
    parser.parse(lines)
    return parser