Thinklab-SJTU / EDA-AI

Implementation of NeurIPS 2021 paper "On Joint Learning for Solving Placement and Routing in Chip Design" & NeurIPS 2022 paper "The Policy-gradient Placement and Generative Routing Neural Networks for Chip Design".
MIT License
197 stars 45 forks source link

I have a question about how the code read dataset #22

Closed kirito-chen closed 1 year ago

kirito-chen commented 1 year ago

I read the code for some days, but I find I didn't konw how it read dataset. In fullplace_env.py : add = "test/ispd2005/adaptec3.json" and in model.py:

def build_graph():
    path1 = dirname(dirname(abspath(__file__))) + '/data/edges_1.dat'
    path2 = dirname(dirname(abspath(__file__))) + '/data/edges_2.dat'

But I didn't find how it read the real data like benchmarks/ispd2005/adaptec3/adaptec3.nets adaptec3.nodes and so on. Besides, I wonder to know the files of 'DeepPlace/data' folder meaning what (edges_1.dat, edges_2.dat, n_edges_710.dat, 3_dic.npy)

MissNightSTG commented 1 year ago

Hello! Did you solve your problem? I also wonder how the dataset is read.

kirito-chen commented 1 year ago

I think I know what the files edges_1.dat mean. They are the macro of adaptec3, author made them for easy to train. Such as

//in edges_1.dat
[708, 709, 662, 663..
//edges_2.dat
[709, 708, 663, 662...
//n_edges_710.dat
[[709, 708], [663, 662]...

They mean edges 708->709, 709->708 and so on. nodes encoding from 0 to 709, and the number of removable macro in adaotec3 is 710

kirito-chen commented 1 year ago

Hello! Did you solve your problem? I also wonder how the dataset is read.

Indeed, the code only train the data adaptec3, and author throw away macro's imformation like shape, pin and so on but only as they point. So when train use "place", the code read "data/edges_x.dat" only (in Policy->CNNBase->build_graph() ). The process is like Go because macro is a point. And when train use "fullplace", the code read "test/ispd2005/adaptec3.json" which is used by dreamplace only. That's all. I hope it can help you