The comparator is trying to be very symmetrical. It has two ports, “before” and “after”. It allows you to connect the predictor and DUT to “before, after” or “after, before”. The code works if the actual DUT transaction comes in on the before port or the after. Might be a little too clever.
Download the tar file - the code is slightly different than the cookbook page. The example runs the same no matter how you connect the ports in scoreboard_ooo_imps.svh
class scoreboard_ooo_imps extends analysis_group_base;
function void connect_phase(uvm_phase phase);
// connect up scoreboard analysis exports
// mon_axp.connect(comp.after_axp ); // Original
// predictor.results_ap.connect(comp.before_axp); // Original
mon_axp.connect(comp.before_axp ); // Swapped
predictor.results_ap.connect(comp.after_axp); // Swapped