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

Component not expected before begin in architecture #27

Open
philipabbey opened this issue Jul 23, 2021 · 0 comments
Open

Component not expected before begin in architecture #27

philipabbey opened this issue Jul 23, 2021 · 0 comments
Labels

Comments

@philipabbey
Copy link

Parse failure with: VHDLParser block-stream recursive.vhdl

ERROR: Expected one of these keywords: BEGIN, END, USE, CONSTANT, FUNCTION, PROCEDURE, IMPURE, PURE, SIGNAL, SHARED. Found: 'component'.

Example file recursive.vhdl:

--
-- Recursive component instantiation
--
-- instantiation_recursive.vhd
--
-- From p153 https://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_3/ug901-vivado-synthesis.pdf
-- Solely tail recursive example.
--

library ieee;
use ieee.std_logic_1164.all;
library unisim;
use unisim.vcomponents.all;

entity instantiation_recursive is
  generic(
    sh_st : integer := 4
  );
  port(
    CLK : in  std_logic;
    DI  : in  std_logic;
    DO  : out std_logic
  );
end entity instantiation_recursive;

architecture recursive of instantiation_recursive is
  component instantiation_recursive
    generic(
      sh_st : integer
    );
    port(
      CLK : in std_logic;
      DI : in std_logic;
      DO : out std_logic
    );
  end component;

  signal tmp : std_logic;

begin

  GEN_FD_LAST : if sh_st = 1 generate
    inst_fd : FD
      port map(D => DI, C => CLK, Q => DO);
  end generate;

  GEN_FD_INTERM : if sh_st /= 1 generate
    inst_fd : FD
      port map(D => DI, C => CLK, Q => tmp);

    inst_sstage : instantiation_recursive
      generic map(sh_st => sh_st - 1)
      port map(DI => tmp, CLK => CLK, DO => DO);
  end generate;

end recursive;
@Paebbels Paebbels added the Bug label Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants