Home > Community > Forums > Custom IC Design > Schematic entry parameter as a function of instance name

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Schematic entry parameter as a function of instance name 

Last post Fri, Feb 12 2010 2:39 PM by yoyega. 7 replies.
Started by yoyega 02 Feb 2010 05:33 PM. Topic has 7 replies and 2765 views
Page 1 of 1 (8 items)
Sort Posts:
  • Tue, Feb 2 2010 5:33 PM

    • yoyega
    • Top 500 Contributor
    • Joined on Thu, May 14 2009
    • Valencia, Valencia
    • Posts 18
    • Points 300
    Schematic entry parameter as a function of instance name Reply

     Hi, I have a question concerning a schematic entry. Let's assume that I have defined a subcircuit that has pwl souce inside. This pwl source reads the point/time values from a file, and I want that the name of the file in the definition of the pwl source to be automatically set as a funcion of the name of the instance of the subcircuit. Does anyone knows how to do this?

    Example:

    subckt myckt
        I0 ( node1 node2 ) isource type=pwl file="a_function_of_the_name_of_the_instance_of_myckt"
        ...
    end myckt

    This way, if I have to instantiate several instances of myckt, each instance would automatically read point/time values from different files.

    Thanks,
    Pedro

    • Post Points: 20
  • Wed, Feb 3 2010 12:32 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,263
    • Points 21,565
    Re: Schematic entry parameter as a function of instance name Reply

    Certainly not "automatically"

    Let's ignore the provided SUBCKT syntax provided and try something that PSpice might actually process:

    .SUBCKT MYCKT 1 2

    + PARAMS: MYFILE=SOMEPATH.TXT

    IX 1 2 PWL FILE {MYFILE}

    .ENDS

    Check the PSpice Users Guide and PSpice Reference Guide PDFs for more precise details.

    If you use the model editor to create the Capture part, the part will have a "MYFILE" property that you can put the filename into within the schematic. NOTE SPICE, and therefore, PSpice netlist lines cannot exceed 80 characters in total, so you will to bear that in mind when specifying the filename, also the full filename and path should be specified and should not contain spaces. This method is not really a vast difference over the provided IPWL File part though.

    • Post Points: 20
  • Wed, Feb 3 2010 10:43 AM

    Re: Schematic entry parameter as a function of instance name Reply

    Since the question was about spectre, I'd also say it's not directly possible in spectre - but you could use a similar approach as outlined by oldmouldy. I wondered about using the percent keywords in the filename, but looking at the available percent codes, none is the hierarchical path to the instance (search in cdnshelp for MMSIM71/72 say for "percent").

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Feb 8 2010 9:31 PM

    • yoyega
    • Top 500 Contributor
    • Joined on Thu, May 14 2009
    • Valencia, Valencia
    • Posts 18
    • Points 300
    Re: Schematic entry parameter as a function of instance name Reply

     Hi, thank you for your replies. You are right Andrew, as I am using spectre oldmouldy's approach is not very straightforward. The point is that I have to instantiate and interconect 1024 instances of the same subcircuit (a pixel), and that each instance needs to be excited with a different independent current source, and that each current source has a different dc value. I don't want to entry all the 1024 schematic instances by hand. Do you think that skill language can be helpfull for this?...the truth is that I know nothing about skill programming...

     

    Thanks and regards,

    Pedro

    • Post Points: 20
  • Mon, Feb 8 2010 9:37 PM

    Re: Schematic entry parameter as a function of instance name Reply

    Maybe. You could potentially have some SKILL code which set the fileName parameter on each instance to something unique.

    I'm afraid it's beyond what I have time to help with this week - so I'd recommend either hoping that somebody else on the forum can help, or speaking to Cadence Customer Support (anyway I'd have had to uncover a bit more about how things were structured, or give an example that you could tweak to suit your needs).

    Regards,

    Andrew.

    • Post Points: 20
  • Tue, Feb 9 2010 10:42 AM

    • yoyega
    • Top 500 Contributor
    • Joined on Thu, May 14 2009
    • Valencia, Valencia
    • Posts 18
    • Points 300
    Re: Schematic entry parameter as a function of instance name Reply

     Ok, thank you Andrew. I think that the easiest solution now would be to entry just the schematic of one pixel, to use the Analog Artist to generate the netlist of this one pixel subcircuit, and then incorporate this subcircuit into some c++ code that generates netlist of the full 32x32 pixel matrix (I know how to program in c++). In the mean time I will try to learn the basics of skill programming so I can find a better solution next time...

     

    Thanks again for your answers,

    Pedro 

    • Post Points: 20
  • Tue, Feb 9 2010 6:57 PM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 386
    • Points 7,290
    Re: Schematic entry parameter as a function of instance name Reply

    It seems to me that the best approach would be to write Skill to generate your schematic. Making the parameter dynamically depend on the instance name wouldn't help you very much. Since you'll probably need to explicitly define the instance names, you might as well explicitly define the parameter (pwl file name) at the same time. You could also enhance the code below to wire up your array.

    procedure(buildPixelArray(@optional (cv geGetEditCellView()))
      let((myLib myCell myView origin instName fileName)
        myLib = "myLib"
        myCell = "pixelCkt"
        myView = "symbol"
        for(col 0 31
            for(row 0 31
                origin = list(row col)
                sprintf(instName "Pixel_%02d_%02d" row col)
                sprintf(fileName "/path/to/pwl/%s.pwl" instName)
                inst = dbCreateParamInstByMasterName(cv myLib myCell myView
                    instName
                    origin
                    "R0"
                    1
                    list(
                        list("myPwlParam" "string" fileName)
                    )
                )
            )
        )
      ) ;let
    ) ;proc

    Run this code with an empty schematic open for edit.

    Derek

    • Post Points: 20
  • Fri, Feb 12 2010 2:39 PM

    • yoyega
    • Top 500 Contributor
    • Joined on Thu, May 14 2009
    • Valencia, Valencia
    • Posts 18
    • Points 300
    Re: Schematic entry parameter as a function of instance name Reply

    Hi, thank you very much dmay! I will try the code and see what happens! 

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by yoyega at 02 Feb 2010 05:33 PM. Topic has 7 replies.