reposting here in case you know the answer, this i...
# openlane
u
reposting here in case you know the answer, this is for openroad
m
1. File an enhancement request, it shouldn't be hard to add
2. no redirect was dropped when we added the logger
You might ask in #openroad in the future
e
@User For 1, I do this:
sed -n ‘/sky130_fd_sc_hd__dfxtp_2/,/area/p’ trimmed.lib | tail -1     area : 21.270400000;
m
You could also get the area from LEF using opendb
u
Thanks @User , @User , I’ll open a ticket for 1, as it may be generally useful. I think the sed approach is too hacky and not convenient for what I wanted this time, which is simply aggregate the area from the instances. I can try the LEF approach, would you share an example? About 2, is there any alternative? I think is common usage case for batch mode to dump specific reports to different files. Btw, I posted originally on #openroad, but I re-posted here as I thought it had more traction…
Filed: https://github.com/The-OpenROAD-Project/OpenROAD/issues/1614 I can add more details as required.
m
Roughly set db [ord::get_db] foreach lib [$db getLibs] { set dbu [expr 1.0 * [$lib getDbUnitsPerMicron]] foreach master [$lib getMasters] { puts "[$master getName] [expr [$master getWidth] / $dbu * [$master getHeight] / $dbu]" } }
in sq microns
u
Thanks a lot, will give it a try. I’ll file another ticket for redirect.
Thanks, this worked.
Copy code
proc create_lib_area_dict {} {
	set lib_area_dict [dict create]	
	set db [ord::get_db]
	foreach lib [$db getLibs] {
	    set dbu [expr 1.0 * [$lib getDbUnitsPerMicron]]
	    foreach master [$lib getMasters] {
	        dict lappend lib_area_dict [$master getName] [expr [$master getWidth] / $dbu * [$master getHeight] / $dbu]
	    }
	}
	return $lib_area_dict
}

proc get_cells_area { cells lib_area_dict } {
	set area 0
	foreach cel $cells {
		set lib_cell [get_name [get_lib_cells -of_objects $cel]]
		set area [expr $area + [dict get $lib_area_dict $lib_cell]]
	}
	return $area
}
puts "Design Area: [get_cells_area [get_cells -hier] [create_lib_area_dict]]"