I'm having some trouble with blackboxing in netgen...
# analog-design
d
I'm having some trouble with blackboxing in netgen. My ultimate goal is to get this to pass (it currently fails for me when I clone the repo): https://github.com/efabless/caravel_user_project_analog/blob/main/netgen/run_lvs_wrapper_verilog.sh I think the challenge is that we need to treat the analog subcircuit as a blackbox because its verilog implementation is only a functional model. I can't get the "model mycellname blackbox" command to work as I expect, even on a tiny example. My failing examples, with some notes, are here: https://github.com/standanley/netgen_blackbox_test
t
There is a way to do this by writing a custom setup script that first loads a SPICE netlist for the analog block, and then reads the verilog top level module, and assigns them both to the same netlist. Otherwise, though, I will need to take a look at your example; the fact that the module is behavioral means that netgen is supposed to detect that and automatically treat the module as a black-box. So I'm not sure why that isn't happening.
The purpose of pin matching is that it is otherwise possible (as Weston has noted) to, say, swap plus and minus inputs on an opamp and be none the wiser because the topology is the same. But to compare pins, either (1) the pin names have to be the same in both netlists, or (2) you have to make a very complicated setup file where you tell netgen exactly what pin names are supposed to match each other in both netlists. I am attaching a variation of your two files (spice and verilog). Your verilog was incorrect to begin with since you declared module "child" but instantiated module "child_v" which does not exist. Mostly I just made sure the module name matches the subcircuit name and the pins all have the same names, and then everything works fine. If you insist on mismatched cell names you can use the "equate classes" command but you should give the canonical form for each class with the circuit included, such as "-circuit1 child" and "-circuit2 child_v". If you insist on having different pin names, it can be handled, but becomes much more complicated in the setup.
BTW, comparing these two netlists requires nothing special in the setup file; a stock/empty setup file will do.
d
Got it, thanks! The verilog was probably broken because I had tried many combinations of matching / non-matching names, but apparently not the version that worked.