Line 1... |
Line 1... |
-- $Id: ibd_kw11l.vhd 641 2015-02-01 22:12:15Z mueller $
|
-- $Id: ibd_kw11l.vhd 676 2015-05-09 16:31:54Z mueller $
|
--
|
--
|
-- Copyright 2008-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2008-2015 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 25... |
Line 25... |
-- 2010-10-17 333 12.1 M53d xc3s1000-4 9 23 0 14 s 5.3
|
-- 2010-10-17 333 12.1 M53d xc3s1000-4 9 23 0 14 s 5.3
|
-- 2009-07-11 232 10.1.03 K39 xc3s1000-4 8 25 0 15 s 5.3
|
-- 2009-07-11 232 10.1.03 K39 xc3s1000-4 8 25 0 15 s 5.3
|
--
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2015-05-09 676 1.2 add CPUSUSP, freeze timer when cpu suspended
|
-- 2011-11-18 427 1.1.1 now numeric_std clean
|
-- 2011-11-18 427 1.1.1 now numeric_std clean
|
-- 2010-10-17 333 1.1 use ibus V2 interface
|
-- 2010-10-17 333 1.1 use ibus V2 interface
|
-- 2009-06-01 221 1.0.5 BUGFIX: add RESET; don't clear tcnt on ibus reset
|
-- 2009-06-01 221 1.0.5 BUGFIX: add RESET; don't clear tcnt on ibus reset
|
-- 2008-08-22 161 1.0.4 use iblib; add EI_ACK to proc_next sens. list
|
-- 2008-08-22 161 1.0.4 use iblib; add EI_ACK to proc_next sens. list
|
-- 2008-05-09 144 1.0.3 use intreq flop, use EI_ACK
|
-- 2008-05-09 144 1.0.3 use intreq flop, use EI_ACK
|
Line 50... |
Line 51... |
port (
|
port (
|
CLK : in slbit; -- clock
|
CLK : in slbit; -- clock
|
CE_MSEC : in slbit; -- msec pulse
|
CE_MSEC : in slbit; -- msec pulse
|
RESET : in slbit; -- system reset
|
RESET : in slbit; -- system reset
|
BRESET : in slbit; -- ibus reset
|
BRESET : in slbit; -- ibus reset
|
|
CPUSUSP : in slbit; -- cpu suspended
|
IB_MREQ : in ib_mreq_type; -- ibus request
|
IB_MREQ : in ib_mreq_type; -- ibus request
|
IB_SRES : out ib_sres_type; -- ibus response
|
IB_SRES : out ib_sres_type; -- ibus response
|
EI_REQ : out slbit; -- interrupt request
|
EI_REQ : out slbit; -- interrupt request
|
EI_ACK : in slbit -- interrupt acknowledge
|
EI_ACK : in slbit -- interrupt acknowledge
|
);
|
);
|
Line 102... |
Line 104... |
R_REGS <= N_REGS;
|
R_REGS <= N_REGS;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process proc_regs;
|
end process proc_regs;
|
|
|
proc_next : process (R_REGS, IB_MREQ, CE_MSEC, EI_ACK)
|
proc_next : process (R_REGS, IB_MREQ, CE_MSEC, CPUSUSP, EI_ACK)
|
variable r : regs_type := regs_init;
|
variable r : regs_type := regs_init;
|
variable n : regs_type := regs_init;
|
variable n : regs_type := regs_init;
|
variable idout : slv16 := (others=>'0');
|
variable idout : slv16 := (others=>'0');
|
variable ibreq : slbit := '0';
|
variable ibreq : slbit := '0';
|
variable ibw0 : slbit := '0';
|
variable ibw0 : slbit := '0';
|
Line 140... |
Line 142... |
n.intreq := '0';
|
n.intreq := '0';
|
end if;
|
end if;
|
end if;
|
end if;
|
|
|
-- other state changes
|
-- other state changes
|
if CE_MSEC = '1' then
|
if CE_MSEC='1' and CPUSUSP='0' then -- on msec and not suspended
|
n.tcnt := slv(unsigned(r.tcnt) + 1);
|
n.tcnt := slv(unsigned(r.tcnt) + 1);
|
if unsigned(r.tcnt) = tdivide-1 then
|
if unsigned(r.tcnt) = tdivide-1 then
|
n.tcnt := (others=>'0');
|
n.tcnt := (others=>'0');
|
n.moni := '1';
|
n.moni := '1';
|
if r.ie = '1' then
|
if r.ie = '1' then
|