| #!/usr/bin/tclsh8.5 |
| |
| # Copyright (c) Efabless Corporation. All rights reserved. |
| # See LICENSE file in the project root for full license information. |
| |
| set ::env(OPENLANE_ROOT) [file dirname [file normalize [info script]]] |
| source $::env(OPENLANE_ROOT)/scripts/utils/utils.tcl |
| proc run_non_interactive_mode {args} { |
| set ::env(OPENLANE_ROOT) [file dirname [file normalize [info script]]] |
| source $::env(OPENLANE_ROOT)/scripts/tcl_commands/all.tcl |
| if {[prep {*}$args] < 0} { |
| puts "prep failed" |
| exit |
| } |
| run_synthesis |
| run_floorplan |
| run_placement |
| #run_cts |
| gen_pdn |
| run_routing |
| run_magic |
| run_magic_drc |
| run_magic_spice_export |
| run_netgen |
| } |
| |
| proc run_interactive_mode {args} { |
| set ::env(TCLLIBPATH) $::env(OPENLANE_ROOT)/scripts/tcl_commands/ |
| exec tclsh |& tee /dev/tty |
| } |
| |
| proc run_magic_drc_batch {args} { |
| set options {{-magicrc optional} \ |
| {-tech optional} \ |
| {-report required} \ |
| {-design required} \ |
| {-gds required}} |
| set flags {} |
| parse_key_args "run_magic_drc_batch" args arg_values $options flags_mag $flags |
| if { [info exists arg_values(-magicrc)] } { |
| set magicrc [file normalize $arg_values(-magicrc)] |
| } |
| if { [info exists arg_values(-tech)] } { |
| set ::env(TECH) [file normalize $arg_values(-tech)] |
| } |
| set ::env(GDS_INPUT) [file normalize $arg_values(-gds)] |
| set ::env(REPORT_OUTPUT) [file normalize $arg_values(-report)] |
| set ::env(DESIGN_NAME) $arg_values(-design) |
| |
| if { [info exists magicrc] } { |
| exec magic \ |
| -noconsole \ |
| -dnull \ |
| -rcfile $magicrc \ |
| $::env(OPENLANE_ROOT)/scripts/magic_drc_batch.tcl \ |
| </dev/null |& tee /dev/tty |
| } else { |
| exec magic \ |
| -noconsole \ |
| -dnull \ |
| $::env(OPENLANE_ROOT)/scripts/magic_drc_batch.tcl \ |
| </dev/null |& /dev/tty |
| } |
| } |
| |
| proc run_file {args} { |
| set ::env(TCLLIBPATH) $::env(OPENLANE_ROOT)/scripts/tcl_commands/ |
| exec tclsh $args |& tee /dev/tty |
| } |
| |
| set options {{-design optional} \ |
| {-tag optional} \ |
| {-config optional} \ |
| {-file optional} \ |
| } |
| |
| |
| set flags {-init_design_config -disable_output -interactive -drc} |
| |
| set argv_copy $argv |
| parse_key_args "flow.tcl" argv arg_values $options flags_map $flags |
| |
| if { [info exists flags_map(-interactive)] } { |
| if { [info exists arg_values(-file)] } { |
| run_file $arg_values(-file) |
| } else { |
| run_interactive_mode "$argv_copy" |
| } |
| } elseif { [info exists flags_map(-drc)] } { |
| run_magic_drc_batch {*}$argv_copy |
| } else { |
| run_non_interactive_mode {*}$argv_copy |
| } |
| |
| |