如何在 AMS 中将多个对象类型驱动到一个网络上?
How to drive multiple object types onto a net in AMS?
在 QuestaSIM 用户手册版本 10.5a 中,第 336 页指出:
In the most recent SystemVerilog standard (Std IEEE 1800-2012), two important concepts were established:
User-Defined Nettype (UDN) — UDN allows a definition of a net type
that can carry arbitrarily complex data using a built-in type (such as
real) or a user-defined type (such as struct). Consequently, UDN is a
generalization of the wreal net type from Verilog-AMS. In order to
allow connectivity of models that rely on UDNs, a more generic
connectivity mechanism is needed—the interconnect object.
但他们确实没有具体说明 UDN 是如何构建的。对 'nettype' 和 'interconnect' 的语法引用似乎接近这个描述,但两者都不符合它——我不能分配互连,我不能将我自己的类型与 nettype 一起使用。我正在创建一个模型,需要将用户定义的对象驱动到规范中定义的 UDN 上。
module SomeModel(output nettype ObjectContainingProperties outputToInterconnect);
class ObjectContainingProperties;
endclass
ObjectContainingProperties ocp;
assign outputToInterconnect=ocp;
initial begin
ocp=new();
end
endmodule
但我收到错误消息:
QuestaSim-64 vlog 10.5a Compiler 2016.04 Apr 4 2016
Start time: 18:55:05 on Dec 19,2016
vlog -ams -wireasinterconnect SomeModel.sv
-- Compiling module SomeModel
** Error: (vlog-13069) SomeModel.sv(11): near "nettype": syntax error, unexpected nettype, expecting IDENTIFIER.
如何创建对象并将其附加到 UDN - 语法是什么?或者我如何可靠地将不同类型的对象驱动到网络上?
用户定义的网络类型不是 SystemVerilog 的 OOP class
类型系统的一部分。您只能定义作为包含位或实数组合的结构或数组的网络类型。 类 仅用于访问参数化函数。 (参见 13.8 参数化任务和函数)。
您只能将类似的类型驱动到网络上。如果您查看解析函数的原型(来自第 6.6.7 节)
function automatic T Tsum (input T driver[]);
您看到该函数有一个输入参数,它是一个数组。这将填充来自网络上所有驱动程序的值 - 它们必须都是同一类型。
interconnect
构造只是连接的管道。它将假定它所连接的类型,并且您将无法将具有不同网络类型的信号连接到相同的 interconnect
在 QuestaSIM 用户手册版本 10.5a 中,第 336 页指出:
In the most recent SystemVerilog standard (Std IEEE 1800-2012), two important concepts were established:
User-Defined Nettype (UDN) — UDN allows a definition of a net type that can carry arbitrarily complex data using a built-in type (such as real) or a user-defined type (such as struct). Consequently, UDN is a generalization of the wreal net type from Verilog-AMS. In order to allow connectivity of models that rely on UDNs, a more generic connectivity mechanism is needed—the interconnect object.
但他们确实没有具体说明 UDN 是如何构建的。对 'nettype' 和 'interconnect' 的语法引用似乎接近这个描述,但两者都不符合它——我不能分配互连,我不能将我自己的类型与 nettype 一起使用。我正在创建一个模型,需要将用户定义的对象驱动到规范中定义的 UDN 上。
module SomeModel(output nettype ObjectContainingProperties outputToInterconnect);
class ObjectContainingProperties;
endclass
ObjectContainingProperties ocp;
assign outputToInterconnect=ocp;
initial begin
ocp=new();
end
endmodule
但我收到错误消息:
QuestaSim-64 vlog 10.5a Compiler 2016.04 Apr 4 2016
Start time: 18:55:05 on Dec 19,2016
vlog -ams -wireasinterconnect SomeModel.sv
-- Compiling module SomeModel
** Error: (vlog-13069) SomeModel.sv(11): near "nettype": syntax error, unexpected nettype, expecting IDENTIFIER.
如何创建对象并将其附加到 UDN - 语法是什么?或者我如何可靠地将不同类型的对象驱动到网络上?
用户定义的网络类型不是 SystemVerilog 的 OOP class
类型系统的一部分。您只能定义作为包含位或实数组合的结构或数组的网络类型。 类 仅用于访问参数化函数。 (参见 13.8 参数化任务和函数)。
您只能将类似的类型驱动到网络上。如果您查看解析函数的原型(来自第 6.6.7 节)
function automatic T Tsum (input T driver[]);
您看到该函数有一个输入参数,它是一个数组。这将填充来自网络上所有驱动程序的值 - 它们必须都是同一类型。
interconnect
构造只是连接的管道。它将假定它所连接的类型,并且您将无法将具有不同网络类型的信号连接到相同的 interconnect