Skip to content

Commit

Permalink
Correct parameter names.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Jun 22, 2023
1 parent 0d1ad79 commit 3d158dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const IR::Expression *Bmv2V1ModelTableStepper::computeTargetMatchType(
const auto *ctrlPlaneKey = ToolsVariables::getSymbolicVariable(keyExpr->type, keyName);
// We can recover from taint by simply not adding the optional match.
// Create a new symbolic variable that corresponds to the key expression.
cstring maskName = properties.tableName + "_mask_" + keyProperties.name;
const IR::Expression *ternaryMask = nullptr;
// We can recover from taint by inserting a ternary match that is 0.
const auto *wildCard = IR::getConstant(keyExpr->type, 0);
Expand All @@ -56,6 +55,7 @@ const IR::Expression *Bmv2V1ModelTableStepper::computeTargetMatchType(
new Ternary(keyProperties.key, ctrlPlaneKey, wildCard));
return hitCondition;
}
cstring maskName = properties.tableName + "_mask_" + keyProperties.name;
const auto *fullMatch = IR::getMaxValueConstant(keyExpr->type);
ternaryMask = ToolsVariables::getSymbolicVariable(keyExpr->type, maskName);
auto *maskCond =
Expand Down Expand Up @@ -126,8 +126,7 @@ void Bmv2V1ModelTableStepper::evalTableActionProfile(
// Synthesize a symbolic variable here that corresponds to a control plane argument.
// We get the unique name of the table coupled with the unique name of the action.
// Getting the unique name is needed to avoid generating duplicate arguments.
cstring keyName =
properties.tableName + "_param_" + actionName + std::to_string(argIdx);
cstring keyName = properties.tableName + "_arg_" + actionName + std::to_string(argIdx);
const auto &actionArg = ToolsVariables::getSymbolicVariable(parameter->type, keyName);
arguments->push_back(new IR::Argument(actionArg));
// We also track the argument we synthesize for the control plane.
Expand Down Expand Up @@ -213,8 +212,7 @@ void Bmv2V1ModelTableStepper::evalTableActionSelector(
// Synthesize a symbolic variable here that corresponds to a control plane argument.
// We get the unique name of the table coupled with the unique name of the action.
// Getting the unique name is needed to avoid generating duplicate arguments.
cstring keyName =
properties.tableName + "_param_" + actionName + std::to_string(argIdx);
cstring keyName = properties.tableName + "_arg_" + actionName + std::to_string(argIdx);
const auto &actionArg = ToolsVariables::getSymbolicVariable(parameter->type, keyName);
arguments->push_back(new IR::Argument(actionArg));
// We also track the argument we synthesize for the control plane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ void SharedPnaTableStepper::evalTableActionProfile(
// Synthesize a symbolic variable here that corresponds to a control plane argument.
// We get the unique name of the table coupled with the unique name of the action.
// Getting the unique name is needed to avoid generating duplicate arguments.
cstring keyName =
properties.tableName + "_param_" + actionName + std::to_string(argIdx);
cstring keyName = properties.tableName + "_arg_" + actionName + std::to_string(argIdx);
const auto &actionArg = ToolsVariables::getSymbolicVariable(parameter->type, keyName);
arguments->push_back(new IR::Argument(actionArg));
// We also track the argument we synthesize for the control plane.
Expand Down Expand Up @@ -204,8 +203,7 @@ void SharedPnaTableStepper::evalTableActionSelector(
// Synthesize a symbolic variable here that corresponds to a control plane argument.
// We get the unique name of the table coupled with the unique name of the action.
// Getting the unique name is needed to avoid generating duplicate arguments.
cstring keyName =
properties.tableName + "_param_" + actionName + std::to_string(argIdx);
cstring keyName = properties.tableName + "_arg_" + actionName + std::to_string(argIdx);
const auto &actionArg = ToolsVariables::getSymbolicVariable(parameter->type, keyName);
arguments->push_back(new IR::Argument(actionArg));
// We also track the argument we synthesize for the control plane.
Expand Down

0 comments on commit 3d158dc

Please sign in to comment.