8000 Extension to strength reduction for issue 5280 by ChrisDodd · Pull Request #5281 · p4lang/p4c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extension to strength reduction for issue 5280 #5281

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ using SmallStepUtil::stepAndExamineOp;

namespace {

/// Test the step function for v + e binary operation.
/// Test the step function for v - e binary operation.
TEST_F(Bmv2SmallStepTest, Binary01) {
const auto test = createBmv2V1modelSmallStepExprTest("bit<8> f;", "8w42 + hdr.h.f");
const auto test = createBmv2V1modelSmallStepExprTest("bit<8> f;", "8w42 - hdr.h.f");
ASSERT_TRUE(test);

const auto *opBin = extractExpr<IR::Operation_Binary>(test->getProgram());
ASSERT_TRUE(opBin);

// Step on the binary operation and examine the resulting continuation
// to include the rebuilt IR::Add node.
// to include the rebuilt IR::Sub node.
stepAndExamineOp(
opBin, opBin->right, test->getCompilerResult(),
[opBin](const IR::PathExpression *expr) { return new IR::Add(opBin->left, expr); });
[opBin](const IR::PathExpression *expr) { return new IR::Sub(opBin->left, expr); });
}

/// Test the step function for e + e binary operation.
Expand Down
23 changes: 23 additions & 0 deletions frontends/p4/strengthReduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const IR::Node *DoStrengthReduction::postorder(IR::BAnd *expr) {
if (isZero(expr->left)) return expr->left;
if (isZero(expr->right)) return expr->right;
if (expr->left->equiv(*expr->right)) return expr->left;
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

Expand All @@ -101,6 +102,7 @@ const IR::Node *DoStrengthReduction::postorder(IR::BOr *expr) {
new IR::BAnd(expr->srcInfo, expr->type, l->expr, r->expr));
if (hasSideEffects(expr)) return expr;
if (expr->left->equiv(*expr->right)) return expr->left;
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

Expand All @@ -122,6 +124,7 @@ const IR::Node *DoStrengthReduction::postorder(IR::BXor *expr) {
!expr->left->type->is<IR::Type_Unknown>())
// we assume that this type is right
return new IR::Constant(expr->srcInfo, expr->left->type, 0);
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

Expand Down Expand Up @@ -195,9 +198,28 @@ const IR::Node *DoStrengthReduction::postorder(IR::Sub *expr) {
return expr;
}

const IR::Node *DoStrengthReduction::postorder(IR::SubSat *expr) {
if (isZero(expr->right)) return expr->left;
if (hasSideEffects(expr)) return expr;
auto *type = expr->type->to<IR::Type::Bits>();
if (isZero(expr->left) && type && !type->isSigned) return expr->left;
if (expr->left->equiv(*expr->right) && expr->left->type &&
!expr->left->type->is<IR::Type_Unknown>())
return new IR::Constant(expr->srcInfo, expr->left->type, 0);
return expr;
}

const IR::Node *DoStrengthReduction::postorder(IR::Add *expr) {
if (isZero(expr->right)) return expr->left;
if (isZero(expr->left)) return expr->right;
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

const IR::Node *DoStrengthReduction::postorder(IR::AddSat *expr) {
if (isZero(expr->right)) return expr->left;
if (isZero(expr->left)) return expr->right;
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

Expand Down Expand Up @@ -252,6 +274,7 @@ const IR::Node *DoStrengthReduction::postorder(IR::Mul *expr) {
if (hasSideEffects(expr)) return expr;
if (isZero(expr->left)) return expr->left;
if (isZero(expr->right)) return expr->right;
if (expr->left->is<IR::Constant>()) std::swap(expr->left, expr->right);
return expr;
}

Expand Down
2 changes: 2 additions & 0 deletions frontends/p4/strengthReduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class DoStrengthReduction final : public Transform {
const IR::Node *postorder(IR::LOr *expr) override;
const IR::Node *postorder(IR::LNot *expr) override;
const IR::Node *postorder(IR::Sub *expr) override;
const IR::Node *postorder(IR::SubSat *expr) override;
const IR::Node *postorder(IR::Add *expr) override;
const IR::Node *postorder(IR::AddSat *expr) override;
const IR::Node *postorder(IR::UPlus *expr) override;
const IR::Node *postorder(IR::Shl *expr) override;
const IR::Node *postorder(IR::Shr *exp F438 r) override;
Expand Down
4 changes: 2 additions & 2 deletions testdata/p4_14_samples_outputs/TLV_parsing-first.p4
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t
@name(".format_options_timestamp") action format_options_timestamp() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_base.ihl = (bit<4>)(8w5 + (hdr.ipv4_option_timestamp.len >> 3));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 3) + 8w5);
}
@name(".format_options_both") action format_options_both() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_option_NOP.push_front(1);
hdr.ipv4_option_NOP[0].setValid();
hdr.ipv4_option_NOP[0].value = 8w0x1;
hdr.ipv4_base.ihl = (bit<4>)(8w8 + (hdr.ipv4_option_timestamp.len >> 2));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 2) + 8w8);
}
@name("._nop") action _nop() {
}
Expand Down
4 changes: 2 additions & 2 deletions testdata/p4_14_samples_outputs/TLV_parsing-frontend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t
@name(".format_options_timestamp") action format_options_timestamp() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_base.ihl = (bit<4>)(8w5 + (hdr.ipv4_option_timestamp.len >> 3));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 3) + 8w5);
}
@name(".format_options_both") action format_options_both() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_option_NOP.push_front(1);
hdr.ipv4_option_NOP[0].setValid();
hdr.ipv4_option_NOP[0].value = 8w0x1;
hdr.ipv4_base.ihl = (bit<4>)(8w8 + (hdr.ipv4_option_timestamp.len >> 2));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 2) + 8w8);
}
@name("._nop") action _nop() {
}
Expand Down
4 changes: 2 additions & 2 deletions testdata/p4_14_samples_outputs/TLV_parsing-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t
@name(".format_options_timestamp") action format_options_timestamp() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_base.ihl = (bit<4>)(8w5 + (hdr.ipv4_option_timestamp.len >> 3));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 3) + 8w5);
}
@name(".format_options_both") action format_options_both() {
hdr.ipv4_option_NOP.pop_front(3);
hdr.ipv4_option_EOL.pop_front(3);
hdr.ipv4_option_NOP.push_front(1);
hdr.ipv4_option_NOP[0].setValid();
hdr.ipv4_option_NOP[0].value = 8w0x1;
hdr.ipv4_base.ihl = (bit<4>)(8w8 + (hdr.ipv4_option_timestamp.len >> 2));
hdr.ipv4_base.ihl = (bit<4>)((hdr.ipv4_option_timestamp.len >> 2) + 8w8);
}
@name("._nop") action _nop() {
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/axon-first.p4
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout
packet.extract<axon_head_t>(hdr.axon_head);
meta.my_metadata.fwdHopCount = hdr.axon_head.fwdHopCount;
meta.my_metadata.revHopCount = hdr.axon_head.revHopCount;
meta.my_metadata.headerLen = (bit<16>)(8w2 + hdr.axon_head.fwdHopCount) + (bit<16>)hdr.axon_head.revHopCount;
meta.my_metadata.headerLen = (bit<16>)(hdr.axon_head.fwdHopCount + 8w2) + (bit<16>)hdr.axon_head.revHopCount;
transition select(hdr.axon_head.fwdHopCount) {
8w0: accept;
default: parse_next_fwdHop;
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/axon-frontend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout
packet.extract<axon_head_t>(hdr.axon_head);
meta.my_metadata.f BEA9 wdHopCount = hdr.axon_head.fwdHopCount;
meta.my_metadata.revHopCount = hdr.axon_head.revHopCount;
meta.my_metadata.headerLen = (bit<16>)(8w2 + hdr.axon_head.fwdHopCount) + (bit<16>)hdr.axon_head.revHopCount;
meta.my_metadata.headerLen = (bit<16>)(hdr.axon_head.fwdHopCount + 8w2) + (bit<16>)hdr.axon_head.revHopCount;
transition select(hdr.axon_head.fwdHopCount) {
8w0: accept;
default: parse_next_fwdHop;
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/axon-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout
packet.extract<axon_head_t>(hdr.axon_head);
meta._my_metadata_fwdHopCount0 = hdr.axon_head.fwdHopCount;
meta._my_metadata_revHopCount1 = hdr.axon_head.revHopCount;
meta._my_metadata_headerLen2 = (bit<16>)(8w2 + hdr.axon_head.fwdHopCount) + (bit<16>)hdr.axon_head.revHopCount;
meta._my_metadata_headerLen2 = (bit<16>)(hdr.axon_head.fwdHopCount + 8w2) + (bit<16>)hdr.axon_head.revHopCount;
transition select(hdr.axon_head.fwdHopCount) {
8w0: accept;
default: parse_next_fwdHop;
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/gateway6-first.p4
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_
default_action = NoAction();
}
apply {
if (8w1 == 8w15 & hdr.data.b2) {
if (8w1 == hdr.data.b2 & 8w15) {
test1.apply();
} else {
test2.apply();
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/gateway6-frontend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_
default_action = NoAction_2();
}
apply {
if (8w1 == 8w15 & hdr.data.b2) {
if (8w1 == hdr.data.b2 & 8w15) {
test1_0.apply();
} else {
test2_0.apply();
Expand Down
2 changes: 1 addition & 1 deletion testdata/p4_14_samples_outputs/gateway6-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_
default_action = NoAction_2();
}
apply {
if (8w1 == 8w15 & hdr.data.b2) {
if (8w1 == hdr.data.b2 & 8w15) {
test1_0.apply();
} else {
test2_0.apply();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ action push_vxlan_tunnel_u0(inout headers_t hdr, in EthernetAddress overlay_dmac
if (hdr.customer_ipv6.isValid()) {
customer_ip_len = customer_ip_len + 16w40 + hdr.customer_ipv6.payload_length;
}
hdr.u0_ipv4.total_len = 16w50 + customer_ip_len;
hdr.u0_ipv4.total_len = customer_ip_len + 16w50;
hdr.u0_ipv4.version = 4w4;
hdr.u0_ipv4.ihl = 4w5;
hdr.u0_ipv4.diffserv = 8w0;
Expand All @@ -359,7 +359,7 @@ action push_vxlan_tunnel_u0(inout headers_t hdr, in EthernetAddress overlay_dmac
hdr.u0_udp.setValid();
hdr.u0_udp.src_port = 16w0;
hdr.u0_udp.dst_port = 16w4789;
hdr.u0_udp.length = 16w30 + customer_ip_len;
hdr.u0_udp.length = customer_ip_len + 16w30;
hdr.u0_udp.checksum = 16w0;
hdr.u0_vxlan.setValid();
hdr.u0_vxlan.reserved = 24w0;
Expand All @@ -381,7 +381,7 @@ action push_vxlan_tunnel_u1(inout headers_t hdr, in EthernetAddress overlay_dmac
if (hdr.u0_ipv6.isValid()) {
u0_ip_len = u0_ip_len + 16w40 + hdr.u0_ipv6.payload_length;
}
hdr.u1_ipv4.total_len = 16w50 + u0_ip_len;
hdr.u1_ipv4.total_len = u0_ip_len + 16w50;
hdr.u1_ipv4.version = 4w4;
hdr.u1_ipv4.ihl = 4w5;
hdr.u1_ipv4.diffserv = 8w0;
Expand All @@ -396,7 +396,7 @@ action push_vxlan_tunnel_u1(inout headers_t hdr, in EthernetAddress overlay_dmac
hdr.u1_udp.setValid();
hdr.u1_udp.src_port = 16w0;
hdr.u1_udp.dst_port = 16w4789;
hdr.u1_udp.length = 16w30 + u0_ip_len;
hdr.u1_udp.length = u0_ip_len + 16w30;
hdr.u1_udp.checksum = 16w0;
hdr.u1_vxlan.setValid();
hdr.u1_vxlan.reserved = 24w0;
Expand All @@ -418,8 +418,8 @@ action push_nvgre_tunnel_u0(inout headers_t hdr, in EthernetAddress overlay_dmac
if (hdr.customer_ipv6.isValid()) {
customer_ip_len = customer_ip_len + 16w40 + hdr.customer_ipv6.payload_length;
}
hdr.u0_ipv4.total_len = 16w50 + customer_ip_len;
hdr.u0_ipv4.total_len = 16w42 + hdr.u0_ipv4.total_len;
hdr.u0_ipv4.total_len = customer_ip_len + 16w50;
hdr.u0_ipv4.total_len = hdr.u0_ipv4.total_len + 16w42;
hdr.u0_ipv4.version = 4w4;
hdr.u0_ipv4.ihl = 4w5;
hdr.u0_ipv4.diffserv = 8w0;
Expand Down Expand Up @@ -453,8 +453,8 @@ action push_nvgre_tunnel_u1(inout headers_t hdr, in EthernetAddress overlay_dmac
if (hdr.u0_ipv6.isValid()) {
u0_ip_len = u0_ip_len + 16w40 + hdr.u0_ipv6.payload_length;
}
hdr.u1_ipv4.total_len = 16w50 + u0_ip_len;
hdr.u1_ipv4.total_len = 16w42 + hdr.u1_ipv4.total_len;
hdr.u1_ipv4.total_len = u0_ip_len + 16w50;
hdr.u1_ipv4.total_len = hdr.u1_ipv4.total_len + 16w42;
hdr.u1_ipv4.version = 4w4;
hdr.u1_ipv4.ihl = 4w5;
hdr.u1_ipv4.diffserv = 8w0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_24.customer_ipv6.isValid()) {
customer_ip_len_0 = customer_ip_len_0 + 16w40 + hdr_24.customer_ipv6.payload_length;
}
hdr_24.u0_ipv4.total_len = 16w50 + customer_ip_len_0;
hdr_24.u0_ipv4.total_len = customer_ip_len_0 + 16w50;
hdr_24.u0_ipv4.version = 4w4;
hdr_24.u0_ipv4.ihl = 4w5;
hdr_24.u0_ipv4.diffserv = 8w0;
Expand All @@ -813,7 +813,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_24.u0_udp.setValid();
hdr_24.u0_udp.src_port = 16w0;
hdr_24.u0_udp.dst_port = 16w4789;
hdr_24.u0_udp.length = 16w30 + customer_ip_len_0;
hdr_24.u0_udp.length = customer_ip_len_0 + 16w30;
hdr_24.u0_udp.checksum = 16w0;
hdr_24.u0_vxlan.setValid();
hdr_24.u0_vxlan.reserved = 24w0;
Expand Down Expand Up @@ -843,7 +843,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_25.customer_ipv6.isValid()) {
customer_ip_len_3 = customer_ip_len_3 + 16w40 + hdr_25.customer_ipv6.payload_length;
}
hdr_25.u0_ipv4.total_len = 16w50 + customer_ip_len_3;
hdr_25.u0_ipv4.total_len = customer_ip_len_3 + 16w50;
hdr_25.u0_ipv4.version = 4w4;
hdr_25.u0_ipv4.ihl = 4w5;
hdr_25.u0_ipv4.diffserv = 8w0;
Expand All @@ -858,7 +858,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_25.u0_udp.setValid();
hdr_25.u0_udp.src_port = 16w0;
hdr_25.u0_udp.dst_port = 16w4789;
hdr_25.u0_udp.length = 16w30 + customer_ip_len_3;
hdr_25.u0_udp.length = customer_ip_len_3 + 16w30;
hdr_25.u0_udp.checksum = 16w0;
hdr_25.u0_vxlan.setValid();
hdr_25.u0_vxlan.reserved = 24w0;
Expand Down Expand Up @@ -888,7 +888,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_26.customer_ipv6.isValid()) {
customer_ip_len_4 = customer_ip_len_4 + 16w40 + hdr_26.customer_ipv6.payload_length;
}
hdr_26.u0_ipv4.total_len = 16w50 + customer_ip_len_4;
hdr_26.u0_ipv4.total_len = customer_ip_len_4 + 16w50;
hdr_26.u0_ipv4.version = 4w4;
hdr_26.u0_ipv4.ihl = 4w5;
hdr_26.u0_ipv4.diffserv = 8w0;
Expand All @@ -903,7 +903,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_26.u0_udp.setValid();
hdr_26.u0_udp.src_port = 16w0;
hdr_26.u0_udp.dst_port = 16w4789;
hdr_26.u0_udp.length = 16w30 + customer_ip_len_4;
hdr_26.u0_udp.length = customer_ip_len_4 + 16w30;
hdr_26.u0_udp.checksum = 16w0;
hdr_26.u0_vxlan.setValid();
hdr_26.u0_vxlan.reserved = 24w0;
Expand Down Expand Up @@ -933,7 +933,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_27.u0_ipv6.isValid()) {
u0_ip_len_0 = u0_ip_len_0 + 16w40 + hdr_27.u0_ipv6.payload_length;
}
hdr_27.u1_ipv4.total_len = 16w50 + u0_ip_len_0;
hdr_27.u1_ipv4.total_len = u0_ip_len_0 + 16w50;
hdr_27.u1_ipv4.version = 4w4;
hdr_27.u1_ipv4.ihl = 4w5;
hdr_27.u1_ipv4.diffserv = 8w0;
Expand All @@ -948,7 +948,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_27.u1_udp.setValid();
hdr_27.u1_udp.src_port = 16w0;
hdr_27.u1_udp.dst_port = 16w4789;
hdr_27.u1_udp.length = 16w30 + u0_ip_len_0;
hdr_27.u1_udp.length = u0_ip_len_0 + 16w30;
hdr_27.u1_udp.checksum = 16w0;
hdr_27.u1_vxlan.setValid();
hdr_27.u1_vxlan.reserved = 24w0;
Expand Down Expand Up @@ -978,7 +978,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_28.u0_ipv6.isValid()) {
u0_ip_len_3 = u0_ip_len_3 + 16w40 + hdr_28.u0_ipv6.payload_length;
}
hdr_28.u1_ipv4.total_len = 16w50 + u0_ip_len_3;
hdr_28.u1_ipv4.total_len = u0_ip_len_3 + 16w50;
hdr_28.u1_ipv4.version = 4w4;
hdr_28.u1_ipv4.ihl = 4w5;
hdr_28.u1_ipv4.diffserv = 8w0;
Expand All @@ -993,7 +993,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_28.u1_udp.setValid();
hdr_28.u1_udp.src_port = 16w0;
hdr_28.u1_udp.dst_port = 16w4789;
hdr_28.u1_udp.length = 16w30 + u0_ip_len_3;
hdr_28.u1_udp.length = u0_ip_len_3 + 16w30;
hdr_28.u1_udp.checksum = 16w0;
hdr_28.u1_vxlan.setValid();
hdr_28.u1_vxlan.reserved = 24w0;
Expand Down Expand Up @@ -1023,7 +1023,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
if (hdr_29.u0_ipv6.isValid()) {
u0_ip_len_4 = u0_ip_len_4 + 16w40 + hdr_29.u0_ipv6.payload_length;
}
hdr_29.u1_ipv4.total_len = 16w50 + u0_ip_len_4;
hdr_29.u1_ipv4.total_len = u0_ip_len_4 + 16w50;
hdr_29.u1_ipv4.version = 4w4;
hdr_29.u1_ipv4.ihl = 4w5;
hdr_29.u1_ipv4.diffserv = 8w0;
Expand All @@ -1038,7 +1038,7 @@ control dash_ingress(inout headers_t hdr, inout metadata_t meta, in pna_main_inp
hdr_29.u1_udp.setValid();
hdr_29.u1_udp.src_port = 16w0;
hdr_29.u1_udp.dst_port = 16w4789;
hdr_29.u1_udp.length = 16w30 + u0_ip_len_4;
hdr_29.u1_udp.length = u0_ip_len_4 + 16w30;
hdr_29.u1_udp.checksum = 16w0;
hdr_29.u1_vxlan.setValid();
hdr_29.u1_vxlan.reserved = 24w0;
Expand Down
Loading
Loading
0