← Back to team overview

kicad-developers team mailing list archive

Re: Spice Netlist Modification

 

I have just re-posted the file and added an additional field for a 
reference designator prefix. If you add text to FIELD6, it will be 
placed in front of the current REFERENCE value. This is needed in 
spice when you want to define a subcircuit which must begin with an 
X.

Summary of changes:
FIELD6 - Reference designator prefix to be placed in front of the 
component REFERENCE field without a space.

FIELD7 - Replaces the component VALUE in the spice line.

FIELD8 - Inserted between the component nodes and VALUE.

Brad

--- In kicad-devel@xxxxxxxxxxxxxxx, "bam3976" <bam3976@...> wrote:
>
> 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.
> 
> Brad
> 
> --- In kicad-devel@xxxxxxxxxxxxxxx, "bam3976" <bam3976@> wrote:
> >
> > I am a new user of Kicad and so far I have been very impressed. 
> Good 
> > job to Jean-Pierre for a nice package.
> > 
> > After trying the Spice netlist option, I was left wishing there 
> were 
> > some more options in building the spice line for each 
component.  
> As 
> > 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 
> be 
> > 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 
> display 
> > as follows: R1 1 2 10K. To add the model it would need to be: R1 
1 
> 2 
> > 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. 
> My 
> > 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 
> the 
> > 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
> >
>










References