Advertisement
Guest User

Untitled

a guest
Nov 17th, 2016
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (procedure NetlistTextNetlist(nlInst)
  2.     (let (formatter netlister des obj inst nlFile subcTerms (nlString "") view (cont t) inh_prop topConfig topSchematic
  3.           inhConns isBus rootName termOnInstance connectedTo trueNlFile line (inTop nil))
  4.         formatter = (nlGetFormatter nlInst)
  5.         netlister = (nlGetNetlister formatter)
  6.                 des = (nlGetDesign netlister)
  7.         obj = (ddGetObj (nlGetLibName nlInst) (nlGetCellName nlInst) (nlGetViewName nlInst) "*" )
  8.         inst = (nlGetId nlInst)
  9.        
  10.         nlFile = (infile obj->readPath)
  11.         (while (gets line nlFile)
  12.             (if (rexMatchp "^ *\\*terminals:" line) then subcTerms = (Drop (parseString (substring line 1 (strlen line) - 1) " ") 1))
  13.             (if (rexMatchp "^ *\\*netlist_file:" line) then trueNlFile = (cadr (parseString line "\"")))
  14.         )
  15.         (close nlFile)
  16.  
  17.         (nlIncludeSrcFile formatter trueNlFile)
  18.         nlString = (strcat nlString inst~>name " (")
  19.                 inhConns = (ResolvedInheritedConnections inst~>cellView inst)
  20.                 topConfig = (infile (strcat (ddGetObj (nlGetTopLibName des) (nlGetTopCellName des) (nlGetTopViewName des))->readPath "/expand.cfg"))
  21.                 (while (gets line topConfig) && cont
  22.                         (if (rexMatchp "^design" line) then cont = nil
  23.                                                                                                 view = (car (parseString (cadr (parseString line ":")) ";"))
  24.                         )
  25.                 )
  26.                 (close topConfig)
  27.                 topSchematic = (dbOpenCellViewByType (nlGetTopLibName des) (nlGetTopCellName des) view)
  28.                 (if (IsInstantiated topSchematic->instances (nlGetLibName nlInst) (nlGetCellName nlInst)) then inTop = t)
  29.         (foreach term subcTerms
  30.                 isBus = (rexMatchp "^.+<.+>$" term)
  31.                 (if isBus
  32.                  then (rexCompile "^\\(.+\\)<\\(.+\\)>$")
  33.                           rootName = (rexReplace term "\\1" 0)
  34.                           termOnInstance = (car (FilterByName inst~>instTerms rootName))
  35.                           connectedTo = (FindBusConnection (dbProduceMemName termOnInstance~>net~>name) (dbProduceMemName termOnInstance~>name) term)
  36.                  else termOnInstance = (car (FilterByName inst~>instTerms term))
  37.                       (if termOnInstance
  38.                    then connectedTo = termOnInstance->net->name
  39.                    else inh_prop = (FilterByValuePos inhConns (strcat term "!") 2)
  40.                                         (if inTop then connectedTo = (car (last inh_prop))              
  41.                                           else (if (caddr inh_prop) != ""
  42.                                                         then connectedTo = (strcat "inh_" (caddr inh_prop))
  43.                                                         else connectedTo = (strcat "inh_" (car inh_prop))
  44.                                                    )
  45.                         )
  46.                   )
  47.             )
  48.             (rexCompile "<")
  49.             connectedTo = (rexReplace connectedTo "\\\\<" 0)
  50.             (rexCompile ">")
  51.             connectedTo = (rexReplace connectedTo "\\\\>" 0)
  52.             nlString = (strcat nlString connectedTo " ")
  53.         )
  54.         nlString = (strcat nlString ") " inst~>cellName)
  55.         (nlPrintString netlister nlString)
  56.     )
  57. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement