There is a python file named BasePlat.py which contain something like this:
class BasePlatform(SimObj):
type = 'BasePlatform'
size = Param.Int(100, "Number of entries")
class Type1(BasePlatform):
type = 'Type1'
cxx_class = 'Type1'
Now this file is used in another file named BaseModel.py
from BasePlat import BasePlatform
class BaseModel(ModelObj):
type = 'BaseModel'
delay = Param.Int(50, "delay")
platform = Param.BasePlatform(NULL, "platform")
These file define the parameters. In another file inst.py, some models are instantiated and I can modify the parameters. For example I can define two models with different delays.
class ModelNumber1(BaseModel):
delay = 10
class ModelNumber2(BaseModel):
delay = 15
However I don't know how can I reach size parameter in BasePlatform. I want something like this (this is not a true code):
class ModelNumber1(BaseModel):
delay = 10
platform = Type1
**platform.size = 5**
class ModelNumber2(BaseModel):
delay = 15
platform = Type1
**platform.size = 8**
How can I do that?
BasePlat.pyandBaseModel.pytobaseplat.pyandbasemodel.py