본문으로 건너뛰기Skip to content 1:1 문의 — [email protected]로 이메일 작성 Contact us — email [email protected]

TCL(.tcl) 파일이란 무엇인가요?

TCL(Tool Command Language)은 EDA tool의 스크립팅 언어입니다. Synopsys, Cadence, Siemens의 주요 tool이 모두 TCL 기반 인터페이스를 제공하며, 설계 flow를 자동화하는 데 사용됩니다. .tcl 파일 자체가 설계 데이터는...

TCL(.tcl) 파일이란 무엇인가요?
Photo by Davi Diório Mendes / Unsplash
🆓 무료 글 · 누구나 무료로 읽을 수 있는 글입니다

TCL(Tool Command Language)은 EDA tool의 스크립팅 언어입니다. Synopsys, Cadence, Siemens의 주요 tool이 모두 TCL 기반 인터페이스를 제공하며, 설계 flow를 자동화하는 데 사용됩니다. .tcl 파일 자체가 설계 데이터는 아니지만, RTL-to-GDS flow를 구동하는 핵심 파일입니다.

자세한 문법은 아래를 참고하세요:

https://www.yes24.com/product/goods/172510976

Electronic circuit board with glowing traces and various components
Photo by Brecht Corbeel on Unsplash

Synthesis Script 예제

# syn_run.tcl (Design Compiler)

# ============================================
# Setup
# ============================================
set TOP_MODULE   "top_design"
set RTL_PATH     "./rtl"
set LIB_PATH     "./lib"
set RESULT_PATH  "./results"

# Library 설정
set_app_var target_library \
    "${LIB_PATH}/ss_0p75v_125c.db"
set_app_var link_library \
    "* ${LIB_PATH}/ss_0p75v_125c.db"

# ============================================
# Read Design
# ============================================
analyze -format sverilog [glob ${RTL_PATH}/*.sv]
elaborate ${TOP_MODULE}
link

# ============================================
# Constraints
# ============================================
source ./constraints/${TOP_MODULE}.sdc

# ============================================
# Synthesis
# ============================================
# Compile with optimization
compile_ultra -no_autoungroup -gate_clock

# ============================================
# Reports
# ============================================
report_timing -max_paths 10 \
    > ${RESULT_PATH}/timing.rpt
report_area -hierarchy \
    > ${RESULT_PATH}/area.rpt
report_power \
    > ${RESULT_PATH}/power.rpt
report_constraint -all_violators \
    > ${RESULT_PATH}/constraint.rpt

# ============================================
# Output
# ============================================
write -format verilog \
    -output ${RESULT_PATH}/${TOP_MODULE}.v
write -format ddc \
    -output ${RESULT_PATH}/${TOP_MODULE}.ddc
write_sdc \
    ${RESULT_PATH}/${TOP_MODULE}.sdc

P&R Script 예제

# pnr_run.tcl (Innovus)

# ============================================
# Design Import
# ============================================
set init_verilog "./results/top_design.v"
set init_design_settop "top_design"
set init_top_cell "top_design"
set init_lef_file [list \
    "./lib/tech.lef" \
    "./lib/cells.lef" \
    "./lib/sram.lef"  \
]
set init_mmmc_file "./scripts/mmmc.tcl"

init_design

# ============================================
# Floorplan
# ============================================
source ./scripts/floorplan.tcl

# ============================================
# Placement
# ============================================
setPlaceMode -place_detail_legalization_inst_gap 1
place_opt_design

# ============================================
# CTS
# ============================================
set_ccopt_property target_max_trans 0.15
set_ccopt_property target_skew 0.05
ccopt_design

# ============================================
# Route
# ============================================
setNanoRouteMode -routeWithTimingDriven true
setNanoRouteMode -routeWithSiDriven true
routeDesign

# ============================================
# Post-Route Optimization
# ============================================
optDesign -postRoute -hold

# ============================================
# Output
# ============================================
saveDesign ./results/top_design.enc
defOut ./results/top_design.def
saveNetlist ./results/top_design_routed.v

TCL 활용 팁

변수와 리스트를 활용하면 재사용 가능한 script를 만들 수 있습니다. proc로 함수를 정의하여 반복 작업을 자동화합니다. foreach로 여러 corner나 module에 대해 반복 실행합니다. Flow를 단계별 script로 분리하여 관리합니다(floorplan.tcl, placement.tcl, cts.tcl, route.tcl).

정리

TCL은 EDA tool을 구동하는 스크립팅 언어이며, synthesis, P&R, STA의 전 과정을 자동화합니다. Design import, constraint 적용, optimization, report, output을 script로 기술하며, MMMC 설정도 TCL로 관리합니다.

관련 글

댓글

VLSI KOREA BRIEFING

반도체를 읽는 안목, 메일함으로.

엔지니어의 시각과 산업의 흐름을 함께. 무료로 구독하세요.

이미 구독 중인가요? 로그인