https://open-source-silicon.dev logo
#openlane
Title
# openlane
u

20Mhz

01/31/2022, 11:32 AM
reposting here in case you know the answer, this is for openroad
m

Matt Liberty

02/01/2022, 4:12 PM
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

Eric Smith

02/02/2022, 1:17 AM
@User For 1, I do this:
sed -n ‘/sky130_fd_sc_hd__dfxtp_2/,/area/p’ trimmed.lib | tail -1     area : 21.270400000;
m

Matt Liberty

02/02/2022, 4:09 AM
You could also get the area from LEF using opendb
u

20Mhz

02/03/2022, 2:54 PM
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

Matt Liberty

02/03/2022, 6:22 PM
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

20Mhz

02/03/2022, 8:47 PM
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]]"