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

Wrong value in generic constant when using slice name #931

Closed
jorkrohn opened this issue Jul 25, 2024 · 0 comments
Closed

Wrong value in generic constant when using slice name #931

jorkrohn opened this issue Jul 25, 2024 · 0 comments

Comments

@jorkrohn
Copy link

When compiling the following files I get an unexpected value in the generic constant GC_SLV

nvc_bug_pkg.vhd :

library ieee;
use ieee.std_logic_1164.all;

package nvc_bug_pkg is

    constant C_SLV_SIZE : integer := 16;

end package nvc_bug_pkg;

nvc_bug.vhd :

library ieee;
use ieee.std_logic_1164.all;

library work;
use work.nvc_bug_pkg.all;

entity nvc_bug is
    generic (
        GC_SLV : std_logic_vector(C_SLV_SIZE-1 downto 0) := x"8008"
    );
end entity nvc_bug;

architecture test of nvc_bug is
begin

    p_nvc_bug : process
    begin
        assert GC_SLV(C_SLV_SIZE-1 downto 0) = x"8008" report "Mismatch. Expected 8008, got " & to_hstring(GC_SLV(C_SLV_SIZE-1 downto 0)) severity failure;
        report "Test succeeded";
        wait;
    end process p_nvc_bug;

end architecture test;

I invoke nvc with this command:

nvc -a nvc_bug_pkg.vhd nvc_bug.vhd -e nvc_bug -r nvc_bug

I'm running withe the current latest version on master (2e5ad89)

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

1 participant