One Signal Two Names

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
 
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
 
Thanks Mike,

Looks like alias would do the trick if it would work in simulation also.

Joel


"Mike Treseler" <mike_treseler@comcast.net> wrote in message
news:3p2ur4F8emibU1@individual.net...
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
 
Mike,
What exactly do you mean by:
You could use an alias for this.
The downside is that aliases are not visible in simulation.
Since alias doesn't create new objects, tools are not able to display them
in Waveforms?

Thanks
Srini
 
Srinivasan Venkataramanan wrote:

Since alias doesn't create new objects, tools are not able to display them
in Waveforms?
Last time I tried this in modelsim, I could see the
base variable but not the alias slice.

Declared objects are always visible in sim.

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top