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!