diff --git a/vhdl/splink.vhdl b/vhdl/splink.vhdl index cf585da..ccd3062 100644 --- a/vhdl/splink.vhdl +++ b/vhdl/splink.vhdl @@ -146,10 +146,12 @@ begin -- TODO udp_length, range check with MAX_STRAND_LEN num_pixels <= MAX_STRAND_LEN; - -- FIXME bounds check - active_strand <= to_integer(unsigned(udp_data)); - - receive_state <= FRAME_NUM; + if unsigned(udp_data) >= NUM_STRANDS then + receive_state <= DROP; + else + active_strand <= to_integer(unsigned(udp_data)); + receive_state <= FRAME_NUM; + end if; when FRAME_NUM => if not some_strands_written then