3.2.1.1 Template

Combinatorial logic is described with a code pattern as follows:

def top(<parameters>):
    ...
    @always_comb
    def combLogic():
        <functional code>
    ...
    return combLogic, ...

The always_comb decorator describes combinatorial logic. 3.1. The decorated function is a local function that specifies what happens when one of the input signals of the logic changes. The always_comb decorator infers the input signals automatically. It returns a generator that is sensitive to all inputs, and that executes the function whenever an input changes.



Footnotes

... logic.3.1
The name always_comb refers to a construct with similar semantics in SystemVerilog.
About this document