Hi -- > the spice-SDB backend includes the library with the .INCLUDE card and > additionally includes the whole file. > > Is this the desired behaviour. Do you expect any problems based on the > multiple definition of the models?
Well, it may or may not be the desired behavior; that's a question for the users (including you). For better or worse, it *is* the way that spice-sdb is currently programmed to work. Here are some workarounds: 1. You can put a .include card in your SPICE deck by using a SPICE directive symbol (in the SPICE symbol library), and typing ".include foo.lib" into the value field. This will put the raw ".include foo.lib" into your deck without dumping the contents of the foo.lib file into your deck. 2. You can invoke spice-sdb like this: gnetlist -I -g spice-sdb foo.sch The -I flag tells gnetlist to not put the contents of any file into the netlist, but rather just put a ".include foo.bar" directive in the deck. (Note that I don't think I have tested this on .include directives, so if it does the wrong thing, please let me know. As for the desired behavior of spice-sdb, I have received a complaint or two previously about how the .include directive works. Perhaps I should fix the behavior. The question is: What should the behavior be. Here are some suggestions for you to think about: 1. I could just remove the .include directive symbol. Then, users who want to put a SPICE directive into their netlists would have to use the SPICE directive symbol as described above. This solution is totally unambiguous, but it does require the user to know about the .include card's syntax. 2. I could make the .include symbol simply embedd ".include foo.bar" into the SPICE netlist. This is probably what you are expecting. Is this what people want? But then how can I tell spice-sdb to stick a foreign SPICE file into the current netlist? Through an "embedd" symbol which is used explicitly to embedd an external file into the current netlist? 3. Any other possibilities? If everybody using spice-sdb offers an opinion I am open to changing it to implement the most logical behavior. Finally, FWIW, your SPICE simulator should not be confused by the appearance of multiple .models in your deck. ISTR that the SPICE parser creates a list of .models it has seen in your deck, and checks to see if a model is already in the list before it sticks a new one in. No promises, though! Stuart