Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a VHDL "typedef"

Tags:

typedef

vhdl

I want to "create" a type "my_type", which is a std_logic_vector(...), like this C/VHDL fake code: typedef std_logic_vector(CONSTANT downto 0) my_type.

"type" does not allow you to do it with std_logic_vector(...), only with array, and "alias" uses only valid types, you can't create a type with it.

So how to do it?

like image 577
Leonardo Alt Avatar asked Feb 25 '23 19:02

Leonardo Alt


1 Answers

You need subtype

subtype foo is std_logic_vector(7 downto 0);
like image 174
Philippe Avatar answered Mar 03 '23 19:03

Philippe