You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains commonly used cells and headers for use in various projects.
Cell Contents
This repository currently contains the following cells, ordered by categories.
Please note that cells with status deprecated are not to be used for new designs and only serve to provide compatibility with old code.
Ready/valid stream interface with a custom payload type
active
Ports
Generally, modules with sequential logic receive at least the following inputs.
Intentional exceptions are clock, reset, cdc cells, and any cells that receive multiple clock inputs.
Name
Description
clk_i
Clock driving sequential logic.
rst_ni
Asynchronous reset, active-low. Brings the module to its reset state.
clr_i
Synchronous clear, active-high. Brings the module to its reset state in the next clock cycle. Can be driven by synchronous logic or tied to 1'b0 if unused.
Use of Macros
Internally, the cells use macros to implement sequential logic (flip-flops) and assertions.
These macros are defined in this repo; see RTL Register Macros and SVA Macros below for more details.
Header Contents
This repository currently contains the following header files.
RTL Register Macros
The header file registers.svh contains macros that expand to descriptions of registers.
To avoid misuse of always_ff blocks, only the following macros shall be used to describe sequential behavior.
The use of linter rules that flag explicit uses of always_ff in source code is encouraged.
Flip-flop with load-enable and synchronous active-low reset
`FFLNR
q_sig, d_sig, load_ena, (clk_sig)
Flip-flop with load-enable without reset
The name of the clock signal for implicit variants is clk_i.
The name of the reset signal for implicit variants is rst_i or rst_ni, respectively for active-high and active-low variants.
Argument suffix _sig indicates signal names for present and next state as well as clocks, resets and synchronous clear signals.
Argument rst_val specifies the value literal to be assigned upon reset.
Argument load_ena specifies the boolean expression that forms the load enable of the register.
Arguments clr_sig, rst_sig and rstn_sig must be plain signal names, not expressions.
SystemVerilog Assertion Macros
The header file assertions.svh contains macros that expand to assertion blocks.
These macros should reduce the effort in writing many assertions and make it
easier to use them. They are similar to but incompatible with the macros used by lowrisc.
Simple Assertion and Cover Macros
Macro
Arguments
Description
`ASSERT_I
__name, __prop, (__desc)
Immediate assertion
`ASSERT_INIT
__name, __prop, (__desc)
Assertion in initial block. Can be used for things like parameter checking
`ASSERT_FINAL
__name, __prop, (__desc)
Assertion in final block
`ASSERT
__name, __prop, (__clk, __rst, __desc)
Assert a concurrent property directly
`ASSERT_NEVER
__name, __prop, (__clk, __rst, __desc)
Assert a concurrent property NEVER happens
`ASSERT_KNOWN
__name, __sig, (__clk, __rst, __desc)
Concurrent clocked assertion with custom error message
`COVER
__name, __prop, (__clk, __rst)
Cover a concurrent property
The name of the clock and reset signals for implicit variants is clk_i and rst_ni, respectively.
__desc is an optional string argument describing the failure causing the assertion to be violated that is embedded into the error report and defaults to "".
Complex Assertion Macros
Macro
Arguments
Description
`ASSERT_PULSE
__name, __sig, (__clk, __rst, __desc)
Assert that signal is an active-high pulse with pulse length of 1 clock cycle
`ASSERT_IF
__name, __prop, __enable, (__clk, __rst, __desc)
Assert that a property is true only when an enable signal is set
`ASSERT_KNOWN_IF
__name, __sig, __enable, (__clk, __rst, __desc)
Assert that signal has a known value (each bit is either '0' or '1') after reset if enable is set
Assert that the unmasked data on a ready-valid interface is kept stable after valid is asserted, until ready is asserted
The name of the clock and reset signals for implicit variants is clk_i and rst_ni, respectively.
__desc is an optional string argument describing the failure causing the assertion to be violated that is embedded into the error report and defaults to "".
Assumption Macros
Macro
Arguments
Description
`ASSUME
__name, __prop, (__clk, __rst, __desc)
Assume a concurrent property
`ASSUME_I
__name, __prop, (__desc)
Assume an immediate property
The name of the clock and reset signals for implicit variants is clk_i and rst_ni, respectively.
__desc is an optional string argument describing the failure causing the assertion to be violated that is embedded into the error report and defaults to "".
Formal Verification Macros
Macro
Arguments
Description
`ASSUME_FPV
__name, __prop, (__clk, __rst, __desc)
Assume a concurrent property during formal verification only
`ASSUME_I_FPV
__name, __prop, (__desc)
Assume an immediate property during formal verification only
`COVER_FPV
__name, __prop, (__clk, __rst)
Cover a concurrent property during formal verification
The name of the clock and reset signals for implicit variants is clk_i and rst_ni, respectively.
__desc is an optional string argument describing the failure causing the assertion to be violated that is embedded into the error report and defaults to "".