• 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 Design
  3. Plot Schematic Hierarchy into single file

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 15886
  • 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

Plot Schematic Hierarchy into single file

HoWei
HoWei over 7 years ago

Hi,

I did set up my .cdsplotinit to call a script, which allows me to print into PDFs. That is working fine for single schematic pages.

When doing a hierarchical plot from a schematic, it seems like for every plot a new print job is spooled into the print queue.

For this case I do have the workaround, to concatenate all jobs (postscript files) into a single postscript-file and generate a PDF (which is overwritten during each job process) - by the last job I do have a PDF containing all schematic pages from the hierarchy. The problem is, that the concatenated postscript file still exists and I have to delete it manually to get an empty file for the next print-job.

Question 1: Is it possible to have only one print job started for a hierarchical plot, containing all schematic pages ?

This would simplify the plotting and I would not need to concatenate print jobs.

Question 2: Is it possible to get a trigger/function after the last print job that allows me to delete the concatenated postscript-file ?

I can see the log in the CIW window that says "INFO (SCH-1272): Successfully plotted 3 cellviews" and I would make use of this function if possible.

  • Cancel
Parents
  • HoWei
    HoWei over 7 years ago

    I found a way to workaround this, by using a timeout (checking if file has been accessed in the last minute) between print jobs. If the concatenated file has not been modified during the last minute, then the file will be overwritten - as it is expected that this is a new print job. If the file was modified during the last minute, the new job will be appended to the file. This requires the users to wait at least 1 minute between print jobs, otherwise they get a result that contains the previous print data as well. the 1 minute limit is caused by the "find <filename> -mmin 1" command.

    In addition I create a *.emf file via inkscape  - this works only for the last page printed - means its usage is intended for a 1-page printjob only.

    If someone wants to test that workaround, here are the contents of the files I use:

    ".cdsplotinit"

    PDF_EMF_600dpi_color|PDF_EMF: \
            :type=postscript2: \
            :spool=${ICD_CFG}/scripts/cadence_plot.sh: \
            :resolution#600: \
            :maximumPages#30: \
            :paperSize="A4" 4830 6310 132 168:

    "cadence_plot.sh"

    #!/bin/bash

    # Cadence pipes the postscript data to stdin of this script
    # stdin can be accessed via "cat" - see below
    #
    # wait at least a minute before executing the next print job or
    # delete the file ${PROJECT_HOME}/tmp_plot_${USER}.ps manually before
    # the next print job is queued, otherwise you get the content from the previous job included

    # Check to see if a pipe exists on stdin.
    if [ -p /dev/stdin ]; then
            echo "Data was piped to this script!"

            #check if temporary file had been modified less than 1 minute ago
            #to verify if the printjob is a multipage job or not
            #if yes then the printjob will be appended to the file
            #if no the printjob will create a new file
            if test `find "${PROJECT_HOME}/tmp_plot_${USER}.ps" -mmin -1`; then
                    cat >> ${PROJECT_HOME}/tmp_plot_${USER}.ps #read postscript file from stdin and append to temporary file
            else
                    cat > ${PROJECT_HOME}/tmp_plot_${USER}.ps #read postscript file from stdin and overwrite temporary file
            fi
            #generate PDF file from temporary file and overwrite
            #during each new job - the last generation as all schematic
            #hierarchy levels included
            gs -sDEVICE=pdfwrite -sOutputFile=${PROJECT_HOME}/plot_${USER}.pdf ${PROJECT_HOME}/tmp_plot_${USER}.ps

            #generate EMF file - for multipage output only last page remains
            inkscape ${PROJECT_HOME}/plot_${USER}.pdf --export-emf=${PROJECT_HOME}/plot_${USER}.emf

            #open viewer in background and will be updated by each new job
            evince ${PROJECT_HOME}/plot_${USER}.pdf &


    else
            #since no pipe exists, do nothing
            echo "No input was found on stdin, skipping!"
    fi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • HoWei
    HoWei over 7 years ago

    I found a way to workaround this, by using a timeout (checking if file has been accessed in the last minute) between print jobs. If the concatenated file has not been modified during the last minute, then the file will be overwritten - as it is expected that this is a new print job. If the file was modified during the last minute, the new job will be appended to the file. This requires the users to wait at least 1 minute between print jobs, otherwise they get a result that contains the previous print data as well. the 1 minute limit is caused by the "find <filename> -mmin 1" command.

    In addition I create a *.emf file via inkscape  - this works only for the last page printed - means its usage is intended for a 1-page printjob only.

    If someone wants to test that workaround, here are the contents of the files I use:

    ".cdsplotinit"

    PDF_EMF_600dpi_color|PDF_EMF: \
            :type=postscript2: \
            :spool=${ICD_CFG}/scripts/cadence_plot.sh: \
            :resolution#600: \
            :maximumPages#30: \
            :paperSize="A4" 4830 6310 132 168:

    "cadence_plot.sh"

    #!/bin/bash

    # Cadence pipes the postscript data to stdin of this script
    # stdin can be accessed via "cat" - see below
    #
    # wait at least a minute before executing the next print job or
    # delete the file ${PROJECT_HOME}/tmp_plot_${USER}.ps manually before
    # the next print job is queued, otherwise you get the content from the previous job included

    # Check to see if a pipe exists on stdin.
    if [ -p /dev/stdin ]; then
            echo "Data was piped to this script!"

            #check if temporary file had been modified less than 1 minute ago
            #to verify if the printjob is a multipage job or not
            #if yes then the printjob will be appended to the file
            #if no the printjob will create a new file
            if test `find "${PROJECT_HOME}/tmp_plot_${USER}.ps" -mmin -1`; then
                    cat >> ${PROJECT_HOME}/tmp_plot_${USER}.ps #read postscript file from stdin and append to temporary file
            else
                    cat > ${PROJECT_HOME}/tmp_plot_${USER}.ps #read postscript file from stdin and overwrite temporary file
            fi
            #generate PDF file from temporary file and overwrite
            #during each new job - the last generation as all schematic
            #hierarchy levels included
            gs -sDEVICE=pdfwrite -sOutputFile=${PROJECT_HOME}/plot_${USER}.pdf ${PROJECT_HOME}/tmp_plot_${USER}.ps

            #generate EMF file - for multipage output only last page remains
            inkscape ${PROJECT_HOME}/plot_${USER}.pdf --export-emf=${PROJECT_HOME}/plot_${USER}.emf

            #open viewer in background and will be updated by each new job
            evince ${PROJECT_HOME}/plot_${USER}.pdf &


    else
            #since no pipe exists, do nothing
            echo "No input was found on stdin, skipping!"
    fi

    • 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