k.rallis
k.rallis

Reputation: 71

SystemVerilog support of icarus (iverilog compiler)

I am using iverilog on a Mac, and I have problem compiling some codes that include always_ff and always_comb blocks. ModelSim compiles those codes without any problem. Is it possible to configure iverilog so as to support always_ff and always_comb blocks, or they are just not supported by the compiler?

Upvotes: 5

Views: 20867

Answers (2)

MayeulC
MayeulC

Reputation: 1848

AndresM's answer is not completely accurate. Icarus verilog defaults to IEEE Std 1364-2005, and it is the better supported standard, but that can be changed with the -g switch. From 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.

Indeed, it tells you so when trying to use unpacked arrays in ports:

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

Upvotes: 12

AndresM
AndresM

Reputation: 1373

always_comb, always_latch and always_ff are some of the keywords that were introduced in the SystemVerilog IEEE Std 1800-2012. They are not part of the Verilog IEEE Std 1364-2005, which is what the Icarus Verilog compiler supports.

I am not aware of any free SystemVerilog simulators. However, you can always simulate and synthesize your SystemVerilog design using EDA Playground.

Upvotes: 4

Related Questions