After being unable to get TI's CD4049UB PSpice model working in ngspice, I started using this 2-MOSFET CMOS circuit illustrated here to get my simulations at least close:
It has worked great for testing, but I'd prefer to fit that circuit's functionality into a library usable with KiCad's built-in 4049 component symbol (which has 7 units- the 6 inverters plus power), as illustrated for example here, with one inverter and the IC's power connections:
The problem is that I have no idea how to write the subcircuits required to fit this simple circuit, and no amount of reading docs and looking at examples makes it clearer to me. Particularly mysterious to me is how to get that 7th unit (power) in KiCad's 4049 symbol powering the 6 inverter instances in the IC.
Here's the complete netlist for a basic working example of my CMOS circuit:
.title KiCad schematic
M1 out in VCC VCC MPMOS
M2 out in 0 0 MNMOS
V1 VCC 0 9
V2 in 0 sin(4.5 4v 1k)
.model MNMOS NMOS level=8 version=3.3.3
.model MPMOS PMOS level=8 version=3.3.3
.tran 50u 10m
.end
Thanks in advance for any insight.