LibrePDK: MOSFET generator

OK. The last few weeks I’ve been hacking around on the LibrePDK support for IHP’s SG13G2 node.

After lots of cursing and questioning my life’s choices which led me to the situation I was in, I just finally managed to make the tool dynamically spit out NMOS and PMOS FETs based on the input provided by a JSON file.

For example for an NMOS (tests/single_nmos/single_nmos.json)

{
        "name": "single_nmos",
        "nets": ["drain","gate","source"],
        "instances": {
                "M1": {
                        "type":"nmos",
                        "nets": {
                                "drain": "drain",
                                "gate": "gate",
                                "source": "source",
                                "bulk": "source"
                        },
                        "R_on": 100.0,
                        "V_DS": 1.2
                }
        }
}

Or matching for a PMOS (tests/single_pmos/single_pmos.json)

{
        "name": "single_pmos",
        "nets": ["drain","gate","source"],
        "instances": {
                "M1": {
                        "type":"pmos",
                        "nets": {
                                "drain": "drain",
                                "gate": "gate",
                                "source": "source",
                                "bulk": "source"
                        },
                        "R_on": 100.0,
                        "V_DS": 1.2
                }
        }
}

Running librepdk_generator -t SG13G2 -
d single_pmos.json -o out
in the tests/single_pmos, opening the magic file in out results in a transistor with the proper amount of fingers.

ngspice -a test1.spice produces the expected output. With 100 Ohms as target R_DS resistance in saturation, with 1.2V over Drain to Source, 12mA are pretty much what we need.

Same now also works for NMOS

I’m done for today… OMG… that was a hackathon.

You can check out the code on our LibreSilicon GitLab repo here: https://gitlab.libresilicon.com/generator-tools/librepdk

Please comment when you know why the predicted currents still are a bit off.

Leave a Reply

Your email address will not be published. Required fields are marked *