Fix extra signature file path in pel parsing

Change-Id: Ia73a1e6ca066d5af9417313a34c744ab0e125f9a
Signed-off-by: Caleb Palmer <cnpalmer@us.ibm.com>
diff --git a/chip_data/p10_10/node_eq_core_fir.json b/chip_data/p10_10/node_eq_core_fir.json
index e3f32f9..a3e2ad8 100644
--- a/chip_data/p10_10/node_eq_core_fir.json
+++ b/chip_data/p10_10/node_eq_core_fir.json
@@ -385,7 +385,7 @@
                     "desc": "PC system checkstop - Recoverable error received when recovery disabled"
                 },
                 "29": {
-                    "desc": "LSU SRAM recoverable error (DCACHE parity error, ERAT parity error, etc)"
+                    "desc": "LSU SRAM recoverable error (DCACHE or ERAT PE,etc)"
                 },
                 "30": {
                     "desc": "LSU set deleted"
diff --git a/chip_data/p10_20/node_eq_core_fir.json b/chip_data/p10_20/node_eq_core_fir.json
index 8cc042b..52e683e 100644
--- a/chip_data/p10_20/node_eq_core_fir.json
+++ b/chip_data/p10_20/node_eq_core_fir.json
@@ -394,7 +394,7 @@
                     "desc": "PC system checkstop - Recoverable error received when recovery disabled"
                 },
                 "29": {
-                    "desc": "LSU SRAM recoverable error (DCACHE parity error, ERAT parity error, etc)"
+                    "desc": "LSU SRAM recoverable error (DCACHE or ERAT PE,etc)"
                 },
                 "30": {
                     "desc": "LSU set deleted"
diff --git a/chip_data/p10_20/regs_mc.json b/chip_data/p10_20/regs_mc.json
index fdba2ea..213ce47 100644
--- a/chip_data/p10_20/regs_mc.json
+++ b/chip_data/p10_20/regs_mc.json
@@ -286,6 +286,18 @@
                 "7": "0x0F010D4E"
             }
         },
+        "MC_DSTL_STATUS": {
+            "instances": {
+                "0": "0x0C010D10",
+                "1": "0x0C010D50",
+                "2": "0x0D010D10",
+                "3": "0x0D010D50",
+                "4": "0x0E010D10",
+                "5": "0x0E010D50",
+                "6": "0x0F010D10",
+                "7": "0x0F010D50"
+            }
+        },
         "MC_ERR_RPT0": {
             "instances": {
                 "0": "0x0C010C1E",
@@ -770,6 +782,19 @@
                     "6": 6,
                     "7": 7
                 }
+            },
+            {
+                "reg_name": "MC_DSTL_STATUS",
+                "reg_inst": {
+                    "0": 0,
+                    "1": 1,
+                    "2": 2,
+                    "3": 3,
+                    "4": 4,
+                    "5": 5,
+                    "6": 6,
+                    "7": 7
+                }
             }
         ],
         "MC_FIR": [
diff --git a/chip_data/parse_chip_data.py b/chip_data/parse_chip_data.py
index 7de4d14..027f7aa 100755
--- a/chip_data/parse_chip_data.py
+++ b/chip_data/parse_chip_data.py
@@ -36,6 +36,8 @@
 def gen_chip_data_binary(indir: str, outdir: str) -> None:
     for model_ec, base in _import_chip_data(indir).items():
         file = f"chip_data_{model_ec.lower()}.cdb"
+        if not os.path.exists(outdir):
+            os.makedirs(outdir)
         with open(os.path.join(outdir, file), "wb") as fp:
             binary_encode(model_ec, base, fp)
 
@@ -43,6 +45,8 @@
 def gen_peltool_json(cdIndir: str, outdir: str, exSigPath=None) -> None:
     for model_ec, base in _import_chip_data(cdIndir).items():
         file = f"pel_parser_data_{model_ec.lower()}.json"
+        if not os.path.exists(outdir):
+            os.makedirs(outdir)
         with open(os.path.join(outdir, file), "w") as fp:
             peltool_encode(model_ec, base, fp, exSigPath)
 
diff --git a/chip_data/pyprd/chip_data/peltool.py b/chip_data/pyprd/chip_data/peltool.py
index 4428b46..bc808ae 100644
--- a/chip_data/pyprd/chip_data/peltool.py
+++ b/chip_data/pyprd/chip_data/peltool.py
@@ -78,7 +78,7 @@
             node[1][pos] = bit.desc
 
     # If the input extra signature file exists, add those to the data.
-    if os.path.isfile(exSigPath):
+    if exSigPath and os.path.isfile(exSigPath):
         with open(exSigPath, "r") as sigFp:
             fileData = sigFp.read()
             sigPattern = r'PRD_EXTRA_SIG\s*\(\s*([^"]*)\s*,\s*(0x[0-9A-Fa-f]{8})\s*,\s*"([^"]*)"'
diff --git a/chip_data/pyprd/util/hash.py b/chip_data/pyprd/util/hash.py
index a807d0b..ae7a0d8 100644
--- a/chip_data/pyprd/util/hash.py
+++ b/chip_data/pyprd/util/hash.py
@@ -1,3 +1,8 @@
+#!/usr/bin/env python3
+
+import argparse
+
+
 def hash_string(num_bytes: int, string: str) -> int:
     """
     Converts a string into an integer hash value. This is primarily used to
@@ -40,3 +45,12 @@
     Returns a formatted hex string of the given string's hash value.
     """
     return "{0:0{1}x}".format(hash_string(num_bytes, string), num_bytes * 2)
+
+
+if __name__ == "__main__":
+
+    cli = argparse.ArgumentParser()
+    cli.add_argument("num_bytes", help="Number of bytes to hash to")
+    cli.add_argument("string_name", help="String to hash")
+    args = cli.parse_args()
+    print(hex(hash_string(int(args.num_bytes), args.string_name)))