@@ -22,11 +22,11 @@ limitations under the License.
2222#include " controlFlowGraph.h"
2323#include " expression.h"
2424#include " frontends/common/model.h"
25+ #include " frontends/p4-14/fromv1.0/v1model.h"
2526#include " ir/ir.h"
2627#include " lib/cstring.h"
2728#include " lib/json.h"
2829#include " lib/ordered_map.h"
29- #include " frontends/p4-14/fromv1.0/v1model.h"
3030
3131namespace P4 ::BMV2 {
3232
@@ -90,9 +90,9 @@ template <>
9090struct ActionProfileTraits <Arch::V1MODEL> {
9191 static const cstring name () { return " action profile" _cs; }
9292 static const cstring propertyName () {
93- return P4V1::V1Model::instance.tableAttributes .tableImplementation .name ;
93+ return P4V1::V1Model::instance () .tableAttributes .tableImplementation .name ;
9494 }
95- static const cstring typeName () { return P4V1::V1Model::instance.action_profile .name ; }
95+ static const cstring typeName () { return P4V1::V1Model::instance () .action_profile .name ; }
9696 static const cstring sizeParamName () { return " size" _cs; }
9797};
9898
@@ -118,7 +118,7 @@ struct ActionSelectorTraits;
118118template <>
119119struct ActionSelectorTraits <Arch::V1MODEL> : public ActionProfileTraits<Arch::V1MODEL> {
120120 static const cstring name () { return " action selector" _cs; }
121- static const cstring typeName () { return P4V1::V1Model::instance.action_selector .name ; }
121+ static const cstring typeName () { return P4V1::V1Model::instance () .action_selector .name ; }
122122};
123123
124124template <>
@@ -140,7 +140,7 @@ struct RegisterTraits;
140140template <>
141141struct RegisterTraits <Arch::V1MODEL> {
142142 static const cstring name () { return " register" _cs; }
143- static const cstring typeName () { return P4V1::V1Model::instance.registers .name ; }
143+ static const cstring typeName () { return P4V1::V1Model::instance () .registers .name ; }
144144 static const cstring sizeParamName () { return " size" _cs; }
145145 // / the index of the type parameter for the data stored in the register, in
146146 // / the type parameter list of the extern type declaration.
@@ -198,10 +198,10 @@ template <>
198198struct CounterlikeTraits <Standard::CounterExtern<Standard::Arch::V1MODEL>> {
199199 static const cstring name () { return " counter" _cs; }
200200 static const cstring directPropertyName () {
201- return P4V1::V1Model::instance.tableAttributes .counters .name ;
201+ return P4V1::V1Model::instance () .tableAttributes .counters .name ;
202202 }
203- static const cstring typeName () { return P4V1::V1Model::instance.counter .name ; }
204- static const cstring directTypeName () { return P4V1::V1Model::instance.directCounter .name ; }
203+ static const cstring typeName () { return P4V1::V1Model::instance () .counter .name ; }
204+ static const cstring directTypeName () { return P4V1::V1Model::instance () .directCounter .name ; }
205205 static const cstring sizeParamName () { return " size" _cs; }
206206 static std::optional<size_t > indexTypeParamIdx () { return std::nullopt ; }
207207};
@@ -210,10 +210,10 @@ template <>
210210struct CounterlikeTraits <Standard::CounterExtern<Standard::Arch::V1MODEL2020>> {
211211 static const cstring name () { return " counter" _cs; }
212212 static const cstring directPropertyName () {
213- return P4V1::V1Model::instance.tableAttributes .counters .name ;
213+ return P4V1::V1Model::instance () .tableAttributes .counters .name ;
214214 }
215- static const cstring typeName () { return P4V1::V1Model::instance.counter .name ; }
216- static const cstring directTypeName () { return P4V1::V1Model::instance.directCounter .name ; }
215+ static const cstring typeName () { return P4V1::V1Model::instance () .counter .name ; }
216+ static const cstring directTypeName () { return P4V1::V1Model::instance () .directCounter .name ; }
217217 static const cstring sizeParamName () { return " size" _cs; }
218218 static std::optional<size_t > indexTypeParamIdx () { return 0 ; }
219219};
@@ -243,10 +243,10 @@ template <>
243243struct CounterlikeTraits <Standard::MeterExtern<Standard::Arch::V1MODEL>> {
244244 static const cstring name () { return " meter" _cs; }
245245 static const cstring directPropertyName () {
246- return P4V1::V1Model::instance.tableAttributes .meters .name ;
246+ return P4V1::V1Model::instance () .tableAttributes .meters .name ;
247247 }
248- static const cstring typeName () { return P4V1::V1Model::instance.meter .name ; }
249- static const cstring directTypeName () { return P4V1::V1Model::instance.directMeter .name ; }
248+ static const cstring typeName () { return P4V1::V1Model::instance () .meter .name ; }
249+ static const cstring directTypeName () { return P4V1::V1Model::instance () .directMeter .name ; }
250250 static const cstring sizeParamName () { return " size" _cs; }
251251 static std::optional<size_t > indexTypeParamIdx () { return std::nullopt ; }
252252};
@@ -255,10 +255,10 @@ template <>
255255struct CounterlikeTraits <Standard::MeterExtern<Standard::Arch::V1MODEL2020>> {
256256 static const cstring name () { return " meter" _cs; }
257257 static const cstring directPropertyName () {
258- return P4V1::V1Model::instance.tableAttributes .meters .name ;
258+ return P4V1::V1Model::instance () .tableAttributes .meters .name ;
259259 }
260- static const cstring typeName () { return P4V1::V1Model::instance.meter .name ; }
261- static const cstring directTypeName () { return P4V1::V1Model::instance.directMeter .name ; }
260+ static const cstring typeName () { return P4V1::V1Model::instance () .meter .name ; }
261+ static const cstring directTypeName () { return P4V1::V1Model::instance () .directMeter .name ; }
262262 static const cstring sizeParamName () { return " size" _cs; }
263263 static std::optional<size_t > indexTypeParamIdx () { return 0 ; }
264264};
0 commit comments