• 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. back annotating bussed terminal DC voltages with cdsterm...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 127
  • Views 2189
  • 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

back annotating bussed terminal DC voltages with cdsterm in Symbol

ebecheto
ebecheto 7 months ago

Unfortunately, Cadence Forum had put this LOCK feature in the forum, so we cannot "necro post" to a question, even if we found the solution to a question thanks to the reply in the topic.

I want to replying to this post :

 Annotating bussed terminal voltages with cdsTerm() 

I found a solution to put instead of the cdsTerm("myBUS<7:0>") in the symbol label

Here is my answer :


strcat("0b" apply('strcat foreach(mapcar cds list(cdsTerm("ADJUST<7>") cdsTerm("ADJUST<6>") cdsTerm("ADJUST<5>") cdsTerm("ADJUST<4>") cdsTerm("ADJUST<3>") cdsTerm("ADJUST<2>") cdsTerm("ADJUST<1>") cdsTerm("ADJUST<0>")) sprintf(nil "%d" floor(evalstring(cds))))))

Unfortunatly, we cannot loop on index with only one name to modify, since cdsTerm will not evaluate sprintf. (mayby there is a trick with apply/eval/evalstring, but i did not try.

cdsTerm(sprintf(nil "qin7<%d>" 0)) ;=> error

Hope it helps.

++

  • Cancel
  • henker
    henker 7 months ago

    evalstring( sprintf(nil "cdsTerm(%L)" bitname) ) should work, and than loop over dbProduceMemName("ADJUST<7:0>"), might be more readable.

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ebecheto
    ebecheto 7 months ago in reply to henker

    Hi henker,

    Yes indeed, :

    apply('strcat foreach(mapcar s dbProduceMemName("qin6<7:0>") evalstring(sprintf(nil "cdsTerm(%L)" s) ))) ;=> ok

    Is more clear, but the ouput in the symbol is : 01.81.801.81.801.8   for   "0b0110 1101"

    The nice output is want is "0b01101101" in the label.

    I managed it with :

    strcat("0b" apply('strcat foreach(mapcar cds list(cdsTerm("ADJUST<7>") cdsTerm("ADJUST<6>") cdsTerm("ADJUST<5>") cdsTerm("ADJUST<4>") cdsTerm("ADJUST<3>") cdsTerm("ADJUST<2>") cdsTerm("ADJUST<1>") cdsTerm("ADJUST<0>")) sprintf(nil "%d" floor(evalstring(cds))))))

    But i was not able to do it so far, even with your trick. IF i mix the two ideas i got nil or nothing in the label.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • henker
    henker 7 months ago in reply to ebecheto

    My evalstring example returns a string with the annotated voltage on that bit (the string that is returned by cdsTerm).

    You want a logic value, which you generate by calculating the floor of the number representation of the annotation value (which is the result of the evalstring in your example), This however obviously only works if your output voltage is between 1 and 2 (>=1 && <2 to be exact).

    You have to combine both approaches, I had intentionally left this as your home exercise...

    Anyway, stretched with comments:

    strcat(
    	"0b" 
    	apply('strcat 
    		foreach(mapcar s dbProduceMemName("qin6<7:0>")
    			; s contains each bit of the bus notation
    			s = evalstring(sprintf(nil "cdsTerm(%L)" s))
    			; s contains the string of the annotated value (can be voltage, can be something else)
    			s = atof(s)
    			; s now contains a float value if the input string was a number, nil otherwise
    
    			; return result of a A2D conversion with a threshold; in your example maybe VDD/2 = 0.9V
    			; also should handle what happens if no voltage is annotated, here just return ""
    			if(s if(s<0.9 "0" "1") "")
    		)
    	)
    )

    Instead of a complicated one-liner you also could put this into a procedure with some control arguments, where you have a bit more freedom, and call this in the label, e.g.
    cdsTermBusAD("qin6<7:0>" ?threshold 0.9 ?encoding "binary").

    I leave options and possibilities of this approach to your fantasy, just for starters, e.g. instead of the fixed threshold you could get the current supply/ground voltage from the instance and calculate the threshold with that. Again, as home exercise, if you want...

    Regards,

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • ebecheto
    ebecheto 7 months ago in reply to henker

    How do you know i a am a one-liner fan? ;-)

    Here is you solution that works :

    strcat("0b" apply('strcat foreach(mapcar s dbProduceMemName("qin6<7:0>") if(atof(evalstring(sprintf(nil "cdsTerm(%L)" s)))>0.9 "1" "0")))) ;<= one liner solution OK !
    

    !

    I was almost there, but if you remove the atof part, the result is nil. That was my mistake.

    But i did not imagine it was possible to create one's function and call it in the symbol label. I love that feature. May be i will dig into it later. (I need to do my work before my homeWork)

    Thanks Henker for your nice tips.

    Regards,

    • 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