3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-24 23:03:42 +00:00

Add $size() function. At the moment it works only on expressions, not on memories.

This commit is contained in:
Udi Finkelstein 2017-09-26 06:25:42 +03:00
parent 29f8acf095
commit 64eb8f29ad
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,15 @@
module functions01;
wire [3:0]x;
wire [$size(x)-1:0]x_size;
wire [$size({x, x})-1:0]xx_size;
wire [3:0]w[0:5];
//
// The following are not supported yet:
//
//wire [$size(w)-1:0]w_s;
//wire [$bits(x)-1:0]x_bits;
//wire [$bits({x, x})-1:0]xx_bits;
endmodule