Skip to content

Commit

Permalink
add control-plane sources and module (#451)
Browse files Browse the repository at this point in the history
* add control-plane sources and module

and fixes a few other minor issues
- add license file
- disable PDF/Latex in the config
- add dependencies to build ir/ir-generated.h

* exclude control-plane/PI
  • Loading branch information
Calin Cascaval authored Apr 7, 2017
1 parent 264df65 commit d3e02a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ mostlyclean-local:
-$(RM) -r $(DX_CLEANFILES)

# easier to remember rule for making the documentation
docs: $(DOXY_SOURCES)
# also depends on the ir-generated.h (part of BUILT_SOURCES)
# and force rebuilding documentation when sources change
docs: $(BUILT_SOURCES) $(DOXY_SOURCES)
@$(MAKE) doxygen-doc
else
docs:
Expand Down
15 changes: 11 additions & 4 deletions control-plane/p4RuntimeSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ limitations under the License.
#include "p4RuntimeSerializer.h"

namespace P4 {

/** \defgroup control_plane Control Plane API Generation */
/** \addtogroup control_plane
* @{
*/
/// XXX(seth) High level goals of the generator go here!!
namespace ControlPlaneAPI {

// XXX(seth): Here are the known issues:
Expand Down Expand Up @@ -103,7 +109,7 @@ struct HeaderFieldPath {
* invalid or too complex.
*/
static HeaderFieldPath* from(const IR::Expression* expression,
const ReferenceMap* refMap,
const ReferenceMap* refMap,
const TypeMap* typeMap) {
auto type = typeMap->getType(expression->getNode(), true);
if (expression->is<IR::PathExpression>()) {
Expand Down Expand Up @@ -245,7 +251,7 @@ static int64_t getTableSize(const IR::P4Table* table) {

auto sizeProperty = table->properties->getProperty("size");
if (sizeProperty == nullptr) {
return defaultTableSize;
return defaultTableSize;
}

if (!sizeProperty->value->is<IR::ExpressionValue>()) {
Expand Down Expand Up @@ -304,7 +310,7 @@ struct Counterlike {
/// The name of the instance.
const cstring name;
/// If non-null, the instance's annotations.
const IR::IAnnotated* annotations;
const IR::IAnnotated* annotations;
/// The units parameter to the instance; valid values vary depending on @Kind.
const cstring unit;
/// The size parameter to the instance.
Expand Down Expand Up @@ -520,7 +526,7 @@ struct P4SymbolSuffixSet {
// How many suffixes pass through this node? This includes suffixes that
// terminate at this node.
unsigned instances = 0;

// Outgoing edges from this node. The SuffixNode should never be null.
std::map<cstring, SuffixNode*> edges;
};
Expand Down Expand Up @@ -1512,4 +1518,5 @@ void serializeP4Runtime(std::ostream* destination,
}
}

/** @} *//* end group control_plane */
} // namespace P4
9 changes: 6 additions & 3 deletions docs/doxygen/doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -745,15 +745,17 @@ WARN_LOGFILE = p4c-doxygen-warn.log

# include first the Markdown documentation in docs and then the code
INPUT = $(SRCDIR)/docs/doxygen \
$(SRCDIR)/LICENSE.md \
$(SRCDIR)/docs/README.md \
$(SRCDIR)/docs/IR.md \
$(SRCDIR)/ir \
ir/ir-generated.h \
$(SRCDIR)/frontends \
$(SRCDIR)/midend \
$(SRCDIR)/backends \
$(SRCDIR)/lib \
$(SRCDIR)/extensions \
ir/ir-generated.h
$(SRCDIR)/control-plane


# This tag can be used to specify the character encoding of the source files
Expand Down Expand Up @@ -791,7 +793,8 @@ RECURSIVE = YES

EXCLUDE = $(SRCDIR)/frontends/p4/README.md \
$(SRCDIR)/midend/README.md \
$(SRCDIR)/extensions/p4_tests
$(SRCDIR)/extensions/p4_tests \
$(SRCDIR)/control-plane/PI

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down Expand Up @@ -1553,7 +1556,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.

GENERATE_LATEX = YES
GENERATE_LATEX = NO

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down

0 comments on commit d3e02a2

Please sign in to comment.