Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #667 #669

Merged
merged 1 commit into from
May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backends/bmv2/analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ limitations under the License.
#include "frontends/p4/methodInstance.h"
#include "frontends/p4/tableApply.h"

#include "lib/ordered_map.h"
#include "lib/ordered_set.h"

namespace BMV2 {

unsigned CFG::Node::crtId = 0;
Expand Down
8 changes: 4 additions & 4 deletions backends/bmv2/analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ class CFG final : public IHasDbPrint {
class ProgramParts {
public:
// map action to parent
std::map<const IR::P4Action*, const IR::P4Control*> actions;
ordered_map<const IR::P4Action*, const IR::P4Control*> actions;
// Maps each Parameter of an action to its positional index.
// Needed to generate code for actions.
std::map<const IR::Parameter*, unsigned> index;
ordered_map<const IR::Parameter*, unsigned> index;
// Parameters of controls/parsers
std::set<const IR::Parameter*> nonActionParameters;
ordered_set<const IR::Parameter*> nonActionParameters;
// for each action its json id
std::map<const IR::P4Action*, unsigned> ids;
ordered_map<const IR::P4Action*, unsigned> ids;
// All local variables
std::vector<const IR::Declaration_Variable*> variables;
// All the parsers
Expand Down
3 changes: 2 additions & 1 deletion backends/bmv2/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
#include "ir/ir.h"
#include "lib/cstring.h"
#include "lib/json.h"
#include "lib/ordered_map.h"
#include "analyzer.h"
#include "frontends/common/model.h"

Expand Down Expand Up @@ -56,7 +57,7 @@ class V1ModelProperties {
};

using ErrorValue = unsigned int;
using ErrorCodesMap = std::unordered_map<const IR::IDeclaration *, ErrorValue>;
using ErrorCodesMap = ordered_map<const IR::IDeclaration *, ErrorValue>;
using BlockTypeMap = std::map<const IR::Block*, const IR::Type*>;

Util::IJson* nodeName(const CFG::Node* node);
Expand Down