Scoreboard.xcc

Author: Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechin@st.com)

Copyright 2001 - 2007 STMicroelectronics

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

ScoreboardAction— Access or write action of an Instance for use by a Scoreboard.
union ScoreboardAction_ {
  struct {
    Instance INSTANCE;
    int16_t LASTDATE;
  } __;
  uint32_t PACKED;
};
typedef union ScoreboardAction_ ScoreboardAction_, *ScoreboardAction;
typedef const union ScoreboardAction_ *const_ScoreboardAction;
#define ScoreboardAction_INSTANCE(this) ((this)->__.INSTANCE)
#define ScoreboardAction__INSTANCE(this) (&(this)->__.INSTANCE)
#define ScoreboardAction_LASTDATE(this) ((this)->__.LASTDATE)
#define ScoreboardAction__LASTDATE(this) (&(this)->__.LASTDATE)
#define ScoreboardAction_PACKED(this) ((this)->PACKED)
#define ScoreboardAction__PACKED(this) (&(this)->PACKED)
Scoreboard— Emulates the scoreboard scheduler of a superscalar processor.

This Scoreboard computes the earliest date an Instruction can be issued within a time window, given the StorageCell uses and the Resource requirements of the Instruction. The Resource requirements must ensure the Instruction(s) issued at the same date by Scoreboard can always be grouped together.

Each WRITEACTIONS entry records the last write date to a particular StorageCell. Each ACCESSACTIONS entry records the last access date to a particular StorageCell.

struct Scoreboard_ {
  //@args       Memory memory, Processor processor, int windowSize
  Memory MEMORY;
  ResourceTable_ *TABLE;
  //@access WINDOWSIZE  ResourceTable_WINDOWSIZE(Scoreboard_TABLE(this))
  //@access CLP2HORIZON ResourceTable_CLP2HORIZON(Scoreboard_TABLE(this))
  //@access WINDOWSTART ResourceTable_WINDOWSTART(Scoreboard_TABLE(this))
  ScoreboardAction_ *WRITEACTIONS;
  ScoreboardAction_ *ACCESSACTIONS;
};
Scoreboard_memory— This Scoreboard Memory allocator.
static inline Memory
Scoreboard_memory(const_Scoreboard this)
{
  return Scoreboard_MEMORY(this);
}
Scoreboard_windowStart— This Scoreboard WINDOWSTART.
static inline int
Scoreboard_windowStart(const_Scoreboard this)
{
  return Scoreboard_WINDOWSTART(this);
}
Scoreboard_schedule— Schedule Instruction(s) using this Scoreboard.
void
Scoreboard_schedule(Scoreboard this, InstructionStack instructions);
Scoreboard_advance— Advance time so the WINDOWSTART equals the new date.
Require
Given newDate is not lower than this Scoreboard_windowStart.
Ensure
This Scoreboard_windowStart equals newDate.

Used to prevent new Instruction(s) from being scheduled before newDate.

static inline void
Scoreboard_advance(Scoreboard this, int newDate)
{
  ResourceTable_advance(Scoreboard_TABLE(this), newDate);
}
Scoreboard_reset— Reset this Scoreboard to empty state and given windowStart.

The sequence +Scoreboard_merge(Scoreboard_reset(this, windowStart), that, 0)+ has the effect of translating that Scoreboard to this at windowStart.

Scoreboard
Scoreboard_reset(Scoreboard this, int windowStart);
Scoreboard_merge— Merge this Scoreboard with that delayed Scoreboard.
Return
true iff this Scoreboard has changed as result of merge.

Used to merge Scoreboard(s) at control-flow join.

bool
Scoreboard_merge(Scoreboard this, const_Scoreboard that, int delay);