|
import os |
|
|
|
|
|
def getMacroDef(): |
|
def_dict={} |
|
for dir_name in os.listdir("data/Nangate45"): |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name)): |
|
continue |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name,"lib")): |
|
continue |
|
|
|
def_file=os.path.join("data/Nangate45",dir_name,"def","2_4_floorplan_macro.def") |
|
if os.path.isfile(def_file): |
|
def_dict[dir_name]=def_file |
|
|
|
return def_dict |
|
|
|
def getCellDef(): |
|
def_dict={} |
|
for dir_name in os.listdir("data/Nangate45"): |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name)): |
|
continue |
|
if os.path.isdir(os.path.join("data/Nangate45",dir_name,"lib")): |
|
continue |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name,"def")): |
|
continue |
|
|
|
def_file=os.path.join("data/Nangate45",dir_name,"def","3_2_place_iop.def") |
|
if os.path.isfile(def_file): |
|
def_dict[dir_name]=def_file |
|
|
|
return def_dict |
|
|
|
def getAllCellDef(): |
|
def_dict={} |
|
for dir_name in os.listdir("data/Nangate45"): |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name)): |
|
continue |
|
|
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name,"def")): |
|
continue |
|
|
|
def_file=os.path.join("data/Nangate45",dir_name,"def","3_2_place_iop.def") |
|
if os.path.isfile(def_file): |
|
def_dict[dir_name]=def_file |
|
|
|
return def_dict |
|
|
|
def getAfterDef(stage): |
|
|
|
if stage == "place": |
|
def_name="3_place.def" |
|
elif stage =="cts": |
|
def_name="4_cts.def" |
|
elif stage == "route": |
|
def_name="5_route.def" |
|
|
|
|
|
def_dict={} |
|
for dir_name in os.listdir("data/Nangate45"): |
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name)): |
|
continue |
|
|
|
if not os.path.isdir(os.path.join("data/Nangate45",dir_name,"def")): |
|
continue |
|
def_file=os.path.join("data/Nangate45",dir_name,"def",def_name) |
|
if os.path.isfile(def_file): |
|
def_dict[dir_name]=def_file |
|
|
|
|
|
return def_dict |
|
|
|
def getNetlist(): |
|
netlist_dict={} |
|
for dir_name in os.listdir("raw_data"): |
|
|
|
netlist_file=os.path.join("raw_data",dir_name,"1_synth.v") |
|
if os.path.isfile(netlist_file): |
|
netlist_dict[dir_name]=netlist_file |
|
|
|
return netlist_dict |
|
|
|
|
|
|
|
|
|
|