19#ifndef BF_P4C_PARDE_CHECK_PARSER_MULTI_WRITE_H_
20#define BF_P4C_PARDE_CHECK_PARSER_MULTI_WRITE_H_
24#include "backends/tofino/bf-p4c/parde/parde_visitor.h"
25#include "backends/tofino/bf-p4c/parde/parser_info.h"
26#include "backends/tofino/bf-p4c/parde/parser_query.h"
27#include "ir/pass_manager.h"
53 std::map<const IR::BFN::ParserPrimitive *, IR::BFN::ParserWriteMode> extract_to_write_mode;
54 std::map<std::pair<PHV::FieldSlice, PHV::FieldSlice>,
bool> compatability;
59 bool check(
const std::vector<const IR::BFN::Extract *> extracts)
const;
98 profile_t init_apply(
const IR::Node *root)
override;
99 IR::Node *preorder(IR::BFN::Extract *extract)
override;
100 IR::Node *preorder(IR::BFN::ParserChecksumWritePrimitive *pcw)
override;
102 template <
typename T>
108 : phv(p), field_to_states(fs), pq(pi, fs) {}
Definition ir/pass_manager.h:40
Definition ordered_set.h:32
Definition phv_fields.h:898
Definition phv_fields.h:1095
Checks multiple writes to the same field on non-mutually exclusive paths.
Definition check_parser_multi_write.h:36
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition check_parser_multi_write.h:47
bool check_compatability(const PHV::FieldSlice &slice_a, const PHV::FieldSlice &slice_b)
Definition check_parser_multi_write.cpp:899
bool check(const std::vector< const IR::BFN::Extract * > extracts) const
Check that the write modes of all extracts are consistent.
Definition check_parser_multi_write.cpp:601
void check_pre_alloc(const ordered_set< const IR::BFN::ParserPrimitive * > &state_writes)
Definition check_parser_multi_write.cpp:793
void check_and_adjust(const std::vector< const IR::BFN::Extract * > extracts)
Check and adjust the write modes of all extracts to be consistent.
Definition check_parser_multi_write.cpp:675
void check_post_alloc()
Verify/unify parser write mode consistency post PHV allocation.
Definition check_parser_multi_write.cpp:822
Map field to the parser states in which they are extracted or assigned from checksums.
Definition phv_fields.h:1755
Collection of functions to check parser information.
Definition parser_query.h:35