Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (procedure NetlistTextNetlist(nlInst)
- (let (formatter netlister des obj inst nlFile subcTerms (nlString "") view (cont t) inh_prop topConfig topSchematic
- inhConns isBus rootName termOnInstance connectedTo trueNlFile line (inTop nil))
- formatter = (nlGetFormatter nlInst)
- netlister = (nlGetNetlister formatter)
- des = (nlGetDesign netlister)
- obj = (ddGetObj (nlGetLibName nlInst) (nlGetCellName nlInst) (nlGetViewName nlInst) "*" )
- inst = (nlGetId nlInst)
- nlFile = (infile obj->readPath)
- (while (gets line nlFile)
- (if (rexMatchp "^ *\\*terminals:" line) then subcTerms = (Drop (parseString (substring line 1 (strlen line) - 1) " ") 1))
- (if (rexMatchp "^ *\\*netlist_file:" line) then trueNlFile = (cadr (parseString line "\"")))
- )
- (close nlFile)
- (nlIncludeSrcFile formatter trueNlFile)
- nlString = (strcat nlString inst~>name " (")
- inhConns = (ResolvedInheritedConnections inst~>cellView inst)
- topConfig = (infile (strcat (ddGetObj (nlGetTopLibName des) (nlGetTopCellName des) (nlGetTopViewName des))->readPath "/expand.cfg"))
- (while (gets line topConfig) && cont
- (if (rexMatchp "^design" line) then cont = nil
- view = (car (parseString (cadr (parseString line ":")) ";"))
- )
- )
- (close topConfig)
- topSchematic = (dbOpenCellViewByType (nlGetTopLibName des) (nlGetTopCellName des) view)
- (if (IsInstantiated topSchematic->instances (nlGetLibName nlInst) (nlGetCellName nlInst)) then inTop = t)
- (foreach term subcTerms
- isBus = (rexMatchp "^.+<.+>$" term)
- (if isBus
- then (rexCompile "^\\(.+\\)<\\(.+\\)>$")
- rootName = (rexReplace term "\\1" 0)
- termOnInstance = (car (FilterByName inst~>instTerms rootName))
- connectedTo = (FindBusConnection (dbProduceMemName termOnInstance~>net~>name) (dbProduceMemName termOnInstance~>name) term)
- else termOnInstance = (car (FilterByName inst~>instTerms term))
- (if termOnInstance
- then connectedTo = termOnInstance->net->name
- else inh_prop = (FilterByValuePos inhConns (strcat term "!") 2)
- (if inTop then connectedTo = (car (last inh_prop))
- else (if (caddr inh_prop) != ""
- then connectedTo = (strcat "inh_" (caddr inh_prop))
- else connectedTo = (strcat "inh_" (car inh_prop))
- )
- )
- )
- )
- (rexCompile "<")
- connectedTo = (rexReplace connectedTo "\\\\<" 0)
- (rexCompile ">")
- connectedTo = (rexReplace connectedTo "\\\\>" 0)
- nlString = (strcat nlString connectedTo " ")
- )
- nlString = (strcat nlString ") " inst~>cellName)
- (nlPrintString netlister nlString)
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement