VHDL-Mode icon indicating copy to clipboard operation
VHDL-Mode copied to clipboard

Aggregate assignment syntax unsupported

Open lenigoor opened this issue 6 years ago • 7 comments

The following construction is allowed with the "new" VHDL-2008 syntax, but the highlighting on the last bracket does not agree.

architecture rtl of test is
	signal alpha : std_logic_vector(1 downto 0);
	signal beta  : std_logic_vector(1 downto 0);
	signal gamma : std_logic_vector(3 downto 0);
begin
	(alpha, beta) <= gamma;
end architecture;

afbeelding

lenigoor avatar Nov 28 '19 20:11 lenigoor

That’s a 2008 construct? I am not surprised that I don’t support that. I’ll have to research that and see if there’s anything I can do. The assignment construction is one of the most problematic because it is so generic.

It’s Thanksgiving in the US so will probably be a few days before I can dig into this. Thanks for the report. I really appreciate it.

Remillard avatar Nov 28 '19 21:11 Remillard

Alright. I can't say I see this structure a lot but maybe I should. It seems useful. In any event I found notes in Ashenden (page 102 in 3rd edition) on aggregate assignments in VHDL 87/93/2002 (where it was much less useful) and then in 2008, it does seem to allow a lot of possibilities. I'll have to see if that's something I can work into the signal assignment context rules. It'll probably take a special match.

Remillard avatar Dec 02 '19 15:12 Remillard

Basic support added. May be able to build on that in the future.

Remillard avatar Dec 03 '19 15:12 Remillard

Awesome, thank you for adding some basic support 😄

lenigoor avatar Dec 15 '19 10:12 lenigoor

No trouble at all. If I can figure out how to scope it better, I'll do so though I'm worried it would require a complete restructuring of the syntax definition. And I have a sneaking suspicion it might break if you try to aggregate assign to slices, but it's a little step forward. Honestly I probably ought to start using this construct in my own code; it seems pretty handy.

Remillard avatar Dec 15 '19 14:12 Remillard

Can you please also add the variable assignment operator (:=) to this fix? It's VHDL 2008 too.

erpalma avatar Jan 16 '20 10:01 erpalma

Sure I'll see what I can do.

Remillard avatar Jan 16 '20 13:01 Remillard