unihd-cag / skillbridge

A seamless python to Cadence Virtuoso Skill interface
https://unihd-cag.github.io/skillbridge/
GNU Lesser General Public License v3.0
185 stars 39 forks source link

[SUPPORT] Using the plot function with OCEAN scripting in Python #221

Closed PaulKokhanov1 closed 1 year ago

PaulKokhanov1 commented 1 year ago

Hello, I was having issues on how to use the plot function in OCEAN using skillbridge. I am using the code line image However I get the following error when running my code image What would be the best way to solve this issue, as trying to do something along the lines of ws'plot' causes python to think I am attempting to plot the expression "VS('/net1')" instead of just net1, and thus virtuoso is unable to find the expression in my dc results. Any suggestions? Thanks

nielsbuwen commented 1 year ago

Hi,

can you show me the original OCEAN code that you want to translate?

Is it plot("VS('/net')") or plot(VS('/net')).

The first code would be ws['plot']("VS('/net')") in python and the second is a bit more complicated:

ws['plot'](ws['VS']('/net'))  # this should work
PaulKokhanov1 commented 1 year ago

Hello,

Yes it was the second one, specifically, image

But ws['plot'](ws['VS']('/net')) did work! Thank you so much.

nielsbuwen commented 1 year ago

Glad i could help.

Depending on the size of the return value of VS("/net") it could be faster to only compute that part on the SKILL side.

ws['plot'](ws['VS'].var("/net"))  # notice the 'var'

ws['VS'].var is a symbolic expression that is only evaluated on the SKILL side. My original answer sends the results from VS to python and then back to SKILL. With the new snippet you save that round-trip. The downside is that you can't use the result from VS on the python side.

Feel free to close the issue, when you don't have any more questions about this.