sv 易混淆语法
1. 数组上下界随变量变化的语法;
//for(i=0; i<=11;i++) begin // file_data_re0[((i+1)*12)-1 +: i*12] = data_re0; // file_data_im0[((i+1)*12)-1 +: i*12] = data_im0; //end for(i=0; i<=11;i++) begin file_data_re0[i*12 +: 12] = data_re0; file_data_im0[i*12 +: 12] = data_im0; end file_data_re0 = {12{data_re0}}; file_data_im0 = {12{data_im0}};
2. $bits() 使用;
logic [7:0] fa[10]; typedef struct { logic valid; bit [7:0] data; } MyType; logic [$bits(MyType)-1 : 0] mytype_bitstream; logic [$bits(fa)-1 : 0] fa_bitstream; initial begin $display("Bitstream size of MyType: %0d", $bits(MyType)); $display("Bitstream size of Fixed Array: %0d", $size(fa_bitstream)); end
3.unpacked/packed array(合并数组/非合并数组)
本文来自博客园,作者:hematologist,转载请注明原文链接:https://www.cnblogs.com/littleMa/p/12619825.html
posted on 2020-04-02 14:49 hematologist 阅读(559) 评论(0) 编辑 收藏 举报