Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -Werror=return-type")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g -Wall -Werror=return-type")
# set(CMAKE_BUILD_TYPE "Release")
set(BUILD_ECOS OFF)
set(BUILD_ECOS ON)
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb -Werror=return-type")

# if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
Expand Down
34 changes: 24 additions & 10 deletions scripts/design/ics55/config/rcx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,57 @@
"corners": [
{
"name": "TYPICAL",
"temperature": 25,
"temperature": [25],
"ecc_tf": "/corners/TYP.json",
"itf_file": "/corners/TYP.itf",
"captab_file": "/corners/TYP.captab",
"spef_file": "/RCX_ecc/output/gcd_TYPICAL.spef"
"spef_file": [
{ "25" : "/RCX_ecc/output/gcd_TYPICAL_25C.spef" }
]
},
{
"name": "RCbest",
"temperature": 25,
"temperature": [-40, 125],
"ecc_tf": "/corners/RCbest.json",
"itf_file": "/corners/RCbest.itf",
"captab_file": "/corners/RCbest.captab",
"spef_file": "/RCX_ecc/output/gcd_RCbest.spef"
"spef_file": [
{ "-40" : "/RCX_ecc/output/gcd_RCbest_m40C.spef" },
{ "125" : "/RCX_ecc/output/gcd_RCbest_125C.spef" }
]
},
{
"name": "RCworst",
"temperature": 25,
"temperature": [-40, 125],
"ecc_tf": "/corners/RCworst.json",
"itf_file": "/corners/RCworst.itf",
"captab_file": "/corners/RCworst.captab",
"spef_file": "/RCX_ecc/output/gcd_RCworst.spef"
"spef_file": [
{ "-40" : "/RCX_ecc/output/gcd_RCworst_m40C.spef" },
{ "125" : "/RCX_ecc/output/gcd_RCworst_125C.spef" }
]
},
{
"name": "Cbest",
"temperature": 25,
"temperature": [-40, 125],
"ecc_tf": "/corners/Cbest.json",
"itf_file": "/corners/Cbest.itf",
"captab_file": "/corners/Cbest.captab",
"spef_file": "/RCX_ecc/output/gcd_Cbest.spef"
"spef_file": [
{ "-40" : "/RCX_ecc/output/gcd_Cbest_m40C.spef" },
{ "125" : "/RCX_ecc/output/gcd_Cbest_125C.spef" }
]
},
{
"name": "Cworst",
"temperature": 25,
"temperature": [-40, 125],
"ecc_tf": "/corners/Cworst.json",
"itf_file": "/corners/Cworst.itf",
"captab_file": "/corners/Cworst.captab",
"spef_file": "/RCX_ecc/output/gcd_Cworst.spef"
"spef_file": [
{ "-40" : "/RCX_ecc/output/gcd_Cworst_m40C.spef" },
{ "125" : "/RCX_ecc/output/gcd_Cworst_125C.spef" }
]
}
]
}
53 changes: 53 additions & 0 deletions scripts/design/ics55/config/sta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"liberty" :[
{
"corner": "MAX",
"temperature": 125,
"path" : [
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CR/liberty/ics55_LLSC_H7CR_ss_rcworst_1p08_125_nldm.lib",
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CL/liberty/ics55_LLSC_H7CR_ss_rcworst_1p08_125_nldm.lib"
]
},
{
"corner": "WCL",
"temperature": -40,
"path" : [
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CR/liberty/ics55_LLSC_H7CR_ss_cworst_1p08_m40_nldm.lib",
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CL/liberty/ics55_LLSC_H7CR_ss_cworst_1p08_m40_nldm.lib"
]
},
{
"corner": "TYP",
"temperature": 25,
"path" : [
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CR/liberty/ics55_LLSC_H7CR_typ_tt_1p2_25_nldm.lib",
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CL/liberty/ics55_LLSC_H7CR_typ_tt_1p2_25_nldm.lib"
]
},
{
"corner": "MIN",
"temperature": -40,
"path" : [
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CR/liberty/ics55_LLSC_H7CR_ff_rcbest_1p32_m40_nldm.lib",
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CL/liberty/ics55_LLSC_H7CR_ff_rcbest_1p32_m40_nldm.lib"
]
},
{
"corner": "ML",
"temperature": 125,
"path" : [
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CR/liberty/ics55_LLSC_H7CR_ff_cbest_1p32_125_nldm.lib",
"/IP/STD_cell/ics55_LLSC_H7C_V1p10C100/ics55_LLSC_H7CL/liberty/ics55_LLSC_H7CR_ff_cbest_1p32_125_nldm.lib"
]
}
],
"signoff" : [
{
"MAX": ["Cworst", "RCworst"],
"WCL": ["Cworst", "RCworst"],
"TYP": ["TYPICAL"],
"MIN": ["Cworst", "RCworst", "Cbest", "RCbest"],
"ML": ["Cworst", "RCworst", "Cbest", "RCbest"]
}
]
}
20 changes: 11 additions & 9 deletions scripts/design/ics55/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ICS55 ECC 脚本说明和用户手册

本文档说明 `scripts/design/ics55` 目录下的 GCD 参考设计脚本、运行方式、输入输出目录和调试开关。该 flow 面向 ICS55 PDK,使用 `ecc_bin` 依次执行 floorplan、fanout 修复、place、CTS、legalization、route、DRC、filler、RCX 和 STA
本文档说明 `scripts/design/ics55` 目录下的 GCD 参考设计脚本、运行方式、输入输出目录和调试开关。该 flow 面向 ICS55 PDK,使用 `ecc_bin` 依次执行 floorplan、fanout 修复、place、CTS、legalization、route、DRC、filler、RCX、STAharden

## 目录结构

Expand All @@ -22,10 +22,11 @@ scripts/design/ics55/
│ ├── CTS.tcl
│ ├── legalization.tcl
│ ├── route.tcl
│ ├── drc.tcl
│ ├── filler.tcl
│ ├── rcx.tcl
│ ├── sta.tcl
│ ├── drc.tcl
│ └── filler.tcl
│ └── harden.tcl
└── gcd/ # 默认 workspace
├── home/ # workspace 元数据
├── origin/ # workspace 输入
Expand All @@ -36,7 +37,7 @@ scripts/design/ics55/
└── <step>_ecc/data/ # 工具工作目录
```

`<step>_ecc` 包括 `Floorplan_ecc`、`fixFanout_ecc`、`place_ecc`、`CTS_ecc`、`legalization_ecc`、`route_ecc`、`RCX_ecc`、`sta_ecc`、`drc_ecc` 和 `filler_ecc`。
`<step>_ecc` 包括 `Floorplan_ecc`、`fixFanout_ecc`、`place_ecc`、`CTS_ecc`、`legalization_ecc`、`route_ecc`、`drc_ecc`、`filler_ecc`、`RCX_ecc`、`sta_ecc` 和 `harden_ecc`。

## 前置条件

Expand Down Expand Up @@ -154,16 +155,17 @@ set RTL2GDS_FLOW 0
| 6 | route | `steps/route.tcl` | `legalization_ecc/output/gcd_legalization.def.gz` 或 `gcd_legalization_db` | `init_rt`、`run_rt` | `route_ecc/output/gcd_route.*`、`gcd_route_db` |
| 7 | drc | `steps/drc.tcl` | `route_ecc/output/gcd_route.def.gz` 或 `gcd_route_db` | `init_drc`、`run_drc` | `drc_ecc/output/gcd_drc.*`、`gcd_drc_db`、`report/drc.rpt` |
| 8 | filler | `steps/filler.tcl` | `drc_ecc/output/gcd_drc.def.gz` 或 `gcd_drc_db` | `run_filler` | `filler_ecc/output/gcd_filler.*`、`gcd_filler_db` |
| 9 | RCX | `steps/rcx.tcl` | `filler_ecc/output/gcd_filler.def.gz` 或 `gcd_filler_db`、`config/rcx.json` | `init_rcx`、`read_mapping`、`read_corner`、`run_rcx`、`report_rcx` | `RCX_ecc/output/gcd_RCX.*`、`gcd_RCX_db`、`gcd_<corner>.spef` |
| 10 | sta | `steps/sta.tcl` | `RCX_ecc/output/gcd_RCX.v`、`origin/gcd.sdc`、`config/rcx.json` 中的 SPEF | `read_netlist`、`read_liberty`、`read_sdc`、`read_spef`、`report_timing` | `sta_ecc/output/gcd_sta.*`、`output/sta/<corner>/` |
| 9 | RCX | `steps/rcx.tcl` | `filler_ecc/output/gcd_filler.def.gz` 或 `gcd_filler_db`、`config/rcx.json` | `init_rcx -config`、`run_rcx`、`report_rcx` | `RCX_ecc/output/gcd_RCX.*`、`gcd_RCX_db`、`gcd_<corner>.spef` |
| 10 | sta | `steps/sta.tcl` | `filler_ecc/output/gcd_filler.def.gz` 或 `gcd_filler_db`、`origin/gcd.sdc`、`config/rcx.json` 中的 SPEF | `read_netlist`、`read_liberty`、`read_sdc`、`read_spef`、`report_timing` | `sta_ecc/output/gcd_sta.*`、`output/sta/<corner>/` |
| 11 | harden | `steps/harden.tcl` | `filler_ecc/output/gcd_filler.def.gz` 或 `gcd_filler_db` | `gds_save -harden`、`write_soc_json`、`write_abstract_lef`、`write_timing_model` | `harden_ecc/output/gcd_harden.gds`、`gcd_harden.json`、`gcd_harden.lef`、`gcd_harden.lib`、`gcd_harden_db` |

每个 step 的 `output` 目录通常包含:

- `*.def.gz`:保存后的 DEF
- `*.v`:保存后的 Verilog netlist
- `*.gds`:保存后的 GDS,失败时脚本只打印 warning 并继续
- `*_db/`:`save_data` 保存的持久化 idb 数据
- `*.json`:脚本中预留的 `json_save` 路径,当前 `step_common.tcl` 中 `json_save` 被注释,默认不会生成
- `*.json`:脚本中预留的 `json_save` 路径,当前 `step_common.tcl` 中 `json_save` 被注释,普通 step 默认不会生成;`harden` step 会通过 `write_soc_json` 生成 SoC harden JSON

每个 step 的 `report` 目录通常包含:

Expand Down Expand Up @@ -215,7 +217,7 @@ gcd/config/<tool>_default_config.json

`step_common.tcl` 中的 `step_prepare_configs` 会把配置里的相对目录展开为绝对路径:

- `Floorplan_ecc`、`fixFanout_ecc`、`place_ecc`、`CTS_ecc`、`legalization_ecc`、`route_ecc`、`RCX_ecc`、`sta_ecc`、`drc_ecc`、`filler_ecc`、`config`、`origin`、`home` 展开到 workspace 根目录。
- `Floorplan_ecc`、`fixFanout_ecc`、`place_ecc`、`CTS_ecc`、`legalization_ecc`、`route_ecc`、`drc_ecc`、`filler_ecc`、`RCX_ecc`、`sta_ecc`、`harden_ecc`、`config`、`origin`、`home` 展开到 workspace 根目录。
- `IP`、`prtech`、`corners` 展开到 PDK 根目录。

因此运行脚本后,`gcd/config/*.json` 可能会被改写成绝对路径,这是预期行为。`steps/rtl2gds.tcl` 会先 source `create_workspace.tcl`,重新创建默认 `gcd` workspace 并复制 `config/`、`origin/` 模板;单步 `run_ecc.sh` 不会自动重建 workspace。
Expand Down Expand Up @@ -249,7 +251,7 @@ gcd/config/<tool>_default_config.json
支持的 step:

```text
Floorplan fixFanout place CTS legalization route drc filler RCX sta
Floorplan fixFanout place CTS legalization route drc filler RCX sta harden
```

## 常见问题
Expand Down
43 changes: 39 additions & 4 deletions scripts/design/ics55/run_ecc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"

ECC_BINARY="${ECC_BINARY:-${REPO_ROOT}/bin/ecc_bin}"
WORKSPACE="${WORKSPACE_HOME:-gcd}"
STEPS=(Floorplan fixFanout place CTS legalization route drc filler RCX sta)
STEPS=(create_workspace Floorplan fixFanout place CTS legalization route drc filler RCX sta harden)

usage() {
cat <<EOF
Expand Down Expand Up @@ -69,6 +69,43 @@ run_step() {
return "${status}"
}

run_flow() {
local runner
local status

runner="$(mktemp "${TMPDIR:-/tmp}/ecc-rtl2gds.XXXXXX.tcl")"
cat > "${runner}" <<EOF
set RTL2GDS 1
set RESTORE_DATA 1
set RTL2GDS_FLOW 1

source {${SCRIPT_DIR}/steps/create_workspace.tcl}
source {${SCRIPT_DIR}/steps/Floorplan.tcl}
source {${SCRIPT_DIR}/steps/fixFanout.tcl}
source {${SCRIPT_DIR}/steps/place.tcl}
source {${SCRIPT_DIR}/steps/CTS.tcl}
source {${SCRIPT_DIR}/steps/legalization.tcl}
source {${SCRIPT_DIR}/steps/route.tcl}
source {${SCRIPT_DIR}/steps/drc.tcl}
source {${SCRIPT_DIR}/steps/filler.tcl}
source {${SCRIPT_DIR}/steps/rcx.tcl}
source {${SCRIPT_DIR}/steps/sta.tcl}
source {${SCRIPT_DIR}/steps/harden.tcl}

set RTL2GDS_FLOW 0
step_maybe_flow_exit
EOF

if "${ECC_BINARY}" -script "${runner}" "${WORKSPACE}"; then
status=0
else
status=$?
fi

rm -f "${runner}"
return "${status}"
}

STEP="all"
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
usage
Expand Down Expand Up @@ -111,9 +148,7 @@ cd "${SCRIPT_DIR}"

case "${STEP}" in
all)
for step in "${STEPS[@]}"; do
run_step "${step}"
done
run_flow
;;
*)
if is_supported_step "${STEP}"; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/design/ics55/steps/create_workspace.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ proc cw_parameters_json {} {
}

proc cw_flow_json {} {
set step_names {Floorplan fixFanout place CTS legalization route drc filler RCX sta}
set step_names {Floorplan fixFanout place CTS legalization route drc filler RCX sta harden}
set step_items {}
foreach step_name $step_names {
lappend step_items [format { {
Expand Down Expand Up @@ -152,7 +152,7 @@ proc cw_subflow_json {step_name} {
}

proc cw_create_workspace {workspace_root source_config_dir workspace_config_dir source_origin_dir workspace_origin_dir} {
set step_names {Floorplan fixFanout place CTS legalization route drc filler RCX sta}
set step_names {Floorplan fixFanout place CTS legalization route drc filler RCX sta harden}

file mkdir $workspace_root
foreach dir {home origin config log} {
Expand Down
Loading
Loading