Step 1: create a PLI application program in C, such as, a "Hello world" as hereafter.
/********************************************************************** * $hello example -- PLI application using VPI routines * * C source to print "Hello World" as a PLI application. * * Usage: $hello; * * *********************************************************************/
#include /* ANSI C standard library */ #include /* ANSI C standard input/output library */ #include /* IEEE 1364 PLI VPI routine library */
/********************************************************************** * $hello Registration Data * (add this function name to the vlog_startup_routines array) *********************************************************************/ void hello_register() { s_vpi_systf_data tf_data;
Step 3: compiling and linking the $hello system task g++ -c -I/[install_dir]/modeltech/include [app-source-files] ld -G -B symbolic -o mti_pli_apps.so [pli_app_object_files]
In above $hello example, we do as follows: g++ -c -I/[install_dir]/modeltech/include hello_vpi.c g++ -c -I/[install_dir]/modeltech/include hello_register.c ld -G -B symbolic -o mti_pli_apps.so hello_vpi.o hello_register.o
Step 4: Modify the ModelSim .ini file at /[install_dir]/modeltech/modelsim.ini specify the names of the shared object libraries in the Veriuser variable. This variable is typically found towards the middle of the modelsim.ini file, and by default it is commented out. Any number of shared object files may be listed, separated by a white space. As an example, the $hello system task has shared object mti_pli_apps.so, then the Verisuer variable would be set to:
;List of dynamically loaded objects for Verilog PLI applications Veriuser=mti_pli_apps.so
Step 5: Create a verilog file to use $hello system task
hello.v
module hello(clk, reset); input clk, reset; initial begin $hello(); end
endmodule
Step 6: Create do files to run hello.v in ModelSim command-line mode
File test.do: #this is to run hello in cmd mode do test_stim.do quit -f
File test_stim.do
# setup an oscillator on the CLK input force clk 1 50 -r 100 force clk 0 100 -r 100
# reset the clock and then count to 100 force reset 1 run 100
force reset 0 run 10000
Step 7: Simulate Hello.v in modelSim
Type following command in Dos/Unix prompt $vsim -c -do test.do test -wlf test.wlf
The -c argument instructs ModelSim not to invoke the GUI. The -wlf argument saves the simulation results in a WLF file. This allows you to view the simulation results in the GUI for debugging purposes.
지난번에 등록하였던 반도체설계기사 실기를 보고 왔습니다. 다른 시험의 경우 하루나 이틀정도는 시간을 내어서 공부를 하였지만(전공관련의 시험인 경우죠.. ^^) 요즘 정신없는 일이 있었던데다가 일도 좀 생겨서 제대로 공부를 한번도 못했지만 단순히 제 전공분야라는 자신감만으로 시험보러 갔습니다. ^^;;
장소는 광운대 IDEC센터이더군요. 처음 HDL강의를 들었던 곳도 저곳이었는데(VHDL의 경우는 좀 더 먼저했습니다만, Verilog는 처음이었죠. ^^).... 하여간, 좀 먼저 도착한지라 아침겸 점심으로 라볶기를 하나 먹고(시험보는거 맞는지...-_-) 시험장으로 향했습니다. 한 20명 안되시는 분들이 시험을 보러 오신거 같더군요. 일년에 한번 있는 시험인데다가 별로 인지도(?)도 없는 시험이라 많은 분들이 응시는 안하는 것 같더군요.
오늘의 문제는 JK플립플롭으로 8진카운터 설계, 무어머신을 이용한 주파수 분석(?)기, 7세그먼트 디코더가 나왔더군요. 아무래도 전공이 전공인지라 빨리 끝내고 나왔습니다만.. ^^; 실기시험 자체에 대한 평가로는 저희학교에서 강의하는 디지털시스템설계정도만 들어도 충분히 풀수 있는 문제더군요.(물론 잘 들어야겠지만.. ^^)
시험중 아쉬웠던 점은 문제에 미스프린트가 좀 있었다는 것과 시뮬레이션에 대해서 조건이 좀 애매하다고 해야 한 점.. 그리고 실제 반도체 설계에 대해서 단지 functional simulation으로만 자격증 시험을 치룬다는 것이었다. 이쪽 분야에 계신 분들은 다 아시겠지만 func. sim.의 경우는 정말 전체 작업에 20%정도나 될까 하는 작업인지라... ^^ 하여간, 문제를 잘 못 읽지만 않았다면 내 7번째 자격증은 무난히 얻을 것 같다. 다음엔 무선설비기사닷~!!