rtl/execute.py
def AluControl(alu_inst, alu_op, funct7, funct3):
    """Produce an appropriate alu_inst for the given op, funct3 and funct7.

    N.B. This function is very similar to how the idecode control works.
    """

    alu_op0 = alu_op(0, 0)
    alu_op1 = alu_op(1, 1)

    alu_inst <<= 0

    #
    # N.B. Atlas doesn't currently support reflected operations with constant
    # values (e.g. `1 & some_wire`). Because of this, the constant value 1
    # needs to be set to a wire to be used in the loop below.
    #

    true_w = Wire(Bits(1))
    true_w <<= 1

    NameSignals(locals())

    for inst_spec in alu_instructions:

        alu_op0_match = OptionalMatch(true_w, inst_spec.alu_op0, alu_op0)
        alu_op1_match = OptionalMatch(true_w, inst_spec.alu_op1, alu_op1)
        funct3_match = OptionalMatch(true_w, inst_spec.funct3, funct3)
        funct7_match = OptionalMatch(true_w, inst_spec.funct7, funct7)

        with alu_op0_match & alu_op1_match & funct3_match & funct7_match:
            alu_inst <<= inst_spec.alu_inst
Produce an appropriate alu_inst for the given op, funct3 and funct7.

    N.B. This function is very similar to how the idecode control works.
    
Produce an appropriate alu_inst for the given op, funct3 and funct7.
Produce an appropriate alu_inst for the given op funct3 and funct7 .
def AluControl(alu_inst, alu_op, funct7, funct3):
    alu_op0 = alu_op(0, 0)
    alu_op1 = alu_op(1, 1)
    alu_inst <<= 0
     N.B. Atlas doesn't currently support reflected operations with constant
     values (e.g. `1 & some_wire`). Because of this, the constant value 1
     needs to be set to a wire to be used in the loop below.
    true_w = Wire(Bits(1))
    true_w <<= 1
    NameSignals(locals())
    for inst_spec in alu_instructions:
        alu_op0_match = OptionalMatch(true_w, inst_spec.alu_op0, alu_op0)
        alu_op1_match = OptionalMatch(true_w, inst_spec.alu_op1, alu_op1)
        funct3_match = OptionalMatch(true_w, inst_spec.funct3, funct3)
        funct7_match = OptionalMatch(true_w, inst_spec.funct7, funct7)
        with alu_op0_match & alu_op1_match & funct3_match & funct7_match:
            alu_inst <<= inst_spec.alu_inst
def AluControl ( alu_inst , alu_op , funct7 , funct3 ) : alu_op0 = alu_op ( 0 , 0 ) alu_op1 = alu_op ( 1 , 1 ) alu_inst <<= 0 true_w = Wire ( Bits ( 1 ) ) true_w <<= 1 NameSignals ( locals ( ) ) for inst_spec in alu_instructions : alu_op0_match = OptionalMatch ( true_w , inst_spec . alu_op0 , alu_op0 ) alu_op1_match = OptionalMatch ( true_w , inst_spec . alu_op1 , alu_op1 ) funct3_match = OptionalMatch ( true_w , inst_spec . funct3 , funct3 ) funct7_match = OptionalMatch ( true_w , inst_spec . funct7 , funct7 ) with alu_op0_match & alu_op1_match & funct3_match & funct7_match : alu_inst <<= inst_spec . alu_inst
Produce an appropriate alu_inst for the given op, funct3 and funct7.
Produce an appropriate alu_inst for the given op funct3 and funct7 .
"""Produce an appropriate alu_inst for the given op, funct3 and funct7.

    N.B. This function is very similar to how the idecode control works.
    """ # # N.B. Atlas doesn't currently support reflected operations with constant # values (e.g. `1 & some_wire`). Because of this, the constant value 1 # needs to be set to a wire to be used in the loop below. #
alu_inst
alu_op
funct7
funct3