Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
Include.
  • Loading branch information
fruffy committed Jul 22, 2022
1 parent be5e978 commit 3b84874
Show file tree
Hide file tree
Showing 11 changed files with 276 additions and 225 deletions.
3 changes: 0 additions & 3 deletions backends/bmv2/common/addMissingIds.cpp

This file was deleted.

201 changes: 0 additions & 201 deletions backends/bmv2/common/addMissingIds.h

This file was deleted.

2 changes: 2 additions & 0 deletions backends/bmv2/simple_switch/midend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ limitations under the License.
#include "midend/midEndLast.h"
#include "midend/fillEnumMap.h"
#include "midend/removeAssertAssume.h"
#include "control-plane/addMissingIds.h"
#include "backends/bmv2/simple_switch/options.h"


Expand All @@ -71,6 +72,7 @@ SimpleSwitchMidEnd::SimpleSwitchMidEnd(CompilerOptions& options, std::ostream* o
if (BMV2::SimpleSwitchContext::get().options().loadIRFromJson == false) {
auto convertEnums = new P4::ConvertEnums(&refMap, &typeMap, new EnumOn32Bits("v1model.p4"));
addPasses({
new P4::AddMissingIdAnnotations(&refMap, &typeMap),
options.ndebug ? new P4::RemoveAssertAssume(&refMap, &typeMap) : nullptr,
new P4::CheckTableSize(),
new P4::RemoveMiss(&refMap, &typeMap),
Expand Down
7 changes: 0 additions & 7 deletions backends/bmv2/simple_switch/simpleSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ limitations under the License.
#include <algorithm>
#include <cstring>
#include <set>
#include "backends/bmv2/common/addMissingIds.h"
#include "backends/bmv2/common/annotations.h"
#include "frontends/p4/fromv1.0/v1model.h"
#include "frontends/p4/cloner.h"
#include "midend/flattenLogMsg.h"
#include "p4/toP4/toP4.h"
#include "simpleSwitch.h"
#include "backends/bmv2/simple_switch/options.h"

Expand Down Expand Up @@ -1224,11 +1222,6 @@ SimpleSwitchBackend::convert(const IR::ToplevelBlock* tlb) {
main->apply(*parseV1Arch);
program = toplevel->getProgram();

program = program->apply(
P4::BMV2::AddMissingIdAnnotations(refMap, typeMap, toplevel));
P4::ToP4 newEmitter;
program->apply(newEmitter);

program->apply(DiscoverStructure(structure));

/// generate error types
Expand Down
2 changes: 2 additions & 0 deletions control-plane/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ add_custom_command(OUTPUT ${P4RUNTIME_GEN_SRCS} ${P4RUNTIME_GEN_HDRS}
#PROTOBUF_GENERATE_PYTHON (P4RUNTIME_GEN_PYTHON P4RUNTIME_INFO_GEN_HDRS ${P4RUNTIME_INFO_PROTO})

set (CONTROLPLANE_SRCS
addMissingIds.cpp
bytestrings.cpp
flattenHeader.cpp
p4RuntimeArchHandler.cpp
Expand All @@ -86,6 +87,7 @@ set (CONTROLPLANE_SOURCES
)

set (CONTROLPLANE_HDRS
addMissingIds.h
bytestrings.h
flattenHeader.h
p4RuntimeArchHandler.h
Expand Down
Loading

0 comments on commit 3b84874

Please sign in to comment.