P4C
The P4 Compiler
Loading...
Searching...
No Matches
tofino/instruction_memory.h
1
19
#ifndef BF_P4C_MAU_TOFINO_INSTRUCTION_MEMORY_H_
20
#define BF_P4C_MAU_TOFINO_INSTRUCTION_MEMORY_H_
21
22
#include "backends/tofino/bf-p4c/mau/instruction_memory.h"
23
24
namespace
Tofino
{
25
26
struct
InstructionMemory
:
public
::InstructionMemory
{
27
static
constexpr
int
IMEM_ROWS = 32;
28
static
constexpr
int
IMEM_COLORS = 2;
29
30
BFN::Alloc2D<cstring, IMEM_ROWS, IMEM_COLORS>
ingress_imem_use;
31
BFN::Alloc2D<cstring, IMEM_ROWS, IMEM_COLORS>
egress_imem_use;
32
33
BFN::Alloc2D<bitvec, IMEM_ROWS, IMEM_COLORS>
ingress_imem_slot_inuse;
34
BFN::Alloc2D<bitvec, IMEM_ROWS, IMEM_COLORS>
egress_imem_slot_inuse;
35
36
BFN::Alloc2Dbase<cstring>
&imem_use(gress_t gress) {
37
if
(gress == INGRESS || gress == GHOST)
return
ingress_imem_use;
38
return
egress_imem_use;
39
}
40
41
BFN::Alloc2Dbase<bitvec>
&imem_slot_inuse(gress_t gress) {
42
if
(gress == INGRESS || gress == GHOST)
return
ingress_imem_slot_inuse;
43
return
egress_imem_slot_inuse;
44
}
45
46
InstructionMemory
() :
::InstructionMemory
(Device::imemSpec()) {}
47
};
48
49
}
// end namespace Tofino
50
51
#endif
/* BF_P4C_MAU_TOFINO_INSTRUCTION_MEMORY_H_ */
BFN::Alloc2D
Definition
alloc.h:152
BFN::Alloc2Dbase
Definition
alloc.h:76
Tofino
Definition
tofino/action_data_bus.cpp:28
InstructionMemory
Definition
instruction_memory.h:82
Tofino::InstructionMemory
Definition
tofino/instruction_memory.h:26
backends
tofino
bf-p4c
mau
tofino
instruction_memory.h
Generated by
1.12.0