3-RTL Modifications SV
3-RTL Modifications SV
3-RTL Modifications SV
module RTL_Modifications_SV ;
int a[4];
initial
begin
$display("--------------FOR LOOP---------------------------------------------------");
for(int i=0;i<5;i++) $display("\t Value of i = %0d",i);
$display("-----------------------------------------------------------------");
$display("--------------FOREACH LOOP---------------------------------------------------");
foreach(a[i]) a[i] = i;
foreach(a[i]) $display("\tValue of a[%0d]=%0d",i,a[i]);
$display("-----------------------------------------------------------------");
end
// always_ff and always_latch are used for infering latches and flipflops.
/*
always_ff @(posedge clock or posedge reset)
if (reset)
q <= 0;
else if (enable)
q++;
*/