Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] VHDL Aliases advanced usecase of name signment

Status
Not open for further replies.

wtr

Full Member level 5
Joined
May 1, 2014
Messages
299
Helped
29
Reputation
58
Reaction score
25
Trophy points
1,308
Activity points
4,108
Hello all,

We've got a board where the test_leds have been routed terribly.

TEST_LEDS(9 downto 0) are wired in a scattered format

Looks something like this

(3)--------(8)
(8)--------(5)
(4)--------(2)
(9)--------(1)
(0)--------(7)

I want to be able to generate an alias name that can be assigned using slicing.

The following is the alias syntax rule
Code:
alias_declaration ::=
alias alias_designator [ : subtype_indication ] is name [ signature ] ;
alias_designator ::= identifier | character_literal | operator_symbol


Code VHDL - [expand]
1
alias led : std_logic_vector(TEST_LEDS'range) is xxx



Where I want xxx to be test_led(0) & test_led(9) etc

I know the following works but it doesn't give me the std_logic_vector I want for slicing.

Code VHDL - [expand]
1
2
alias led9 : std_logic is test_led(0);
alias led8 : std_logic is test_led(9);



Regards
 

For this, you'd probably be better off just creating a slv signal and assigning the leds in a more suitable order. You can only alias to existing objects.
 

I would either have a permutation function, do the permutation elsewhere at the top level, or do the permutation in the xdc file.
 

So,

The following is allowed because TEST_LEDS object exists, even if we've switched range ascending/deceasing and sliced it.


Code VHDL - [expand]
1
2
alias leds : std_logic_vector(3 downto 0) is TEST_LEDS(3 downto 0);
alias leds2 : std_logic_vector(3 downto 0) is TEST_LEDS(4 to 7);



However one cannot create a """new""" object by concatenating a selection of objects?

alias leds : std_logic_vector(7 downto 0) is TEST_LEDS(4 to 7) & TEST_LEDS(3 downto 0);

An object is (a constant, variable signal or a file) <- basically stuff before the begin keyboard in architecture body.

This is a shame.

Was aware of the slv method, but was trying to do something clever/pushing the language.
 

why not just create another signal? It really isnt any different to what you're doing.
 

TrickyDicky,

It's not about getting to the destination. IT's about the journey.
 

Sometimes, during the journey, an npc suggests adding a layer of indirection. Upon completing this quest you gain +1 wisdom.
 
  • Like
Reactions: wtr

    wtr

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top