icarus 的 SystemVerilog 支持(iverilog 编译器)

SystemVerilog support of icarus (iverilog compiler)

我在 Mac 上使用 iverilog,我在编译一些包含 always_ffalways_comb 块的代码时遇到问题。 ModelSim 编译这些代码没有任何问题。是否可以配置 iverilog 以支持 always_ffalways_comb 块,或者编译器不支持它们?

always_combalways_latchalways_ff 是 SystemVerilog IEEE Std 1800-2012 中引入的一些关键字。它们不是 Icarus Verilog 编译器支持的 Verilog IEEE Std 1364-2005 的一部分。

我不知道有任何免费的 SystemVerilog 模拟器。但是,您始终可以使用 EDA Playground.

来模拟和综合您的 SystemVerilog 设计

A​​ndresM 的回答并不完全准确。 Icarus verilog 默认为 IEEE Std 1364-2005,它是支持更好的标准,但可以使用 -g 开关更改。来自 man iverilog:

-g1995|-g2001|-g2001-noconfig|-g2005|-g2005-sv|-g2009|-g2012

Select the Verilog language generation to support in the compiler. This selects between IEEE1364-1995, IEEE1364-2001, IEEE1364-2005, IEEE1800-2005, IEEE1800-2009, or IEEE1800-2012. Icarus Verilog currently defaults to the IEEE1364-2005 generation of the language. This flag is used to restrict the language to a set of keywords/features, this allows simulation of older Verilog code that may use newer keywords and for compatibility with other tools. Much of the IEEE1800 generations functionality is not currently supported. The IEEE1800 generations do parse all the keywords, so they can be used to verify that IEEE1364 compliant Verilog code does not use any of the new IEEE1800 keywords.

确实,当您尝试在端口中使用未打包的数组时,它会告诉您:

error: Ports cannot be unpacked arrays. Try enabling SystemVerilog support.