Wednesday, December 03, 2008     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: Skill function to retrieve ptf entries
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
andyk
Posts: 22
Online: User is Offline
3/18/2005 7:39 AM  
Hi all,

to get things started, I attached a skill function I recently wrote. This function returns key and injected properties of the ptf table of a given component and property object set and can be used to verify that the properties attached to the given component match the key properties in the assoc. part table file. As you know this this will result in an error during packageing if these don't match....

Andy

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ARGUMENTS:
;; chandle - is a hande to concepthdl
;; compObj - is a component object
;; the following would return one such thing
;; (setq cmdRetObj (cnSendCommand cnh "find 4rnet" ?runOptions verbose) )
;; (setq group (cnGetGroupName cmdRetObj))
;; (csFreeGroup cnh group)
;; (setq primObjSet (cnGetGroupedObjectSet cmdRetObj))
;; (setq compObjSet (cnGetComps primObjSet))
;; (setq compObj (car compObjSet))
;; propObjSet - list property objects attached to component
;; can be retrieved using csGetComponentProps(cnh compObj)
;; RETURNS:
;; -1 : indicates that there was an error retrieving the part_table view object
;; this usually mean sthat there is no part_table file
;; -2 : indicates that not all keyproperties where found in the propObjSet
;; nil : if the properties of the passed propObjSet cannot be matched with the key
;; properties
;; list : a list containing a list of key properties and a list of injected properties
;; and their values
;; Example:
;; AK_cnGetCompPtfProps(cnh, compObj, propObjSet)
;; (
;; (("VALUE" "100/187/100")
;; ("LTX_RATING" "1/16W")
;; ("POSTOL" "1%")
;; ("PART_NUMBER" "166-0061-00")
;; ("PACK_TYPE" "4RNET")
;; ("TC" "200PPM")
;; )
;; (("STATUS" "C")
;; ("PART_NUMBER" "166-0061-00")
;; ("JEDEC_TYPE" "CANET16")
;; ("DEVICE_LABEL" "RN")
;; ("HEIGHT" "10")
;; ("SIGNAL_MODEL" "4RNET_166-0061-00")
;; )
;; )
;;
(procedure AK_cnGetCompPtfProps(chandle, compObj, propObjSet)
prog( (comp_name comp_lib viewsInfoObj ptfview filepath ptf_line i msgs
iport char1 ptf_prop_line propList valueList found_kps
keyprops injprops prop keyvalues injvalues val kval read_lines
kvalueList jvalueList)

(setq compName (cnGetCompName compObj))
(setq compLib (cnGetCompLibName compObj))
(setq compDbId (cnGetCompDbId compObj))
viewsInfoObj = cnlGetViewInfo(cnh list( list(compLib compName "part_table") ) )

(setq msgs (cnGetMsgs (cnGetMsgInfo viewsInfoObj)))
(if msgs != nil then
(return -1)
else
ptfview = car(cnlGetViews(viewsInfoObj))
filepath = cnlGetViewFilePath(ptfview)
sprintf( masterfile "%s/master.tag" filepath)
iport = infile(masterfile)
fscanf( iport "%s" ptffile)
close(iport)
sprintf( file "%s/%s" filepath, ptffile)
iport = infile(file)

(while (gets line iport)
(if (rexMatchp "[a-zA-Z0-9]+" line) then
(setq read_lines (rexMatchp "[|]" line))
(setq char1 (substring line 1 1))

;; replace multiple spaces with one space
rexCompile(" +")
(setq ptf_line (rexReplace line " " 0))
;; replace all " | " with "|"
rexCompile(" | ")
(setq ptf_line (rexReplace ptf_line "|" 0))
(rexCompile " ;\n")
(setq ptf_line (rexReplace ptf_line "" 0))
(if char1 == ":" then
(setq read_lines t)
(rexCompile "(OPT='[a-zA-Z]*')")
(setq keyprops (parseString
(rexReplace
(substring
(substring ptf_line 1 ((nindex ptf_line " = ") - 1) )
2
);substring
""
0
);rexReplace
"|"
);parseString
);setq

(setq injprops (parseString
(rexReplace

(substring ptf_line ((nindex ptf_line " = ") + 3) )

""
0
);rexReplace
"|"
);parseString
)
;;printf("\n%L\n%L\n\n" keyprops, injprops)
(setq valueList nil)
(setq found_kps 0)
(foreach prop keyprops
(foreach propObj propObjSet
(setq propName (cnGetPropName propObj))
(setq propValue (cnGetPropValue propObj))
(if propName == prop then
(setq found_kps (found_kps + 1))
(setq valueList (append1 valueList propValue))
);if
);foreach
);foreach
;;(printf "%d %d \n%L\n" (length keyprops), found_kps, valueList)
(if (length keyprops) != found_kps then
close(iport)
(setq propList -2)
);if
;;;;;; ELSE ;;;;;;;;;;
else
(if read_lines then
(setq keyvalues (parseString
(rexReplace
(substring
(substring ptf_line 1 ((nindex ptf_line " = ") - 1) )
2
);substring
""
0
);rexReplace
"|"
);parseString
)
(setq injvalues (parseString
(rexReplace

(substring ptf_line ((nindex ptf_line " = ") + 3) )

""
0
);rexReplace
"|"
);parseString
)
;;printf("%L\n%L\n%L\n%L\n\n" valueList, ptf_line, keyvalues, injvalues)
(setq found_kps t)
(for i 0 ((length keyvalues) - 1)
(setq val (nth i valueList))
(setq kval (substring (nth i keyvalues) 2))
(setq kval (substring kval 1 ((nindex kval "'") - 1)))
(if kval != val then
(setq found_kps nil)
);if
);for
(if found_kps then
(setq jvalueList nil)
(setq kvalueList nil)
(for i 0 ((length injvalues) - 1)
(setq val (substring (nth i injvalues) 2))
(setq val (substring val 1 ((nindex val "'") - 1)))
rexCompile("\n")
(setq val (rexReplace val "" 0))
(setq jvalueList (append1 jvalueList val))
);for
(for i 0 ((length keyvalues) - 1)
(setq val (substring (nth i keyvalues) 2))
(setq val (substring val 1 ((nindex val "'") - 1)))
rexCompile("\n")
(setq val (rexReplace val "" 0))
(setq kvalueList (append1 kvalueList val))
);for
(setq propList
(list
(mapcar 'list keyprops kvalueList)
(mapcar 'list injprops jvalueList)
)
)
);
);
);if char1 == ":"
);
);while
close(iport)
(return propList)
);if
);prog
);procedure
Posting to forums is available to community members only.
Login or Register

Forums > Silicon-package-board > Shared code - SKILL > Skill function to retrieve ptf entries


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.