Quantcast
Channel: Cadence Community
Viewing all articles
Browse latest Browse all 3331

Making 'reload' work on custom expressions in plot window

$
0
0

 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 BLOCKED EXPRESSION 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

 


Viewing all articles
Browse latest Browse all 3331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>