79266369

Date: 2024-12-09 20:33:31
Score: 1.5
Natty:
Report link

Is there an inverse function to $typename? I'd like to create a type given a string with its definition. Very simple and contrived example assuming this function is called $name2type:

logic signed [7:0] my_byte_array [16];
initial $display (" type of my_byte_array is %s", $typename(my_byte_array));
// prints type of my_byte_array is logic signed[7:0]$[0:15]

// want same size as my_byte_array but unsigned
$name2type("logic unsigned [7:0]$[0:15]") my_unsigned_byte_array;

Thanks for any pointers or ideas!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Is there an in
  • Low reputation (1):
Posted by: David R