V
Vandana
Guest
Hi All,
I have included a snippet of my code below in which I have some
trouble.
When I simulate I find that the time does not advance.
If I remove the for i in 0 to 5 loop, then the time advances, but I
find that the UNIFORM call does not change the value of z. What am I
doing wrong here?
Thanks for your time.
Thanks,
Vandana
-----------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
----------------------------
...
...
----------
begin -- behav
latch : process is
variable seed1, seed2 : integer := 1;
variable z : real := 0.0;
variable k : integer;
variable ra_s,ca_s,ba_s,cra_s : integer := 0;
begin
loop
for i in 0 to 5 loop
-- wait until clk = '1';
UNIFORM(seed1 ,seed2,z);
--wait until clk = '1';
if (z < 1.0/3.0) then
write_en <= '1' ; read_en <= '0' ; refresh_en <= '1' ;
wait until clk = '1';
elsif (z > 1.0/3.0 and z < 2.0/3.0) then
write_en <= '0'; read_en <= '1'; refresh_en <=
'1';
wait until clk = '1';
else
for b in 0 to 2 loop
write_en <= '1'; read_en <= '1';
refresh_en <= '0';
for i in 0 to 7 loop -- 8 banks
cra <=
std_ulogic_vector(to_unsigned(i, cra'length));
wait until clk ='1';
end loop ;
end loop;
end if;
end loop;
end loop;
end process latch;
end behav;
I have included a snippet of my code below in which I have some
trouble.
When I simulate I find that the time does not advance.
If I remove the for i in 0 to 5 loop, then the time advances, but I
find that the UNIFORM call does not change the value of z. What am I
doing wrong here?
Thanks for your time.
Thanks,
Vandana
-----------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
----------------------------
...
...
----------
begin -- behav
latch : process is
variable seed1, seed2 : integer := 1;
variable z : real := 0.0;
variable k : integer;
variable ra_s,ca_s,ba_s,cra_s : integer := 0;
begin
loop
for i in 0 to 5 loop
-- wait until clk = '1';
UNIFORM(seed1 ,seed2,z);
--wait until clk = '1';
if (z < 1.0/3.0) then
write_en <= '1' ; read_en <= '0' ; refresh_en <= '1' ;
wait until clk = '1';
elsif (z > 1.0/3.0 and z < 2.0/3.0) then
write_en <= '0'; read_en <= '1'; refresh_en <=
'1';
wait until clk = '1';
else
for b in 0 to 2 loop
write_en <= '1'; read_en <= '1';
refresh_en <= '0';
for i in 0 to 7 loop -- 8 banks
cra <=
std_ulogic_vector(to_unsigned(i, cra'length));
wait until clk ='1';
end loop ;
end loop;
end if;
end loop;
end loop;
end process latch;
end behav;