blob: d0ea452cb29ebbc9359593d72dccf2b88c603963 [file] [log] [blame]
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# waiver file for SPI Device
set_clock_drivers prim_clock_buf prim_clock_mux2
### ARITH
waive -rules {ARITH_CONTEXT} -location {spi_readcmd.sv} \
-regexp {'addr_q\[31:2\] \+ 1'b1' is self-determined} \
-comment "Leave it as it is for readability"
waive -rules {ARITH_CONTEXT} -location {spid_readsram.sv} \
-regexp {'current_address_i\[31:2\] \+ 1'b1' is self-deter} \
-comment "Leave it as it is for readability"
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {[nN]et.*a_(address|param|user).*not read from} \
-comment "several TLUL signals are not used by register file"
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {Net .reg2hw.*.qe. is not read from} \
-comment "registers with multiple fields often have unused qe's since they are duplicative"
waive -rules NOT_READ -location {spi_device.sv} -regexp {Signal 'reg2hw.*.qe' is not read from} \
-comment "registers with multiple fields often have unused qe's since they are duplicative"
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {[nN]et.*tl_h_i.[ad]_(ready|param|sink|size|source|user)} \
-comment "TL-UL converter doesn't use the signals"
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {[nN]et.*[tr]xf_addr\.(base|limit)\.q.*' is not read} \
-comment "Only lower 9bits are used for sram_addr but leaving the register fields flexible"
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {[nN]et.*sram_base_addr.*' is not read} \
-comment "Sram base address is given by parameter. Didn't decided if this field is used."
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {[nN]et.*[rt]xf_ptr.*' is not read} \
-comment "Only lower bits are used for sram_addr but leaving the register fields flexible"
waive -rules NOT_READ -location {spi_device.sv} -regexp {Signal.*[tr]xf_addr\.(base|limit)\.q.*' is not read} \
-comment "Only lower 9bits are used for sram_addr but leaving the register fields flexible"
waive -rules NOT_READ -location {spi_device.sv} -regexp {Signal.*sram_base_addr.*' is not read} \
-comment "Sram base address is given by parameter. Didn't decided if this field is used."
waive -rules NOT_READ -location {spi_device.sv} -regexp {Signal.*[rt]xf_ptr.*' is not read} \
-comment "Only lower bits are used for sram_addr but leaving the register fields flexible"
waive -rules HIER_NET_NOT_READ -location {spi_fwmode.sv} -regexp {[nN]et.*spi_mode.* is not read} \
-comment "FwMode is used. This field is used when EEPROM is implemented"
waive -rules HIER_NET_NOT_READ -location {spi_fwmode.sv} -regexp {[nN]et.*fwm_sram_error.* is not read} \
-comment "SRAM error correction code is not implemented"
waive -rules HIER_NET_NOT_READ NOT_READ -location {spi_device.sv} -regexp {.*fifo_level\..xlvl\.q} \
-comment "RXLevel and TXLevel is used only for pointer width."
waive -rules HIER_NET_NOT_READ -location {spi_device.sv} -regexp {(tl_sram_h2d|tl_i).*a_mask} \
-comment "TL SRAM adapter does not use mask"
waive -rules HIER_NET_NOT_READ NOT_READ -location {spi_device.sv} -regexp {mem_(a|b)_(rerror|addr)} \
-comment "Only portion of Memory address is used depending on SramAw parameter"
waive -rules NOT_READ -location {spi_fwm_rxf_ctrl.sv} -regexp {Signal 'ptr_cmp\[1:0\]' is not read} \
-comment "Only upper bits are used to compare FIFO full condition to avoid partial write"
waive -rules CONST_OUTPUT -location {spi_fwm_txf_ctrl.sv} -regexp {Output 'sram_w.*' is driven} \
-comment "always read operation from TX FIFO CTRL"
waive -rules CONST_OUTPUT -location {spi_fwm_*xf_ctrl.sv} -regexp {Output 'depth.*} \
-comment "Based on the SRAM size 2kB, it cannot hit the case"
waive -rules CONST_FF -location {spi_p2s.sv} \
-regexp {Flip-flop 'tx_state' is driven} \
-comment "Intended behavior"
waive -rules CONST_FF -location {spi_device.sv} -regexp {fwm_rerr_q} \
-comment "Will implement the interrupt later. Waive for now"
waive -rules CONST_FF -location {spi_fwmode.sv} -regexp {'tx_state' is driven by constant one} \
-comment "Intentionally reset to TxIdle and assign TxActive else. For CPHA=1 mode"
waive -rules TWO_STATE_TYPE -location {spi_device.sv} -regexp {'fwm_fifo_e' is of} \
-comment "Intended declaration"
waive -rules TWO_STATE_TYPE -location {spi_device.sv} \
-regexp {'sys_sram_e' is of two state type} \
-comment "Enum int unsigned is used as a index. OK to be two state"
waive -rules TWO_STATE_TYPE -location {spid_upload.sv} \
-regexp {'sramintf_e' is of two state type} \
-comment "Enum int unsigned is used as a index. OK to be two state"
waive -rules TWO_STATE_TYPE -location {spid_status.sv} \
-regexp {'status_bit_e' is of two state type} \
-comment "Enum status_bit_e is used as an index. OK to be two state"
waive -rules ONE_BIT_MEM_WIDTH -location {spi_device.sv spi_fwmode.sv} -regexp {Memory 'fwm_sram_.*' has word} \
-comment "Intended implementation to make it consistent with other signals"
waive -rules {ONE_BIT_MEM_WIDTH} -location {spi_device.sv} \
-regexp {Memory 'sub_(sram|p2s)_.*' has word} \
-comment "Intended implemenetation to make it consistent"
waive -rules EXPLICIT_BITLEN -location {spi_*} -regexp {for constant '1'} \
-comment "Parameter subtract is fine"
waive -rules INPUT_NOT_READ -location {spi_fwm_*xf_ctrl.sv} -regexp {Input port 'sram_error' is not read} \
-comment "Sram error protection is not yet implemented"
waive -rules INPUT_NOT_READ -location {spi_fwmode.sv} -regexp {Input port 'mode_i' is not read} \
-comment "Only FwMode is used at this moment"
waive -rules CONST_FF -location {spi_device.sv} -msg {Flip-flop 'fwm_rxerr_q' is driven by constant zero} \
-comment "This is an unimplemented error signal which is currently tied to 0."
# intentional terminal states
waive -rules TERMINAL_STATE -location {spi_cmdparse.sv} -regexp {Terminal state 'St(Status|Jedec|Sfdp|ReadCmd|Upload|Addr4B|WrEn)' is detected}
waive -rules TERMINAL_STATE -location {spi_readcmd.sv} \
-regexp {Terminal state 'Main(Output|Error)' is detected} \
-comment "Intentional dead-end. CSb will reset"
waive -rules TERMINAL_STATE -location {spid_jedec.sv} \
-regexp {Terminal state 'StDevId' is detected} \
-comment "Intentional dead-end. CSb will reset"
# async resets
waive -rules RESET_DRIVER -location {spi_device.sv} \
-regexp {'rst_(spi|txfifo|rxfifo)_n' is driven} \
-comment "Async reset generation is required here"
waive -rules RESET_MUX -location {spi_device.sv} \
-regexp {Asynchronous reset 'rst_(spi|txfifo|rxfifo)_n' is driven} \
-comment "The MUX is needed to control the reset during scanmode (scanmode_i == 1)"
waive -rules RESET_MUX -location {spi_device.sv} \
-regexp {'sram_rst_n.*' is driven by a multiplexer here} \
-comment "Scan reset mux, but need to have asynchronous reset"
# clock inverter and muxes
waive -rules CLOCK_MUX -location {spi_device.sv} -regexp {Clock 'sck_n' is driven by a multiplexer here, used as a clock 'clk_(out|src)_i'} \
-comment "The multiplexer is needed to bypass the clock inverter during testing"
waive -rules CLOCK_MUX -location {spi_device.sv} -regexp {Clock 'clk_spi_in_buf' reaches a multiplexer here, used as a clock.*} \
-comment "These multiplexers are needed to select between inverted and non-inverted clock based on configuration"
## For Generic Ascentlint only
waive -rules CLOCK_MUX -location {spi_device.sv} \
-regexp {Clock '(clk_i|sram_clk_muxed)'} \
-comment "ascentlint with prim generic has generated clock starting from a flop"
#### INFO
waive -rules VAR_INDEX -location {spi_fwm_rxf_ctrl.sv} -regexp {'byte_enable\[pos\]'} \
-comment "Flip-flop implemented"
waive -rules VAR_INDEX -location {spi_fwm_rxf_ctrl.sv} -regexp {'sram_[wr]data.*'} \
-comment "Flip-flop implemented"
waive -rules VAR_INDEX -location {spi_fwm_txf_ctrl.sv} -regexp {'fifo_wdata_d.*'} \
-comment "fifo_data_d is latched to fifo_data[7:0]"
waive -rules CASE_INC -location {spi_fwm_*xf_ctrl.sv} -regexp {Case statement tag not} \
-comment "Enum type is used for state machine"
#### NOT used
#### For the convenience of the design, below signals are intentionally unused
waive -rules {NOT_USED NOT_READ} -location {spi_device.sv} \
-regexp {'sub_(sram|p2s)_.*\[1\]' is not (used|read)} \
-comment "CmdParse does not have SRAM intf"
#### Intented Terminal States
waive -rules {TERMINAL_STATE} -location {spi_cmdparse.sv} \
-regexp {StWait} \
-comment "CmdParse stays StWait until CSb de-assertion is received"
waive -rules {TERMINAL_STATE} -location {spid_status.sv} \
-regexp {StActive} \
-comment "Until CSb de-asserted, the logic keeps sending the STATUS to the host system"
#### Integer use
waive -rules {INTEGER} -location {spi_cmdparse.sv} \
-regexp {'i' of type int used as a non-constant value} \
-comment "Need to give the index to the submodules to recognize which command it received"
waive -rules {INTEGER} -location {spid_status.sv} \
-regexp {'i' of type int used as a non-constant value} \
-comment "Find correct cmd_index and return the appropriate byte_sel signal"
#### SRAM mux
#### SRAM has unpacked array to mux/demux. Waive one bit unpacked array
waive -rules {ONE_BIT_MEM_WIDTH} -location {spi_device.sv} \
-regexp {Memory 'sub_.*' has word width which is a single bit wide} \
-comment "Unpacked array for mux/demux"
#### Clock use
####
waive -rules {CLOCK_USE} -location {spi_device.sv} \
-regexp {clk_i' is connected to 'prim_clock_mux2' port 'clk1_i', and used as a clock 'CK' at} \
-comment "This clock mux is required."
#### Passthrough
waive -rules {TERMINAL_STATE} -location {spi_passthrough.sv} \
-regexp {Terminal state 'St.* state register 'st_d' is not} \
-comment "Dead End States waiting CSb de-assertion"
waive -rules {NOT_READ} -location {spi_passthrough.sv} \
-regexp {Signal 'opcode.*}
#### Sign/ unsigned
waive -rules {ASSIGN_SIGN NEG_ASSIGN} -location {spi_passthrough.sv} \
-regexp {'addr_size_d'} \
-comment "Waive the unsigned, negative value errors for readability"
waive -rules {CALC_NEXT_STATE} -location {spid_status.sv} \
-regexp {'byte_sel_d' is assigned a non-constant expression 'i'} \
-comment "byte_sel_q is not a state but mux selection register. but coded similar to the state machine"
## Terminal
waive -rules {TERMINAL_STATE} -location {spid_readbuffer.sv} \
-regexp {'StActive' is detected.} \
-comment "StActive is final state waiting CSb de-assertion"
waive -rules {TERMINAL_STATE} -location {spid_upload.sv} \
-regexp {'StPayload' is detected.} \
-comment "StPayload is the final state waiting CSb"
## PKG
waive -rules {INPUT_NOT_READ} -location {spi_device_pkg.sv} \
-regexp {'ci\..*' is not read} \
-comment "Only portion of the cmd info struct is used"
## PARAM_ENUM
waive -rules {PARAM_ENUM_VAL} -location {spi_device.sv} \
-regexp {Parameter 'N' is .* 'SysSramEnd'} \
-comment "The enum is used as a constant in the design."