|
7 | 7 |
|
8 | 8 | from pipeline_manager.dataflow_builder.entities import Direction |
9 | 9 |
|
10 | | -from topwrap.backend.kpm.common import PORT_INTF_TYPE, KpmNodeAdditionalData, LayerType |
| 10 | +from topwrap.backend.kpm.common import PORT_INTF_TYPE, LayerType |
11 | 11 | from topwrap.frontend.kpm.common import ( |
12 | 12 | KpmFrontendParseException, |
13 | 13 | kpm_dir_to_ir_intf, |
|
17 | 17 | from topwrap.kpm_common import SPECIFICATION_VERSION |
18 | 18 | from topwrap.model.connections import Port |
19 | 19 | from topwrap.model.interface import Interface, InterfaceDefinition |
20 | | -from topwrap.model.misc import ElaboratableValue, FileReference, Identifier, Parameter |
| 20 | +from topwrap.model.misc import ( |
| 21 | + ElaboratableValue, |
| 22 | + FileReference, |
| 23 | + Identifier, |
| 24 | + Parameter, |
| 25 | +) |
21 | 26 | from topwrap.model.module import Module |
22 | 27 | from topwrap.util import JsonType |
23 | 28 |
|
@@ -84,13 +89,13 @@ def parse( |
84 | 89 | if node.get("layer", "") != LayerType.IP_CORE.value: |
85 | 90 | continue |
86 | 91 |
|
87 | | - add: KpmNodeAdditionalData = node["additionalData"] |
| 92 | + add = node.get("additionalData", None) |
| 93 | + if add is None: |
| 94 | + raise KpmFrontendParseException( |
| 95 | + f"Node {node['name']} lacks additionalData vith VLNV" |
| 96 | + ) |
88 | 97 | mod = Module( |
89 | | - id=Identifier( |
90 | | - name=add["full_module_id"]["name"], |
91 | | - vendor=add["full_module_id"]["vendor"], |
92 | | - library=add["full_module_id"]["library"], |
93 | | - ), |
| 98 | + id=Identifier(**add["full_module_id"]), |
94 | 99 | refs=[FileReference(source)] if source else (), |
95 | 100 | ) |
96 | 101 |
|
|
0 commit comments