Tim Edwards

08/18/2020, 5:26 PM
@User: Well, then, I can at least ask about the things that I am having issues with at the moment, which mainly where spectre and ngspice depart from each other in syntax in fundamental ways. In the ngspice documentation, the suggestion is that if you want to pass a parameter to a subcircuit, you need to have the parameter named on the ".subckt" line, and the value after "=" is unused/discarded. But then if the parameter is on the ".subckt" line, then it becomes mandatory, and it is not legal to call the subcircuit without it. If you have parameters on a ".param" line inside the subcircuit, they are local to the subcircuit. However, the spectre subcircuits sometimes put parameters on the .subckt line, sometimes in a .param line, and apparently that doesn't make a difference in how you can call the subcircuit (?). I'm confused about this point. But for a transistor, say, if you want to be able to pass the source/drain areas or bsim4 parameters "sa", "sb", and "sd", number of fingers, etc., then those must always be passed when you instantiate the transistor. But most of those parameters aren't known by any tool except maybe the layout editor (Magic doesn't even know how to generate the bsim4 parameters, although I guess I will take a stab at implementing it sometime). I think the traditional way to handle that is for tools like schematic capture to pass some "special" value like "-1" to parameters, and then the subcircuit model checks for that and substitutes some "reasonable" estimate based on L, W, etc. I do not know if those restrictions are really in ngspice, or if the documentation is correct, or up to date. I do not want to have to rewrite every device model to get it to work.