V93k test method parameter names with forbidden Ruby characters

71 views Asked by At

The custom V93K test methods we use have parameter names that have characters that are forbidden in Ruby. For example:

testmethodparameters

tm_1:
  "ComponentRule.ComponentRuleNameVariable" = "ComponentRuleMinConfig";
  "ComponentRule.ExecuteRules" = "true";
  "ComponentRule.RuleGroupNameVariable" = "ComponentRuleGroupName";
  "ComponentRule.ScriptNameVariable" = "ComponentRuleScriptName";
  "Softset.NumberOfPatternInfo" = "1";
  "Softset.PatternInfo0.EdgesPerVector" = "2";

When looking at the Origen V93k docs, I see that Origen will convert a Ruby styled variable to the camel case required by the V93k, but would it handle a variable with an actual period in it? I am storing them using the Origen::Parameters::Set class like so, but to retrieve the correct parameter name, I would have to write some 'parameter name flattener' method.

params.bist.Softset.PatternInfo0.EdgesPerVector = "2"
params.bist.Softset.PatternInfo0.FuseProgramming = "false"

Before I write said method, does Origen already have a way to handle this case already that is not part of the docs? If not, would a PR be well received?

thx

1

There are 1 answers

1
Ginty On

It would handle a period in the C++ parameter name, the example here contains a parameter called 'An.UnusualName'.

When you supply the parameter name via a string like this then it is rendered verbatim into the test flow:

tm_1:
  "An.UnusualName" = "blah"

To assign a value to this in an interface though then you need to convert the period to an underscore, Origen will create both the fully lower-cased and underscored accessor and also one with only the periods converted to underscores:

t = test_methods.my_lib.my_test
t.an_unusual_name = "blah"
t.An_UnusualName                # => "blah"

It would add significant complication to generate filler objects on the fly to support t.An.UnusualName = "blah" and I don't think it is worth it - the existing API is fine for humans.

I can see that supporting the name with the period might be preferable for scripting though. An easier approach that would provide what is needed would be to add a set_param method or similar to this class:

t.set_param("An.UnusualName", "blah")