One Signal Two Names

W

Weddick

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
 
M

Mike Treseler

Weddick said:
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
 
W

Weddick

Thanks Mike,

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

Joel
 
S

Srinivasan Venkataramanan

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
 
M

Mike Treseler

Srinivasan said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top