Tuesday 1st February 2022
Is there a good way to update the netlist/model for a component when I modify the sheet it came from, assuming the ports didn't change?
One option I’ve tried is to just delete the component and re-add it, but I have to make sure the new symbol matches the old ones. This is the method I usually use.
Another option I’ve tried is to view the netlist for the sheet, copy the relevant lines, and paste the lines into the right place in the model for the component, which works, but is error prone and assumes the required models didn't change.
A third option I looked at was making a script to do it, but I don’t know how to get the required models, and I couldn’t figure out how to get the ports for the current sheet.
Jürgen LayoutEditorFull Tuesday 1st February 2022Attachments: (only for registered users) Screenshot_20220201_104153.png
In case the component sheet is in the same *les* schematic file the component will be listed in the *-internal-* library. Here you have an option to update the spice netlist in an automatic way. Just make sure the option *create netlist/model information from schematic* is active
If you use a separate library file for the component you can go to the component and press *edit component* and enter the new netlist model. From then on all new created netlist will use the new model in the current opened LayoutEditor instance. In case you are running the LayoutEditor twice, one for the library and one for the schematic you need to restart the second instance after making the changes to make it effective.
So I think there is no need to do any scripting. Nevertheless it is possible. Get the component you want to adjust with components::findComponent() and then set the new netlist/model with setNetlist()/setModel(). If you need a more detailed example for this, please let me know.
Tuesday 1st February 2022
Thanks. I was not aware that the internal library was handled differently from separate libraries. I was always adding components to a separate library. I can just use the internal library until I'm satisfied that the sheet/component is finalized, and them move it to a separate library.
The updating was a little confusing at first. I'd change the sheet for the component, then switch to the testbench sheet with the simulation components, and changes wouldn't appear in the netlsit. I found I could close and re-open the schematic before simulating to get the updated component, but eventually just added
`schematic->drawing->updateNetlist();` at the beginning of the simulation/netlisting script and now it functions as I'd like.