init_val
is 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_attr
does provide you with an overrideable init_val
parameter as well, just disconnected from the init_val
template. So in your case just removing the init_val
instantiation 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_reset
template in each attribute, and override the soft_reset
method and have it call into init
. This should make the attributes re-run their init code (which, if you have not modified it, will set their values to init_val
).