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
I'm using the following code to communicate over a bus within a test hierarchy, but it does not seem to simulate correctly in NVC, while it does in ghdl and modelsim.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entitytestisendentitytest;
architecturebehoftestistypet_event_ctrl_unresolvedisrecord
val : std_logic;
ack : std_logic;
endrecord;
typet_event_ctrl_driversisarray (naturalrange<> ) of t_event_ctrl_unresolved;
functionresolved_event_ctrl(input_vector : t_event_ctrl_drivers) return t_event_ctrl_unresolved;
subtype t_event_ctrl is resolved_event_ctrl t_event_ctrl_unresolved;
typet_events_unresolvedisrecord
flag1 : t_event_ctrl;
flag2 : t_event_ctrl;
endrecord;
typet_events_driversisarray (naturalrange<> ) of t_events_unresolved;
function resolved_events(input_vector : t_events_drivers) return t_events_unresolved;
subtype t_events is resolved_events t_events_unresolved;
function resolved_event_ctrl(
input_vector : t_event_ctrl_drivers
) return t_event_ctrl_unresolved
isvariable ret : t_event_ctrl_unresolved := (others=>'0');
beginif input_vector'length=0THENreturn ret;
elsefor i in input_vector'rangeloopif input_vector(i).val ='1'then
ret.val :='1';
endif;
if input_vector(i).ack ='1'then
ret.ack :='1';
endif;
endloop;
return ret;
endif;
endfunctionresolved_event_ctrl;
functionresolved_events(
input_vector : t_events_drivers
) return t_events_unresolved
isvariable ret : t_events_unresolved := (others=> (others=>'0'));
beginif input_vector'length=0THENreturn ret;
elsefor i in input_vector'rangeloop
ret.flag1 := resolved_event_ctrl(t_event_ctrl_drivers'(ret.flag1, input_vector(i).flag2));
ret.flag2 := resolved_event_ctrl(t_event_ctrl_drivers'(ret.flag2, input_vector(i).flag2));
endloop;
return ret;
endif;
endfunctionresolved_events;
signal events : t_events;
beginp_events : processbegin
events <= (others=> (others=>'0'));
loopwaiton events.flag2.val;
report"Got val"severitynote;
ifrising_edge(events.flag2.val) thenreport"Sending ack"severitynote;
events.flag2.ack <='1'after1us, '0'after1.1us;
endif;
iffalling_edge(events.flag2.val) thenreport"Resetting ack"severitynote;
events.flag2.ack <='1', '0'after1ns;
endif;
endloop;
endprocessp_events;
processprocedure com2(signal flag : inout t_event_ctrl) isbegin
events.flag2.val <='1';
report"Send val 1"severitynote;
waituntil events.flag2.ack ='1';
report"Got ack"severitynote;
report"Send val 0"severitynote;
events.flag2.val <='1';
waituntil events.flag2.ack ='0';
report"Got ack 0"severitynote;
endprocedure;
procedure com(signal flag_event : inout t_events) isbegin
com2(flag_event.flag2);
endprocedure;
beginwaitfor1us;
report"Running"severitynote;
com(events);
wait;
endprocess;
endarchitecturebeh;
I'm using the following code to communicate over a bus within a test hierarchy, but it does not seem to simulate correctly in NVC, while it does in ghdl and modelsim.
Expected output
The text was updated successfully, but these errors were encountered: