@@ -38,15 +38,16 @@ proc read_lef { args } {
3838 ord::read_lef_cmd $filename $lib_name $tech_name $make_tech $make_lib
3939}
4040
41- sta::define_cmd_args " read_def" {[-floorplan_initialize|-incremental|-child ]\
41+ sta::define_cmd_args " read_def" {[-floorplan_initialize|-incremental]\
4242 [-continue_on_errors]\
4343 [-tech name] \
44+ [-chip chip_name] \
4445 filename }
4546
4647proc read_def { args } {
47- sta::parse_key_args " read_def" args keys {-tech} \
48+ sta::parse_key_args " read_def" args keys {-tech -chip } \
4849 flags {-floorplan_initialize -incremental \
49- -order_wires -continue_on_errors -child }
50+ -order_wires -continue_on_errors}
5051 sta::check_argc_eq1 " read_def" $args
5152 set filename [file nativename [lindex $args 0]]
5253 if { ![file exists $filename ] } {
@@ -55,25 +56,41 @@ proc read_def { args } {
5556 if { ![file readable $filename ] || ![file isfile $filename ] } {
5657 utl::error " ORD" 4 " $filename is not readable."
5758 }
58- set tech_name " "
5959 if { [info exists keys(-tech)] } {
6060 set tech_name $keys(-tech)
61+ set tech [[ord::get_db] findTech $tech_name ]
62+ if { $tech == " NULL" } {
63+ utl::error ORD 52 " Technology $tech_name not found."
64+ }
6165 } elseif { ![ord::db_has_tech] } {
6266 utl::error " ORD" 5 " No technology has been read."
67+ } else {
68+ set tech [[ord::get_db] getTech]
6369 }
6470 if { [info exists flags(-order_wires)] } {
6571 utl::warn " ORD" 33 " -order_wires is deprecated."
6672 }
6773 set continue_on_errors [info exists flags(-continue_on_errors)]
6874 set floorplan_init [info exists flags(-floorplan_initialize)]
6975 set incremental [info exists flags(-incremental)]
70- set child [info exists flags(-child)]
71- if { $floorplan_init + $incremental + $child > 1 } {
72- utl::error ORD 16 " Options -incremental, -floorplan_initialization,\
73- and -child are mutually exclusive."
76+ if { $floorplan_init + $incremental > 1 } {
77+ utl::error ORD 16 " Options -incremental and -floorplan_initialization\
78+ are mutually exclusive."
79+ }
80+ if { [info exists keys(-chip)] } {
81+ set chip [[ord::get_db] findChip $keys(-chip) ]
82+ if { $chip == " NULL" } {
83+ utl::error ORD 21 " Chip $keys(-chip) not found."
84+ }
85+ } else {
86+ if { [[ord::get_db] getChip] == " NULL" } {
87+ set chip [odb::dbChip_create [ord::get_db] $tech ]
88+ } else {
89+ set chip [[ord::get_db] getChip]
90+ }
7491 }
75- ord::read_def_cmd $filename $tech_name $ continue_on_errors $floorplan_init \
76- $incremental $child
92+ ord::read_def_cmd $filename $continue_on_errors $floorplan_init \
93+ $incremental $chip
7794}
7895
7996sta::define_cmd_args " write_def" {[-version version] filename}
0 commit comments