Line 7... |
Line 7... |
--
|
--
|
-- Description
|
-- Description
|
-- Contains a platform to build endpoints on.
|
-- Contains a platform to build endpoints on.
|
--
|
--
|
-- To Do:
|
-- To Do:
|
-- -
|
-- REMARK: Dont set complete before the packet is ready in inbound packet
|
|
-- handler.
|
|
-- REMARK: Add error indication if erronous sizes are received.
|
--
|
--
|
-- Author(s):
|
-- Author(s):
|
-- - Magnus Rosenius, magro732@opencores.org
|
-- - Magnus Rosenius, magro732@opencores.org
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
Line 68... |
Line 70... |
configAdr_o : out std_logic_vector(21 downto 0);
|
configAdr_o : out std_logic_vector(21 downto 0);
|
configDat_o : out std_logic_vector(31 downto 0);
|
configDat_o : out std_logic_vector(31 downto 0);
|
configDat_i : in std_logic_vector(31 downto 0);
|
configDat_i : in std_logic_vector(31 downto 0);
|
configAck_i : in std_logic;
|
configAck_i : in std_logic;
|
|
|
slaveCyc_i : in std_logic;
|
inboundCyc_i : in std_logic;
|
slaveStb_i : in std_logic;
|
inboundStb_i : in std_logic;
|
slaveAdr_i : in std_logic_vector(7 downto 0);
|
inboundAdr_i : in std_logic_vector(7 downto 0);
|
slaveDat_i : in std_logic_vector(31 downto 0);
|
inboundDat_i : in std_logic_vector(31 downto 0);
|
slaveAck_o : out std_logic;
|
inboundAck_o : out std_logic;
|
|
|
masterCyc_o : out std_logic;
|
outboundCyc_o : out std_logic;
|
masterStb_o : out std_logic;
|
outboundStb_o : out std_logic;
|
masterDat_o : out std_logic_vector(31 downto 0);
|
outboundDat_o : out std_logic_vector(31 downto 0);
|
masterAck_i : in std_logic);
|
outboundAck_i : in std_logic);
|
end entity;
|
end entity;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
Line 108... |
Line 110... |
requestPayloadLength_o : out std_logic_vector(3 downto 0);
|
requestPayloadLength_o : out std_logic_vector(3 downto 0);
|
requestPayloadIndex_i : in std_logic_vector(3 downto 0);
|
requestPayloadIndex_i : in std_logic_vector(3 downto 0);
|
requestPayload_o : out std_logic_vector(31 downto 0);
|
requestPayload_o : out std_logic_vector(31 downto 0);
|
requestDone_i : in std_logic;
|
requestDone_i : in std_logic;
|
|
|
slaveCyc_i : in std_logic;
|
inboundCyc_i : in std_logic;
|
slaveStb_i : in std_logic;
|
inboundStb_i : in std_logic;
|
slaveAdr_i : in std_logic_vector(7 downto 0);
|
inboundAdr_i : in std_logic_vector(7 downto 0);
|
slaveDat_i : in std_logic_vector(31 downto 0);
|
inboundDat_i : in std_logic_vector(31 downto 0);
|
slaveAck_o : out std_logic);
|
inboundAck_o : out std_logic);
|
end component;
|
end component;
|
|
|
component MaintenanceResponseOutbound is
|
component MaintenanceResponseOutbound is
|
port(
|
port(
|
clk : in std_logic;
|
clk : in std_logic;
|
Line 137... |
Line 139... |
responsePayloadWrite_i : in std_logic;
|
responsePayloadWrite_i : in std_logic;
|
responsePayloadIndex_i : in std_logic_vector(3 downto 0);
|
responsePayloadIndex_i : in std_logic_vector(3 downto 0);
|
responsePayload_i : in std_logic_vector(31 downto 0);
|
responsePayload_i : in std_logic_vector(31 downto 0);
|
responseDone_o : out std_logic;
|
responseDone_o : out std_logic;
|
|
|
masterCyc_o : out std_logic;
|
outboundCyc_o : out std_logic;
|
masterStb_o : out std_logic;
|
outboundStb_o : out std_logic;
|
masterDat_o : out std_logic_vector(31 downto 0);
|
outboundDat_o : out std_logic_vector(31 downto 0);
|
masterAck_i : in std_logic);
|
outboundAck_i : in std_logic);
|
end component;
|
end component;
|
|
|
type StateType is (IDLE,
|
type StateType is (IDLE,
|
CONFIG_READ, CONFIG_READ_RESPONSE,
|
CONFIG_READ, CONFIG_READ_RESPONSE,
|
CONFIG_WRITE, CONFIG_WRITE_RESPONSE);
|
CONFIG_WRITE, CONFIG_WRITE_RESPONSE);
|
Line 313... |
Line 315... |
requestWdptr_o=>wdptr,
|
requestWdptr_o=>wdptr,
|
requestPayloadLength_o=>requestPayloadLength,
|
requestPayloadLength_o=>requestPayloadLength,
|
requestPayloadIndex_i=>requestPayloadIndex,
|
requestPayloadIndex_i=>requestPayloadIndex,
|
requestPayload_o=>requestPayload,
|
requestPayload_o=>requestPayload,
|
requestDone_i=>requestDone,
|
requestDone_i=>requestDone,
|
slaveCyc_i=>slaveCyc_i,
|
inboundCyc_i=>inboundCyc_i,
|
slaveStb_i=>slaveStb_i,
|
inboundStb_i=>inboundStb_i,
|
slaveAdr_i=>slaveAdr_i,
|
inboundAdr_i=>inboundAdr_i,
|
slaveDat_i=>slaveDat_i,
|
inboundDat_i=>inboundDat_i,
|
slaveAck_o=>slaveAck_o);
|
inboundAck_o=>inboundAck_o);
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Response packet handler.
|
-- Response packet handler.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Note that the dstId and srcId is flipped since the response should be
|
-- Note that the dstId and srcId is flipped since the response should be
|
Line 342... |
Line 344... |
responsePayloadLength_i=>requestPayloadLength,
|
responsePayloadLength_i=>requestPayloadLength,
|
responsePayloadWrite_i=>responsePayloadWrite,
|
responsePayloadWrite_i=>responsePayloadWrite,
|
responsePayloadIndex_i=>responsePayloadIndex,
|
responsePayloadIndex_i=>responsePayloadIndex,
|
responsePayload_i=>configDat_i,
|
responsePayload_i=>configDat_i,
|
responseDone_o=>responseDone,
|
responseDone_o=>responseDone,
|
masterCyc_o=>masterCyc_o,
|
outboundCyc_o=>outboundCyc_o,
|
masterStb_o=>masterStb_o,
|
outboundStb_o=>outboundStb_o,
|
masterDat_o=>masterDat_o,
|
outboundDat_o=>outboundDat_o,
|
masterAck_i=>masterAck_i);
|
outboundAck_i=>outboundAck_i);
|
|
|
end architecture;
|
end architecture;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
Line 384... |
Line 386... |
requestPayloadLength_o : out std_logic_vector(3 downto 0);
|
requestPayloadLength_o : out std_logic_vector(3 downto 0);
|
requestPayloadIndex_i : in std_logic_vector(3 downto 0);
|
requestPayloadIndex_i : in std_logic_vector(3 downto 0);
|
requestPayload_o : out std_logic_vector(31 downto 0);
|
requestPayload_o : out std_logic_vector(31 downto 0);
|
requestDone_i : in std_logic;
|
requestDone_i : in std_logic;
|
|
|
slaveCyc_i : in std_logic;
|
inboundCyc_i : in std_logic;
|
slaveStb_i : in std_logic;
|
inboundStb_i : in std_logic;
|
slaveAdr_i : in std_logic_vector(7 downto 0);
|
inboundAdr_i : in std_logic_vector(7 downto 0);
|
slaveDat_i : in std_logic_vector(31 downto 0);
|
inboundDat_i : in std_logic_vector(31 downto 0);
|
slaveAck_o : out std_logic);
|
inboundAck_o : out std_logic);
|
end entity;
|
end entity;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
Line 419... |
Line 421... |
|
|
signal wdptr : std_logic;
|
signal wdptr : std_logic;
|
signal size : std_logic_vector(3 downto 0);
|
signal size : std_logic_vector(3 downto 0);
|
signal words : natural range 0 to 32;
|
signal words : natural range 0 to 32;
|
|
|
signal slaveAck : std_logic;
|
signal inboundAck : std_logic;
|
signal maintReadComplete : std_logic;
|
signal maintReadComplete : std_logic;
|
signal maintWriteComplete : std_logic;
|
signal maintWriteComplete : std_logic;
|
|
|
signal packetIndex : natural range 0 to 33;
|
signal packetIndex : natural range 0 to 33;
|
signal requestData : std_logic_vector(31 downto 0);
|
signal requestData : std_logic_vector(31 downto 0);
|
Line 432... |
Line 434... |
signal memoryAddress : std_logic_vector(3 downto 0);
|
signal memoryAddress : std_logic_vector(3 downto 0);
|
signal memoryDataIn : std_logic_vector(31 downto 0);
|
signal memoryDataIn : std_logic_vector(31 downto 0);
|
|
|
begin
|
begin
|
|
|
slaveAck_o <= slaveAck;
|
inboundAck_o <= inboundAck;
|
|
|
requestReadReady_o <= maintReadComplete when (state = READY) else '0';
|
requestReadReady_o <= maintReadComplete when (state = READY) else '0';
|
requestWriteReady_o <= maintWriteComplete when (state = READY) else '0';
|
requestWriteReady_o <= maintWriteComplete when (state = READY) else '0';
|
|
|
MaintenanceRequest: process(clk, areset_n)
|
MaintenanceRequest: process(clk, areset_n)
|
begin
|
begin
|
if (areset_n = '0') then
|
if (areset_n = '0') then
|
slaveAck <= '0';
|
inboundAck <= '0';
|
|
|
maintReadComplete <= '0';
|
maintReadComplete <= '0';
|
maintWriteComplete <= '0';
|
maintWriteComplete <= '0';
|
|
|
requestVc_o <= '0';
|
requestVc_o <= '0';
|
Line 465... |
Line 467... |
when RECEIVE_PACKET =>
|
when RECEIVE_PACKET =>
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
-- This state waits for a new maintenance request packet, receives it
|
-- This state waits for a new maintenance request packet, receives it
|
-- and parses it.
|
-- and parses it.
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
if (slaveCyc_i = '1') then
|
if (inboundCyc_i = '1') then
|
if (slaveAck = '0') then
|
if (inboundAck = '0') then
|
if (slaveStb_i = '1') then
|
if (inboundStb_i = '1') then
|
if (slaveAdr_i = x"80") then
|
if (inboundAdr_i = x"80") then
|
-------------------------------------------------------------
|
-------------------------------------------------------------
|
-- Maintenance Read Request packet parser.
|
-- Maintenance Read Request packet parser.
|
-------------------------------------------------------------
|
-------------------------------------------------------------
|
case (packetIndex) is
|
case (packetIndex) is
|
when 0 =>
|
when 0 =>
|
-- x"0000" & ackid & vc & crf & prio & tt & ftype
|
-- x"0000" & ackid & vc & crf & prio & tt & ftype
|
requestVc_o <= slaveDat_i(9);
|
requestVc_o <= inboundDat_i(9);
|
requestCrf_o <= slaveDat_i(8);
|
requestCrf_o <= inboundDat_i(8);
|
requestPrio_o <= slaveDat_i(7 downto 6);
|
requestPrio_o <= inboundDat_i(7 downto 6);
|
requestTt_o <= slaveDat_i(5 downto 4);
|
requestTt_o <= inboundDat_i(5 downto 4);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 1 =>
|
when 1 =>
|
-- destid
|
-- destid
|
requestDstId_o <= slaveDat_i;
|
requestDstId_o <= inboundDat_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 2 =>
|
when 2 =>
|
-- srcid
|
-- srcid
|
requestSrcId_o <= slaveDat_i;
|
requestSrcId_o <= inboundDat_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 3 =>
|
when 3 =>
|
-- transaction & rdsize & srcTID & hop & config_offset(20:13)
|
-- transaction & rdsize & srcTID & hop & config_offset(20:13)
|
size <= slaveDat_i(27 downto 24);
|
size <= inboundDat_i(27 downto 24);
|
requestTid_o <= slaveDat_i(23 downto 16);
|
requestTid_o <= inboundDat_i(23 downto 16);
|
requestOffset_o(20 downto 13) <= slaveDat_i(7 downto 0);
|
requestOffset_o(20 downto 13) <= inboundDat_i(7 downto 0);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 4 =>
|
when 4 =>
|
-- config_offset(12:0) & wdptr & rsrv & crc(15:0)
|
-- config_offset(12:0) & wdptr & rsrv & crc(15:0)
|
requestOffset_o(12 downto 0) <= slaveDat_i(31 downto 19);
|
requestOffset_o(12 downto 0) <= inboundDat_i(31 downto 19);
|
wdptr <= slaveDat_i(18);
|
wdptr <= inboundDat_i(18);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
maintReadComplete <= '1';
|
maintReadComplete <= '1';
|
when others =>
|
when others =>
|
-- There should be no more content in a maintenance read request.
|
-- There should be no more content in a maintenance read request.
|
-- Discard.
|
-- Discard.
|
end case;
|
end case;
|
elsif (slaveAdr_i = x"81") then
|
inboundAck <= '1';
|
|
elsif (inboundAdr_i = x"81") then
|
-------------------------------------------------------------
|
-------------------------------------------------------------
|
-- Maintenance Write Request packet parser.
|
-- Maintenance Write Request packet parser.
|
-------------------------------------------------------------
|
-------------------------------------------------------------
|
case (packetIndex) is
|
case (packetIndex) is
|
when 0 =>
|
when 0 =>
|
-- x"0000" & ackid & vc & crf & prio & tt & ftype
|
-- x"0000" & ackid & vc & crf & prio & tt & ftype
|
requestVc_o <= slaveDat_i(9);
|
requestVc_o <= inboundDat_i(9);
|
requestCrf_o <= slaveDat_i(8);
|
requestCrf_o <= inboundDat_i(8);
|
requestPrio_o <= slaveDat_i(7 downto 6);
|
requestPrio_o <= inboundDat_i(7 downto 6);
|
requestTt_o <= slaveDat_i(5 downto 4);
|
requestTt_o <= inboundDat_i(5 downto 4);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 1 =>
|
when 1 =>
|
-- destId
|
-- destId
|
requestDstId_o <= slaveDat_i;
|
requestDstId_o <= inboundDat_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 2 =>
|
when 2 =>
|
-- srcId
|
-- srcId
|
requestSrcId_o <= slaveDat_i;
|
requestSrcId_o <= inboundDat_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 3 =>
|
when 3 =>
|
-- transaction & wrsize & srcTID & hop & config_offset(20:13)
|
-- transaction & wrsize & srcTID & hop & config_offset(20:13)
|
size <= slaveDat_i(27 downto 24);
|
size <= inboundDat_i(27 downto 24);
|
requestTid_o <= slaveDat_i(23 downto 16);
|
requestTid_o <= inboundDat_i(23 downto 16);
|
requestOffset_o(20 downto 13) <= slaveDat_i(7 downto 0);
|
requestOffset_o(20 downto 13) <= inboundDat_i(7 downto 0);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 4 =>
|
when 4 =>
|
-- config_offset(12:0) & wdptr & rsrv & double-word(63:48)
|
-- config_offset(12:0) & wdptr & rsrv & double-word(63:48)
|
requestOffset_o(12 downto 0) <= slaveDat_i(31 downto 19);
|
requestOffset_o(12 downto 0) <= inboundDat_i(31 downto 19);
|
wdptr <= slaveDat_i(18);
|
wdptr <= inboundDat_i(18);
|
requestData(31 downto 16) <= slaveDat_i(15 downto 0);
|
requestData(31 downto 16) <= inboundDat_i(15 downto 0);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 =>
|
when 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 =>
|
-- double-word(47:16)
|
-- double-word(47:16)
|
requestData(31 downto 16) <= slaveDat_i(15 downto 0);
|
requestData(31 downto 16) <= inboundDat_i(15 downto 0);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
|
|
if (not ((size = "1000") and (wdptr = '1'))) then
|
if (not ((size = "1000") and (wdptr = '1'))) then
|
memoryWrite <= '1';
|
memoryWrite <= '1';
|
memoryDataIn <= requestData(31 downto 16) & slaveDat_i(31 downto 16);
|
memoryDataIn <= requestData(31 downto 16) & inboundDat_i(31 downto 16);
|
end if;
|
end if;
|
when 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 =>
|
when 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 =>
|
-- double-word(15:0) & double-word(63:48)
|
-- double-word(15:0) & double-word(63:48)
|
requestData(31 downto 16) <= slaveDat_i(15 downto 0);
|
requestData(31 downto 16) <= inboundDat_i(15 downto 0);
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
|
|
memoryWrite <= '1';
|
memoryWrite <= '1';
|
memoryDataIn <= requestData(31 downto 16) & slaveDat_i(31 downto 16);
|
memoryDataIn <= requestData(31 downto 16) & inboundDat_i(31 downto 16);
|
|
-- REMARK: Dont set complete before the packet is ready...
|
maintWriteComplete <= '1';
|
maintWriteComplete <= '1';
|
when others =>
|
when others =>
|
-- There should be no more content in a maintenance write request.
|
-- There should be no more content in a maintenance write request.
|
-- Discard.
|
-- Discard.
|
end case;
|
end case;
|
|
inboundAck <= '1';
|
end if;
|
end if;
|
slaveAck <= '1';
|
|
end if;
|
end if;
|
else
|
else
|
if (memoryWrite = '1') then
|
if (memoryWrite = '1') then
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
end if;
|
end if;
|
|
|
memoryWrite <= '0';
|
memoryWrite <= '0';
|
slaveAck <= '0';
|
inboundAck <= '0';
|
end if;
|
end if;
|
else
|
else
|
if (maintReadComplete = '1') or (maintWriteComplete = '1') then
|
if (maintReadComplete = '1') or (maintWriteComplete = '1') then
|
state <= READY;
|
state <= READY;
|
end if;
|
end if;
|
Line 678... |
Line 682... |
use work.rio_common.all;
|
use work.rio_common.all;
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- REMARK: Add handler for maintenance response with error also...
|
|
entity MaintenanceResponseOutbound is
|
entity MaintenanceResponseOutbound is
|
port(
|
port(
|
clk : in std_logic;
|
clk : in std_logic;
|
areset_n : in std_logic;
|
areset_n : in std_logic;
|
enable : in std_logic;
|
enable : in std_logic;
|
Line 701... |
Line 704... |
responsePayloadWrite_i : in std_logic;
|
responsePayloadWrite_i : in std_logic;
|
responsePayloadIndex_i : in std_logic_vector(3 downto 0);
|
responsePayloadIndex_i : in std_logic_vector(3 downto 0);
|
responsePayload_i : in std_logic_vector(31 downto 0);
|
responsePayload_i : in std_logic_vector(31 downto 0);
|
responseDone_o : out std_logic;
|
responseDone_o : out std_logic;
|
|
|
masterCyc_o : out std_logic;
|
outboundCyc_o : out std_logic;
|
masterStb_o : out std_logic;
|
outboundStb_o : out std_logic;
|
masterDat_o : out std_logic_vector(31 downto 0);
|
outboundDat_o : out std_logic_vector(31 downto 0);
|
masterAck_i : in std_logic);
|
outboundAck_i : in std_logic);
|
end entity;
|
end entity;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
Line 751... |
Line 754... |
responsePrio_i & responseTt_i & x"8";
|
responsePrio_i & responseTt_i & x"8";
|
|
|
MaintenanceResponse: process(clk, areset_n)
|
MaintenanceResponse: process(clk, areset_n)
|
begin
|
begin
|
if (areset_n = '0') then
|
if (areset_n = '0') then
|
masterCyc_o <= '0';
|
outboundCyc_o <= '0';
|
masterStb_o <= '0';
|
outboundStb_o <= '0';
|
|
|
memoryEnable <= '0';
|
memoryEnable <= '0';
|
memoryAddress <= (others=>'0');
|
memoryAddress <= (others=>'0');
|
|
|
responsePayloadIndex <= (others=>'0');
|
responsePayloadIndex <= (others=>'0');
|
Line 769... |
Line 772... |
when WAIT_PACKET =>
|
when WAIT_PACKET =>
|
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
--
|
--
|
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
if (responseReadReady_i = '1') then
|
if (responseReadReady_i = '1') then
|
masterCyc_o <= '1';
|
outboundCyc_o <= '1';
|
masterStb_o <= '1';
|
outboundStb_o <= '1';
|
masterDat_o <= responseHeader;
|
outboundDat_o <= responseHeader;
|
packetIndex <= 1;
|
packetIndex <= 1;
|
memoryEnable <= '1';
|
memoryEnable <= '1';
|
memoryAddress <= (others=>'0');
|
memoryAddress <= (others=>'0');
|
responsePayloadIndex <= (others=>'0');
|
responsePayloadIndex <= (others=>'0');
|
state <= READ_RESPONSE;
|
state <= READ_RESPONSE;
|
elsif (responseWriteReady_i = '1') then
|
elsif (responseWriteReady_i = '1') then
|
masterCyc_o <= '1';
|
outboundCyc_o <= '1';
|
masterStb_o <= '1';
|
outboundStb_o <= '1';
|
masterDat_o <= responseHeader;
|
outboundDat_o <= responseHeader;
|
packetIndex <= 1;
|
packetIndex <= 1;
|
state <= WRITE_RESPONSE;
|
state <= WRITE_RESPONSE;
|
end if;
|
end if;
|
|
|
when READ_RESPONSE =>
|
when READ_RESPONSE =>
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
if (masterAck_i = '1') then
|
if (outboundAck_i = '1') then
|
case (packetIndex) is
|
case (packetIndex) is
|
when 1 =>
|
when 1 =>
|
-- destination
|
-- destination
|
masterDat_o <= responseDstId_i;
|
outboundDat_o <= responseDstId_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 2 =>
|
when 2 =>
|
-- source
|
-- source
|
masterDat_o <= responseSrcId_i;
|
outboundDat_o <= responseSrcId_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 3 =>
|
when 3 =>
|
-- transaction & status & targetTID & hop & reserved(7:0)
|
-- transaction & status & targetTID & hop & reserved(7:0)
|
masterDat_o <= "0010" & "0000" & responseTid_i & x"ff" & x"00";
|
outboundDat_o <= "0010" & "0000" & responseTid_i & x"ff" & x"00";
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 4 =>
|
when 4 =>
|
-- reserved(15:0) & double-wordN(63:48)
|
-- reserved(15:0) & double-wordN(63:48)
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
masterDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
outboundDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
masterDat_o <= x"0000" & x"0000";
|
outboundDat_o <= x"0000" & x"0000";
|
else
|
else
|
masterDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
outboundDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
end if;
|
end if;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 =>
|
when 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 =>
|
-- double-wordN(47:16)
|
-- double-wordN(47:16)
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
masterDat_o <= responsePayload(31 downto 16) & x"0000";
|
outboundDat_o <= responsePayload(31 downto 16) & x"0000";
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
masterDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
outboundDat_o <= x"0000" & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
else
|
else
|
masterDat_o <=
|
outboundDat_o <=
|
responsePayload(31 downto 16) & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
end if;
|
end if;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 =>
|
when 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 =>
|
-- double-wordN(15:0) & double-wordN(63:48)
|
-- double-wordN(15:0) & double-wordN(63:48)
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
if (responsePayloadLength_i = "0000") and (responseWdptr_i = '0') then
|
masterDat_o <= x"0000" & x"0000";
|
outboundDat_o <= x"0000" & x"0000";
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
elsif (responsePayloadLength_i = "0000") and (responseWdptr_i = '1') then
|
masterDat_o <= responsePayload(31 downto 16) & x"0000";
|
outboundDat_o <= responsePayload(31 downto 16) & x"0000";
|
else
|
else
|
if (responsePayloadIndex /= responsePayloadLength_i(3 downto 1)) then
|
if (responsePayloadIndex /= responsePayloadLength_i(3 downto 1)) then
|
masterDat_o <=
|
outboundDat_o <=
|
responsePayload(31 downto 16) & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) & memoryDataRead(31 downto 16);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
else
|
else
|
masterDat_o <=
|
outboundDat_o <=
|
responsePayload(31 downto 16) & x"0000";
|
responsePayload(31 downto 16) & x"0000";
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
responsePayload(31 downto 16) <= memoryDataRead(15 downto 0);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
memoryAddress <= std_logic_vector(unsigned(memoryAddress) + 1);
|
end if;
|
end if;
|
end if;
|
end if;
|
Line 870... |
Line 873... |
|
|
when WRITE_RESPONSE =>
|
when WRITE_RESPONSE =>
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
if (masterAck_i = '1') then
|
if (outboundAck_i = '1') then
|
case (packetIndex) is
|
case (packetIndex) is
|
when 1 =>
|
when 1 =>
|
-- destination
|
-- destination
|
masterDat_o <= responseDstId_i;
|
outboundDat_o <= responseDstId_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 2 =>
|
when 2 =>
|
-- source
|
-- source
|
masterDat_o <= responseSrcId_i;
|
outboundDat_o <= responseSrcId_i;
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when 3 =>
|
when 3 =>
|
-- transaction & status & targetTID & hop & reserved(7:0)
|
-- transaction & status & targetTID & hop & reserved(7:0)
|
masterDat_o <= "0011" & "0000" & responseTid_i & x"ff" & x"00";
|
outboundDat_o <= "0011" & "0000" & responseTid_i & x"ff" & x"00";
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
when others =>
|
when others =>
|
-- reserved(15:0) & crc(15:0)
|
-- reserved(15:0) & crc(15:0)
|
masterDat_o <= x"00000000";
|
outboundDat_o <= x"00000000";
|
packetIndex <= packetIndex + 1;
|
packetIndex <= packetIndex + 1;
|
state <= WAIT_COMPLETE;
|
state <= WAIT_COMPLETE;
|
end case;
|
end case;
|
end if;
|
end if;
|
|
|
when WAIT_COMPLETE =>
|
when WAIT_COMPLETE =>
|
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
--
|
--
|
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
if (masterAck_i = '1') then
|
if (outboundAck_i = '1') then
|
masterCyc_o <= '0';
|
outboundCyc_o <= '0';
|
masterStb_o <= '0';
|
outboundStb_o <= '0';
|
state <= RESPONSE_DONE;
|
state <= RESPONSE_DONE;
|
end if;
|
end if;
|
|
|
when RESPONSE_DONE =>
|
when RESPONSE_DONE =>
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|