- removed BURSTLEN from generics

- fixed burst counter
- fixed SDR PHY

git-svn-id: http://moon:8086/svn/vhdl/trunk@1224 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2015-05-25 08:03:05 +00:00
parent 5427d4cae0
commit 5fe93ed9ac
17 changed files with 58 additions and 59 deletions
+12 -15
View File
@@ -32,8 +32,7 @@ use work.sdram_types.all;
entity sdram_cmd is
Generic
(
F_SDRCLK : real := 100.0;
BURST_LEN : natural := 2
F_SDRCLK : real := 100.0
);
Port
(
@@ -58,7 +57,6 @@ architecture behaviour of sdram_cmd is
signal cc_load_en : std_logic;
signal cycle_finished : std_logic;
signal burst_preset : natural range 0 to 3;
signal burst_load_en : std_logic;
signal burst_finished : std_logic;
@@ -94,7 +92,6 @@ fsm_sdr_state:
cc_preset <= TIMING(cmd);
burst_load_en <= '0';
cmd_ack <= '0';
burst_preset <= BURST_LEN/2-1;
phy_ctrl.re <= '0';
phy_ctrl.drive_en <= '0';
phy_ctrl.we <= '0';
@@ -267,20 +264,20 @@ cycle_counter:
------------------------------------------------------------------------------------------
burst_counter:
process (rst, clk)
variable burst_cnt : natural range 0 to 3;
process (clk)
variable burst_cnt : natural range 0 to 2**(LMR_BL_CURR);
begin
if rst = '1' then
burst_cnt := 0;
elsif rising_edge(clk) then
burst_finished <= '0';
if rising_edge(clk) then
if burst_load_en = '1' then
burst_cnt := burst_preset;
elsif burst_cnt /= 0 then
burst_cnt := burst_cnt - 1;
end if;
if burst_cnt = 0 then
burst_finished <= '0';
burst_cnt := 2**(LMR_BL_CURR);
if 2**(LMR_BL_CURR) = DATA_RATE_FACTOR then
burst_finished <= '1';
end if;
elsif burst_cnt < DATA_RATE_FACTOR then
burst_finished <= '1';
else
burst_cnt := burst_cnt - DATA_RATE_FACTOR;
end if;
end if;
end process;