Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support folding for VHDL 08 else-generate and case-generate #80

Closed
wants to merge 1 commit into from
Closed

Conversation

danselmi
Copy link
Contributor

@danselmi danselmi commented Apr 27, 2022

Folding of if cond generate ... elsif cond generate ... else generate ... end generate; and case sel generate ... end generate; was not working.
These two are new with vhdl 08.

@nyamatongwe nyamatongwe self-assigned this Apr 27, 2022
@nyamatongwe nyamatongwe added the vhdl Caused by the vhdllexer label Apr 27, 2022
@danselmi danselmi changed the title Support VHDL 08 else-generate and case-generate Support folding for VHDL 08 else-generate and case-generate Apr 27, 2022
@nyamatongwe
Copy link
Member

This needs a working test case in test/examples/vhdl that exercises the change. Read about creating and running tests in test/README.

Unfortunately, the VHDL lexer currently assigns different styles to Windows-style (\r\n) line end bytes after comments which upsets the test runner. Either avoid comments in the test case or change the comment ending behaviour to be like LexPython (sc.ch == '\r' || sc.ch == '\n') or LexCPP (sc.atLineStart).

@nyamatongwe
Copy link
Member

Searched for an example that includes generate (http://esd.cs.ucr.edu/labs/tutorial/FIR.vhd) and the patch stops folding on generate. The code is (truncated):

    gen8:	for j in K-1 downto 0 generate
	
        stages:	process (rst, clk)
        begin
		-- ...
        end process;
		
    end generate;

@danselmi
Copy link
Contributor Author

danselmi commented May 1, 2022

fixed it.
also added a test case.
thanks

@nyamatongwe
Copy link
Member

Committed most recent changes with some more additions as ff879c5. The main addition was to rerun TestLexers which updated the .styled and .folded files as there were a couple of missing sections -- in 0e497af, the .vhd is 57 lines long but the generated files are 47/46 lines long. Also added a change log entry. Please check the current repository state.

@nyamatongwe
Copy link
Member

Included in 5.1.7 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vhdl Caused by the vhdllexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants