Add a static method for dumping hardware map and reuse it across the script reducing duplicated code. Fixes #21475 Signed-off-by: Anas Nashif <anas.nashif@intel.com>