You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a package is given to an entity through generic map with generic types, nvc crashes
--------------------------------------------------packagetest_generic_pkgisgeneric(typeg_countertype ;
g_initval : g_countertype ;
function"+" (l : g_countertype ; r : integer) return g_countertype );
subtypecountertypeis g_countertype;
constant init_counter : g_countertype := g_initval;
endpackagetest_generic_pkg;
--------------------------------------------------LIBRARY ieee ;
USE ieee.NUMERIC_STD.all ;
USE ieee.std_logic_1164.all ;
entitygentestisgeneric(package test_pkg isnew work.test_generic_pkg genericmap(<>));
port (
clk : instd_logic
);
endentitygentest;
architecturetestofgentestisuse test_pkg.all;
signal counter : countertype := init_counter;
beginprocess(clk)
beginifrising_edge(clk) then
counter <= counter +1;
endif;
endprocess;
endtest;
--------------------------------------------------LIBRARY ieee ;
USE ieee.NUMERIC_STD.all ;
USE ieee.std_logic_1164.all ;
entitygen_package_tbisend;
architecturevunit_simulationofgen_package_tbissubtype sig issigned(15downto0);
package test_pkg isnew work.test_generic_pkg genericmap(g_countertype => sig, g_initval =>to_signed(-6, 16), "+"=>"+");
use test_pkg.all;
constant clock_period : time:=1ns;
constant simtime_in_clocks : integer:=50;
signal simulator_clock : std_logic:='0';
signal simulation_counter : natural:=0;
------------------------------------- simulation specific signals ----signal counter : countertype := init_counter;
begin------------------------------------------------------------------------simtime : processbeginwaitfor simtime_in_clocks*clock_period;
assertfalsereport"Simulation Finished"severityfailure;
endprocesssimtime;
simulator_clock <=not simulator_clock after clock_period/2.0;
------------------------------------------------------------------------stimulus : process(simulator_clock)
beginifrising_edge(simulator_clock) then
simulation_counter <= simulation_counter +1;
counter <= counter +1;
assert counter = init_counter + simulation_counter report"generic package did not work correctly"severityfailure;
endif; -- rising_edgeendprocessstimulus;
------------------------------------------------------------------------u_gentest : entitywork.gentestgenericmap(test_pkg)
portmap(simulator_clock);
endvunit_simulation;
example run
$ /c/Program\ files/NVC/bin/nvc.exe -a testbenches/gen_package_tb.vhd -e gen_package_tb -r
** Fatal: tree kind T_GENERIC_DECL does not have item I_IDENT2
When a package is given to an entity through generic map with generic types, nvc crashes
example run
$ /c/Program\ files/NVC/bin/nvc.exe -a testbenches/gen_package_tb.vhd -e gen_package_tb -r
** Fatal: tree kind T_GENERIC_DECL does not have item I_IDENT2
Please report this bug at https://github.com/nickg/nvc/issues
The text was updated successfully, but these errors were encountered: