P4C
The P4 Compiler
Loading...
Searching...
No Matches
ActionData::Format Class Reference

Classes

struct  Use
 

Public Member Functions

 Format (PhvInfo &p, const IR::MAU::Table *t, const ReductionOrInfo &ri, SplitAttachedInfo &sai)
 
void allocate_format (IR::MAU::Table::ImmediateControl_t imm_ctrl, FormatType_t format_type)
 
void set_uses (safe_vector< Use > *u)
 

Static Public Attributes

static constexpr int ACTION_RAM_BYTES = 16
 
static constexpr int IMMEDIATE_BITS = 32
 
static constexpr int METER_COLOR_SIZE = 8
 
static constexpr int METER_COLOR_START_BIT = IMMEDIATE_BITS - METER_COLOR_SIZE
 

Member Function Documentation

◆ allocate_format()

void ActionData::Format::allocate_format ( IR::MAU::Table::ImmediateControl_t imm_ctrl,
FormatType_t format_type )

Builds a vector of potential action data packings. The following are potential notes for later improvements and criticisms.

1. The algorithm for determining the balance between Action Data Table and Immediate space
   might not be the long term solution, as I had the idea to possibly run the condense
   algorithm over two separate spaces.  Right now, the condense algorithm runs assuming
   that all data will be packed in the same area, specifically Action Data RAM.  Perhaps
   the long term solution is to condense into two spaces simultaneously, immediate and
   action data.

2. The naming is fairly cumbersome.  Specifically the terms slots and sections appear, and
   mean different things.  Slots refer to Action Data Bus Input Slots, which come from the
   ALUOperation objects, while Sections refer to the RamSection class,
   which through the condense algorithm, can have multiple ALUOperation objects.
   Separate analysis over these object is necessary, but the naming can be confusing.

3. The algorithm is not finely tuned to save Action Data Bus resources, though usually this
   isn't the constraint that prevents tables from fitting.  I think before trying to
   optimize this for Action Data Bus, other portions of the Action Data Bus algorithm can
   improve, e.g. O(n^2) approach of allocating all tables simultaneously rather than one at
   a time, mutual exclusive optimizations, and the extra copies of the entry from lsb.