Quantcast
Channel: Cadence Technology Forums
Viewing all articles
Browse latest Browse all 63257

Forum Post: RE: Convert Digital Bus to an Integer value - Calculator Viva

$
0
0
Hi Faisal, I had a few minutes on a plane yesterday (I know how to have fun!), so I threw this together. It needs the code from this post too (I made life easier for myself by reusing some of that code). To use it, use the "fx" button in the calculator function panel and navigate to the file - it will add the calculator UI too which works just like analog2Digital. See the comments at the top for an example usage. /* abA2DBus.il Author A.D.Beckett Group Custom IC (UK), Cadence Design Systems Ltd. Language SKILL Date Jun 20, 2018 Modified By Function to convert an analog bus to a digital bus. For example: numConv(value(abA2DBus(VT("/op ") "center" ?vCenter 0.6) 0 ) "dec" t) Outputs the decimal value of the bus at time 0. Can be installed in the calculator using the fx button in the function panel. *************************************************** SCCS Info: @(#) abA2DBus.il 06/20/18.09:13:19 1.1 */ /********************************************************************* * * * abA2DBus(analogBus thresholdType [?vCenter vCenter] [?vHigh vHigh] * * [?vLow vlow] [?timeX 1]) * * * * Function similar to analog2Digital except will work on an analog * * bus and return a digital bus. * * * *********************************************************************/ procedure (abA2DBus(analogBus @rest args) awvCreateBusFromWaveList( apply ('analog2Digital abUnwrapFamily(analogBus)~>wave args ) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;; GUI builder information ;;;;;;;;;;;;;;;;;;;;;;;;;;; ocnmRegGUIBuilder( '( nil function abA2DBus name abA2DBus description "Returns the digital form of an analog bus waveform" category ( "Custom Functions" ) analysis ( nil general ( nil format ( "abA2DBus(%s %s)" signal thresholdType) signals ( nil signal ( nil prompt "Waveform" tooltip "Input waveform" ) ) params ( nil thresholdType ( nil prompt "Logic Threshold" tooltip "Logic Threshold." required t default "hilo" type (( "hilo" ( " \"hilo\" ?vHigh %s ?vLow %s ?timeX %s" vHigh vLow timeX)) ( "center" ( " \"center\" ?vCenter %s" vCenter))) guiRowHint 1 guiEnableHint ((vHigh "hilo" ) (vLow "hilo" ) (timeX "hilo" ) (vCenter "center" )) ) vHigh ( nil prompt "Voltage High/Low" tooltip "Any value higher than this is high state." default nil guiRowHint 2 required nil keyed t type float ) vLow ( nil prompt "" tooltip "Any value lower than this is low state." default nil guiRowHint 2 required nil keyed t type float ) vCenter ( nil prompt "Center Voltage" tooltip "Any value higher than this value is high state, and lower than this is low state." default nil guiRowHint 3 required nil keyed t type float ) timeX ( nil prompt "Time to X" tooltip "The minimum duration of analog signal between vHigh and vLow. It is used to determine logic X." default 1 required nil keyed t guiRowHint 4 type float ) ) inputrange t ) ) outputs (result) ) ) Regards, Andrew.

Viewing all articles
Browse latest Browse all 63257

Trending Articles



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