← Back to team overview

kicad-developers team mailing list archive

Re: Spice Netlist Modification


I just realized that I transposed the VALUE and model statements for 
the spice line. Adding a model to a passive device should be in the 
form: R1 1 2 RMOD 10K. I will modify the code this evening and re-
post the file. You just need to switch the VALUE and FIELD8 texts.

Sorry for any confusion this may have caused.


--- In kicad-devel@xxxxxxxxxxxxxxx, "bam3976" <bam3976@...> wrote:
> I am a new user of Kicad and so far I have been very impressed. 
> job to Jean-Pierre for a nice package.
> After trying the Spice netlist option, I was left wishing there 
> some more options in building the spice line for each component.  
> it stands now, the spice line is basically REFDES <nodes> VALUE.  
> This has some limitations when you want to add more to the spice 
> line and not change the VALUE displayed in the schematic.
> For example, if I had a transistor that had a VALUE of 2N2222, the 
> spice line would display as follows: Q1 1 2 3 2N2222. This would 
> fine if my model name was the same as the VALUE. If the model name 
> was something like QMOD_2N2222, this wouldn't work.
> Another example would be the case of adding a model to a passive 
> component like a resistor. To do this in Spice you need to add the 
> model name after the resistance value. A 10K resistor would 
> as follows: R1 1 2 10K. To add the model it would need to be: R1 1 
> 10K RMOD.
> Although I am not a software coder, I made an attempt to fix this 
> using some of the additional fields available for the components. 
> suggestion is to add a couple of Spice value fields that the user 
> can populate and they will only display in the spice netlist. I set 
> up FIELD7 to be used to completely replace the VALUE in the spice 
> netlist. I used FIELD8 to add additonal text after the VALUE on the 
> same line. If both fields are empty, the netlist will default to 
> original line.
> I made changes to NETFORM.CPP which I will rename as NETFORM_A.CPP 
> and post in the files section. The function I modified is called 
> WriteNetListPspice. If anyone else thinks this is a good idea maybe 
> it could be added to the program. Since I am not very good with 
> software, maybe someone could clean this up and make it better.
> Brad

Follow ups