• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. PSpice
  3. Creating and editing models

Stats

  • State Not Answered
  • Replies 6
  • Subscribers 26
  • Views 14239
  • Members are here 0
More Content

Creating and editing models

Mohammad Sadr
Mohammad Sadr over 4 years ago

Hi Friends

I needed an LM565 to simulate, but unfortunately, the software did not have that LM565, and I accidentally saw this code on the Internet!
But I do not know how to give this code to the software!

The code is available in the following file

8637.SUBCIRCUIT.pdf

I have another problem and that I do not know what the format code is ?! And that when I copied this code from this PDF I had to change it. Can you help me and tell me if the code in the file above is the same as the code I wrote below or not ?!

Thank You

code:

.SUBCKT LM565 1 2 3 4 5 6 7 8 9 10
C_C1 0 init 1u
R_R3 $N_0001 6 1.75k
R_R4 0 init 1g
R_R6 8 9 10g
R_R2 3 0 10g
R_R1 $N_0002 7 3.6k
E_E15 $N_0002 0 VALUE { V($N_0003, 0)+V(6,0) }
E_E1 $N_0003 0 TABLE { 0.68*V(2, 0)*V(5,0) } + ( (-0.68,-0.68) (0.68,0.68) )
G_G1 init 0 VALUE { (V(7,0)-V(6,0))*0.00001458/(R0*C0*(V(10,0)-V(1,0))) }
E_E13 4 0 VALUE {sin(6.28*(0.27/(R0*C0))*(time+(R0*C0/(6.28*0.27))*V(0,init))) }
E_E3 $N_0001 0 VALUE {0.126354*(0.7+V(1,0))+0.873646*V(10,0) }
.ENDS
  • Sign in to reply
  • Cancel
Parents
  • ShawnLogan
    0 ShawnLogan over 4 years ago

    Dear Mohammad,

    Mohammad Sadr said:
    I have another problem and that I do not know what the format code is ?! And that when I copied this code from this PDF I had to change it. Can you help me and tell me if the code in the file above is the same as the code I wrote below or not ?!

    I am sorry, but your question(s?) is (are) not 100% clear to me. I think you are asking two questions.

    1. What netlist format is the code you provided in this post?

    2. Is this netlist provided in your post equivalent to that contained in the Adobe file for which you provided the URL?

    I will try to answer my "version" of your questions and hope I understand Mohammad...

    1. The netlist format is clearly SPICE. In order to use that file in a spectre based simulation, the following article will provide a step-by-step process to create a symbol for this netlist and include the SPICE formatted netlist in a spectre simulation. I have used the procedure successfully countless number of times.

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nXEGEA2&pageName=ArticleContent

    2.  It appears the netlist code you provided in your post is a copy of that shown in the Adobe file whose link you provided. If you read this article, it includes the clause "Teh SPICE netlist of developed model is:", which confirms that the code is in SPICE format. Given that your netlist is identical to that in the Adobe file, I have no reason to believe the two are different. I am not sure why you might think they are not the same - but perhaps I do not have a correct understanding of your question!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Andrew Beckett
    0 Andrew Beckett over 4 years ago in reply to ShawnLogan

    Hi Mohammad,

    More importantly, knowing which tool you're actually trying to use this model in is pretty key. Given that this is a discrete component, I suspect you're probably wanting to use PSPICE, in which case the PCB Design forum would be more appropriate than the forum on Custom IC Design. The answers would be different, I'm sure - if we know, I can move the thread over to the PCB Design forum if that's more relevant.

    The format is actually PSPICE format (there may be other flavours of SPICE which it also works in, but this is an extension of Berkeley SPICE but the behavioural constructs look very PSPICE-like).

    If you were to include it in a spectre simulation, you'd need to use the "pspice include" on Setup->Simulation Files in ADE (just including it as a model file won't work), or using the links that Shawn shared, you'd ensure it was a pspice text view.

    There is a mistake in the code - the line for E_E1 has a "+" in the middle which shouldn't be there. In SPICE and PSPICE, a "+" at the beginning of the line is a continuation character, and simply is a way of indicating that the next line is a continuation of the previous. Since you've combined onto one line, that + shouldn't be there (Spectre complains because of this, and it's fine if removed).

    The model also refers to two global parameters R0 and C0 which I assume refer to the external restore and capacitor values connected to the VCO in Figure 2. So in ADE you'd need to define those as design variables.

    If you're using PSPICE however, other than fixing the + on E_E1, the setup would be different so that's why I'd direct you to somebody familiar with PSPICE who can give more directed advice.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Andrew Beckett
    0 Andrew Beckett over 4 years ago in reply to ShawnLogan

    Hi Mohammad,

    More importantly, knowing which tool you're actually trying to use this model in is pretty key. Given that this is a discrete component, I suspect you're probably wanting to use PSPICE, in which case the PCB Design forum would be more appropriate than the forum on Custom IC Design. The answers would be different, I'm sure - if we know, I can move the thread over to the PCB Design forum if that's more relevant.

    The format is actually PSPICE format (there may be other flavours of SPICE which it also works in, but this is an extension of Berkeley SPICE but the behavioural constructs look very PSPICE-like).

    If you were to include it in a spectre simulation, you'd need to use the "pspice include" on Setup->Simulation Files in ADE (just including it as a model file won't work), or using the links that Shawn shared, you'd ensure it was a pspice text view.

    There is a mistake in the code - the line for E_E1 has a "+" in the middle which shouldn't be there. In SPICE and PSPICE, a "+" at the beginning of the line is a continuation character, and simply is a way of indicating that the next line is a continuation of the previous. Since you've combined onto one line, that + shouldn't be there (Spectre complains because of this, and it's fine if removed).

    The model also refers to two global parameters R0 and C0 which I assume refer to the external restore and capacitor values connected to the VCO in Figure 2. So in ADE you'd need to define those as design variables.

    If you're using PSPICE however, other than fixing the + on E_E1, the setup would be different so that's why I'd direct you to somebody familiar with PSPICE who can give more directed advice.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Mohammad Sadr
    0 Mohammad Sadr over 4 years ago in reply to Andrew Beckett
    Andrew Beckett said:
    There is a mistake in the code - the line for E_E1 has a "+" in the middle which shouldn't be there. In SPICE and PSPICE, a "+" at the beginning of the line is a continuation character, and simply is a way of indicating that the next line is a continuation of the previous. Since you've combined onto one line, that + shouldn't be there (Spectre complains because of this, and it's fine if removed).

    Hi

    This was exactly my problem, when I copied the code I said to myself, is this + now for addition, or does it have another use ?! 

    Because I saw this example in a document. And well, I'm not familiar with this code either, I just want my circuit to work, that's it!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Andrew Beckett
    0 Andrew Beckett over 4 years ago in reply to Mohammad Sadr

    OK, having seen your other post in this thread, your questions are about Orcad Capture (and hence Pspice) so I'll move this thread into the PCB Design forum as that's the best place for it. You should also ideally speak to your College Tutor as they should be giving you some guidance on how to start...

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Mohammad Sadr
    0 Mohammad Sadr over 4 years ago in reply to Andrew Beckett

    I'm sorry, I did not realize that I had to raise this issue in the PCB section, but whatever you do, I am a newcomer.
    Since the topic was about model design and EC, I guessed this forum is better.
    In any case, I apologize.

    Well, our teacher does not give any instructions and expects us to do everything, even from 0 to 100, I did this learning with this software myself.
    Thank you dear friend

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information