42 std::map<unsigned, ordered_map<const IR::BFN::ParserState *, unsigned>>
43 stack_offset_state_bit_offsets_;
46 int min_packet_bit_offset_;
49 int max_packet_bit_offset_;
58 &stack_offset_state_bit_offsets,
67 &stack_offset_state_bit_offsets,
70 stack_offset_state_bit_offsets_(stack_offset_state_bit_offsets),
106 return state_bit_offsets_;
111 return state_bit_offsets_.at(state);
116 auto offset = *Values(state_bit_offsets_).begin();
162 int postGapBits)
const;
195 typedef std::map<const Pseudoheader *, ordered_map<const PHV::Field *, FieldSliceExtractInfo *>,
199 typedef std::map<cstring, std::map<const IR::BFN::ParserState *, std::set<unsigned>>>
216 void updateFieldMap(
const PHV::Field *field,
const IR::BFN::ParserState *state,
217 unsigned stack_offset,
unsigned state_bit_offset,
int min_packet_bit_offset,
218 int max_packet_bit_offset) {
220 fieldMap.at(field)->
update(state, stack_offset, state_bit_offset, min_packet_bit_offset,
221 max_packet_bit_offset);
224 state_bit_offsets[state] = state_bit_offset;
225 std::map<unsigned, ordered_map<const IR::BFN::ParserState *, unsigned>>
226 stack_offset_state_bit_offsets;
227 stack_offset_state_bit_offsets[stack_offset][state] = state_bit_offset;
230 min_packet_bit_offset, max_packet_bit_offset, field);
235 const IR::BFN::ParserState *state,
unsigned stack_offset,
236 unsigned state_bit_offset,
int min_packet_bit_offset,
237 int max_packet_bit_offset) {
240 fei->update(state, stack_offset, state_bit_offset, min_packet_bit_offset,
241 max_packet_bit_offset);
244 state_bit_offsets[state] = state_bit_offset;
245 std::map<unsigned, ordered_map<const IR::BFN::ParserState *, unsigned>>
246 stack_offset_state_bit_offsets;
247 stack_offset_state_bit_offsets[stack_offset][state] = state_bit_offset;
250 min_packet_bit_offset, max_packet_bit_offset, field);
256 void updateHeaderStackMap(
cstring header_stack,
const IR::BFN::ParserState *state,
257 const std::set<unsigned> indices) {
258 headerStackMap[header_stack][state].insert(indices.begin(), indices.end());