본문 바로가기

VLSI/Tools

[Verilog] test bench 에서 fsdb file 생성

fsdb (fast signals database) file 은 waveform viewer 로 debugging 또는 power analysis tool 에서 estimation 하는데 사용하는 등, VLSI (Very Large Scale Integration) 개발에 많이 사용된다.

 

test_bench.v 에 다음과 같이 $fsdbDumpfile system task 를 호출하고, Synopsys 社 의 VCS (Verilog Compiler Simulator) tool 을 이용하면, fsdb file 을 생성할 수 있다.

initial begin
    // Name of fsdb file is "dump.fsdb"
    $fsdbDumpfile("dump.fsdb");
    
    // In this case, DUT (Design Under Test) name is "processor_top"
    // "0" means dumping all hierarchy signals. "1" means dumping only chosen module signals.
    $fsdbDumpvars(0, processor_top);
end

 

 

하지만 상황에 따라  Cadence 社 의 Xceilium simulator tool 을 활용하여, xrun 명령어로 fsdb file 을 생성해야 하는 경우가 있다. (예를 들어, 현재 부서가 Cadence 社 tool chain 으로 개발환경을 구축한 경우)

$fsdbDumpfile system task 를 호출하기 위해 다음과 같이 ${LD_LIBRARY_PATH}$fsdbDumpfile 이 정의된 file 들이 있는 path 를 setting 한다면 Cadence tool 을 이용해서도 손쉽게 fsdb file 을 생성 가능하다.

 

아래 예시는 Redhat 환경을 가정했다. path 는 개발 서버마다 다를 수 있으므로, 확인하여 추가하면 된다.

#!/bin/csh

# Write synopsys header files location to "LD_LIBRARY_PATH". It depends on your system.
# Below code means that it adds a path to ${LD_LIBRARY_PATH}.
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${NOVAS_HOME}/share/PLI/ius/Linux/boot

# Usually, target rtl files are written on "rtl_list.f" to manage file list easily
# If you want to run specific file (ex. file_name.v) directly, "xrun file_name.v" is also working.
xrun -f rtl_list.f

 

 

반복적으로 사용하기 위해서는, 위 code 를 script file 로 만들어서 사용하면 된다.

script file 이름이 run_sim 이라면 chmod +x run_sim 으로 excutable 권한을 추가하고, 아래와 같이 terminal 에 입력하여 수행 가능하다.

 

$chmod +x run_sim
$./run_sim