Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement/references/*.json.gz binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Temp working directories
temp/

# Debug/fix scripts
_fix_*.py
_check_*.py
_debug_*.py

# Evaluation artifacts
artifacts.json
metrics.json

117 changes: 117 additions & 0 deletions benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# VLSI Global Placement

Global placement is a critical stage in VLSI (Very Large Scale Integration) physical design.
After logic synthesis and floorplanning, standard cells and macros must be placed on the chip
such that wirelength is minimized while respecting physical constraints.

This benchmark uses the **ISPD 2005** placement contest benchmarks, the industry-standard
open-source benchmark suite for VLSI placement. The agent must implement a placement algorithm
that minimizes Half-Perimeter Wirelength (HPWL) without violating hard constraints.

## File Structure

```text
VLSIGlobalPlacement/
├── .gitignore # Git ignore rules
├── datasets/ # Raw ISPD 2005 Bookshelf data
│ └── ispd2005/ # (empty; preprocessed JSONs are in references/)
├── README.md # Navigation doc (this file)
├── README_zh-CN.md # Navigation doc (Chinese)
├── Task.md # Detailed task description
├── Task_zh-CN.md # Detailed task description (Chinese)
├── references/ # Benchmark reference data
│ ├── adaptec1.json.gz # Easy benchmark (~211k cells, gzip)
│ ├── adaptec1_difficulty.json # Difficulty metadata
│ ├── adaptec3.json.gz # Medium benchmark (~451k cells, gzip)
│ └── adaptec3_difficulty.json # Difficulty metadata
├── scripts/
│ ├── init.py # [MODIFIABLE] Placement algorithm
│ └── preprocess.py # Bookshelf -> JSON converter
├── verification/
│ ├── evaluator.py # Scoring and legality checks
┬ ├── test_evaluator.py # Unit tests
│ ├── requirements.txt # Python dependencies
│ └── docker/
│ └── Dockerfile # Containerized evaluation
├── baseline/
│ └── solution.py # Row-based placement baseline
┬ └── result_log.txt # Baseline evaluation results
└── frontier_eval/ # Unified task metadata
├── initial_program.txt
├── eval_command.txt
├── agent_files.txt
├── artifact_files.txt
├── readonly_files.txt
├── copy_files.txt
├── candidate_destination.txt
├── eval_cwd.txt
├── constraints.txt
└── run_eval.py
```

## Quick Start

### 1. Install Dependencies

```bash
pip install -r verification/requirements.txt
```

### 2. Run the Baseline Solver

```bash
cd benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement
python scripts/init.py
# Outputs: temp/submission.json
```

### 3. Evaluate a Candidate Program

```bash
cd benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement
python verification/evaluator.py scripts/init.py --benchmark adaptec1
```

### 4. Run with Unified Task Framework

```bash
python -m frontier_eval task=unified task.benchmark=ElectronicDesignAutomation/VLSIGlobalPlacement algorithm=openevolve algorithm.iterations=0
```

## Benchmarks

| Name | Difficulty | Fixed Cells | Movable Cells | Nets | Pins | Die Size |
|------|-----------|-------------|---------------|------|------|----------|
| adaptec1 | Easy | 543 | 210,904 | 221,142 | 944,053 | 11589x11589 |
| adaptec3 | Medium | 723 | 450,927 | 466,758 | 1,875,039 | 23190x23386 |

## Task Summary

- **Input**: Die dimensions, cell library, fixed/movable cells, netlist, initial placement
- **Output**: (x, y) coordinates for every movable cell
- **Hard Constraints**: No fixed cells moved, no cells out of bounds, no overlaps
- **Optimization Objective**: Minimize Half-Perimeter Wirelength (HPWL)
- **Editable File**: scripts/init.py (only place_components() function)

## Dataset License

The ISPD 2005 benchmarks were created by the ICCAD 2005 / ISPD 2006 placement contest committees
and are freely available for academic use.

## Compressed JSON Format

The reference files are gzip-compressed JSON with a compact netlist representation.
Each net is stored as a list of integer cell indices rather than full pin dictionaries:

```json
{"netlist": [[0, 1, 2], [3, 4], ...]}
```

The compact netlist reduces JSON size by approximately 65% compared to the verbose
format, and gzip further reduces the on-disk size by about 84% (adaptec1: 22.6MB ->
3.7MB, adaptec3: 48.2MB -> 7.9MB). The `_decompress_netlist()` function in
scripts/init.py and verification/evaluator.py reconstructs the full pin
dictionaries at load time. The transformation is lossless with respect to the
HPWL computation. The scripts/preprocess.py script generates this compressed
format directly from the original Bookshelf data.

Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# VLSI 全局布局

全局布局是 VLSI(超大规模集成电路)物理设计中的关键阶段。
在逻辑综合和布图规划之后,标准单元和宏单元必须放置在芯片上,
以最小化线长,同时满足物理约束。

本基准测试使用 **ISPD 2005** 布局竞赛基准,这是 VLSI 布局领域
行业标准的开源基准套件。Agent 必须实现一个最小化半周长线长(HPWL)
的布局算法,同时不违反硬约束。

## 文件结构

```text
VLSIGlobalPlacement/
├── .gitignore # Git 忽略规则
├── datasets/ # 原始 ISPD 2005 Bookshelf 数据
│ └── ispd2005/ # (空目录;预处理后的 JSON 在 references/ 中)
├── README.md # 导航文档(英文)
├── README_zh-CN.md # 导航文档(中文,本文件)
├── Task.md # 详细任务描述(英文)
├── Task_zh-CN.md # 详细任务描述(中文)
├── references/ # 基准参考数据
│ ├── adaptec1.json.gz # 简单基准(约21万单元,gzip)
│ ├── adaptec1_difficulty.json # 难度元数据
│ ├── adaptec3.json.gz # 中等基准(约45万单元)
│ └── adaptec3_difficulty.json # 难度元数据
├── scripts/
│ ├── init.py # [可修改] 布局算法
│ └── preprocess.py # Bookshelf 格式转 JSON
├── verification/
│ ├── evaluator.py # 评分和合法性检查
│ ├── requirements.txt # Python 依赖
│ └── docker/
│ └── Dockerfile # 容器化评测
├── baseline/
│ └── solution.py # 行式放置基线
└── frontier_eval/ # Unified task 元数据
├── initial_program.txt
├── eval_command.txt
├── agent_files.txt
├── artifact_files.txt
├── readonly_files.txt
├── copy_files.txt
├── candidate_destination.txt
├── eval_cwd.txt
├── constraints.txt
└── run_eval.py
```

## 快速开始

### 1. 安装依赖

```bash
pip install -r verification/requirements.txt
```

### 2. 运行基线求解器

```bash
cd benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement
python scripts/init.py
# 输出: temp/submission.json
```

### 3. 评估候选程序

```bash
cd benchmarks/ElectronicDesignAutomation/VLSIGlobalPlacement
python verification/evaluator.py scripts/init.py --benchmark adaptec1
```

### 4. 使用 Unified Task 框架运行

```bash
python -m frontier_eval \
task=unified \
task.benchmark=ElectronicDesignAutomation/VLSIGlobalPlacement \
algorithm=openevolve \
algorithm.iterations=0
```

## 基准数据

| 名称 | 难度 | 固定单元 | 可移动单元 | 网络数 | 引脚数 | 芯片尺寸 |
|------|------|---------|-----------|--------|--------|---------|
| adaptec1 | 简单 | 543 | 210,904 | 221,142 | 944,053 | 11589x11589 |
| adaptec3 | 中等 | 723 | 450,927 | 466,758 | 1,875,039 | 23190x23386 |

## 任务概要

- **输入**:芯片尺寸、单元库、固定/可移动单元、网表、初始布局
- **输出**:每个可移动单元的 (x, y) 坐标
- **硬约束**:不移动固定单元、所有单元在芯片内、无重叠
- **优化目标**:最小化半周长线长(HPWL)
- **可编辑文件**:scripts/init.py(仅 place_components() 函数)

## 数据集许可

ISPD 2005 基准由 ICCAD 2005 / ISPD 2006 布局竞赛委员会创建,
可免费用于学术用途。

## 压缩 JSON 格式

参考文件为 gzip 压缩的 JSON,并采用紧凑的网表表示。
每个网表存储为整数单元索引列表,而非完整的引脚字典:

```json
{"netlist": [[0, 1, 2], [3, 4], ...]}
```

紧凑网表相比详细格式可减少约 65% 的 JSON 大小,
gzip 进一步将磁盘占用减少约 84%(adaptec1:22.6MB -> 3.7MB,adaptec3:48.2MB -> 7.9MB)。
scripts/init.py 和 verification/evaluator.py 中的 _decompress_netlist() 函数
在加载时重建完整的引脚字典。该转换相对于 HPWL 计算是无损的。
scripts/preprocess.py 脚本直接从原始 Bookshelf 数据生成此压缩格式。
Loading
Loading