我可以在使用结构作为参数的 systemverilog 中合成参数化函数吗?

Can I synthesize a parameterized function in systemverilog where structure is used as a parameter?

我试图合成一个参数化函数,其中结构作为参数给出。我在参数化函数的开头收到以下错误 "Syntax error at or near token 'virtual'."

我正在尝试编译这个简单的包。

   package def;

typedef struct packed {
    logic[10:0] SIZE1;
    logic[10:0] SIZE2;
} my_struct;
endpackage


import def::*;

virtual class my_class #(parameter my_struct new_struct = '{10,11});
static function [new_struct.SIZE2-1:0] adder (input [new_struct.SIZE1-1:0] a, b);
return a+b; 
endfunction
endclass

module top 
#(parameter my_struct new_struct2 = '{63,64})
(input logic [new_struct2.SIZE1-1:0] a, b,
output logic [new_struct2.SIZE2-1:0] y) ;
assign y = my_class #(.new_struct(new_struct2))::adder(a,b); 
endmodule

我是不是做错了什么?或者 Synopsys DC 不支持此功能?

(更新:代码已经更新,这个可以用Synopsys DC合成)

根据 http://www.sutherland-hdl.com/papers/2013-SNUG-SV_Synthesizable-SystemVerilog_paper.pdf § 5.6.7 参数化 task/function arguments using static classes,class 必须是virtual 并在 $unit 声明中定义 space。这意味着 class 不能在包内定义。正如论文所指出的,这是一个奇怪的要求。

尝试将 class 移出包。您也可以尝试在 $unit 范围内导入函数,但不确定这是否有效。

...
endpackage : def
import def::my_class; // or def::*;
...