Skip to content

Commit

Permalink
update reading main.frc and adding files exitstance check
Browse files Browse the repository at this point in the history
  • Loading branch information
RehabSayed-G committed Aug 8, 2023
1 parent 240efce commit a690560
Show file tree
Hide file tree
Showing 3 changed files with 6,807 additions and 2 deletions.
23 changes: 22 additions & 1 deletion rules/klayout/macros/gf180mcu_drc.lydrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ run_dir = File.expand_path("..", dir_path)
## read the log of drc run to get output lydb file paths if run_dir option is disables
gds_name = layout_path.split()[1].to_s.split(".")[0]

out_dir = "#{run_dir}/macros/run_drc_main"

if Dir.exist?out_dir
`rm -r #{out_dir}`
end

## create options passed to run_drc.py
options_str = "--variant=#{options["variant"]} --run_dir=#{run_dir}/macros/run_drc_main --macro_gen"

## run_drc command line
cmd = "python3 #{run_dir}/drc/run_drc.py --path=#{layout_path} #{options_str}"

## start running drc
puts "######### running #{cmd}"
drc_res = `#{cmd}`

## pass options to main.drc
$run_mode = options["run_mode"]
Expand Down Expand Up @@ -84,11 +99,17 @@ $offgrid = options["offgrid"]

$conn_drc = options["connectivity"]

unless File.exist?"#{run_dir}/macros/run_drc_main/main.drc"
STDERR.puts "file run_drc_main.drc doesn't exist"
exit
end

## include run files

#%include ../drc/rule_decks/antenna.drc
#%include ../drc/rule_decks/density.drc
#%include ../drc/main.drc
#%include run_drc_main/main.drc


</text>
</klayout-macro>
9 changes: 8 additions & 1 deletion rules/klayout/macros/gf180mcu_lvs.lylvs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ if options["netlist"] == ""
net_name = layout_path.split()[1].to_s().split(".")[0]

net_dir = "#{layout_path.split()[0]}/#{net_name}.cdl"

unless File.exist?net_dir
net_dir = "#{layout_path.split()[0]}/#{net_name}.spice"
end
else
net_dir = options["netlist"]

end

unless File.exist?net_dir
STDERR.puts "netlist file #{net_dir} doesn't exist"
exit
end

## read the log of lvs run to get output lydb file paths if run_dir option is disables
gds_name = layout_path.split()[1].to_s.split(".")[0]

Expand Down
Loading

0 comments on commit a690560

Please sign in to comment.