W
Weddick
Guest
If I have a bus --> xyz(31 downto 0) is there a way to assign another name
such that it references xyz(20 downto 10)?
Thanks,
Joel
such that it references xyz(20 downto 10)?
Thanks,
Joel
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You could use an alias for this.If I have a bus --> xyz(31 downto 0) is there a way to assign another name
such that it references xyz(20 downto 10)?
variable left_v : unsigned( 9 downto 0);
_right_v_
and use these to assign to the bus:
bus <= left_v & mid_v & left_v;
_right_v_
Weddick wrote:
If I have a bus --> xyz(31 downto 0) is there a way to assign another
name such that it references xyz(20 downto 10)?
You could use an alias for this.
The downside is that aliases are not visible in simulation.
You could declare variables (or signals) for the fields.
variable left_v : unsigned(10 downto 0);
variable mid_v : unsigned(10 downto 0);
variable left_v : unsigned( 9 downto 0);
and use these to assign to the bus:
bus <= left_v & mid_v & left_v;
-- Mike Treseler
Since alias doesn't create new objects, tools are not able to display themYou could use an alias for this.
The downside is that aliases are not visible in simulation.
Last time I tried this in modelsim, I could see theSince alias doesn't create new objects, tools are not able to display them
in Waveforms?