Line 4... |
Line 4... |
--See wrimm subversion project for version history
|
--See wrimm subversion project for version history
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
library wrimm;
|
|
use wrimm.WrimmPackage.all;
|
use work.WrimmPackage.all;
|
|
|
entity Wrimm is
|
entity Wrimm is
|
--generic (
|
|
-- MasterParams : WbMasterDefType;
|
|
-- SlaveParams : WbSlaveDefType;
|
|
-- StatusParams : StatusFieldDefType;
|
|
-- SettingParams : SettingFieldDefType;
|
|
-- TriggerParams : TriggerFieldDefType);
|
|
port (
|
port (
|
WbClk : in std_logic;
|
WbClk : in std_logic;
|
WbRst : out std_logic;
|
WbRst : out std_logic;
|
|
|
WbMasterIn : in WbMasterOutArray; --Signals from Masters
|
WbMasterIn : in WbMasterOutArray; --Signals from Masters
|
Line 64... |
Line 58... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
procArb: process(WbClk,rstZ) is --Round robin arbitration (descending)
|
procArb: process(WbClk,rstZ) is --Round robin arbitration (descending)
|
variable vGrant : WbMasterGrantType;
|
variable vGrant : WbMasterGrantType;
|
begin
|
begin
|
if (rstZ='0') then
|
if (rstZ='0') then
|
vGrant(vGrant'range) := (Others=>'0');
|
vGrant := (Others=>'0');
|
vGrant(vGrant'left) := '1';
|
vGrant(vGrant'left) := '1';
|
elsif rising_edge(WbClk) then
|
elsif rising_edge(WbClk) then
|
loopGrant: for i in WbMasterType loop
|
loopGrant: for i in WbMasterType loop
|
if vGrant(i)='1' and WbMasterIn(i).Cyc='0' then --else maintain grant
|
if vGrant(i)='1' and WbMasterIn(i).Cyc='0' then --else maintain grant
|
loopNewGrantA: for j in i to WbMasterType'right loop --last master with cyc=1 will be selected
|
loopNewGrantA: for j in i to WbMasterType'right loop --last master with cyc=1 will be selected
|
Line 85... |
Line 79... |
end if;
|
end if;
|
end loop loopNewGrantB; --grant only moves after new requester
|
end loop loopNewGrantB; --grant only moves after new requester
|
end if;
|
end if;
|
end if;
|
end if;
|
end loop loopGrant;
|
end loop loopGrant;
|
grant <= vGrant;
|
|
end if; --Clk
|
end if; --Clk
|
|
grant <= vGrant;
|
end process procArb;
|
end process procArb;
|
--=============================================================================
|
--=============================================================================
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Master Multiplexers
|
-- Master Multiplexers
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|