Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
.include vs .lib directives
Hello guys,
I'd like to ask how ngspice, under the hood of Kicad, actually manages library files.?
?
From ngspice manual, there are two ways to include .models or .subckt, namely using .include vs .lib directive.
?
.include <filename> literally includes the content of <filename> where the directive is located (e.g. within a .cir netlist). It works, let's say, just like the #include pre-processing directive in C language.
?
.lib instead actually includes only parts from library referenced in the file where the .lib directive is. The manual says that. lib directive has the following format: .lib <filename> libname. The latter should be the name of a "section" within the <filename> library file.
?
If the above is correct, what are the "markers" of sections within the library files ?
?
Thanks.
? |
开云体育Try opening a library file in a text editor
(but be careful with Notepad - it sometimes plays tricks) and
look through it. I think you will see plainly the section
markers. On 2025-02-26 19:22, Carlo wrote:
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion |
开云体育On 26/02/2025 20:22, Carlo wrote:
If the above is correct, what are the "markers" of sections within the library files ?.subckt <name> 1 2 3 .. .. .ends <name> The above. -- Regards,
Tony |
On Wed, Feb 26, 2025 at 01:35 PM, Tony Casey wrote:
.subckt <name> 1 2 3From ngspice-44 manual section 2.10:
From above I believe the "markers" are .LIB and .ENDL statements within the library file itself. I'll do a test using them within a my library.
?
Carlo.
? |
开云体育On 27/02/2025 08:38, Carlo wrote:
That would make .subckt models non-portable between different SPICE simulators. -- Regards,
Tony |
On Thu, Feb 27, 2025 at 12:28 AM, Tony Casey wrote:
That would make .subckt models non-portable between different SPICE simulators.Of course, the solution is not modify the library itself (no .LIB <libname> .ENDL within it) but use "set ngbehavior=lt" command into .spiceinit configuration file for ngspice. ?
Carlo. |
to navigate to use esc to dismiss