• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. bindkey to plot.il

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 143
  • Views 15072
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

bindkey to plot.il

thecalman
thecalman over 15 years ago

 I need to set a bindkey to schPlot("plot.il"), which I can do alright except that I need to have the outputfile to be different each time so that I am not overwriting anything!

I was thinking maybe append a date/time string to a base filename.  I tried to use the getCurrentTime() function but I need to format it somehow! for an example, I would like "Mar 1 05:23:37 2010" to be "03.01.2010.052337" and then concat this to become my outputfile. ex. "myplotfile_03.01.2010.052337.ps".  Could someone please help me.

  • Cancel
Parents
  • ebecheto
    ebecheto over 15 years ago

    Dear thecalman.

    I think I have something for you. To convert your picture you have the linux command 'convert' (imagemagick). Very usefull! I recommand to change the postscript option setlinwidth to 5 instead of 1. It gives a netter black line. You do not necessaryneed the full code underneath. May be just sprintf(nil "Your linux command %s" "ls ps pwd whatever") followed by (system cmd) will be enough for your need. You may have notice in the code that the line : while( isFile( filename=sprintf(nil "%s-%s-%s_%d.ps" cvId~>libName cvId~>cellName cvId~>viewName i)) i++)  prevent overwriting existing pics. 

    Hope it help,

    Regards.

     

     

     (procedure prettyPrint(@optional (imprimante "lprdcrv"))
    let( (cmd cvId i pt filename eko)
    cmd=sprintf(nil "if grep \"%s|\" ~/.cdsplotinit; then echo yes; else echo \"%s|default: :type=postscript2: :resolution#600: :maximumPages#30: :paperSize=\\\"A4\\\" 4810 6330 172 132:\n\" >> ~/.cdsplotinit; fi" imprimante imprimante)
    (system cmd)
    ;; eko=sprintf(nil "%s" cmd)
    eko=sprintf(nil "echo \"%s\"" imprimante)
    (system eko)

    cvId=geGetWindowCellView()
    ;schematic or symbol plot
    if( member(cvId~>viewName list("schematic" "symbol")) then pt="sch" else pt="le" ) i=0;
    while( isFile( filename=sprintf(nil "%s-%s-%s_%d.ps" cvId~>libName cvId~>cellName cvId~>viewName i)) i++)

    ;; set(concat(pt "PlotOptions") '(nil area "whole" plot "cellview" header nil plotToFile t plotterType "postscript2" papersize "A4"  display "display" tmpdir "/tmp" fit t center t orientation "automatic") )
    set(concat(pt "PlotOptions") '(nil area "whole" plot "Viewing Area" header nil plotToFile t plotterType "postscript2" papersize "A4"  display "display" tmpdir "/tmp" center t orientation "automatic") )
    eval(concat(pt "PlotOptions"))->view=eval(cvId~>viewName)
    eval(concat(pt "PlotOptions"))->cell=eval(cvId~>cellName)
    eval(concat(pt "PlotOptions"))->library=eval(cvId~>libName)
    ; eval(concat(pt "PlotOptions"))->bBox=cvId~>bBox
    eval(concat(pt "PlotOptions"))->viewlist=eval(cvId~>viewName)
    eval(concat(pt "PlotOptions"))->outputfile=filename
    eval(concat(pt "PlotOptions"))->plotter=imprimante

    ; plot schematic or layout
    ;; schPlot() || lePlot()
    ; eval(concat(pt "Plot()"));<== ... does not work
    evalstring(strcat(pt "Plot()"));<== yeah Works

    cmd=sprintf(nil "convert -trim -rotate 90 %s %s.png" filename filename filename )
    cmd=sprintf(nil "%s; cat %s |sed \"s/1 setlinewidth/5 setlinewidth/\">%s.sed.ps" cmd  filename filename )
    cmd=sprintf(nil "%s; convert -trim -rotate 90 %s.sed.ps %s.png" cmd  filename filename )
    cmd=sprintf(nil "%s; cat %s.sed.ps |sed \"s/lineBlue *exch def/lineBlue def/;s/lineRed *exch def/lineRed def/;s/lineGreen exch def/lineGreen def/;\"  > %s.sed_bw.ps" cmd  filename filename )
    cmd=sprintf(nil "%s; convert -trim -rotate 90 %s.sed_bw.ps %s_bw.png" cmd  filename filename )
    cmd=sprintf(nil "%s; rm %s.sed.ps" cmd  filename )
    (system cmd)
    eko=sprintf(nil "Following files had been created in %s :\n%s\n%s.sed_bw.ps\n%s.png\n%s_bw.png\n" pwd() filename filename filename filename)
    printf("%s" eko)
    eko=sprintf(nil "echo \"%s\"" eko)
    (system eko)
    );let
    );proc

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ebecheto
    ebecheto over 15 years ago

    Dear thecalman.

    I think I have something for you. To convert your picture you have the linux command 'convert' (imagemagick). Very usefull! I recommand to change the postscript option setlinwidth to 5 instead of 1. It gives a netter black line. You do not necessaryneed the full code underneath. May be just sprintf(nil "Your linux command %s" "ls ps pwd whatever") followed by (system cmd) will be enough for your need. You may have notice in the code that the line : while( isFile( filename=sprintf(nil "%s-%s-%s_%d.ps" cvId~>libName cvId~>cellName cvId~>viewName i)) i++)  prevent overwriting existing pics. 

    Hope it help,

    Regards.

     

     

     (procedure prettyPrint(@optional (imprimante "lprdcrv"))
    let( (cmd cvId i pt filename eko)
    cmd=sprintf(nil "if grep \"%s|\" ~/.cdsplotinit; then echo yes; else echo \"%s|default: :type=postscript2: :resolution#600: :maximumPages#30: :paperSize=\\\"A4\\\" 4810 6330 172 132:\n\" >> ~/.cdsplotinit; fi" imprimante imprimante)
    (system cmd)
    ;; eko=sprintf(nil "%s" cmd)
    eko=sprintf(nil "echo \"%s\"" imprimante)
    (system eko)

    cvId=geGetWindowCellView()
    ;schematic or symbol plot
    if( member(cvId~>viewName list("schematic" "symbol")) then pt="sch" else pt="le" ) i=0;
    while( isFile( filename=sprintf(nil "%s-%s-%s_%d.ps" cvId~>libName cvId~>cellName cvId~>viewName i)) i++)

    ;; set(concat(pt "PlotOptions") '(nil area "whole" plot "cellview" header nil plotToFile t plotterType "postscript2" papersize "A4"  display "display" tmpdir "/tmp" fit t center t orientation "automatic") )
    set(concat(pt "PlotOptions") '(nil area "whole" plot "Viewing Area" header nil plotToFile t plotterType "postscript2" papersize "A4"  display "display" tmpdir "/tmp" center t orientation "automatic") )
    eval(concat(pt "PlotOptions"))->view=eval(cvId~>viewName)
    eval(concat(pt "PlotOptions"))->cell=eval(cvId~>cellName)
    eval(concat(pt "PlotOptions"))->library=eval(cvId~>libName)
    ; eval(concat(pt "PlotOptions"))->bBox=cvId~>bBox
    eval(concat(pt "PlotOptions"))->viewlist=eval(cvId~>viewName)
    eval(concat(pt "PlotOptions"))->outputfile=filename
    eval(concat(pt "PlotOptions"))->plotter=imprimante

    ; plot schematic or layout
    ;; schPlot() || lePlot()
    ; eval(concat(pt "Plot()"));<== ... does not work
    evalstring(strcat(pt "Plot()"));<== yeah Works

    cmd=sprintf(nil "convert -trim -rotate 90 %s %s.png" filename filename filename )
    cmd=sprintf(nil "%s; cat %s |sed \"s/1 setlinewidth/5 setlinewidth/\">%s.sed.ps" cmd  filename filename )
    cmd=sprintf(nil "%s; convert -trim -rotate 90 %s.sed.ps %s.png" cmd  filename filename )
    cmd=sprintf(nil "%s; cat %s.sed.ps |sed \"s/lineBlue *exch def/lineBlue def/;s/lineRed *exch def/lineRed def/;s/lineGreen exch def/lineGreen def/;\"  > %s.sed_bw.ps" cmd  filename filename )
    cmd=sprintf(nil "%s; convert -trim -rotate 90 %s.sed_bw.ps %s_bw.png" cmd  filename filename )
    cmd=sprintf(nil "%s; rm %s.sed.ps" cmd  filename )
    (system cmd)
    eko=sprintf(nil "Following files had been created in %s :\n%s\n%s.sed_bw.ps\n%s.png\n%s_bw.png\n" pwd() filename filename filename filename)
    printf("%s" eko)
    eko=sprintf(nil "echo \"%s\"" eko)
    (system eko)
    );let
    );proc

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information