P4C
The P4 Compiler
Loading...
Searching...
No Matches
parser_query.h
1
19#ifndef BF_P4C_PARDE_PARSER_QUERY_H_
20#define BF_P4C_PARDE_PARSER_QUERY_H_
21
22#include <ir/ir.h>
23
24#include "backends/tofino/bf-p4c/parde/parde_visitor.h"
25#include "backends/tofino/bf-p4c/parde/parser_info.h"
26#include "ir/pass_manager.h"
27
28class PhvInfo;
30
36 const CollectParserInfo &parser_info;
37 const MapFieldToParserStates &field_to_states;
38
40 bool same_const_source(const IR::BFN::ParserPrimitive *pp,
41 const IR::BFN::ParserPrimitive *qp) const;
42
48 const IR::BFN::Parser *parser, const IR::BFN::ParserPrimitive *p,
49 const IR::BFN::ParserState *ps, const IR::BFN::ParserPrimitive *q,
50 const IR::BFN::ParserState *qs = nullptr) const;
51
59 const IR::BFN::ParserPrimitive *p,
61
65
70
74
76 : parser_info(pi), field_to_states(fs) {}
77};
78
79#endif /*BF_P4C_PARDE_PARSER_QUERY_H_*/
Definition ordered_set.h:32
Definition phv.h:176
Definition phv_fields.h:1095
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
bool is_single_write(const ordered_set< const IR::BFN::ParserPrimitive * > &writes) const
Definition parser_query.cpp:88
bool is_before(const ordered_set< const IR::BFN::ParserPrimitive * > &writes, const IR::BFN::Parser *parser, const IR::BFN::ParserPrimitive *p, const IR::BFN::ParserState *ps, const IR::BFN::ParserPrimitive *q, const IR::BFN::ParserState *qs=nullptr) const
Definition parser_query.cpp:35
ordered_set< const IR::BFN::ParserPrimitive * > find_inits(const ordered_set< const IR::BFN::ParserPrimitive * > &writes) const
Definition parser_query.cpp:99
ordered_set< const IR::BFN::ParserPrimitive * > get_previous_writes(const IR::BFN::ParserPrimitive *p, const ordered_set< const IR::BFN::ParserPrimitive * > &writes) const
Definition parser_query.cpp:71
bool same_const_source(const IR::BFN::ParserPrimitive *pp, const IR::BFN::ParserPrimitive *qp) const
Do two extracts use the same constant value?
Definition parser_query.cpp:24