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

generic packages #85

Closed
vermaete opened this issue Oct 29, 2015 · 7 comments
Closed

generic packages #85

vermaete opened this issue Oct 29, 2015 · 7 comments

Comments

@vermaete
Copy link
Contributor

Could it be the VHDL parser can not handle the new/2008 generic packages?

@kraigher
Copy link
Collaborator

The VUnit parser is lazy and only parses what it needs. Generic packages is not something we try to recognize specifically and they should be considered as regular packages. The generic part of them should be ignored. Are you seeing some crash or incorrect dependency or what lead up to this question?

@pStefanNilsson
Copy link

The VUnit parser seams to crash if you declare a package as a generic to an entity. The same is probably true for type and function generics too.

entity generic_comp is
  generic (package generic_comp_pkg is new work.generic_pkg generic map (<>));
end generic_comp;

@kraigher
Copy link
Collaborator

Thank you pStefanNilsson for you problem description. It would be helpful if you also could provide explicit examples for other cases that you know do not work as well.

@kraigher
Copy link
Collaborator

@pStefanNilsson, @vermaete and others... I have pushed a commit which causes package generics to be ignored rather than produce a crash. Could you verify that this solves your problems? If it does I will create a new VUnit release including the fix.

@pStefanNilsson
Copy link

Thanks kraigher. I tried your fix and it works for me.
Sorry for a late answer on your previous question but below is a few more examples of new odd generics that I think the Vunit parser can't handle.

-- Example from:
-- VHDL-2008: Just the New Stuff
-- Peter J. Ashenden,Jim Lewis

entity generic_counter is
  generic ( type count_type;
            constant reset_value : count_type;
            function increment ( x : count_type ) return count_type );
  port ( clk, reset : in bit;
         data : out count_type );
end entity generic_counter;

begin
  count : process (clk) is
    begin
      if rising_edge(clk) then
        if reset = '1' then
          data <= reset_value;
        else
          data <= increment(data);
        end if;
      end if;
    end process count;
end architecture rtl;

kraigher added a commit that referenced this issue Nov 24, 2015
kraigher added a commit that referenced this issue Nov 24, 2015
@kraigher
Copy link
Collaborator

@pStefanNilsson I have also added ignoring of type and function/procedure generics. Let me know if this is enough to close this issue.

@pStefanNilsson
Copy link

Works fine!

Thanks,

Stefan

Från: kraigher [mailto:[email protected]]
Skickat: Tuesday, November 24, 2015 1:13 PM
Till: LarsAsplund/vunit [email protected]
Kopia: pStefanNilsson [email protected]
Ämne: Re: [vunit] generic packages (#85)

@pStefanNilsson https://github.com/pStefanNilsson I have also added ignoring of type and function/procedure generics. Let me know if this is enough to close this issue.


Reply to this email directly or view it on GitHub https://github.com/LarsAsplund/vunit/issues/85#issuecomment-159249796 . https://github.com/notifications/beacon/APLxA41mJo3dZwmoxwtAyNvqPHxNZcOBks5pJEvbgaJpZM4GYE10.gif

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

No branches or pull requests

3 participants