Hi All,
I am trying to configure an implication constraint to be soft constraint, but i always got compilation error when i add the keyword soft.
For example, the following code can execute without problem.
class packet;
rand bit [3:0] addr;
string addr_range;
constraint address_range { (addr_range == "small") -> (addr < 8);}
endclass
However, once I add “soft”, I’ll got compilation error.
class packet;
rand bit [3:0] addr;
string addr_range;
constraint address_range { soft (addr_range == "small") -> (addr < 8);}
endclass
Error-[SE] Syntax error
Following verilog source has syntax error :
“testbench.sv”, 8: token is ‘->’
constraint address_range { soft (addr_range == “small”) → (addr < 8);}
Wonder what should i do to make this constraint soft?
Thanks in advance!
Hao