ucb-bar / hammer

Hammer: Highly Agile Masks Made Effortlessly from RTL
BSD 3-Clause "New" or "Revised" License
255 stars 59 forks source link

Ability to add the same hooks to all hierarchical modules #564

Open colinschmidt opened 4 years ago

colinschmidt commented 4 years ago

If my project needs to add hooks and is using a hierarchical flow I need to create a dictionary for all possible modules names. https://github.com/ucb-bar/hammer/blob/fcd92bd82b03f9128ab5fa51affc1fd198b674a1/src/hammer-vlsi/hammer_vlsi/cli_driver.py#L740 While the current scheme is powerful it doesn't allow me to specify hooks that should be added to all modules. Ideally a hybrid scheme would be best, perhaps using a dictionary entry like * to note which hooks should be applied to all modules.

harrisonliew commented 4 years ago

@colinschmidt - you could use get_extra_par_hooks for this.

However, doing this would also introduce a bug. If I have a level of hierarchy that needs to be not bound to the common par hooks, I can't override anymore.

colinschmidt commented 4 years ago

Yeah @harrisonliew, the bug you note is why I think we need some solution for this case of overridable defaults for hierarchical hooks.