Automatic Record Constraints when defining constant, signal, or variable
Is your capability/feature request related to a problem?
Partially constrained records are useful for defining subtypes, but I don't see the use when declaring a constant
, signal
, or variable
. For any signal which is not constrained in the record definition, a null range
should be applied.
For example, the AXI4 streaming record:
type axis_t is record
data : std_ulogic_vector ;
dest : std_ulogic_vector ;
id : std_ulogic_vector ;
keep : std_ulogic_vector ;
last : std_ulogic ;
valid : std_ulogic ;
ready : std_ulogic ;
end record ;
An instantiation is currently:
signal axis32 : axis_t( data(31 downto 0), dest(-1 downto 0), id(-1 downto 0), keep(3 downto 0) ) ;
This seems cumbersome.
Describe the solution you'd like
Automatically assume null ranges for the unconstrained elements (dest
and id
):
signal axis32 : axis_t( data(31 downto 0), keep(3 downto 0) ) ;
This also has the added benefit of backward compatibility for future enhancements to the records.
For example, the axis_t
does not have a user
signal. If we modify the definition to add it, any code that uses the old definition now needs to constrain the user
signal as well. This proposal would allow for seamless updating since the user
signal would assume a null range
.