P4C
The P4 Compiler
|
#include <instruction_memory.h>
Classes | |
struct | VLIW_Instruction |
Public Member Functions | |
void | clear () |
void | merge (const Use &alloc) |
bool | operator!= (const Use &u) const |
bool | operator== (const Use &u) const |
Public Attributes | |
std::map< cstring, VLIW_Instruction > | all_instrs |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Use &u) |
Instruction Memory requires two things:
Each match saves with it an action to run. Rather than store a full address per match key, which would be 6 bits apiece, if the total number of possible hit actions are <= 8, then the address just needs to be a unique code between 0 and ceil_log2(hit_actions).
The row and color correspond to the instruction memory row and color, while the mem_code is used by the context JSON to know what to write on the SRAM for running this particular action.