Parameter aliasing

131 views Asked by At

when implementing Origen::Parameters, I understood the importance of defining a 'default' set. But, in essence, my real default is named something different. So I implemented a hack of a parameter alias:

Origen.top_level.define_params :default do |params|
  params.tconds.override = 1
  params.tconds.override_lev_equ_set = 1
  params.tconds.override_lev_spec_set = 1
  params.tconds.override_levset = 1
  params.tconds.override_seqlbl = 'my_pattern'
  params.tconds.override_testf = 'tm_3'
  params.tconds.override_tim_spec_set = 'bist_xxMhz'
  params.tconds.override_timset = '1,1,1,1,1,1,1,1'
  params.tconds.site_control = 'parallel:'
  params.tconds.site_match = 2
end

Origen.top_level.define_params :cpu_mbist_hr, inherit: :default do |params|
 #  way of aliasing parameter names
end

Is there a proper method of parameter aliasing that is just not documented?

1

There are 1 answers

0
Ginty On

There is no other way to do this currently, though I would be open to a PR to enable something like:

default_params = :cpu_mbist_hr

If you don't want them to be called :default in this case though, then maybe you don't really want them to be the default anyway. e.g. adding this immediately after you define them would effectively give you an alternative default and would do pretty much the same job as the proposed API above:

# self is required here to help Ruby know that you are calling the params= API
# and not defining a local variable called params
self.params = :cpu_mbist_hr