2

Verilog system function $value$plusargs invoked as task.Return value will be ignored

I get the above error during a compile of my verilog test which is basically trying to read and write values over i2c. I wasn't getting this error earlier.I don't know what changed which is giving me this error.Also this error points to another file called tb.v which contains the testbench infrastructure. The line it points to in tb.v just says `ifdef TEST

2 Answers 2

5

That error message means you are calling a function which returns a value without doing anything with the return value. As Brian noted, $value$plusargs returns a value, so you need to either assign it to something, or in SystemVerilog you can ignore it with use of void'(..).

// For Verilog
reg result;
result = $value$plusargs(...);

-

// For SystemVerilog
void'($value$plusargs(...));

You may also care to know if the plusarg matched or not. In that case, it's best coded in this way:

if ($value$plusargs(...)) begin
  // do something
end

One explanation as to why you started seeing this all of a sudden, would be if you changed something so the source is being compiled as SystemVerilog instead of Verilog. It's tool dependent, but a given compiler may complain about this in SystemVerilog but not in Verilog.

Sign up to request clarification or add additional context in comments.

Comments

0

$value$pluargs is a function which returns a value. This value is whether or not the call succeeded or not. Not the value of the +arg you're attempting to get. I've seen some simulators get upset if you don't assign the result to something.

Basically this will fix it:

reg dummy;
dummy = $value$plusargs(...)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.