2016-12-20 13 views
1

在QuestaSIM用户手册版本10.5A它是336页指出:如何在AMS中将多个对象类型驱动到网上?

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 - 什么是语法?或者我如何可靠地将不同类型的物体驱动到网络上?

+0

您引用的文本不是IEEE 1800-2012标准。你看过_6.6.7用户定义的nettypes_中的例子吗? –

+0

我在编辑时不小心剪掉了问题的顶部。我不确定它是否值得为此付出代价,我纠正了它。 – Joe

+0

做哟有IEEE 1800-2012手册吗? –

回答

2

用户自定义的nettypes不是SystemVerilog的OOP class类型系统的一部分。您只能定义结构或包含位或实数组合的数组的nettypes。类仅用于访问参数化函数。 (请参阅13.8参数化的任务和功能)。

您只能在网上驾驶类似的类型。如果你看一个解析功能(从6.6.7节)的原型

function automatic T Tsum (input T driver[]); 

您将看到该函数有一个输入参数是一个数组。这将填充网络中所有驱动程序的值 - 它们必须全部是相同的类型。

interconnect构造只是一个连接的渠道。它将假设它所连接的类型,并且您将无法将具有不同nettypes的信号连接到相同的interconnect

+0

公平地说,如果我将T的所有东西都划分子类,那么我的对象就可以毫无问题地被应用了?所以基本上创建一个所有从其继承的基础NetTypeObject?我假设这与多个使用'with'作为分辨率的驱动程序一起工作。 – Joe

+0

除了T不能是类类型。 –

+0

好吧,所以这听起来像用户定义的类型驾驶网络不支持。为了解决这个问题,如果我在顶部有一个单身人士,并在网上开车,网上的价值可能是一个对象的查找键?这看起来公平吗? – Joe

相关问题