Help: SV Function/Task Definition Accepting Arbitrary Sized Vector Input
时间:10-02
整理:3721RD
点击:
Hi EETOP Buddies,
I’d like to define some SystemVerilog tasks/functions which can accept arbitrary sized vector input, like system function $onehot and $countones.
But I don’t know how to declare the argument in task/function, or use PLI to realize it.
Pls. kindly provide your solution if you have such experience.
Thanks a lot.
I’d like to define some SystemVerilog tasks/functions which can accept arbitrary sized vector input, like system function $onehot and $countones.
But I don’t know how to declare the argument in task/function, or use PLI to realize it.
Pls. kindly provide your solution if you have such experience.
Thanks a lot.
Try use Dynamic Arrays or Queues as the argument in task/function
e.g.
virtual protected task my_task(int data_in[$], data_out[]);