Giter Site home page Giter Site logo

p4c-behavioral's Issues

egress_spec documentation

The P4 spec says the standard_metadata.egress_spec field is target specific. So it seems that the behavioral target should specify how to write to this field in order to accomplish various tasks, such as forwarding to a specific port or to a subset of ports.

Need to #include <iostream>

I am running Arch Linux distro and have installed dependencies manually. When compiling,

p4factory/targets/basic_routing/build//bm/src/p4_pd_rpc_server.cpp:1073:7: error:  cerr’ is not a member of ‘std’
       std::cerr << "In rmt_log_level_get\n";
       ^

The following patch resolves:

diff --git a/p4c_bm/templates/src/p4_pd_rpc_server.cpp b/p4c_bm/templates/src/p4_pd_rpc_server.cpp
index 65dd034..4ecb6bd 100644
--- a/p4c_bm/templates/src/p4_pd_rpc_server.cpp
+++ b/p4c_bm/templates/src/p4_pd_rpc_server.cpp
@@ -6,6 +6,7 @@

 #include "${p4_prefix}.h"
 #include <stdlib.h>
+#include <iostream>
 #include "p4_sim/p4_pd_rpc_server.h"
 #include <thrift/protocol/TBinaryProtocol.h>
 #include <thrift/server/TSimpleServer.h>

p4factory builds thrift 0.9.1 from source. I have 0.9.2-3 installed via Arch repository. One thought is that an include iostream was removed in this later thrift version.

Table without match fields

The specification says that the only mandatory field for a table definition is the actions field. However, if the the reads part is is not included (like in the table specification below), the generated cli will not be able to list it or perform any action on it (e.g. set_default_action), as the Thrift template ignores these tables.

An example table:

table forward {
    actions {
        _drop;
    }
}

If this is a bug, I have a solution to fix this by altering the p4_pd_rpc.thrift template to create an empty struct like below for the tables without match fields. This would then generate a client that can list and work with these tables.

struct gossip4_forward_match_spec_t {
}

Register value timeout

Is there is a way to clear the register value automatically after a certain amount of time?

Variable length fields

As far as I can tell, the behavioral model seems to miss support for variable length fields. From a quick look at the source code it looks like adding this would mean moving some stuff around. Is anyone working on adding this, or is this a lower priority thing?

In general it would be useful to outline what's missing somewhere, e.g. in the README.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.