K
Kevin Neilson
This seems simple, but I've been unable to find the answer. I have an
enumerated type like this:
type opmode_type is (m, p_plus_m, p_minus_m, m_plus_c...);
signal opmode : opmode_type;
As I understand it, the synthesizer will assign sequential values to
these (i.e., m=1, p_plus_m=2). But I need to assign particular (3-bit
signed) values to these: e.g., m="101", p_plus_m="110". Is there a way
to do this?
Perhaps I need to do something else entirely. I supposed I could use
aliases to assign names to the constants. I could make a constant array
and somehow index it (maybe with the enumerated type?). Or maybe I
could make a record?
type opmode_type is record m, p_plus_m, ... : unsigned(2 downto 0);
signal opmode : opmode_type := ("101","110",...);
and then access the opmode with a field, as in: opmode.p_plus_m
I just wondered what is most stylistically proper way to do this.
-Kevin
enumerated type like this:
type opmode_type is (m, p_plus_m, p_minus_m, m_plus_c...);
signal opmode : opmode_type;
As I understand it, the synthesizer will assign sequential values to
these (i.e., m=1, p_plus_m=2). But I need to assign particular (3-bit
signed) values to these: e.g., m="101", p_plus_m="110". Is there a way
to do this?
Perhaps I need to do something else entirely. I supposed I could use
aliases to assign names to the constants. I could make a constant array
and somehow index it (maybe with the enumerated type?). Or maybe I
could make a record?
type opmode_type is record m, p_plus_m, ... : unsigned(2 downto 0);
signal opmode : opmode_type := ("101","110",...);
and then access the opmode with a field, as in: opmode.p_plus_m
I just wondered what is most stylistically proper way to do this.
-Kevin