免费下载网站有哪些潍坊住房公积金
DreamPlace 是一款芯片放置工具,用于宏单元(macro)和标准单元(Standard Cell)的放置以及布线,并计算 HPWL、Overlap 等用于衡量芯片性能的参数。
一、环境
1. 系统环境:Ubuntu 20.04
DreamPlace 只能在 Linux 环境使用
2. Python 环境:
- Python 3.8
- PyTorch 2.0.0
- Cuda 11.8
二、安装 Dreamplace
1. 安装第三方 Dependency
- Boost
sudo apt-get update sudo apt-get install libboost-all-dev
- Bison & flex
sudo apt-get install flex bison
2. 下载 DreamPlace
git clone --recursive https://github.com/limbo018/DREAMPlace.git
3. 安装 Python Dependency
cd DREAMPlace
pip install -r requirements.txt
4. Build Dreamplace
build 之前需要先打开 DREAMPlace/dreamplace/ops/CMakeLists.txt
文件,把第 12 行的注释打开(不然无法安装这个包,我在运行 deepplace 的时候用到了这个包,其他情况下还没有用到)
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<installation directory> -DPython_EXECUTABLE=$(which python)
make
make install
-DCMAKE_INSTALL_PREFIX
是安装路径,默认是DREAMPLACE/install
-DPython_EXECUTABLE
是 python 路径,如果有 anaconda 默认是 base 环境
5. Install Benchmarks
cd ../install
python benchmarks/ispd2005_2015.py
另外,benchmark 也可以自己下载并解压到正确的文件夹下,具体位置可参考下文目录树。DreamPlace 只支持 bookshelf 和 Lef/Def 格式的文件。
6. 测试是否安装成功
python dreamplace/Placer.py test/ispd2005/adaptec1.json
python unittest/ops/hpwl_unittest.py
安装完成后的目录结构如下,主要用到的东西都在 install
文件夹内:
DREAMPlace
|-- CMakeLists.txt
|-- Dockerfile
|-- LICENSE
|-- README.md
|-- benchmarks
|-- build
|-- cmake
|-- dreamplace
|-- images
|-- install
| |-- benchmarks
| | |-- ispd2005
| | | |-- adaptec1
| | | | |-- adaptec1.aux
| | | | |-- adaptec1.dp.aux
| | | | |-- adaptec1.eplace-ip.pl
| | | | |-- adaptec1.eplace.aux
| | | | |-- adaptec1.lg.pl
| | | | |-- adaptec1.nets
| | | | |-- adaptec1.nodes
| | | | |-- adaptec1.pl
| | | | |-- adaptec1.scl
| | | | `-- adaptec1.wts
| | | |-- adaptec2
| | | |-- adaptec3
| | | |-- adaptec4
| | | |-- bigblue1
| | | |-- bigblue2
| | | |-- bigblue3
| | | `-- bigblue4
| | |-- ispd2005_2015.py
| | `-- ispd2019.py
| |-- bin
| |-- dreamplace
| | |-- BasicPlace.py
| | |-- EvalMetrics.py
| | |-- NesterovAcceleratedGradientOptimizer.py
| | |-- NonLinearPlace.py
| | |-- Params.py
| | |-- PlaceDB.py
| | |-- PlaceObj.py
| | |-- Placer.py
| | |-- Timer.py
| | |-- __init__.py
| | |-- configure.py
| | |-- ops
| | `-- params.json
| |-- include
| |-- lib
| |-- test
| | |-- dac2012
| | |-- iccad2014
| | |-- iccad2015.ot
| | |-- ispd2005
| | |-- ispd2015
| | `-- ispd2019
| |-- thirdparty
| `-- unittest
|-- requirements.txt
|-- test
|-- thirdparty
`-- unittest
三、测试脚本
回到根目录根目录创建新文件夹,并创建测试脚本
cd ~
mkdir test_dreamplace
cd test_dreamplace
vim main.py
脚本内容如下,其中 params 用来加载配置参数,我们需要提供关于 bechmark 的配置文件,配置文件格式可以参考 test
文件夹内的文件:
import Params, Placerparams = Params.Params()# load parameters
add = "./test/ispd2005/adaptec3.json"
params.load(add)
r = Placer.place(params)
r = r[-3][0]
wl = float(r[0].hpwl.data)
overf = float(r[0].overflow.data)print(wl)
print(overf)
将 DreamPlace 移植到该目录下:
cd ~
cp -r DREAMPlace/install/* test_dreamplace/
然后将 test_dreamplace/dreamplace
文件夹下的除 ops、init.py、configure.py 之外的其他文件移动到 test_dreamplace/
目录下。
之后运行脚本跑通即可:
python main.py
目前该文件夹结构为:
test_dreamplace
|-- BasicPlace.py
|-- EvalMetrics.py
|-- NesterovAcceleratedGradientOptimizer.py
|-- NonLinearPlace.py
|-- Params.py
|-- PlaceDB.py
|-- PlaceObj.py
|-- Placer.py
|-- Timer.py
|-- __pycache__
|-- benchmarks
| |-- ispd2005
| |-- ispd2005_2015.py
| `-- ispd2019.py
|-- bin
|-- dreamplace
| |-- __init__.py
| |-- __pycache__
| |-- configure.py
| `-- ops
|-- include
|-- lib
|-- main.py
|-- params.json
|-- results
| `-- adaptec3
|-- test
|-- thirdparty
`-- unittest