{"id":607,"date":"2017-10-10T10:00:44","date_gmt":"2017-10-10T17:00:44","guid":{"rendered":"http:\/\/www.verilogpro.com\/?p=607"},"modified":"2022-06-26T00:08:33","modified_gmt":"2022-06-26T07:08:33","slug":"systemverilog-arrays-synthesizable","status":"publish","type":"post","link":"https:\/\/www.verilogpro.com\/systemverilog-arrays-synthesizable\/","title":{"rendered":"SystemVerilog Arrays, Flexible and Synthesizable"},"content":{"rendered":"\n

In my last article on plain old Verilog Arrays<\/a>, I discussed their very limited feature set. In comparison, SystemVerilog arrays have greatly expanded capabilities both for writing synthesizable RTL, and for writing non-synthesizable test benches. In this article, we’ll take a look at the synthesizable features of SystemVerilog Arrays we can use when writing design RTL.<\/p>\n\n\n\n

Packed vs Unpacked SystemVerilog Arrays<\/h2>\n\n\n\n

Verilog had only one type of array. SystemVerilog arrays can be either packed<\/em> or unpacked<\/em>. Packed array refers to dimensions declared after the type and before the data identifier name. Unpacked array refers to the dimensions declared after the data identifier name.<\/p>\n\n\n\n

bit [7:0] c1;         \/\/ packed array of scalar bit\nreal      u [7:0];    \/\/ unpacked array of real\n\nint Array[0:7][0:31]; \/\/ unpacked array declaration using ranges\nint Array[8][32];     \/\/ unpacked array declaration using sizes<\/pre>\n\n\n\n