• 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 SKILL
  3. Making 'reload' work on custom expressions in plot wind...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 142
  • Views 1505
  • 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

Making 'reload' work on custom expressions in plot window

FormerMember
FormerMember over 12 years ago

 I created a form to help plot analog waveforms as busses in the plot (Visualization) window. When I reload it after a new simulation, I get a warning and an error:

*WARNING* Symbol(s) named " 'expr_19' " used in the definition of dependent expression  'expr_19'
 have not been defined as expressions. This may result in evaluation errors or ambiguous values for the dependent expression.
 Either add these symbol(s) as expression(s) in the Outputs or remove them from the definition of the dependent expression.

expression evaluation failed: val is not legal.
expression evaluation failed: val is not legal.
"(\"eval\" 0 t nil (\"*Error* eval: unbound variable\" expr_19))"

Do I need to make this a calculator function for it to reload?

Here's the code:

*******************************************************************************************
; 5/14/2013 T. Spargo
;
; Form for the tasCreateBus procedure.
; Takes analog waveforms and creates a bus out of them.
;

hiCreateAppForm(
 ?name 'tasCreateBusForm
 ?formTitle "Create Bus"
 ?callback "tasCreateBusCB()"
 ?fields list(
  list(hiCreateStringField(
   ?name 'busName
   ?prompt "Bus name"
   ?value "")
   0:10 250:30 110
  )
  list(hiCreateButton(
   ?name 'selectNet
   ?callback "tasCreateButtonCB()"
   ?buttonText "Select bus")
   260:10 70:30 110
  )
  list(hiCreateStringField(
   ?name 'plotName
   ?prompt "Plot name"
   ?value "")
   0:50 300:30 110
  )
  list(hiCreateIntField(
   ?name 'bitStart
   ?prompt "First bit"
   ?value 7)
   0:90 150:30 110
  )
  list(hiCreateIntField(
   ?name 'bitEnd
   ?prompt "Last bit"
   ?value 0)
   0:130 150:30 110
  )
  list(hiCreateFloatField(
   ?name 'vt
   ?prompt "Threshold voltage"
   ?value 2.38)
   0:170 200:30 110
  )
  list(hiCreateRadioField(
   ?name 'radix
   ?prompt "Radix to use"
   ?value "Hex"
   ?choices '("Binary" "Octal" "Hex" "Decimal") )
   0:210 320:30 110
  )
 )
; tasCreateBusForm->busName->hiToolTip = "Name of the net or bus"
)

;
; tasName2BusList.il
;
; Given a wire name, bit range, and Vt, it creates a list of digital
; signals that can be passed to awvCreateBus.
;
; tasName2BusList("/I0/DQ_buff" 63 32 2.38)

procedure( tasName2BusList(name upperBit lowerBit Vt)
 let( (bit n2BL bitStr nameStr a2D inst)
 n2BL = list()
 inst = geGetInstHier()
 for( bit lowerBit upperBit
  bitStr = sprintf(nil "%d" bit)
  nameStr = strcat(inst "/" name "<" bitStr ">")
  if( debug printf("tasName2BusList: nameStr = %s\n" nameStr) )
  a2D = awvAnalog2Digital(VT( nameStr) nil nil  Vt  1 "centre")
  if( debug printf("tasName2BusList: a2D = %L\n" a2D))
  n2BL = cons(a2D n2BL)
 )
 n2BL
 )
)

; Create a bus from analog bits.
procedure( tasCreateBusCB()
 let( (winNum busName plotName upperBit lowerBit Vt radix wvBus)
 busName = tasCreateBusForm->busName->value
 plotName= tasCreateBusForm->plotName->value
 upperBit = tasCreateBusForm->bitStart->value
 lowerBit= tasCreateBusForm->bitEnd->value
 Vt = tasCreateBusForm->vt->value
 radix = tasCreateBusForm->radix->value
 if( errset(tasName2BusList(busName upperBit lowerBit Vt)) then
  wvBus = awvCreateBus( plotName tasName2BusList(busName upperBit lowerBit Vt) radix )
 else
  wvBus = awvCreateBus( plotName busName radix )
 )
; wvBus = awvCreateBus( plotName tasName2BusList(busName upperBit lowerBit Vt) radix )
 awvPlotWaveform(awvGetCurrentWindow() list(wvBus))
 )
)

; Click on a net to select it
procedure( tasCreateButtonCB()
 let( (obj netName)
 geSingleSelectPoint()
 obj = geGetSelectedSet()
 if( debug printf("tasCreateButtonCB: obj = %L\n" obj))
 type = car(obj~>objType)
 if( and(type != "path" type != "line") then
  printf("Not a wire, objType = %L\n" obj~>objType)
 else
  netName = car(obj~>net~>name)
  if( debug printf("tasCreateButtonCB: netName = %s\n" netName))
  netName = car(parseString(netName, "<"))
  tasCreateBusForm->busName->value = netName
 )
 )
)
 
debug=t
hiDisplayForm( tasCreateBusForm)
********************************************************************************************

I'm using IC6.1.5-64b.500.12 and simulating in ams (irun64: 12.20-s010).

 

Tom

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Hi Tom,

    The issue is that awvCreateBus doesn't store the expression on the waveform object, so reload doesn't know how to re-construct the bus. This is probably a bug, and should be reported to customer support.

    However, you can workaround it like this:

     ; Create a bus from analog bits.
    procedure( tasCreateBusCB()
     let( (winNum busName plotName upperBit lowerBit Vt radix wvBus listOfBusMembers)
     busName = tasCreateBusForm->busName->value
     plotName= tasCreateBusForm->plotName->value
     upperBit = tasCreateBusForm->bitStart->value
     lowerBit= tasCreateBusForm->bitEnd->value
     Vt = tasCreateBusForm->vt->value
     radix = tasCreateBusForm->radix->value
     if( errset(listOfBusMembers=tasName2BusList(busName upperBit lowerBit Vt)) then
      wvBus = awvCreateBus( plotName listOfBusMembers radix )
      ; set the expression attribute on the bus so that it
      drGetWaveformYVec(wvBus)->expression=`awvCreateBus(,plotName
          list(,@foreach(mapcar busMember listOfBusMembers drGetWaveformYVec(busMember)->expression))
          ,radix)
     else
      wvBus = awvCreateBus( plotName busName radix )
     )
    ; wvBus = awvCreateBus( plotName tasName2BusList(busName upperBit lowerBit Vt) radix )

     awvPlotWaveform(awvGetCurrentWindow() list(wvBus))
     )
    )

    (the bit with the comment "set the expression attribute on the bus..." is the relevant part). The backquote part is a convenient way of constructing a list which looks like an expression, but stuffing in the relevant content with , and ,@.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 12 years ago

     Hi Andrew:

     I mostly follow what you're trying to do. There were a couple missing parens that I added, hopefully in the correct places. When I try to use it, I get an "eval: unbound variable - plotName" error. I don't understand the details enough to fix this.

    I don't understand the ->BLOCK EXPRESSION part- what is that? (NOTE FROM MODERATOR: This was an issue with the forum software, and has since been resolved)

    Here's that procedure- it's been simplified a little:

    ; Create a bus from analog bits.
    procedure( tasCreateBusCB()
     let( (winNum busName plotName upperBit lowerBit Vt radix wvBus listOfBusMembers)
     busName = tasCreateBusForm->busName->value
     plotName= tasCreateBusForm->plotName->value
     upperBit = tasCreateBusForm->bitStart->value
     lowerBit= tasCreateBusForm->bitEnd->value
     Vt = tasCreateBusForm->vt->value
     radix = tasCreateBusForm->radix->value
     listOfBusMembers = tasName2BusList(busName upperBit lowerBit Vt t))
     wvBus = awvCreateBus( plotName listOfBusMembers radix)
     ; 'reload' fix from Cadence
     ; Set the expression attribute on the bus so that it remembers how to recreate it.
     drGetWaveformYVec(wvBus)->expression = `awvCreateBus(,plotName
      list(,@foreach(mapcar busMember listOfBusMembers drGetWaveformYVec(busMember)->expression)),
      radix)
     awvPlotWaveform(awvGetCurrentWindow() list(wvBus))
     )
    )

     Thanks,

    Tom

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Tom,

    No idea what happened - when I pasted the code, something went wrong with the brackets, and I've no idea where the BLOCKED EXPRESSION bit came from (now fixed in the forum software)!

    I'll try pasting it again:

    ; Create a bus from analog bits.
    procedure( tasCreateBusCB()
     let( (winNum busName plotName upperBit lowerBit Vt radix wvBus listOfBusMembers)
     busName = tasCreateBusForm->busName->value
     plotName= tasCreateBusForm->plotName->value
     upperBit = tasCreateBusForm->bitStart->value
     lowerBit= tasCreateBusForm->bitEnd->value
     Vt = tasCreateBusForm->vt->value
     radix = tasCreateBusForm->radix->value
     if( errset(listOfBusMembers=tasName2BusList(busName upperBit lowerBit Vt)) then
      wvBus = awvCreateBus( plotName listOfBusMembers radix )
      drGetWaveformYVec(wvBus)->expression=`awvCreateBus(,plotName 
          list(,@foreach(mapcar busMember listOfBusMembers drGetWaveformYVec(busMember)->expression))
          ,radix)
     else
      wvBus = awvCreateBus( plotName busName radix )
     )
    ; wvBus = awvCreateBus( plotName tasName2BusList(busName upperBit lowerBit Vt) radix )
    
     awvPlotWaveform(awvGetCurrentWindow() list(wvBus))
     )
    )

     

    Note, I didn't include the simplifications you made - I'll leave you to do that.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • 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.

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

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