From 0b4df5850d3022f56f0c416d29291dd70e6280fb Mon Sep 17 00:00:00 2001 From: Adarsh Date: Thu, 29 Aug 2024 00:24:47 +0530 Subject: [PATCH] Fix broken output text in Code Snippets Signed-off-by: Adarsh --- backends/dpdk/README.md | 2 +- backends/p4tools/modules/testgen/README.md | 4 ++-- docs/CodingStandardPhilosophy.md | 2 +- docs/IR.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backends/dpdk/README.md b/backends/dpdk/README.md index 26a7858f4f2..df47204a944 100644 --- a/backends/dpdk/README.md +++ b/backends/dpdk/README.md @@ -68,7 +68,7 @@ To load the 'spec' file in dpdk follow the instructions in the - Currently, programs written for DPDK target should limit the functionality in Ingress blocks, in case non empty Egress blocks are present it will be ignored by default unless Hidden temporary option `--enableEgress` used. When egress block support gets added to the DPDK target, and compiler can generate separate spec file for non empty ingress and egress blocks then option `--enableEgress` will be removed. - DPDK architecture assumes the following signatures for programmable block of PSA. P4C-DPDK converts the input program to this form. -```P4 +``` P4 parser IngressParser (packet_in buffer, out H parsed_hdr, inout M user_meta); control Ingress (inout H hdr, inout M user_meta); diff --git a/backends/p4tools/modules/testgen/README.md b/backends/p4tools/modules/testgen/README.md index 2c7390abb5c..339427bdb96 100644 --- a/backends/p4tools/modules/testgen/README.md +++ b/backends/p4tools/modules/testgen/README.md @@ -114,7 +114,7 @@ P4Testgen supports the use of custom externs to restrict the breadth of possible #### Restricted Tests `testgen_assume(expr)` will add `expr` as a necessary path constraints to all subsequent execution. For example, for the following snippet -```p4 +``` P4 state parse_ethernet { packet.extract(headers.ethernet); testgen_assume(headers.ethernet.ether_type == 0x800); @@ -130,7 +130,7 @@ only inputs which have `0x800` as Ethertype will be generated. This mode is enab #### Finding Assertion Violations Conversely, `testgen_assert(expr)` can be used to find violations in a particular P4 program. By default, `testgen_assert` behaves like `testgen_assume`. If the flag `--assertion-mode` is enabled, P4Testgen will only generate tests that will cause `expr` to be false and, hence, violate the assertion. For example, for -```p4 +``` P4 state parse_ethernet { packet.extract(headers.ethernet); transition select(headers.ethernet.ether_type) { diff --git a/docs/CodingStandardPhilosophy.md b/docs/CodingStandardPhilosophy.md index 4c2562a0f24..95fe83f9c8d 100644 --- a/docs/CodingStandardPhilosophy.md +++ b/docs/CodingStandardPhilosophy.md @@ -138,7 +138,7 @@ the `boost::format` for the format argument, which has some compatibility for `printf` arguments. These functions handle IR and SourceInfo objects smartly. Here is an example: -```C++ +``` C++ IR::NamedRef *ref; error(ErrorType::ERR_INVALID, "%1%: No header or metadata named '%2%'", ref->srcInfo, ref->name); diff --git a/docs/IR.md b/docs/IR.md index c83dc2b94c7..571e4bd8271 100644 --- a/docs/IR.md +++ b/docs/IR.md @@ -72,7 +72,7 @@ IR tree and accumulates information about the tree but does not modify it, while a Transform pass visits every node, possibly modifying the node or replacing it with some other node -```C++ +``` C++ /* pseudo-code for basic Transform visitor */ visit(node, context=ROOT, visited={}) { if (node in visited) { @@ -152,7 +152,7 @@ As an example for how these are used in the IR visitor routines, the IR::If clas three children to visit -- a predicate and two consequents, with the value of the predicate deciding which consequent to execute. The child visitor for `IR::If` is -```C++ +``` C++ visitor.visit(predicate); clone = visitor.flow_clone(); visitor.visit(ifTrue);