# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# waiver file for prim_fifo

waive -rules {ONE_BIT_MEM_WIDTH} -location {prim_fifo_sync.sv} -msg {Memory 'gen_normal_fifo.storage' has word width which is single bit wide} \
      -comment "It is permissible that a FIFO has a wordwidth of 1bit"

waive -rules {INPUT_NOT_READ} -location {prim_fifo_sync.sv} -regexp {Input port '(clk_i|rst_ni)' is not read from, instance.*Depth=0\)} \
      -comment "In passthrough mode, clk and reset are not read form within this module"

waive -rules VAR_INDEX_RANGE      -location {prim_fifo_*sync.sv} -regexp {maximum value .* may be too large for 'storage'} \
      -comment "index is protected by control logic"

## prim_fifo_async_sram_adapter
waive -rules ARITH_CONTEXT -location {prim_fifo_async_sram_adapter.sv} \
      -regexp {(r|w)_wptr_v.*_rptr_v} \
      -comment "The pointer value width is determined. Remove the casting for readability"
waive -rules USE_BEFORE_DECL -location {prim_fifo_async_sram_adapter.sv} -msg {'dec2gray' is referenced before its declaration at prim_fifo_async_sram_adapter.sv} \
      -comment "dec2gray is a function defined towards the end of the file."
waive -rules USE_BEFORE_DECL -location {prim_fifo_async_sram_adapter.sv} -msg {'gray2dec' is referenced before its declaration at prim_fifo_async_sram_adapter.sv} \
      -comment "gray2dec is a function defined towards the end of the file."

# Avoid warnings about overly long macro prototypes (caused by long default values of arguments)
waive -rules {LINE_LENGTH} -location {prim_fifo_assert.svh}  \
      -msg {Line length of} \
      -comment "Some macros cannot be line-wrapped, as some tools do not support that."
