Hi all,
I want to apply the init_val template to several attributes in my model to reset them by sreset template.
Attribute definition below can't be compiled by 166 base, any suggestions?
attribute attr1[10] is (uint64_attr, init_val) {
param init_val = 100;
}
init_valis a template meant to be applied on registers or fields, not generic attributes (in addition, for registers and fields the template is implicitly provided by the object template and there is no need to explicitly instantiate it)That said,
uint64_attrdoes provide you with an overrideableinit_valparameter as well, just disconnected from theinit_valtemplate. So in your case just removing theinit_valinstantiation should make the code compile.However, this will not be enough to tie the attributes into the soft reset mechanisms. The recommended way to do that would be to instantiate
soft_resettemplate in each attribute, and override thesoft_resetmethod and have it call intoinit. This should make the attributes re-run their init code (which, if you have not modified it, will set their values toinit_val).