In my code, I want to do some connections using assign statement for all my tests except one test for which I added a runtime argument "HB_CONN_DISABLE" in my testlist. When I code as follows,I get the below error
if (!$test$plusargs("HB_CONN_DISABLE"))
begin
assign iol.hb_valid_in = dp_if_tx_inject.hb_bar_val_in;
assign iol.hb_in = dp_if_tx_inject.heartbeat_in;
end
Error-[V2KGEUV] Unknown or bad value for genvar
-I-:/nfs/hd/disks/mgr_0240/...............soc_post.sv, 543
Instance/Generate block name: iolc_tb
-I-: Elaboration time unknown or bad value encountered for generate if-statement
-I-: condition expression.
-I-: Please make sure it is elaboration time constant.
I also tried something like below, but in this case it doesn't recognize hb_bar_param in this line if(hb_bar_param==0) may be because by that time the parameter doesn't get the value
initial begin
if ($test$plusargs("HB_BAR_TI_CONN_DISABLE"))
begin
parameter hb_bar_param=1;
end
else
begin
parameter hb_bar_param=0;
end
end
if(hb_bar_param==0)
begin
assign statements......
end
I also tried using assign with ternary operator like the following
assign iol.hb_valid_in = ($test$plusargs("...somthing..")) ? (... some value ...) : (... some other value ...);
but in that case I will still end up assigning something if the testplus args is false, but for me the requirement is that I dont want to assign at all if the testplus args is there, please help me with this problem