Trung tâm đào tạo thiết kế vi mạch Semicon


  • ĐĂNG KÝ TÀI KHOẢN ĐỂ TRUY CẬP NHIỀU TÀI LIỆU HƠN!
  • Create an account
    *
    *
    *
    *
    *
    Fields marked with an asterisk (*) are required.
wafer.jpg

PLUSARGS IN SYSTEMVERILOG

E-mail Print PDF

Plus args are command line switches supported by the simulator. Usually they are application specific. As per SystemVerilog LRM arguments beginning with the ‘+’ character will be available using the $test$plusargs and $value$plusargs PLI APIs.

Plus args are very useful in controlling many things on your environment like controlling your debug mode or to set a value like the debug_level in your environment, set a value to select/deselect particular field in your environment in your simulation.

What is the Syntax :

  1. $test$plusargs (string)

  2. $value$plusargs (string, variable)

This is a system function searches the list of plusargs. For this system in build function, If a string is found the function returns the value 1’b1. If no strong is found matching, the function returns the value 1’b0 and the variable provided is not modified.

Let’s take an example, How should we use this functions in our environment to have control.

initial begin

  if ($test$plusargs("USER_TEST")) begin

    $display("Configuring User Test"); 

    //Execute some code for this mode

  end

end

Once you compile and later run simulator with command line argument: +USER_TEST , the output will be

Configuring User Test

Similarly if you want to read values from command line into variables the second system function will be handy

For Example

initial begin

  string testname;

  if ($value$plusargs("TEST=%s",testname)) begin 

    $display(" Running TEST= %s.",testname); 

  end 

end

Once you compile and pass some argument to simulator as: +TEST=AXI_TEST , the output would be

Running TEST=AXI_TEST 

Bạn Có Đam Mê Với Vi Mạch hay Nhúng      -     Bạn Muốn Trau Dồi Thêm Kĩ Năng

Mong Muốn Có Thêm Cơ Hội Trong Công Việc

Và Trở Thành Một Người Có Giá Trị Hơn

Bạn Chưa Biết Phương Thức Nào Nhanh Chóng Để Đạt Được Chúng

Hãy Để Chúng Tôi Hỗ Trợ Cho Bạn. SEMICON  

  

Last Updated ( Wednesday, 09 June 2021 22:17 )  

Related Articles

Chat Zalo