use repeats for converted unbased-unsized literals

- reduces the number of cast functions which are generated
- adjust package_function_cast to preserve cast converage
- fix issue where cast functions would be generated before localparam
  substitution within a procedure
This commit is contained in:
Zachary Snow
2020-07-24 21:29:59 -06:00
parent 39519dd439
commit 21ebbb5a19
3 changed files with 9 additions and 5 deletions
+3 -2
View File
@@ -1,8 +1,9 @@
package P;
function automatic logic [7:0] f(input logic [2:0] p);
logic [7:0] r;
r = '0;
r[p+:2] = '1;
localparam T = $bits(r[7:0]);
r = T'(1'sb0);
r[p+:2] = $bits(r[p+:2])'(1'sb1);
return r;
endfunction
endpackage