Hi, <@U073W5ECDQ9> I have a question. What changes...
# ihp-sg13g2
k
Hi, @Andreas Krinke I have a question. What changes should be applied to the drc script in order to run it by calling in the following way:
Copy code
klayout -zz -rd in_gds="results/ihp-sg13g2/gcd/base/6_final.gds" \
        -rd report_file=/home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/reports/ihp-sg13g2/gcd/base/6_drc.lyrdb \
        -r /home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/drc/sg13g2_maximal.lydrc) 2>&1 | tee ./logs/ihp-sg13g2/gcd/base/6_drc.log
DRC: batch mode
ERROR: In /home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/drc/sg13g2_maximal.lydrc: 'cell' script variable must be defined on command line
ERROR: RuntimeError: 'cell' script variable must be defined on command line in Executable::execute
a
Do you mean it should work without specifying the cell to check?
k
This is the output log from OpenROAD-flow-script where you can run it using a make target:
make drc
here goes an equivalent DRC ruledeck for skywater which runs using this method
a
You can try to replace
Copy code
raise("'cell' script variable must be defined on command line")
by
Copy code
active_cellname = RBA::CellView::active.cell_name
k
after the suggested change I got this:
Copy code
ERROR: In /home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/drc/sg13g2_maximal.lydrc: layout file must be defined on command line or via 'gdsfile' script variable
ERROR: RuntimeError: layout file must be defined on command line or via 'gdsfile' script variable in Executable::execute
  /home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/drc/sg13g2_maximal.lydrc:37:in `execute'
a
I see - can you replace each occurrence of $gdsfile with $in_gds?
k
let me try
Copy code
ERROR: In /home/herman/github/KrzysztofHerman/OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/drc/sg13g2_maximal.lydrc: 'source': Cell name  not found in input layout
ERROR: RuntimeError: 'source': Cell name  not found in input layout in Executable::execute
a
Copy code
# Supported variables that can be set using "-rd <name>=<value>" on the command line:
# logfile - path to the log file [default: no log file]
# in_gds  - path to the GDS layout to check (required in batch mode)
# cell    - name of the cell to check
# outfile - path to the report database [default: sg13g2_maximal.lyrdb in the script directory]

# to set logfile: -rd logfile="sg13g2_maximal.log"
if $logfile
    log_file($logfile)
end

application = RBA::Application.instance
main_window = application.main_window

# to set input layout: -rd in_gds="path to GDS file"

if main_window
    curr_layout_view = main_window.current_view()
    unless curr_layout_view
        layout_path = RBA::FileDialog::ask_open_file_name("Chose your layout file.", ".", "GDSII files (*.GDS *.gds *.GDS.gz *.gds.gz *.GDS2 *.gds2 *.GDS2.gz *.gds2.gz);; All files (*)")
        main_window.load_layout(layout_path, 1)
        curr_layout_view = main_window.current_view()
    end
    active_layout = RBA::CellView::active.layout
    active_cellname = RBA::CellView::active.cell_name
    source(active_layout, active_cellname)
else
    log("DRC: batch mode")
    # to set cell: -rd cell="topcell"
    if $cell
        active_cellname = $cell
        log("Active cell: " + active_cellname)
        source($in_gds, active_cellname)
        active_layout = source.layout
    else
        source($in_gds)
        active_layout = source.layout
        active_cellname = source.cell_name
    end
end

unless active_layout or $in_gds
    raise("layout file must be defined on command line or via 'in_gds' script variable")
end
k
something is running but still:
Copy code
DRC: batch mode
Elapsed time: 0:10.51[h:]min:sec. CPU time: user 10.34 sys 0.18 (100%). Peak memory: 462132KB.
# Hacky way of getting DRV count (don't error on no matches)
grep -c "<value>" reports/ihp-sg13g2/gcd/base/6_drc.lyrdb > ./reports/ihp-sg13g2/gcd/base/6_drc_count.rpt || [[ $? == 1 ]]
grep: reports/ihp-sg13g2/gcd/base/6_drc.lyrdb: No such file or directory
make: *** [Makefile:934: reports/ihp-sg13g2/gcd/base/6_drc.lyrdb] Error 1
a
Copy code
# Supported variables that can be set using "-rd <name>=<value>" on the command line:
# logfile - path to the log file [default: no log file]
# in_gds  - path to the GDS layout to check (required in batch mode)
# cell    - name of the cell to check
# outfile - path to the report database [default: sg13g2_maximal.lyrdb in the script directory]

# to set logfile: -rd logfile="sg13g2_maximal.log"
if $logfile
    log_file($logfile)
end

application = RBA::Application.instance
main_window = application.main_window

# to set input layout: -rd in_gds="path to GDS file"

if main_window
    curr_layout_view = main_window.current_view()
    unless curr_layout_view
        layout_path = RBA::FileDialog::ask_open_file_name("Chose your layout file.", ".", "GDSII files (*.GDS *.gds *.GDS.gz *.gds.gz *.GDS2 *.gds2 *.GDS2.gz *.gds2.gz);; All files (*)")
        main_window.load_layout(layout_path, 1)
        curr_layout_view = main_window.current_view()
    end
    active_layout = RBA::CellView::active.layout
    active_cellname = RBA::CellView::active.cell_name
    source(active_layout, active_cellname)
else
    log("DRC: batch mode")
    # to set cell: -rd cell="topcell"
    if $cell
        active_cellname = $cell
        log("Active cell: " + active_cellname)
        source($in_gds, active_cellname)
        active_layout = source.layout
    else
        source($in_gds)
        active_layout = source.layout
        active_cellname = source.cell_name
    end
end

unless active_layout or $in_gds
    raise("layout file must be defined on command line or via 'in_gds' script variable")
end

if active_layout.dbu != 0.001
    puts "WARNING: Layout dbu value (" + active_layout.dbu.to_s + " ) deviates from rule file dbu value (0.001). This will scale the layout and may not be intended."
end

report_file = __dir__ + "/sg13g2_maximal.lyrdb"
# to set report file: -rd report_file="sg13g2_maximal.lyrdb"
if $report_file
    report_file = File.expand_path($report_file)
end

report("design rules: sg13g2_maximal | layout cell: " + active_cellname, report_file)
k
it works! Thank you !
a
Should we change this for future versions of the DRC script?
k
I think we could have one generic script. BTW the solution we have is little verbose, adding some summary would be great.
a
What do you mean by "verbose"? The result is the report file that contains all DRC errors.
k
@Andreas Krinke maybe just reporting if the design was DRC clean or not at the end of the check
a
We will print the number of DRC errors in future releases.
👍 1