DEPBAR : Dependency Barrier

Format:

SPA 5.0:
{@{!}Pg} DEPBAR { scoreboard_list } {&req_6} {?sched>=?WAIT3} ; {@{!}Pg} DEPBAR.LE SB#sbidx3, #pendingCnt6 {&req_6} {?sched>=?WAIT3} ; {@{!}Pg} DEPBAR.LE SB#sbidx3, #pendingCnt6, { scoreboard_list } {&req_6} {?sched>=?WAIT3} ; {@{!}Pg} DEPBAR.ALL {&req_6} {?sched>=?WAIT3} ; scoreboard_list is a comma separated list of scoreboards (0..5), containing from 0 to 6 (unique) scoreboard identifiers. scoreboard_list should appear with braces on either side, i.e. "{3,4}" #pendingCnt6 must be between 0 and 63, inclusive.

Description:

This instruction prevents the issue of subsequent instructions from the issuing warp, until the conditions specified by the instruction have been met. It is related to the &req= operand extension, except that it can specifiy more complex conditions (&req= can only specify a list of scoreboards which must be zero), and &req= prevents the issue of the instruction on which it appears (and all subsequent ops), whereas DEPBAR itself must be issued; it prevents the issue of subsequent instructions.

DEPBAR.LE allows waiting on a particular scoreboard to be less than or equal to a specified value.

The basic syntax for DEPBAR is:

    DEPBAR.LE SBn, imm;

where n is a scoreboard name (e.g. 0 thru 5), and imm is a positive integer from 0 to 63 (inclusive). After issue of a packet containing this DEPBAR, the warp will be put to sleep (and potentially taken off deck) until scoreboard n has a value less than or equal to imm.

Other scoreboards can be waited on at the same time by specifying them as additional parameters. However, those scoreboards can only be tested against the value 0.

    DEPBAR.LE SBn, imm, {a [, b [, c, ...]]};

where a, b, c, ... are different scoreboard names (also different from n). After issue, the warp will be put to sleep (and potentially taken off deck) until scoreboards a, b, c, ... have a value of 0, and until scoreboard n has a value less than or equal to imm.

For example:

    DEPBAR.LE SB3, 5, {2, 1};

The DEPBAR will issue, and then stall issue for the warp until the specified scoreboard conditions have occurred. In the example above, the warp will not issue any further packets until the scoreboard named 3 is less than or equal to 5, and scoreboards named 2 and 1 are both 0. The warp may be taken off deck if any of the scoreboards named 3, 2 or 1 are marked as covering a long-latency operation.

Note that DEPBAR behaves differently from &req=, in that its scoreboard conditions apply after issue of the packet, unlike &req= which are conditions that apply before issue.

The DEPBAR instruction must be the last instruction of a packet.

If multiple scoreboards need to be compared with non-zero values, then multiple DEPBAR instructions should be used, with their respective performance overhead. For performance, the compiler should instead try to merge the two scoreboard names to avoid these situations.

DEPBAR can be combined with normal scoreboard requirements (&req=). However, that is not advised because of the potential for additional stalls and additional overhead from going on and off deck more times than necessary. 

Note that DEPBAR.LE uses the "SB" prefix in front of a scoreboard number, simply to make it easier for a human to parse instructions like "DEPBAR.LE SB1, 2" (as opposed to "DEPBAR.LE 1, 2"). No where else in the ISA is this "SB" prefix used, due to a desire to keep op-ex additions to the instruction as small as possible.

DEPBAR.ALL is simply syntactic sugar for "DEPBAR {0, 1, 2, 3, 4, 5}", that is, it wants for all scoreboards to reach zero. Note that this is probably always better done with &req= on the subsequent instruction, rather than with DEPBAR.ALL.

Examples:

    DEPBAR.LE SB0, 1;
DEPBAR.LE SB3, 5, {2, 1};
DEPBAR.ALL;

Back to Index of Instructions