rtl/forward.py
def ForwardUnit():
    """Forwarding unit for Geode.

    This module consumes information from the pipeline to decide when data
    forwarding is necessary to maintain correct execution.
    """

    io = Io({
        'ex_rs1': Input(Bits(Log2Ceil(C['reg-count']))),
        'ex_rs2': Input(Bits(Log2Ceil(C['reg-count']))),
        'mem_reg_write': Input(Bits(1)),
        'mem_rd': Input(Bits(Log2Ceil(C['reg-count']))),
        'wb_reg_write': Input(Bits(1)),
        'wb_rd': Input(Bits(Log2Ceil(C['reg-count']))),
        'fwd1_select': Output(Bits(fwd.bitwidth)),
        'fwd2_select': Output(Bits(fwd.bitwidth)),
    })

    #
    # Here's a good example of metaprogramming in Atlas/Python. Since the logic
    # for forwarding registers for rs1 and rs2 is essentially the same, the
    # logic can be collapsed into one (Python) function that generates this
    # logic.
    #

    ForwardReg(
        io.ex_rs1,
        io.mem_reg_write,
        io.mem_rd,
        io.wb_reg_write,
        io.wb_rd,
        io.fwd1_select
    )

    ForwardReg(
        io.ex_rs2,
        io.mem_reg_write,
        io.mem_rd,
        io.wb_reg_write,
        io.wb_rd,
        io.fwd2_select
    )

    NameSignals(locals())
Forwarding unit for Geode.

    This module consumes information from the pipeline to decide when data
    forwarding is necessary to maintain correct execution.
    
Forwarding unit for Geode.
This module consumes information from the pipeline to decide when data
forwarding is necessary to maintain correct execution.
Forwarding unit for Geode . This module consumes information from the pipeline to decide when data forwarding is necessary to maintain correct execution .
def ForwardUnit():
    io = Io({
        'ex_rs1': Input(Bits(Log2Ceil(C['reg-count']))),
        'ex_rs2': Input(Bits(Log2Ceil(C['reg-count']))),
        'mem_reg_write': Input(Bits(1)),
        'mem_rd': Input(Bits(Log2Ceil(C['reg-count']))),
        'wb_reg_write': Input(Bits(1)),
        'wb_rd': Input(Bits(Log2Ceil(C['reg-count']))),
        'fwd1_select': Output(Bits(fwd.bitwidth)),
        'fwd2_select': Output(Bits(fwd.bitwidth)),
    })
     Here's a good example of metaprogramming in Atlas/Python. Since the logic
     for forwarding registers for rs1 and rs2 is essentially the same, the
     logic can be collapsed into one (Python) function that generates this
     logic.
    ForwardReg(
        io.ex_rs1,
        io.mem_reg_write,
        io.mem_rd,
        io.wb_reg_write,
        io.wb_rd,
        io.fwd1_select
    )
    ForwardReg(
        io.ex_rs2,
        io.mem_reg_write,
        io.mem_rd,
        io.wb_reg_write,
        io.wb_rd,
        io.fwd2_select
    )
    NameSignals(locals())
def ForwardUnit ( ) : io = Io ( { 'ex_rs1' : Input ( Bits ( Log2Ceil ( C [ 'reg-count' ] ) ) ) , 'ex_rs2' : Input ( Bits ( Log2Ceil ( C [ 'reg-count' ] ) ) ) , 'mem_reg_write' : Input ( Bits ( 1 ) ) , 'mem_rd' : Input ( Bits ( Log2Ceil ( C [ 'reg-count' ] ) ) ) , 'wb_reg_write' : Input ( Bits ( 1 ) ) , 'wb_rd' : Input ( Bits ( Log2Ceil ( C [ 'reg-count' ] ) ) ) , 'fwd1_select' : Output ( Bits ( fwd . bitwidth ) ) , 'fwd2_select' : Output ( Bits ( fwd . bitwidth ) ) , } ) ForwardReg ( io . ex_rs1 , io . mem_reg_write , io . mem_rd , io . wb_reg_write , io . wb_rd , io . fwd1_select ) ForwardReg ( io . ex_rs2 , io . mem_reg_write , io . mem_rd , io . wb_reg_write , io . wb_rd , io . fwd2_select ) NameSignals ( locals ( ) )
Forwarding unit for Geode.
Forwarding unit for Geode .
"""Forwarding unit for Geode.

    This module consumes information from the pipeline to decide when data
    forwarding is necessary to maintain correct execution.
    """ # # Here's a good example of metaprogramming in Atlas/Python. Since the logic # for forwarding registers for rs1 and rs2 is essentially the same, the # logic can be collapsed into one (Python) function that generates this # logic. #