-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[P4Testgen] Clean up the implementation of the BMv2 clone externs. (#…
…3976) * Clean up the implementation of the BMv2 clone implementation. Use explicit info objects to maintain state. * A different clone id is not needed. Instead, we should fix PI. * Update the session ID maximum. * Merge fixes.
- Loading branch information
Showing
30 changed files
with
742 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_ | ||
#define BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_ | ||
#include <map> | ||
|
||
#include "backends/p4tools/common/lib/model.h" | ||
#include "lib/castable.h" | ||
#include "lib/cstring.h" | ||
|
||
namespace P4Tools::P4Testgen { | ||
|
||
/* ========================================================================================= | ||
* Abstract Test Object Class | ||
* ========================================================================================= */ | ||
|
||
class TestObject : public ICastable { | ||
public: | ||
TestObject() = default; | ||
~TestObject() override = default; | ||
TestObject(const TestObject &) = default; | ||
TestObject(TestObject &&) = default; | ||
TestObject &operator=(const TestObject &) = default; | ||
TestObject &operator=(TestObject &&) = default; | ||
|
||
/// @returns the string name of this particular test object. | ||
[[nodiscard]] virtual cstring getObjectName() const = 0; | ||
|
||
/// @returns a version of the test object where all expressions are resolved and symbolic | ||
/// variables are substituted according to the mapping present in the @param model. | ||
[[nodiscard]] virtual const TestObject *evaluate(const Model &model) const = 0; | ||
}; | ||
|
||
/// A map of test objects. | ||
using TestObjectMap = ordered_map<cstring, const TestObject *>; | ||
|
||
} // namespace P4Tools::P4Testgen | ||
|
||
#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.