Line 1... |
Line 1... |
-- $Id: rlink_core.vhd 350 2010-12-28 16:40:11Z mueller $
|
-- $Id: rlink_core.vhd 427 2011-11-19 21:04:11Z mueller $
|
--
|
--
|
-- Copyright 2007-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
--
|
--
|
-- This program is free software; you may redistribute and/or modify it under
|
-- This program is free software; you may redistribute and/or modify it under
|
-- the terms of the GNU General Public License as published by the Free
|
-- the terms of the GNU General Public License as published by the Free
|
-- Software Foundation, either version 2, or at your option any later version.
|
-- Software Foundation, either version 2, or at your option any later version.
|
--
|
--
|
Line 20... |
Line 20... |
-- Test bench: tb/tb_rlink_direct
|
-- Test bench: tb/tb_rlink_direct
|
-- tb/tb_rlink_serport
|
-- tb/tb_rlink_serport
|
-- tb/tb_rlink_tba_ttcombo
|
-- tb/tb_rlink_tba_ttcombo
|
--
|
--
|
-- Target Devices: generic
|
-- Target Devices: generic
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1; ghdl 0.18-0.29
|
-- Tool versions: xst 8.2, 9.1, 9.2, 11.4, 12.1, 13.1; ghdl 0.18-0.29
|
--
|
--
|
-- Synthesized (xst):
|
-- Synthesized (xst):
|
-- Date Rev ise Target flop lutl lutm slic t peri
|
-- Date Rev ise Target flop lutl lutm slic t peri
|
-- 2010-12-04 343 12.1 M53d xc3s1000-4 155 322 0 199 s 8.9
|
-- 2010-12-04 343 12.1 M53d xc3s1000-4 155 322 0 199 s 8.9
|
-- 2010-06-06 302 11.4 L68 xc3s1000-4 151 323 0 197 s 8.9
|
-- 2010-06-06 302 11.4 L68 xc3s1000-4 151 323 0 197 s 8.9
|
-- 2010-04-03 274 11.4 L68 xc3s1000-4 148 313 0 190 s 8.0
|
-- 2010-04-03 274 11.4 L68 xc3s1000-4 148 313 0 190 s 8.0
|
-- 2009-07-11 232 10.1.03 K39 xc3s1000-4 147 321 0 197 s 8.3
|
-- 2009-07-11 232 10.1.03 K39 xc3s1000-4 147 321 0 197 s 8.3
|
--
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2011-11-19 427 3.1.3 now numeric_std clean
|
-- 2010-12-25 348 3.1.2 drop RL_FLUSH support, add RL_MONI for rlink_core;
|
-- 2010-12-25 348 3.1.2 drop RL_FLUSH support, add RL_MONI for rlink_core;
|
-- 2010-12-24 347 3.1.1 rename: CP_*->RL->*
|
-- 2010-12-24 347 3.1.1 rename: CP_*->RL->*
|
-- 2010-12-22 346 3.1 wblk dcrc error: send nak, transit to s_error now;
|
-- 2010-12-22 346 3.1 wblk dcrc error: send nak, transit to s_error now;
|
-- rename stat flags: [cd]crc->[cd]err, ioto->rbnak,
|
-- rename stat flags: [cd]crc->[cd]err, ioto->rbnak,
|
-- ioerr->rberr; '111' cmd now aborts via s_txnak and
|
-- ioerr->rberr; '111' cmd now aborts via s_txnak and
|
Line 160... |
Line 161... |
-- 1 1 * * not allowed
|
-- 1 1 * * not allowed
|
--
|
--
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.numeric_std.all;
|
|
|
use work.slvtypes.all;
|
use work.slvtypes.all;
|
use work.comlib.all;
|
use work.comlib.all;
|
use work.rblib.all;
|
use work.rblib.all;
|
use work.rlinklib.all;
|
use work.rlinklib.all;
|
Line 324... |
Line 325... |
);
|
);
|
|
|
proc_regs: process (CLK)
|
proc_regs: process (CLK)
|
begin
|
begin
|
|
|
if CLK'event and CLK='1' then
|
if rising_edge(CLK) then
|
if RESET = '1' then
|
if RESET = '1' then
|
R_REGS <= regs_init;
|
R_REGS <= regs_init;
|
else
|
else
|
R_REGS <= N_REGS;
|
R_REGS <= N_REGS;
|
end if;
|
end if;
|
Line 771... |
Line 772... |
n.rbaval := '1'; -- extend cycle
|
n.rbaval := '1'; -- extend cycle
|
n.rbwe := '1';
|
n.rbwe := '1';
|
end if;
|
end if;
|
|
|
when s_blk => -- s_blk: block count handling -------
|
when s_blk => -- s_blk: block count handling -------
|
n.cnt := unsigned(r.cnt) - 1; -- decrement transfer count
|
n.cnt := slv(unsigned(r.cnt) - 1);-- decrement transfer count
|
if unsigned(r.cnt) = 0 then -- if last transfer
|
if unsigned(r.cnt) = 0 then -- if last transfer
|
if r.rcmd(c_rlink_cmd_rbf_code) = c_rlink_cmd_rblk then -- if rblk
|
if r.rcmd(c_rlink_cmd_rbf_code) = c_rlink_cmd_rblk then -- if rblk
|
n.state := s_txstat; -- next: send stat
|
n.state := s_txstat; -- next: send stat
|
else -- otherwise
|
else -- otherwise
|
n.state := s_rxdcrc; -- next: read data crc
|
n.state := s_rxdcrc; -- next: read data crc
|
Line 850... |
Line 851... |
end case;
|
end case;
|
|
|
if ato_go = '0' then -- handle access timeout counter
|
if ato_go = '0' then -- handle access timeout counter
|
n.atocnt := atocnt_init; -- if ato_go=0, keep in reset
|
n.atocnt := atocnt_init; -- if ato_go=0, keep in reset
|
else
|
else
|
n.atocnt := unsigned(r.atocnt) - 1;-- otherwise count down
|
n.atocnt := slv(unsigned(r.atocnt) - 1);-- otherwise count down
|
end if;
|
end if;
|
|
|
if ito_go = '0' then -- handle idle timeout counter
|
if ito_go = '0' then -- handle idle timeout counter
|
n.itocnt := r.itoval; -- if ito_go=0, keep at start value
|
n.itocnt := r.itoval; -- if ito_go=0, keep at start value
|
else
|
else
|
if CE_INT = '1' then
|
if CE_INT = '1' then
|
n.itocnt := unsigned(r.itocnt) - 1;-- otherwise count down every CE_INT
|
n.itocnt := slv(unsigned(r.itocnt) - 1);-- otherwise cnt dn every CE_INT
|
end if;
|
end if;
|
end if;
|
end if;
|
|
|
N_REGS <= n;
|
N_REGS <= n;
|
|
|