EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

How to write an "alias" statement

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - FPGA - How to write an "alias" statement

Weng Tianxiang
Guest

Tue Dec 04, 2018 9:45 pm   



Hi,

I have a register array with each register having (pointer & data), now I hope to display each of two parts using 2 different names for easy reading in simulation.

Here is code defining the register array R:
type R_Type is array(0 to R_SIZE) of unsigned(POINTER_BITS + DATA_BITS-1 downto 0);
signal R : R_Type;
alias P1 : it shows R array part of (DATA_BITS-1 downto 0);
alias P2 : it shows R array part of (POINTER_BITS-1 downto DATA_BITS);

How to write the 2 alias statements in VHDL 2002 or 2008?

Thank you.

Weng

Weng Tianxiang
Guest

Wed Dec 05, 2018 4:45 am   



On Tuesday, December 4, 2018 at 12:37:54 PM UTC-8, Weng Tianxiang wrote:
Quote:
Hi,

I have a register array with each register having (pointer & data), now I hope to display each of two parts using 2 different names for easy reading in simulation.

Here is code defining the register array R:
type R_Type is array(0 to R_SIZE) of unsigned(POINTER_BITS + DATA_BITS-1 downto 0);
signal R : R_Type;
alias P1 : it shows R array part of (DATA_BITS-1 downto 0);
alias P2 : it shows R array part of (POINTER_BITS-1 downto DATA_BITS);

How to write the 2 alias statements in VHDL 2002 or 2008?

Thank you.

Weng


Here is my version for the answer:
type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

It should work on both 2002/2008 VHDL.

Thank you.

Weng


Guest

Wed Dec 05, 2018 2:45 pm   



On Tuesday, December 4, 2018 at 10:39:48 PM UTC-5, Weng Tianxiang wrote:
Quote:
On Tuesday, December 4, 2018 at 12:37:54 PM UTC-8, Weng Tianxiang wrote:
Hi,

I have a register array with each register having (pointer & data), now I hope to display each of two parts using 2 different names for easy reading in simulation.

Here is code defining the register array R:
type R_Type is array(0 to R_SIZE) of unsigned(POINTER_BITS + DATA_BITS-1 downto 0);
signal R : R_Type;
alias P1 : it shows R array part of (DATA_BITS-1 downto 0);
alias P2 : it shows R array part of (POINTER_BITS-1 downto DATA_BITS);

How to write the 2 alias statements in VHDL 2002 or 2008?

Thank you.

Weng

Here is my version for the answer:
type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

It should work on both 2002/2008 VHDL.


"Should" work??? Haven't you tested it?

Rick C.

Tesla referral code - https://ts.la/richard11209

Weng Tianxiang
Guest

Wed Dec 05, 2018 5:45 pm   



On Wednesday, December 5, 2018 at 5:37:26 AM UTC-8, gnuarm.del...@gmail.com wrote:
Quote:
On Tuesday, December 4, 2018 at 10:39:48 PM UTC-5, Weng Tianxiang wrote:
On Tuesday, December 4, 2018 at 12:37:54 PM UTC-8, Weng Tianxiang wrote:
Hi,

I have a register array with each register having (pointer & data), now I hope to display each of two parts using 2 different names for easy reading in simulation.

Here is code defining the register array R:
type R_Type is array(0 to R_SIZE) of unsigned(POINTER_BITS + DATA_BITS-1 downto 0);
signal R : R_Type;
alias P1 : it shows R array part of (DATA_BITS-1 downto 0);
alias P2 : it shows R array part of (POINTER_BITS-1 downto DATA_BITS);

How to write the 2 alias statements in VHDL 2002 or 2008?

Thank you.

Weng

Here is my version for the answer:
type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

It should work on both 2002/2008 VHDL.

"Should" work??? Haven't you tested it?

Rick C.

Tesla referral code - https://ts.la/richard11209


Hi Rick,

You have been the most famous contributor in FPGA and VHDL group for more than 10 years. If you answer, there is a problem.

Here is a correction version:

type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE)(DATA_BITS-1 downto 0);

Currently I have no Modelsim working and have no means to test. If you are kind enough, please test it. I think it SHOULD work.

Thank you.

Weng


Guest

Thu Dec 06, 2018 7:45 am   



On Wednesday, December 5, 2018 at 11:07:50 AM UTC-5, Weng Tianxiang wrote:
Quote:
On Wednesday, December 5, 2018 at 5:37:26 AM UTC-8, gnuarm.del...@gmail.com wrote:
On Tuesday, December 4, 2018 at 10:39:48 PM UTC-5, Weng Tianxiang wrote:
On Tuesday, December 4, 2018 at 12:37:54 PM UTC-8, Weng Tianxiang wrote:
Hi,

I have a register array with each register having (pointer & data), now I hope to display each of two parts using 2 different names for easy reading in simulation.

Here is code defining the register array R:
type R_Type is array(0 to R_SIZE) of unsigned(POINTER_BITS + DATA_BITS-1 downto 0);
signal R : R_Type;
alias P1 : it shows R array part of (DATA_BITS-1 downto 0);
alias P2 : it shows R array part of (POINTER_BITS-1 downto DATA_BITS);

How to write the 2 alias statements in VHDL 2002 or 2008?

Thank you.

Weng

Here is my version for the answer:
type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

It should work on both 2002/2008 VHDL.

"Should" work??? Haven't you tested it?

Rick C.

Tesla referral code - https://ts.la/richard11209

Hi Rick,

You have been the most famous contributor in FPGA and VHDL group for more than 10 years. If you answer, there is a problem.


First, don't assume that a "frequent" contributor means someone who knows anything. Then notice I only asked a question. I didn't say there was anything wrong.


Quote:
Here is a correction version:

type P1_Type array(0 to R_SIZE) of unsigned(DATA_BITS-1 downto 0);

alias P1 : P1_Type := R(0 to R_SIZE)(DATA_BITS-1 downto 0);

Currently I have no Modelsim working and have no means to test. If you are kind enough, please test it. I think it SHOULD work.


You can download a copy of nearly any FPGA vendor's tools and use whichever simulator they include. I would run it for you, but I am pretty busy at the moment. I'm with a friend who has gone through surgery and I have business tasks to deal with. Sorry I can't help more.

Rick C.

Tesla referral code + https://ts.la/richard11209

elektroda.net NewsGroups Forum Index - FPGA - How to write an "alias" statement

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map