I have four regmodels with names cp_0,cp_1,cp_2, and cp_3. While using the register models the code for all four is the same instead of doing repetitive work I wanted to use $sformatf in place of numerics
You want to implement a hierarchical path using $sformatf. A hierarchical path consists of instance/object names, but $sformatf creares string and not a name.
The RAL allows you to look up a register by name. While not as clean as accessing a register directly, it gives you the flexibility to use $sformatf() to get a register handle.