zuspec-arl-dm 0.1.0.15264414400rc0__cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zsp_arl_dm/__build_num__.py +1 -0
- zsp_arl_dm/__init__.py +22 -0
- zsp_arl_dm/__version__.py +3 -0
- zsp_arl_dm/core.cpython-310-x86_64-linux-gnu.so +0 -0
- zsp_arl_dm/core.pxd +395 -0
- zsp_arl_dm/decl.pxd +317 -0
- zsp_arl_dm/libzsp-arl-dm.so +0 -0
- zsp_arl_dm/pkginfo.py +23 -0
- zsp_arl_dm/py_val_to_val_ref.py +46 -0
- zsp_arl_dm/share/include/TypeFieldAddrClaim.cpp +39 -0
- zsp_arl_dm/share/include/TypeFieldAddrClaim.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/FactoryExt.h +6 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IAccept.h +28 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IArl.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IComponentMap.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContext.h +443 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContextDumper.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContextLoader.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAction.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivity.h +37 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityBind.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityParallel.h +17 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityReplicate.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivitySchedule.h +25 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityScope.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivitySequence.h +26 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityTraverse.h +33 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityTraverseType.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrClaim.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrClaimTransparent.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrHandle.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrSpaceC.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrSpaceTransparentC.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeArlStruct.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeComponent.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeCoreLibComponent.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFlowObj.h +36 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunction.h +115 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunctionImport.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunctionParamDecl.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePackedStruct.h +48 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePureComponent.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePyObj.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeReg.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeRegGroup.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeResource.h +22 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeTransparentAddrSpace.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IFactory.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IMarker.h +56 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivity.h +39 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityBind.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityParallel.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityReplicate.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivitySchedule.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityScope.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivitySequence.h +28 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityTraverse.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelBuildContext.h +36 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelComponentTreeData.h +92 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvalIterator.h +72 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvalIteratorListener.h +62 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvaluator.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelExec.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldAction.h +34 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldClaim.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldComponent.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldComponentRoot.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutor.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutorClaim.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutorGroup.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldInOut.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldPool.h +38 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegGroup.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegGroupRef.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegRef.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IPoolBindDirective.h +33 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IPyImport.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IRegGroup.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IRewriteContext.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IType.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeAction.h +25 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExec.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecGroup.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecProc.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecTargetTmpl.h +59 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprMethodCallContext.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprMethodCallStatic.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPureCompMethodCall.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPyImportRef.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonFieldRef.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonMethodCall.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonModuleRef.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonSubscript.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldActivity.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldAddrClaim.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldAddrClaimTransparent.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldClaim.h +27 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldExecutor.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldExecutorClaim.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldInOut.h +27 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldMethod.h +39 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldPool.h +29 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldReg.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegGroup.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegGroupArr.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegRef.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegVec.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeModelDumper.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmt.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtAssign.h +61 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtBreak.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtContinue.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtDeclScope.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtExpr.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtForeach.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtIfClause.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtIfElse.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtMatch.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtMatchChoice.h +48 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtRepeat.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtRepeatWhile.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtReturn.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtScope.h +62 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtVarDecl.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtWhile.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtYield.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IVisitor.h +246 -0
- zsp_arl_dm/share/include/zsp/arl/dm/TypeKindE.h +23 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ContextDelegator.h +549 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/CopyVisitor.h +204 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/IsResourcePool.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ModelBuildContext.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ModelEvalIteratorListenerBase.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/RewriteVisitorBase.h +346 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskActionHasMemClaim.h +76 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskCollectTopLevelActivities.h +63 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskFindExecutor.h +69 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetExprDataType.h +84 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetSubField.h +98 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetTypeBitWidth.h +76 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsDataTypeFlowObj.h +73 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsDataTypePyObj.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsPackedStruct.h +57 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsRefGroupRef.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsTypeFieldRegGroup.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsTypeFieldRegGroupArr.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskPackStruct2Int.h +80 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskUnpackInt2Struct.h +123 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitActionTypeClaimRef.h +70 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitModelFieldClaim.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitModelFieldInOut.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefAction.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefActivity.h +63 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefActivityScope.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefPyObj.h +75 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefRegGroup.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/VisitorBase.h +456 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/VisitorDelegator.h +356 -0
- zsp_arl_dm/share/include/zsp/arl/dm/loader.h +39 -0
- zsp_arl_dm/val_ref_to_py_val.py +58 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/METADATA +25 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/RECORD +166 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/WHEEL +6 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/entry_points.txt +2 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/licenses/LICENSE +201 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
/**
|
2
|
+
* TaskUnpackInt2Struct.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "dmgr/IDebugMgr.h"
|
23
|
+
#include "dmgr/impl/DebugMacros.h"
|
24
|
+
#include "vsc/dm/impl/ValRefBool.h"
|
25
|
+
#include "vsc/dm/impl/ValRefStruct.h"
|
26
|
+
#include "zsp/arl/dm/IContext.h"
|
27
|
+
#include "zsp/arl/dm/impl/VisitorBase.h"
|
28
|
+
|
29
|
+
namespace zsp {
|
30
|
+
namespace arl {
|
31
|
+
namespace dm {
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
class TaskUnpackInt2Struct : public virtual VisitorBase {
|
36
|
+
public:
|
37
|
+
|
38
|
+
TaskUnpackInt2Struct(
|
39
|
+
dmgr::IDebugMgr *dmgr,
|
40
|
+
IContext *ctxt) : m_dbg(0), m_ctxt(ctxt) {
|
41
|
+
DEBUG_INIT("zsp::arl::dm::TaskUnpackInt2Struct", dmgr);
|
42
|
+
}
|
43
|
+
|
44
|
+
virtual ~TaskUnpackInt2Struct() { }
|
45
|
+
|
46
|
+
vsc::dm::ValRef unpack(
|
47
|
+
const vsc::dm::ValRef &val_i,
|
48
|
+
vsc::dm::IDataTypeStruct *dst_t) {
|
49
|
+
DEBUG_ENTER("unpack val_i=0x%08x", vsc::dm::ValRefInt(val_i).get_val_u());
|
50
|
+
vsc::dm::ValRefStruct val_s(m_ctxt->mkValRefStruct(dst_t));
|
51
|
+
m_bit = 0;
|
52
|
+
m_val_i = val_i;
|
53
|
+
m_val_result_s.clear();
|
54
|
+
m_val_result_s.push_back(val_s);
|
55
|
+
dst_t->accept(m_this);
|
56
|
+
DEBUG("val_s[0]=0x%08x", vsc::dm::ValRefInt(val_s.getFieldRef(0)).get_val_u());
|
57
|
+
DEBUG("val_s[1]=0x%08x", vsc::dm::ValRefInt(val_s.getFieldRef(1)).get_val_u());
|
58
|
+
DEBUG_LEAVE("unpack");
|
59
|
+
return val_s;
|
60
|
+
}
|
61
|
+
|
62
|
+
virtual void visitDataTypeBool(vsc::dm::IDataTypeBool *t) override {
|
63
|
+
DEBUG_ENTER("visitDataTypeBool");
|
64
|
+
vsc::dm::ValRefBool val(m_val_result_s.back());
|
65
|
+
val.set_val((m_val_i.get_val_u() >> m_bit) & 1);
|
66
|
+
|
67
|
+
m_bit += 1;
|
68
|
+
DEBUG_LEAVE("visitDataTypeBool");
|
69
|
+
}
|
70
|
+
|
71
|
+
virtual void visitDataTypeEnum(vsc::dm::IDataTypeEnum *t) override {
|
72
|
+
DEBUG_ENTER("visitDataTypeEnum");
|
73
|
+
vsc::dm::ValRefInt val(m_val_result_s.back());
|
74
|
+
val.set_val((m_val_i.get_val_u() >> m_bit) & 0xFFFFFFFF);
|
75
|
+
|
76
|
+
m_bit += 32;
|
77
|
+
DEBUG_LEAVE("visitDataTypeEnum");
|
78
|
+
}
|
79
|
+
|
80
|
+
virtual void visitDataTypeInt(vsc::dm::IDataTypeInt *t) override {
|
81
|
+
DEBUG_ENTER("visitDataTypeInt width=%d", t->getWidth());
|
82
|
+
vsc::dm::ValRefInt val(m_val_result_s.back());
|
83
|
+
if (t->width() == 64) {
|
84
|
+
val.set_val((m_val_i.get_val_u() >> m_bit));
|
85
|
+
} else {
|
86
|
+
uint64_t ival = (m_val_i.get_val_u() >> m_bit) & (1ULL << t->getWidth())-1;
|
87
|
+
DEBUG("set_val: 0x%08x", ival);
|
88
|
+
val.set_val(ival);
|
89
|
+
DEBUG("get_val: 0x%08x", val.get_val_u());
|
90
|
+
}
|
91
|
+
|
92
|
+
m_bit += t->getWidth();
|
93
|
+
DEBUG_LEAVE("visitDataTypeInt width=%d", t->getWidth());
|
94
|
+
}
|
95
|
+
|
96
|
+
virtual void visitDataTypeStruct(vsc::dm::IDataTypeStruct *t) override {
|
97
|
+
DEBUG_ENTER("visitDataTypeStruct");
|
98
|
+
|
99
|
+
vsc::dm::ValRefStruct val_s(m_val_result_s.back());
|
100
|
+
for (uint32_t i=0; i<t->getFields().size(); i++) {
|
101
|
+
m_val_result_s.push_back(val_s.getFieldRef(i));
|
102
|
+
t->getFields().at(i)->getDataType()->accept(m_this);
|
103
|
+
m_val_result_s.pop_back();
|
104
|
+
}
|
105
|
+
|
106
|
+
DEBUG_LEAVE("visitDataTypeStruct");
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
private:
|
111
|
+
dmgr::IDebug *m_dbg;
|
112
|
+
IContext *m_ctxt;
|
113
|
+
uint32_t m_bit;
|
114
|
+
vsc::dm::ValRefInt m_val_i;
|
115
|
+
std::vector<vsc::dm::ValRef> m_val_result_s;
|
116
|
+
|
117
|
+
};
|
118
|
+
|
119
|
+
} /* namespace dm */
|
120
|
+
} /* namespace arl */
|
121
|
+
} /* namespace zsp */
|
122
|
+
|
123
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
/**
|
2
|
+
* TaskVisitActionTypeClaimRef.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include <functional>
|
23
|
+
#include "zsp/arl/dm/impl/VisitorBase.h"
|
24
|
+
|
25
|
+
namespace zsp {
|
26
|
+
namespace arl {
|
27
|
+
namespace dm {
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
class TaskVisitActionTypeClaimRef : public VisitorBase {
|
32
|
+
public:
|
33
|
+
TaskVisitActionTypeClaimRef(
|
34
|
+
const std::function<void (ITypeFieldInOut *)> &ref_f,
|
35
|
+
const std::function<void (ITypeFieldClaim *)> &claim_f
|
36
|
+
) : m_depth(0), m_ref_f(ref_f), m_claim_f(claim_f) { }
|
37
|
+
|
38
|
+
virtual ~TaskVisitActionTypeClaimRef() { }
|
39
|
+
|
40
|
+
void visit(IDataTypeAction *t) {
|
41
|
+
t->accept(m_this);
|
42
|
+
}
|
43
|
+
|
44
|
+
virtual void visitDataTypeAction(IDataTypeAction *i) override {
|
45
|
+
if (!m_depth) {
|
46
|
+
m_depth++;
|
47
|
+
VisitorBase::visitDataTypeAction(i);
|
48
|
+
m_depth--;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
virtual void visitTypeFieldInOut(ITypeFieldInOut *f) override {
|
53
|
+
m_ref_f(f);
|
54
|
+
}
|
55
|
+
|
56
|
+
virtual void visitTypeFieldClaim(ITypeFieldClaim *f) override {
|
57
|
+
m_claim_f(f);
|
58
|
+
}
|
59
|
+
|
60
|
+
private:
|
61
|
+
int32_t m_depth;
|
62
|
+
std::function<void (ITypeFieldInOut *)> m_ref_f;
|
63
|
+
std::function<void (ITypeFieldClaim *)> m_claim_f;
|
64
|
+
};
|
65
|
+
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* TaskVisitModelFieldClaim.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include <functional>
|
23
|
+
#include "zsp/arl/dm/impl/VisitorBase.h"
|
24
|
+
|
25
|
+
namespace zsp {
|
26
|
+
namespace arl {
|
27
|
+
namespace dm {
|
28
|
+
|
29
|
+
|
30
|
+
class TaskVisitModelFieldClaim : public VisitorBase {
|
31
|
+
public:
|
32
|
+
TaskVisitModelFieldClaim(
|
33
|
+
const std::function<void (IModelFieldClaim *)> &func) :
|
34
|
+
m_func(func), m_depth(0) { }
|
35
|
+
|
36
|
+
virtual ~TaskVisitModelFieldClaim() { }
|
37
|
+
|
38
|
+
void visit(IModelFieldAction *action) {
|
39
|
+
m_depth = 0;
|
40
|
+
action->accept(m_this);
|
41
|
+
}
|
42
|
+
|
43
|
+
virtual void visitModelFieldAction(IModelFieldAction *f) override {
|
44
|
+
if (!m_depth) {
|
45
|
+
m_depth++;
|
46
|
+
VisitorBase::visitModelFieldAction(f);
|
47
|
+
m_depth--;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
virtual void visitModelFieldClaim(IModelFieldClaim *f) override {
|
52
|
+
m_func(f);
|
53
|
+
}
|
54
|
+
|
55
|
+
private:
|
56
|
+
uint32_t m_depth;
|
57
|
+
std::function<void (IModelFieldClaim *)> m_func;
|
58
|
+
};
|
59
|
+
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* TaskVisitModelFieldInOut.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include <functional>
|
23
|
+
#include "zsp/arl/dm/impl/VisitorBase.h"
|
24
|
+
|
25
|
+
namespace zsp {
|
26
|
+
namespace arl {
|
27
|
+
namespace dm {
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
class TaskVisitModelFieldInOut : public VisitorBase {
|
32
|
+
public:
|
33
|
+
TaskVisitModelFieldInOut(
|
34
|
+
const std::function<void (IModelFieldInOut *)> &func) :
|
35
|
+
m_func(func), m_depth(0) { }
|
36
|
+
|
37
|
+
virtual ~TaskVisitModelFieldInOut() { }
|
38
|
+
|
39
|
+
void visit(IModelFieldAction *t) {
|
40
|
+
t->accept(m_this);
|
41
|
+
}
|
42
|
+
|
43
|
+
virtual void visitModelFieldAction(IModelFieldAction *f) override {
|
44
|
+
if (!m_depth) {
|
45
|
+
m_depth++;
|
46
|
+
VisitorBase::visitModelFieldAction(f);
|
47
|
+
m_depth--;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
virtual void visitModelFieldInOut(IModelFieldInOut *f) override {
|
52
|
+
m_func(f);
|
53
|
+
}
|
54
|
+
|
55
|
+
private:
|
56
|
+
std::function<void (IModelFieldInOut *)> m_func;
|
57
|
+
uint32_t m_depth;
|
58
|
+
};
|
59
|
+
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
* ValRefAction.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "vsc/dm/impl/ValRefStruct.h"
|
23
|
+
|
24
|
+
namespace zsp {
|
25
|
+
namespace arl {
|
26
|
+
namespace dm {
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
class ValRefAction : public vsc::dm::ValRefStruct{
|
31
|
+
public:
|
32
|
+
|
33
|
+
ValRefAction(const vsc::dm::ValRef &rhs) : ValRefStruct(rhs) { }
|
34
|
+
|
35
|
+
virtual ~ValRefAction() { }
|
36
|
+
|
37
|
+
};
|
38
|
+
|
39
|
+
} /* namespace dm */
|
40
|
+
} /* namespace arl */
|
41
|
+
} /* namespace zsp */
|
42
|
+
|
43
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/**
|
2
|
+
* ValRefActivity.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "vsc/dm/impl/ValRefStruct.h"
|
23
|
+
#include "zsp/arl/dm/IDataTypeActivityScope.h"
|
24
|
+
|
25
|
+
namespace zsp {
|
26
|
+
namespace arl {
|
27
|
+
namespace dm {
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
class ValRefActivityScope : public vsc::dm::ValRefStruct {
|
32
|
+
public:
|
33
|
+
|
34
|
+
ValRefActivityScope(const ValRef &rhs) : ValRefStruct(rhs) { }
|
35
|
+
|
36
|
+
virtual ~ValRefActivityScope() { }
|
37
|
+
|
38
|
+
int32_t getNumActivities() const {
|
39
|
+
return dynamic_cast<IDataTypeActivityScope *>(type())->getActivities().size();
|
40
|
+
}
|
41
|
+
|
42
|
+
vsc::dm::ValRef getActivityRef(int32_t i) {
|
43
|
+
char *ptr = reinterpret_cast<char *>(m_vp);
|
44
|
+
IDataTypeActivityScope *scope = dynamic_cast<IDataTypeActivityScope *>(type());
|
45
|
+
ITypeFieldActivity *activity = scope->getActivities().at(i).get();
|
46
|
+
vsc::dm::ValRef::Flags flags = static_cast<ValRef::Flags>(
|
47
|
+
static_cast<uint32_t>(m_flags) & ~static_cast<uint32_t>(ValRef::Flags::Owned));
|
48
|
+
flags = flags | ValRef::Flags::IsPtr;
|
49
|
+
int32_t offset = scope->getActivityOffset()+activity->getOffset();
|
50
|
+
return vsc::dm::ValRef(
|
51
|
+
reinterpret_cast<uintptr_t>(&ptr[offset]),
|
52
|
+
field,
|
53
|
+
flags
|
54
|
+
);
|
55
|
+
}
|
56
|
+
|
57
|
+
};
|
58
|
+
|
59
|
+
} /* namespace dm */
|
60
|
+
} /* namespace arl */
|
61
|
+
} /* namespace zsp */
|
62
|
+
|
63
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/**
|
2
|
+
* ValRefActivity.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "vsc/dm/impl/ValRefStruct.h"
|
23
|
+
#include "zsp/arl/dm/IDataTypeActivity.h"
|
24
|
+
|
25
|
+
namespace zsp {
|
26
|
+
namespace arl {
|
27
|
+
namespace dm {
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
class ValRefActivity : public vsc::dm::ValRefStruct {
|
32
|
+
public:
|
33
|
+
|
34
|
+
ValRefActivity(const ValRef &rhs) : ValRefStruct(rhs) { }
|
35
|
+
|
36
|
+
virtual ~ValRefActivity() { }
|
37
|
+
|
38
|
+
int32_t getNumActivities() const {
|
39
|
+
return dynamic_cast<IDataTypeActivity *>(type())->getA
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
ValRef getActivityRef(int32_t)
|
44
|
+
|
45
|
+
};
|
46
|
+
|
47
|
+
} /* namespace dm */
|
48
|
+
} /* namespace arl */
|
49
|
+
} /* namespace zsp */
|
50
|
+
|
51
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/**
|
2
|
+
* ValRefPyObj.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "vsc/dm/impl/ValRefPtr.h"
|
23
|
+
|
24
|
+
namespace pyapi {
|
25
|
+
struct PyEvalObj;
|
26
|
+
}
|
27
|
+
|
28
|
+
namespace zsp {
|
29
|
+
namespace arl {
|
30
|
+
namespace dm {
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
class ValRefPyObj : public virtual vsc::dm::ValRefPtr {
|
35
|
+
public:
|
36
|
+
|
37
|
+
ValRefPyObj(const ValRef &rhs) : vsc::dm::ValRefPtr(rhs) {
|
38
|
+
if (type()) {
|
39
|
+
// Acquire the object
|
40
|
+
type()->initVal(*this);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
virtual ~ValRefPyObj() {
|
45
|
+
if (type()) {
|
46
|
+
// Release the object
|
47
|
+
type()->finiVal(*this);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
pyapi::PyEvalObj *getObj() const {
|
52
|
+
return reinterpret_cast<pyapi::PyEvalObj *>(ValRefPtr::get_val());
|
53
|
+
}
|
54
|
+
|
55
|
+
void setObj(pyapi::PyEvalObj *obj) {
|
56
|
+
// Release current object
|
57
|
+
if (type() && get_val()) {
|
58
|
+
type()->finiVal(*this);
|
59
|
+
}
|
60
|
+
|
61
|
+
set_val(reinterpret_cast<uintptr_t>(obj));
|
62
|
+
|
63
|
+
// Acquire the new object
|
64
|
+
if (type() && get_val()) {
|
65
|
+
type()->initVal(*this);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
};
|
70
|
+
|
71
|
+
} /* namespace dm */
|
72
|
+
} /* namespace arl */
|
73
|
+
} /* namespace zsp */
|
74
|
+
|
75
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* ValRefRegGroup.h
|
3
|
+
*
|
4
|
+
* Copyright 2023 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
class ValRefRegGroup {
|
26
|
+
public:
|
27
|
+
|
28
|
+
virtual ~ValRefRegGroup() { }
|
29
|
+
|
30
|
+
};
|
31
|
+
|
32
|
+
|