NSE-8G™ Standard Product Data Sheet
Preliminary
--
--
Poll the bit here before startiong next message.
rd(RX_STTS);
WHILE rx_fi_busy = '1' LOOP
rd(RX_STTS);
END LOOP;
--
--
--
Check the CRC_ERR bit for the next message
rd(RX_STTS);
rxmsg.crc_err := crc_err_reg;
END LOOP;
--
--
--
--
--
Now we should have a good message or an errored message we want to read
Note: we might have skipped the last message in the code above.
Read the message IF we have any.
IF msgs_rd < msg_lvl_loop THEN
msg_done
:= false;
dword_rd_cnt := 0;
rxmsg.payload := (OTHERS => 0);
WHILE dword_rd_cnt < 8 AND NOT msg_done LOOP
rd(RX_DAT);
-- The returned data is part of the payload
---
---
Simulation Stuff. Should replace with S/W stuff
FOR j IN 3 DOWNTO 0 LOOP
rxmsg.payload((dword_rd_cnt*4)+(3-j)) :=
conv_integer(reg_rd_data(8*j+7 DOWNTO 8*j));
END LOOP;
IF dword_rd_cnt = 0 THEN
rndm_rx_payload_len <= conv_integer(reg_rd_data(31 DOWNTO 24));
END IF;
End Simulation Stuff.
dword_rd_cnt := dword_rd_cnt + 1;
IF polled_rx_mode THEN
rd(RX_STTS);
WHILE rx_fi_busy = '1' LOOP
rd(RX_STTS);
END LOOP;
ELSE
--
-- Fixed delay to allow to ensure 4 SYSCLKs plus o/p delay between RDB edges
--
WAIT FOR 36 ns;
END IF;
--
--
--
--
--
--
Optional S/W algorithm to determine if the MSG is DONE before 8 Dwords
have been read. In this case for SIMULATION the test the msg_done is set
when we've read the number of dwords as indicated in the 1st message
payload byte.
IF dword_rd_cnt = rndm_rx_payload_len THEN
msg_done := true;
END IF;
IF msg_done AND dword_rd_cnt < 8 THEN
--
-- We're on a short message. Need to do RX_XFER_SYNC
--
Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers’ Internal Use
Document ID: PMC-2010850, Issue 1
152