p4lang / p4c-behavioral Goto Github PK
View Code? Open in Web Editor NEW[deprecated] P4 compiler for the behavioral model
License: Apache License 2.0
[deprecated] P4 compiler for the behavioral model
License: Apache License 2.0
Is there is a way to clear the register value automatically after a certain amount of time?
To reproduce go to p4factory/targets/l2_switch/ and run:
make clean
make -j2 bm-p4ofagent PLUGIN_OPENFLOW=1
As the title.
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.
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 {
}
modify_field action only work with type field and integer value but not with register.
how can I write a value to register or copy the register value to header field in this case?
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.