Line 141... |
Line 141... |
writeFrameAbort_o : out std_logic;
|
writeFrameAbort_o : out std_logic;
|
writeContent_o : out std_logic;
|
writeContent_o : out std_logic;
|
writeContentData_o : out std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
writeContentData_o : out std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
|
|
portInitialized_i : in std_logic;
|
portInitialized_i : in std_logic;
|
outboundSymbolEmpty_o : out std_logic;
|
outboundSymbolFull_i : in std_logic;
|
outboundSymbolRead_i : in std_logic;
|
outboundSymbolWrite_o : out std_logic;
|
outboundSymbol_o : out std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
outboundSymbol_o : out std_logic_vector(((2+32)*NUMBER_WORDS-1) downto 0);
|
inboundSymbolFull_o : out std_logic;
|
inboundSymbolEmpty_i : in std_logic;
|
inboundSymbolWrite_i : in std_logic;
|
inboundSymbolRead_o : out std_logic;
|
inboundSymbol_i : in std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0));
|
inboundSymbol_i : in std_logic_vector(((2+32)*NUMBER_WORDS-1) downto 0));
|
end component;
|
end component;
|
|
|
constant NUMBER_WORDS : natural range 1 to 8 := 1;
|
constant NUMBER_WORDS : natural range 1 to 8 := 1;
|
|
|
signal clk : std_logic;
|
signal clk : std_logic;
|
Line 169... |
Line 169... |
signal inboundAckIdRead : std_logic_vector(4 downto 0);
|
signal inboundAckIdRead : std_logic_vector(4 downto 0);
|
signal outstandingAckIdRead : std_logic_vector(4 downto 0);
|
signal outstandingAckIdRead : std_logic_vector(4 downto 0);
|
signal outboundAckIdRead : std_logic_vector(4 downto 0);
|
signal outboundAckIdRead : std_logic_vector(4 downto 0);
|
|
|
signal portInitialized : std_logic;
|
signal portInitialized : std_logic;
|
signal outboundSymbolEmpty : std_logic;
|
signal outboundSymbolFull : std_logic;
|
signal outboundSymbolRead : std_logic;
|
signal outboundSymbolWrite : std_logic;
|
signal outboundSymbol : std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
signal outboundSymbol : std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
signal inboundSymbolFull : std_logic;
|
signal inboundSymbolEmpty : std_logic;
|
signal inboundSymbolWrite : std_logic;
|
signal inboundSymbolRead : std_logic;
|
signal inboundSymbol : std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
signal inboundSymbol : std_logic_vector(2+(32*NUMBER_WORDS-1) downto 0);
|
|
|
signal readFrameEmpty : std_logic;
|
signal readFrameEmpty : std_logic;
|
signal readFrame : std_logic;
|
signal readFrame : std_logic;
|
signal readFrameRestart : std_logic;
|
signal readFrameRestart : std_logic;
|
Line 227... |
Line 227... |
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure ReceiveSymbol(
|
procedure ReceiveSymbol(
|
constant symbolType : in std_logic_vector(1 downto 0);
|
constant symbolType : in std_logic_vector(1 downto 0);
|
constant symbolContent : in std_logic_vector(31 downto 0) := x"00000000") is
|
constant symbolContent : in std_logic_vector(31 downto 0) := x"00000000") is
|
begin
|
begin
|
wait until outboundSymbolEmpty = '0' and clk'event and clk = '1';
|
outboundSymbolFull <= '0';
|
|
wait until clk'event and clk = '1' and outboundSymbolWrite = '1';
|
|
|
while ((outboundSymbol(33 downto 32) = SYMBOL_IDLE) and
|
while ((outboundSymbol(33 downto 32) = SYMBOL_IDLE) and
|
(symbolType /= SYMBOL_IDLE)) loop
|
(symbolType /= SYMBOL_IDLE)) loop
|
outboundSymbolRead <= '1';
|
wait until clk'event and clk = '1' and outboundSymbolWrite = '1';
|
wait until clk'event and clk = '1';
|
|
outboundSymbolRead <= '0';
|
|
wait until outboundSymbolEmpty = '0' and clk'event and clk = '1';
|
|
end loop;
|
end loop;
|
|
|
assert symbolType = outboundSymbol(33 downto 32)
|
assert symbolType = outboundSymbol(33 downto 32)
|
report "Missmatching symbol type:expected=" &
|
report "Missmatching symbol type:expected=" &
|
integer'image(to_integer(unsigned(symbolType))) &
|
integer'image(to_integer(unsigned(symbolType))) &
|
Line 260... |
Line 258... |
" got=" &
|
" got=" &
|
integer'image(to_integer(unsigned(outboundSymbol(31 downto 0))))
|
integer'image(to_integer(unsigned(outboundSymbol(31 downto 0))))
|
severity error;
|
severity error;
|
end if;
|
end if;
|
|
|
outboundSymbolRead <= '1';
|
outboundSymbolFull <= '1';
|
wait until clk'event and clk = '1';
|
|
outboundSymbolRead <= '0';
|
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
-- Procedure to send a symbol.
|
-- Procedure to send a symbol.
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure SendSymbol(
|
procedure SendSymbol(
|
constant symbolType : in std_logic_vector(1 downto 0);
|
constant symbolType : in std_logic_vector(1 downto 0);
|
constant symbolContent : in std_logic_vector(31 downto 0) := x"00000000") is
|
constant symbolContent : in std_logic_vector(31 downto 0) := x"00000000") is
|
begin
|
begin
|
wait until inboundSymbolFull = '0' and clk'event and clk = '1';
|
inboundSymbolEmpty <= '0';
|
|
|
inboundSymbolWrite <= '1';
|
|
inboundSymbol <= symbolType & symbolContent;
|
inboundSymbol <= symbolType & symbolContent;
|
|
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1' and inboundSymbolRead = '1';
|
inboundSymbolWrite <= '0';
|
inboundSymbolEmpty <= '1';
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
-- Process variables.
|
-- Process variables.
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
Line 303... |
Line 297... |
portLinkTimeout <= (others=>'1');
|
portLinkTimeout <= (others=>'1');
|
inputPortEnable <= '1';
|
inputPortEnable <= '1';
|
outputPortEnable <= '1';
|
outputPortEnable <= '1';
|
|
|
portInitialized <= '0';
|
portInitialized <= '0';
|
outboundSymbolRead <= '0';
|
outboundSymbolFull <= '1';
|
inboundSymbolWrite <= '0';
|
inboundSymbolEmpty <= '1';
|
inboundSymbol <= (others => '0');
|
inboundSymbol <= (others => '0');
|
|
|
localAckIdWrite <= '0';
|
localAckIdWrite <= '0';
|
clrOutstandingAckId <= '0';
|
clrOutstandingAckId <= '0';
|
inboundAckIdWrite <= (others=>'0');
|
inboundAckIdWrite <= (others=>'0');
|
Line 472... |
Line 466... |
STYPE1_NOP, "000"));
|
STYPE1_NOP, "000"));
|
end loop;
|
end loop;
|
|
|
ReceiveSymbol(SYMBOL_IDLE);
|
ReceiveSymbol(SYMBOL_IDLE);
|
ReceiveSymbol(SYMBOL_IDLE);
|
ReceiveSymbol(SYMBOL_IDLE);
|
|
ReceiveSymbol(SYMBOL_IDLE);
|
wait until linkInitialized = '1';
|
wait until linkInitialized = '1';
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("TG_RioSerial-TC3");
|
PrintS("TG_RioSerial-TC3");
|
Line 2309... |
Line 2304... |
readContentEmpty_i=>readContentEmpty,
|
readContentEmpty_i=>readContentEmpty,
|
readContent_o=>readContent, readContentEnd_i=>readContentEnd, readContentData_i=>readContentData,
|
readContent_o=>readContent, readContentEnd_i=>readContentEnd, readContentData_i=>readContentData,
|
writeFrameFull_i=>writeFrameFull, writeFrame_o=>writeFrame, writeFrameAbort_o=>writeFrameAbort,
|
writeFrameFull_i=>writeFrameFull, writeFrame_o=>writeFrame, writeFrameAbort_o=>writeFrameAbort,
|
writeContent_o=>writeContent, writeContentData_o=>writeContentData,
|
writeContent_o=>writeContent, writeContentData_o=>writeContentData,
|
portInitialized_i=>portInitialized,
|
portInitialized_i=>portInitialized,
|
outboundSymbolEmpty_o=>outboundSymbolEmpty, outboundSymbolRead_i=>outboundSymbolRead,
|
outboundSymbolFull_i=>outboundSymbolFull,
|
|
outboundSymbolWrite_o=>outboundSymbolWrite,
|
outboundSymbol_o=>outboundSymbol,
|
outboundSymbol_o=>outboundSymbol,
|
inboundSymbolFull_o=>inboundSymbolFull, inboundSymbolWrite_i=>inboundSymbolWrite,
|
inboundSymbolEmpty_i=>inboundSymbolEmpty,
|
|
inboundSymbolRead_o=>inboundSymbolRead,
|
inboundSymbol_i=>inboundSymbol);
|
inboundSymbol_i=>inboundSymbol);
|
|
|
end architecture;
|
end architecture;
|
|
|
|
|