summaryrefslogtreecommitdiff
path: root/lib/model.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-09-30 15:24:06 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-09-30 15:24:06 +0200
commit03f4400a5c11d1567524a20d8d033d0ea3ad8f03 (patch)
tree1b5032cdc5bd41434126a98440ea68d7efb288e7 /lib/model.py
parent0cde8b64d756a522d95c0826ddfcb43c98d3726b (diff)
KConfigModel: Export kconfig hash
Diffstat (limited to 'lib/model.py')
-rw-r--r--lib/model.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/model.py b/lib/model.py
index a75033c..7298fc4 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -1313,6 +1313,7 @@ class KConfigModel:
self.data = list()
for i in indices:
self.data.append(kconfig_benchmark.data[i])
+ self.kconfig_hash = kconfig_benchmark.kconfig_hash
self.symbols = kconfig_benchmark.symbol_names
self.choices = kconfig_benchmark.choice_names
self.symbol = kconfig_benchmark.symbol
@@ -1335,7 +1336,9 @@ class KConfigModel:
@classmethod
def from_json(cls, json_input: dict):
self = cls()
+ assert json_input["model_type"] == "kconfig-dtree"
self.attribute = json_input["attribute"]
+ self.kconfig_hash = json_input["kconfig_hash"]
self.symbols = json_input["symbols"]
self.choices = json_input["choices"]
self.model = self._node_from_json(json_input["model"])
@@ -1380,6 +1383,8 @@ class KConfigModel:
def to_json(self):
output = {
"model": self.model.to_json(),
+ "model_type": "kconfig-dtree",
+ "kconfig_hash": self.kconfig_hash,
"symbols": self.symbols,
"choices": self.choices,
"attribute": self.attribute,