Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation test support for P4Smith #4791

Draft
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

zzmic
Copy link
Contributor

@zzmic zzmic commented Jul 9, 2024

This is a draft PR that aims to re-enable $COMPILER_BIN $TEST_DIR/out.p4 and test whether there is any generation or compilation error occurred while executing backends/p4tools/modules/smith/scripts/compilation-test.sh.

@zzmic zzmic force-pushed the compilation-test-support branch from b3cf81e to d34f60e Compare July 9, 2024 17:47
@zzmic zzmic changed the title Compilation test support Compilation test support for P4Smith Jul 9, 2024
@fruffy fruffy added the p4tools Topics related to the P4Tools back end label Jul 9, 2024
@zzmic zzmic force-pushed the compilation-test-support branch 3 times, most recently from d841ca5 to 21561a7 Compare July 11, 2024 01:48
@zzmic zzmic force-pushed the compilation-test-support branch 3 times, most recently from 3b29458 to 1423109 Compare July 14, 2024 05:33
@zzmic zzmic force-pushed the compilation-test-support branch 2 times, most recently from 0d4fbea to f778c51 Compare July 23, 2024 05:55
…programs with different seeds (to inspect the behavior of the generation and compilation process in a finer/smaller granularity)

Signed-off-by: zzmic <100326374 [email protected]>
…ion-test.sh back to the commit d34f60e, and switch the order of core and generic in backends/p4tools/modules/smith/targets/generic/test/P4Tests.cmake

Signed-off-by: zzmic <100326374 [email protected]>
…n generating the parameter list for the BMv2 portion of the fuzzer

Signed-off-by: zzmic <100326374 [email protected]>
avoid dumping too many generated files after the debugging process

Signed-off-by: zzmic <100326374 [email protected]>
…core, preliminarily override the virtual method in the BMv2 backend (still hasn't worked yet)

2. Get rid of  and expand the function signature of

Signed-off-by: zzmic <100326374 [email protected]>
zzmic added 19 commits July 24, 2024 23:45
Signed-off-by: zzmic <100326374 [email protected]>
Signed-off-by: zzmic <100326374 [email protected]>
Signed-off-by: zzmic <100326374 [email protected]>
Signed-off-by: zzmic <100326374 [email protected]>
…sts.cmake file instead of the bash script

Signed-off-by: zzmic <100326374 [email protected]>
Make further attempts to resolve type resolving

Signed-off-by: zzmic <100326374 [email protected]>
Signed-off-by: zzmic <100326374 [email protected]>
…t and return statements

Signed-off-by: zzmic <100326374 [email protected]>
backends/p4tools/modules/smith/common/expressions.cpp Outdated Show resolved Hide resolved
backends/p4tools/modules/smith/common/expressions.h Outdated Show resolved Hide resolved
backends/p4tools/modules/smith/common/expressions.cpp Outdated Show resolved Hide resolved
backends/p4tools/modules/smith/common/expressions.cpp Outdated Show resolved Hide resolved
backends/p4tools/modules/smith/common/scope.cpp Outdated Show resolved Hide resolved
backends/p4tools/modules/smith/common/scope.cpp Outdated Show resolved Hide resolved
@@ -20,7 20,7 @@ struct Requirements {
bool no_methodcalls{false};
bool not_zero{false};
bool not_negative{false};
bool byte_align_headers{false};
bool byte_align_headers{true};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be target-specific.
Use P4Scope::req.byte_align_headers = false;

backends/p4tools/modules/smith/common/scope.h Outdated Show resolved Hide resolved
@@ -188,6 188,10 @@ IR::Statement *StatementGenerator::genAssignmentStatement() {
removeLval(left, bitType);
}
right = target().expressionGenerator().genExpression(bitType);
if (left->toString().find("said")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.


# List of known bugs.
KNOWN_BUGS=(
"h.eth_hdr.src_addr \* 36646024123162; not implemented"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These error patterns are now too specific. Try to catch the most specific, generic error message. For example. "Div or Mux not implemented"

…b.com>

I, zzmic <100326374 [email protected]>, hereby add my Signed-off-by to this commit: d8d0fde
I, zzmic <100326374 [email protected]>, hereby add my Signed-off-by to this commit: 3e3b306
I, zzmic <100326374 [email protected]>, hereby add my Signed-off-by to this commit: 0df77ab

Signed-off-by: zzmic <100326374 [email protected]>
…ments than the default `genBitType`

Signed-off-by: zzmic <100326374 [email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants