• 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. Custom IC Design
  3. Reading from a text file in Spectre

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 16743
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reading from a text file in Spectre

Analogstudent
Analogstudent over 13 years ago

Hi all,

How can I convert the below Hspice code to something acceptable for Spectre?

************************************************************************************

 Simulator lang=spice

.Tran 100u 1m


.DATA vals LAM
+ FILE='data1'
+ idep1val=1
+ itd1val=2
.ENDDATA   ****** This is how it works in Hspice

Idep1 vdd idep1  idep1val   ***** Bias currents in my spectre netlist
Itd1  vdd itd1   itd1val  

 *********************************************************************

This is the stimulus file that I have included for my scptre simulation.  

It works fine if I just mention the reuired values like this:

Idep1 vdd idep1  100u
Itd1  vdd itd1   100p 

But I need to read these values from an extrenal file and that's where it doesn't like it.

 Is there any better way of doing this?

Your help is highly appreciated.

Regards

Mostafa

 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Mostafa,

    The only point of using a paramset is if you want to sweep - so for example you can use a sweep analysis to vary the parameters over the paramset. But you need a default value defined in a parameters statement:

     

    // parameter set example
    parameters p1=1 p2=2 p3=3 p4=4 val1
    r1 1 2 resistor r=p1
    r2 2 3 resistor r=p2
    r3 3 4 resistor r=p3
    r4 4 0 resistor r=p4
    v1 1 0 vsource dc=1

    mydata paramset {
    p2 p3
    1 2
    1 0.5
    2 3
    }

    sweep1 sweep param=p1 start=1 stop=2 step=1 {
      sweep2 sweep paramset=mydata {
          sweep4 sweep param=p4 start=1 stop=5 step=1 {
            dc dc start=0.5 stop=5 step=0.5 param=dc dev=v1
          }
        }
    }

     

     Hopefully that's clearer

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Mostafa,

    The only point of using a paramset is if you want to sweep - so for example you can use a sweep analysis to vary the parameters over the paramset. But you need a default value defined in a parameters statement:

     

    // parameter set example
    parameters p1=1 p2=2 p3=3 p4=4 val1
    r1 1 2 resistor r=p1
    r2 2 3 resistor r=p2
    r3 3 4 resistor r=p3
    r4 4 0 resistor r=p4
    v1 1 0 vsource dc=1

    mydata paramset {
    p2 p3
    1 2
    1 0.5
    2 3
    }

    sweep1 sweep param=p1 start=1 stop=2 step=1 {
      sweep2 sweep paramset=mydata {
          sweep4 sweep param=p4 start=1 stop=5 step=1 {
            dc dc start=0.5 stop=5 step=0.5 param=dc dev=v1
          }
        }
    }

     

     Hopefully that's clearer

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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