diff --git a/rtl/mem/sdram.vhd b/rtl/mem/sdram.vhd index 04d8ac7..291cd5d 100644 --- a/rtl/mem/sdram.vhd +++ b/rtl/mem/sdram.vhd @@ -160,7 +160,7 @@ architecture arch of sdram is constant CLK_PERIOD : real := 1.0/CLK_FREQ*1000.0; -- the number of clock cycles to wait before initialising the device - constant DESELECT_WAIT : natural := natural(ceil(T_DESL/CLK_PERIOD)); + constant INIT_WAIT : natural := natural(ceil(T_DESL/CLK_PERIOD)); -- the number of clock cycles to wait while a LOAD MODE command is being -- executed @@ -234,13 +234,13 @@ begin when INIT => if wait_counter = 0 then next_cmd <= CMD_DESELECT; - elsif wait_counter = DESELECT_WAIT-1 then + elsif wait_counter = INIT_WAIT-1 then next_cmd <= CMD_PRECHARGE; - elsif wait_counter = PRECHARGE_WAIT-1 then + elsif wait_counter = INIT_WAIT+PRECHARGE_WAIT-1 then next_cmd <= CMD_AUTO_REFRESH; - elsif wait_counter = PRECHARGE_WAIT+REFRESH_WAIT-1 then + elsif wait_counter = INIT_WAIT+PRECHARGE_WAIT+REFRESH_WAIT-1 then next_cmd <= CMD_AUTO_REFRESH; - elsif wait_counter = PRECHARGE_WAIT+REFRESH_WAIT+REFRESH_WAIT-1 then + elsif wait_counter = INIT_WAIT+PRECHARGE_WAIT+REFRESH_WAIT+REFRESH_WAIT-1 then next_state <= MODE; next_cmd <= CMD_LOAD_MODE; end if;