Add test_branch_loop_ctr
[soc.git] / src / soc / decoder / power_enums.py
index b480eabaf5550d74739aeb0aea0da2a26a77deae..ca17eef4d328801ab0926ac27df02c95feca6f1e 100644 (file)
@@ -1,8 +1,8 @@
 from enum import Enum, unique
 import csv
 import os
-import requests
 from os.path import dirname, join
+from collections import namedtuple
 
 def find_wiki_file(name):
     filedir = os.path.dirname(os.path.abspath(__file__))
@@ -221,5 +221,20 @@ class CryIn(Enum):
 # http://bugs.libre-riscv.org/show_bug.cgi?id=261
 
 spr_csv = get_csv("sprs.csv")
+spr_info = namedtuple('spr_info', 'SPR priv_mtspr priv_mfspr length')
+spr_dict = {}
+for row in spr_csv:
+    info = spr_info(SPR=row['SPR'], priv_mtspr=row['priv_mtspr'],
+                    priv_mfspr=row['priv_mfspr'], length=int(row['len']))
+    spr_dict[int(row['Idx'])] = info
 fields = [(row['SPR'], int(row['Idx'])) for row in spr_csv]
 SPR = Enum('SPR', fields)
+
+
+XER_bits = {
+    'SO': 32,
+    'OV': 33,
+    'CA': 34,
+    'OV32': 44,
+    'CA32': 45
+    }