P4C
The P4 Compiler
|
Public Member Functions | |
safe_vector< const ActionData::ALUPosition * > | all_alu_positions () const |
void | clear () |
bool | contains_adb_slot (ActionData::SlotType_t type, int start_byte) const |
Public Attributes | |
std::map< cstring, safe_vector< ActionData::ALUPosition > > | alu_positions |
ActionData::BusInputs | meter_alu_bus_inputs = {{bitvec(), bitvec(), bitvec()}} |
ActionData::BusInputs | table_bus_inputs = {{bitvec(), bitvec(), bitvec()}} |
bool MeterALU::Format::Use::contains_adb_slot | ( | ActionData::SlotType_t | type, |
int | start_byte ) const |
The purpose of this file is to determine the requirements of any LPF, WRED, or Stateful ALU that is writing some value back to the data plane. Unlike meter color, which is processed through the immediate pathway, these type of output come from the ALU on that particular row and output onto the home row action bus. Thus, the requirements are similar to that of an action data table. The following describes their location in the uArch:
MAU Figure 6-73: LPF meter block diagram
The 32-bit Vnew is passed to the RED logic (when enabled) to generate the 8b drop indicator. If RED is enabled, then the drop indicator is output to the action data bus. Otherwise the 32b Vnew (optionally scaled by the LPF action scale field of the meter RAM word) value is sent.
Note:
The output format is encoded as a bitvec of 4 bit. Each bit represents the use of 1 byte on action data bus. The encoded value is computed from 'read.size()' and 'container_bit'. The 'container_bit' gives the offset into 32 bit block. The 'read.size()' gives the size of used bits in the 32 bit block.
MAU Figure 6-74: Stateful ALU block diagram
The alu-hi/lo outputs are also sent to the output ALU where they can be passed to the action data bus. If the output ALU is predicated off, then its output is gated to 0. The exception to this is when the 4b predication output from cmp-hi/lo is being sent directly to the action data bus.
Note:
Same as meter alu above, the output format is encoded as a bitvec of 4 bit.
MAU Sec 6.2.12.7: ALU output
Multiple stateful ALU outputs can be OR’ed together onto the action data bus by configuring the shift values the same across each stateful ALU.
std::map<cstring, safe_vector<ActionData::ALUPosition> > MeterALU::Format::Use::alu_positions |
ALU Operations to be use in InstructionAdjustment
ActionData::BusInputs MeterALU::Format::Use::meter_alu_bus_inputs = {{bitvec(), bitvec(), bitvec()}} |
ADB inputs on home row for all tables that share this associated attached memory