Skip to content

Commit

Permalink
Fix counters attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dodd committed May 24, 2017
1 parent 8cf0913 commit b1da71f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backends/bmv2/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ ControlConverter::convertTable(const CFG::TableNode* node,
size = BMV2::TableAttributes::defaultTableSize;

result->emplace("max_size", size);
auto ctrs = table->properties->getProperty(BMV2::TableImplementation::directCounterName);
auto ctrs = table->properties->getProperty(BMV2::TableAttributes::countersName);
if (ctrs != nullptr) {
if (ctrs->value->is<IR::ExpressionValue>()) {
auto expr = ctrs->value->to<IR::ExpressionValue>()->expression;
Expand Down Expand Up @@ -471,7 +471,7 @@ ControlConverter::convertTable(const CFG::TableNode* node,
}
result->emplace("support_timeout", sup_to);

auto dm = table->properties->getProperty(BMV2::TableAttributes::directMeterName);
auto dm = table->properties->getProperty(BMV2::TableAttributes::metersName);
if (dm != nullptr) {
if (dm->value->is<IR::ExpressionValue>()) {
auto expr = dm->value->to<IR::ExpressionValue>()->expression;
Expand Down
3 changes: 2 additions & 1 deletion backends/bmv2/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const cstring MatchImplementation::rangeMatchTypeName = "range";
const cstring TableAttributes::implementationName = "implementation";
const cstring TableAttributes::sizeName = "size";
const cstring TableAttributes::supportTimeoutName = "supportTimeout";
const cstring TableAttributes::directMeterName = "meters";
const cstring TableAttributes::countersName = "counters";
const cstring TableAttributes::metersName = "meters";
const unsigned TableAttributes::defaultTableSize = 1024;
const cstring V1ModelProperties::jsonMetadataParameterName = "standard_metadata";

Expand Down
3 changes: 2 additions & 1 deletion backends/bmv2/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class TableAttributes {
static const cstring sizeName;
static const cstring supportTimeoutName;
static const unsigned defaultTableSize;
static const cstring directMeterName;
static const cstring countersName;
static const cstring metersName;
};

class V1ModelProperties {
Expand Down

0 comments on commit b1da71f

Please sign in to comment.