19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_CLOT_CANDIDATE_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_CLOT_CANDIDATE_H_
22#include "bf-p4c/lib/cmp.h"
24#include "pseudoheader.h"
26using StatePair = std::pair<const IR::BFN::ParserState *, const IR::BFN::ParserState *>;
40 const std::vector<const FieldSliceExtractInfo *> extract_infos;
44 std::vector<unsigned> can_start_indices_;
48 std::vector<unsigned> can_end_indices_;
54 std::map<const IR::BFN::ParserState *, bitvec> parser_state_to_checksum_bits;
55 std::set<const PHV::FieldSlice *> checksum_slices;
56 unsigned checksum_bits;
62 std::map<const IR::BFN::ParserState *, bitvec> parser_state_to_modified_bits;
63 std::set<const PHV::FieldSlice *> modified_slices;
64 unsigned modified_bits;
70 std::map<const IR::BFN::ParserState *, bitvec> parser_state_to_readonly_bits;
71 std::set<const PHV::FieldSlice *> readonly_slices;
72 unsigned readonly_bits;
78 std::map<const IR::BFN::ParserState *, bitvec> parser_state_to_unused_bits;
79 std::set<const PHV::FieldSlice *> unused_slices;
82 std::map<const IR::BFN::ParserState *, unsigned> parser_state_to_size_in_bits;
84 static unsigned nextId;
93 unsigned size_in_bits(
const IR::BFN::ParserState *parser_state)
const;
107 const std::vector<const FieldSliceExtractInfo *> &extract_infos,
122 const std::vector<const FieldSliceExtractInfo *> &extracts()
const;
151 std::string print()
const;
Definition clot_candidate.h:31
const ordered_map< const IR::BFN::ParserState *, unsigned > & state_bit_offsets() const
The state-relative offsets, in bits, of the first extract in the candidate.
Definition clot_candidate.cpp:120
ordered_set< const IR::BFN::ParserState * > states() const
The parser states containing this candidate's extracts.
Definition clot_candidate.cpp:114
const std::vector< unsigned > & can_start_indices() const
Definition clot_candidate.cpp:133
unsigned max_size_in_bits() const
The maximum length of the candidate, in bits.
Definition clot_candidate.cpp:24
gress_t thread() const
The pipe thread for the extracts in this candidate.
Definition clot_candidate.cpp:118
bool operator<(const ClotCandidate &other) const
Lexicographic order according to (number of unused bits, number of read-only bits,...
Definition clot_candidate.cpp:186
bool beforeAllocatedClot
Definition clot_candidate.h:104
bool afterAllocatedClot
Definition clot_candidate.h:99
const std::vector< unsigned > & can_end_indices() const
Definition clot_candidate.cpp:135
unsigned bit_in_byte_offset() const
The bit-in-byte offset of the first extract in the candidate.
Definition clot_candidate.cpp:125
unsigned size_in_bits(const IR::BFN::ParserState *parser_state) const
The length of the candidate for a given parser state, in bits.
Definition clot_candidate.cpp:36
const ClotCandidate * mark_adjacencies(bool afterAllocatedClot, bool beforeAllocatedClot) const
Definition clot_candidate.cpp:171
const std::map< unsigned, StatePairSet > byte_gaps(const CollectParserInfo &parserInfo, const ClotCandidate *other) const
Definition clot_candidate.cpp:137
Definition clot_info.h:41
Implements comparisons correctly.
Definition field_slice_set.h:25
Definition ordered_map.h:32
Definition ordered_set.h:32