ASIC SoC2012. 2. 6. 19:19
(1) 개요

이 글은 아래 페이지를 참조하였다.

http://snk.tuxfamily.org/lib/ruby-vpi/

기본적으로  Ruby-VPI는 PLI 를 이용해서 Ruby까지 연결된 Interface를 제공한다.
따라서 Ruby를 이용해서  Testbench를 만들어 낼 수 있다는 점이 장점이다.
 
Ruby의 장점을 그대로 계승하기 때문에 Test bench나 검증 작성에 많은 도움이 된다.
검증 작성에서는 RUBY의 Test unit을 그대로 사용할 수 있기 때문에 TDD를 적용해 볼 수 있다.

Ruby-VPI의 최신 버전은 2008년 버전이며 21.1.0 버전이다.
다운로드는 아래 페이지에서 할 수 있다.

http://rubyforge.org/frs/?group_id=1339



(2) 설치

설치는 아래와 같이 한다.
설치에 대한 참조는 아래 링크를 참조 http://snk.tuxfamily.org/lib/ruby-vpi/#setup.inst

rake build
ruby bin/ruby-vpi -v


설치가 잘 되어 있으면 아래와 같은 메시지를 볼 수 있다.

ruby-vpi 21.1.0 (2008-08-02) http://ruby-vpi.rubyforge.org /Users/kevinim/Documents/Verilog_toos/Ruby-VPI/ruby-vpi-21.1.0


인스톨이 안되면 아래와 같이 직접 gem을 통해서 인스톨한다.

gem install ruby-vpi
WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
          /usr/bin aren't both writable.
WARNING:  You don't have /Users/kevinim/.gem/ruby/1.8/bin in your PATH,
          gem executables will not run.
ERROR:  Error installing ruby-vpi:
        rspec requires rspec-expectations (~> 2.7.0, runtime)
 
rspec-ecpectations을 설치해야 하는데 아래와 같이 명령어를 넣어서 설치한다.
 
gem install rspec-expectations

설치되고 검사는 위와 같은 방식으로 실행한다.

ruby-vpi  -v

2008년 이후에 Update가 안되었으니까 굳이 Update할 필요가 없지만,

혹시 몰라서 업데이트 커맨드는 아래와 같다.

gem update ruby-vpi


  (3) RUBY-VPI가 지원하는 시뮬레이터

SimulatorNotes
GPL Cver(recommended) Version 2.11a or newer is acceptable.
Synopsys VCS Any version that supports the -load option is acceptable.
Mentor Modelsim Any version that supports the -pli option is acceptable. SeeSection 6.3. Mentor Modelsim if you are using Modelsim version 6.2g.
Cadence NC-Sim Any version that supports the +loadvpi option is acceptable for Ruby-VPI versions 20.0.0 or older. See Section 6.2. Cadence NC-Sim for details.
Icarus Verilog Version 0.8 is mostly acceptable because you will not be able to access child handles through method calls. See Section 6.1.1. Give full paths to Verilog objects for details.
 
 일단 OSX에서는 ICARUS를 활용해서 한다.
 

(4)  RUBY-VPI의 기본적인 개념

 

ruby-vpi는 두개의 component로 연결되어 있다.
- ruby-vpi와 verilog vpi 이다.

Ruby를 이용해서 테스트 벤치를 가동시키고 test case를 구동시킬 수 있다. 이는  Ruby interpereter는 스크립트를 구동하는데 이는 Ruby-VPI를 통해서 Verilog VPI를 거쳐서 Simulator 를 구동하게 된다.
- 귀찮은 C를 이용한 PLI 가 없으므로 테스트 케이스 개발이 쉬워진다는 장점을 얻을 수 있다.

위의 그림을 단순하게 보면 아래와 같다.



Ruby-VPI를 사용하게 되면 몇개의 파일이 생성되거나 만들어지게 된다.

각각의 파일은 아래와 같다.

- runner.rake
      verilog simulator를 구동한다.
   
- design.rb
      DUT의 method를 정의한다.
     테스팅을 데이터 구조 등도 포함될 수 있다.

- proto.rb
     DUT 모델의 Ruby version

- spec.rb
    테스트를 위한 함수 / 클래스 등을 포함시킨다.

- loader.rb
   test를 로딩하는 user defined test code 이다.



     
 
Posted by GUNDAM_IM