• Home
  • :
  • Community
  • :
  • Forums
  • :
  • Custom IC SKILL
  • :
  • axlOutputResult statements in a loop?

Custom IC SKILL Forums

axlOutputResult statements in a loop?

smikes
smikes 2 months ago

I'm trying to use the type=ocean in Assembler to add outputs. I can do this:

axlOutputResult(-1/(2*pi*1e6*imag(vfreq('ac "/CULVTP"))) "CULVTP")
axlOutputResult(-1/(2*pi*1e6*imag(vfreq('ac "/CLVTP"))) "CLVTP")
axlOutputResult(-1/(2*pi*1e6*imag(vfreq('ac "/CSVTP"))) "CSVTP")

And everything works fine. If I try to get fancy and avoid the massive repetition (this is just a snippet, there are more) it doesn't work though.

foreach(output list("CULVTP" "CLVTP" "CSVTP")
    axlOutputResult(-1/(2*pi*1e6*imag(vfreq('ac strcat("/" output)))) output)
)

Nothing gets populated in the outputs list. I also tried

CULVTP = -1/(2*pi*1e6*imag(vfreq('ac "/CULVTP"))
CLVTP = -1/(2*pi*1e6*imag(vfreq('ac "/CLVTP"))
CSVTP = -1/(2*pi*1e6*imag(vfreq('ac "/CSVTP"))

foreach(output list("CULVTP" "CLVTP" "CSVTP")
    axlOutputResult(evalstring(output) output)
)

And this also produces no outputs.

Why don't either of these work?

Using: sub-version  ICADVM20.1-64b.500.15

  • Reply
  • Cancel
  • Cancel
  • Andrew Beckett
    Andrew Beckett 2 months ago

    You need to add:

    axlAddOutputs('("CULVTP" "CLVTP" "CSVTP"))

    to the first line in your script to advertise to ADE that these outputs are going to be produced by the script. There's an attempt to statically parse the script to identify the outputs and that can't happen if it's in a loop. In much older versions of ADE XL (prior to Assembler) the axlAddOutputs was always required, but it was changed to allow allow literal axlOutputResult() calls to be parsed too - but if both the axlAddOutputs isn't present, or the axlOutputResult is in a loop, it can't identify the outputs unless the script is run - which doesn't make sense at the point the script is added/parsed (since the results are not available at that point, it would fail in most cases).

    Andrew.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • smikes
    smikes 2 months ago in reply to Andrew Beckett

    So this works:

    axlAddOutputs(list(
     "d_rf0" "d_rf1" "d_rf2" "d_rf3" "d_rf4" "d_rf5" "d_rf6" "d_rf7" "d_rf8" "d_rf9"
    ))
    for(i 0 9
        axlOutputResult(
            delay(?wf1 vtime('tran "/in0") ?value1 (VAR("vsup") / 2) ?edge1 "rising" ?nth1 -1 ?td1 0.0 ?tol1 nil ?wf2 vtime('tran "/out0") ?value2 (VAR("vsup") / 2) ?edge2 "falling" ?nth2 -1 ?tol2 nil ?td2 nil ?stop nil ?multiple nil)
            sprintf(nil "d_rf%d" i)
        )
    )

    But this:

    outputs = nil
    for(i 0 9
        outputs = cons(sprintf(nil "%s%d" "d_rf" i) outputs)
    )
    axlAddOutputs(outputs)

    for(i 0 9
        axlOutputResult(
            delay(?wf1 vtime('tran "/in0") ?value1 (VAR("vsup") / 2) ?edge1 "rising" ?nth1 -1 ?td1 0.0 ?tol1 nil ?wf2 vtime('tran "/out0") ?value2 (VAR("vsup") / 2) ?edge2 "falling" ?nth2 -1 ?tol2 nil ?td2 nil ?stop nil ?multiple nil)
            sprintf(nil "d_rf%d" i)
        )
    )

    Yields:

    *Error* car: argument #1 should be a list (type template = "l") - outputs

    By the way why does the software have to be forewarned as to the coming output names? It seems like the axlOutputResult() call contains an expression and [optional] name, shouldn't that be all the information the tool needs to register an output?

    In any case is there a way to pass a list variable to axlAddOutputs() that won't throw a cryptic error? I really would rather not type out all 50 of my incrementally-named outputs.

    Thanks!

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 2 months ago in reply to smikes

    As I mentioned before, the issue here is that the OCEAN script is analysed statically - i.e. not evaluated - at the time the OCEAN script is edited. This then allows any outputs found within the script to be added to the ADE outputs pane so that you can add specs on them. This "static" analysis is done by parsing the file - it doesn't actually run the code though, so loops won't work. It can't just run the code, because at the time the script is edited there may not be any simulation results, and so it would most likely fail.

    It's a tricky problem - providing you a scripted way of adding multiple outputs, but needing to add the outputs early so that you can add specifications. There's not really an easy way to automatically handle that except for the case of a literal list of outputs, however inconvenient that might be.

    Regards,

    Andrew

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel

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.