Liberty(.lib)는 standard cell의 timing, power, area 정보를 담은 라이브러리 파일입니다. Synthesis tool이 cell을 선택하고, STA tool이 delay를 계산하는 데 사용합니다. .db는 .lib의 바이너리 컴파일 버전입니다.
Liberty 파일의 구조
/* example_ss_0p75v_125c.lib */
library (example_ss_0p75v_125c) {
/* Library-level attributes */
technology (cmos);
delay_model : table_lookup;
time_unit : "1ns";
voltage_unit : "1V";
current_unit : "1mA";
capacitive_load_unit (1, pf);
leakage_power_unit : "1nW";
nom_process : 1.0;
nom_voltage : 0.75;
nom_temperature : 125;
/* Lookup table templates */
lu_table_template (delay_7x7) {
variable_1 : input_net_transition;
variable_2 : total_output_net_capacitance;
index_1 ("0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0");
index_2 ("0.001, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2");
}
/* Cell definition */
cell (NAND2_X1) {
area : 1.064;
leakage_power () {
when : "!A1 & !A2";
value : 0.523;
}
leakage_power () {
when : "A1 & A2";
value : 1.847;
}
pin (A1) {
direction : input;
capacitance : 0.0012;
max_transition : 0.5;
}
pin (A2) {
direction : input;
capacitance : 0.0011;
}
pin (ZN) {
direction : output;
function : "!(A1 & A2)";
max_capacitance : 0.15;
timing () {
related_pin : "A1";
timing_sense : negative_unate;
cell_rise (delay_7x7) {
index_1 ("0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0");
index_2 ("0.001, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2");
values ( \
"0.021, 0.025, 0.029, 0.037, 0.060, 0.105, 0.196", \
"0.023, 0.027, 0.031, 0.039, 0.062, 0.107, 0.198", \
"0.030, 0.034, 0.038, 0.046, 0.069, 0.114, 0.205", \
"0.041, 0.045, 0.049, 0.057, 0.080, 0.125, 0.216", \
"0.063, 0.067, 0.071, 0.079, 0.102, 0.147, 0.238", \
"0.127, 0.131, 0.135, 0.143, 0.166, 0.211, 0.302", \
"0.245, 0.249, 0.253, 0.261, 0.284, 0.329, 0.420" \
);
}
rise_transition (delay_7x7) {
/* ... similar 7x7 table ... */
}
cell_fall (delay_7x7) {
/* ... similar 7x7 table ... */
}
fall_transition (delay_7x7) {
/* ... similar 7x7 table ... */
}
}
/* Power */
internal_power () {
related_pin : "A1";
rise_power (delay_7x7) {
/* ... power table ... */
}
fall_power (delay_7x7) {
/* ... power table ... */
}
}
}
}
}
NLDM Table 읽는 법
NLDM(Non-Linear Delay Model)은 2D lookup table입니다. X축(index_1)은 input transition time, Y축(index_2)은 output load capacitance입니다. Table의 각 값은 해당 조건에서의 cell delay(ns)입니다.

예를 들어, input transition = 0.05ns, output load = 0.02pF일 때 cell_rise delay는 table에서 (row 3, col 4) = 0.046ns입니다. STA tool은 실제 조건이 table index 사이에 있으면 보간(interpolation)하여 delay를 계산합니다.
PVT Corner와 Liberty 파일
Liberty 파일은 하나의 PVT(Process, Voltage, Temperature) corner에 대한 정보를 담습니다. 파일 이름에 corner 정보를 포함하는 것이 관례입니다:
example_ss_0p75v_125c.lib # Slow-Slow, 0.75V, 125°C
example_tt_0p85v_25c.lib # Typical-Typical, 0.85V, 25°C
example_ff_0p95v_m40c.lib # Fast-Fast, 0.95V, -40°C
Setup timing은 slow corner에서, hold timing은 fast corner에서 worst case가 됩니다. MCMM 분석에서는 여러 corner의 .lib을 동시에 로드합니다.
Flip-Flop의 Liberty 정의
cell (DFFRNQ_X1) {
area : 4.256;
ff (IQ, IQN) {
next_state : "D";
clocked_on : "CK";
clear : "!RN";
}
pin (D) {
direction : input;
timing () {
related_pin : "CK";
timing_type : setup_rising;
rise_constraint (setup_hold_7x7) {
/* setup time table */
}
}
timing () {
related_pin : "CK";
timing_type : hold_rising;
rise_constraint (setup_hold_7x7) {
/* hold time table */
}
}
}
pin (CK) {
direction : input;
clock : true;
/* ... */
}
pin (Q) {
direction : output;
function : "IQ";
timing () {
related_pin : "CK";
timing_type : rising_edge;
/* CK-to-Q delay tables */
}
}
}
Flip-flop은 ff group으로 sequential 동작을 정의합니다. D pin에는 setup/hold constraint가, Q pin에는 CK-to-Q delay가 정의됩니다.
.db 파일이란?
.db는 Synopsys tool이 .lib을 컴파일한 바이너리 파일입니다. .lib은 텍스트라 읽기는 쉽지만, cell 수가 많으면 파싱이 느립니다. .db는 tool이 빠르게 로드할 수 있는 형태입니다. read_lib으로 .lib을 읽어 write_lib -format db로 변환합니다.
정리
Liberty(.lib)는 cell의 timing, power, area를 NLDM table로 기술하는 표준 라이브러리 파일입니다. PVT corner별로 별도 파일이 필요하며, .db는 tool 로딩 속도를 위한 바이너리 버전입니다. Synthesis, STA, P&R 모든 단계의 핵심 입력입니다.