Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
d48d070a
H
hdl4se
项目概览
饶先宏
/
hdl4se
通知
12
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hdl4se
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d48d070a
编写于
8月 09, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202108092003
上级
c8ecc720
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
45 addition
and
29 deletion
+45
-29
hdl4secell/include/hdl4secell.h
hdl4secell/include/hdl4secell.h
+2
-1
hdl4secell/src/hdl4se_module.c
hdl4secell/src/hdl4se_module.c
+40
-26
hdl4secell/src/hdl4se_variable.c
hdl4secell/src/hdl4se_variable.c
+2
-1
hdl4sesim/src/hdl4sesim.c
hdl4sesim/src/hdl4sesim.c
+1
-1
未找到文件。
hdl4secell/include/hdl4secell.h
浏览文件 @
d48d070a
...
...
@@ -120,7 +120,8 @@ typedef struct sModuleVariable {
unsigned
long
long
data_reg
;
#endif
THREADLOCK
lock
;
void
(
*
func_UpdateVariable
)(
struct
sModuleVariable
*
var
);
//void (*func_UpdateVariable)(struct sModuleVariable* var);
int
updatefunc
;
}
ModuleVariable
;
typedef
struct
sModuleFunction
{
...
...
hdl4secell/src/hdl4se_module.c
浏览文件 @
d48d070a
...
...
@@ -65,6 +65,26 @@ sGeneralModule* hdl4seModuleGetData(HOBJECT object)
FILE
*
recordfileGet
();
void
recordfileRelease
();
inline
static
void
hdl4seUpdateVariableNone
(
ModuleVariable
*
var
)
{
}
inline
static
void
hdl4seUpdateVariableGenFunc
(
ModuleVariable
*
var
)
{
//var->func_UpdateVariable = hdl4seUpdateVariableNone;
var
->
updatefunc
=
0
;
functionCallAndSetNone
(
var
->
moduledata
->
funcs
.
array
[
var
->
genfuncindex
]);
}
inline
static
void
hdl4seUpdateVariableGetValue
(
ModuleVariable
*
var
)
{
// var->func_UpdateVariable = hdl4seUpdateVariableNone;
//functionCallAndSetNone(var->moduledata->funcs.array[var->genfuncindex]);
var
->
updatefunc
=
0
;
hdl4se_module_GetValue
(
&
var
->
module
->
data
,
var
->
moduleportindex
,
var
->
width
,
(
var
->
type
==
VTYPE_REG
)
?
var
->
data_reg
:
var
->
data
);
}
#if HDL4SE_DEBUG
#define UpdateVariable(v) \
do { \
...
...
@@ -89,10 +109,17 @@ do { \
#define UpdateVariable(v) \
do { \
if (v->type != VTYPE_REG) { \
if (v->updatefunc != 0) { \
threadlockLock(v->lock); \
v->func_UpdateVariable(v); \
if (v->updatefunc == 1) { \
hdl4seUpdateVariableGenFunc(v); \
} \
else { \
hdl4seUpdateVariableGetValue(v); \
} \
threadlockUnlock(v->lock); \
} \
} \
} while (0)
#endif
...
...
@@ -452,7 +479,7 @@ int hdl4se_module_ConnectInput(sGeneralModule* pobj, int index, HOBJECT from, in
return
0
;
}
int
hdl4se_module_GetValue
(
sGeneralModule
*
pobj
,
int
index
,
int
width
,
IBigNumber
**
value
)
in
line
in
t
hdl4se_module_GetValue
(
sGeneralModule
*
pobj
,
int
index
,
int
width
,
IBigNumber
**
value
)
{
ModuleVariable
*
var
;
if
(
index
<
0
||
index
>=
pobj
->
variables
.
itemcount
)
...
...
@@ -467,24 +494,6 @@ int hdl4se_module_GetValue(sGeneralModule* pobj, int index, int width, IBigNumbe
return
0
;
}
static
void
hdl4seUpdateVariableNone
(
ModuleVariable
*
var
)
{
}
static
void
hdl4seUpdateVariableGenFunc
(
ModuleVariable
*
var
)
{
var
->
func_UpdateVariable
=
hdl4seUpdateVariableNone
;
functionCallAndSetNone
(
var
->
moduledata
->
funcs
.
array
[
var
->
genfuncindex
]);
}
static
void
hdl4seUpdateVariableGetValue
(
ModuleVariable
*
var
)
{
var
->
func_UpdateVariable
=
hdl4seUpdateVariableNone
;
//functionCallAndSetNone(var->moduledata->funcs.array[var->genfuncindex]);
hdl4se_module_GetValue
(
&
var
->
module
->
data
,
var
->
moduleportindex
,
var
->
width
,
(
var
->
type
==
VTYPE_REG
)
?
var
->
data_reg
:
var
->
data
);
}
int
hdl4se_module_ClkTick
(
sGeneralModule
*
pobj
)
{
int
i
;
...
...
@@ -517,16 +526,21 @@ int hdl4se_module_Setup(sGeneralModule* pobj)
continue
;
if
(
var
->
type
==
VTYPE_REG
)
{
objectCall1
(
var
->
data
,
Clone
,
var
->
data_reg
);
var
->
func_UpdateVariable
=
hdl4seUpdateVariableNone
;
//var->func_UpdateVariable = hdl4seUpdateVariableNone;
var
->
updatefunc
=
0
;
}
else
if
(
var
->
genfuncindex
>=
0
)
{
var
->
func_UpdateVariable
=
hdl4seUpdateVariableGenFunc
;
//var->func_UpdateVariable = hdl4seUpdateVariableGenFunc;
var
->
updatefunc
=
1
;
}
else
if
(
var
->
module
!=
NULL
)
{
var
->
func_UpdateVariable
=
hdl4seUpdateVariableGetValue
;
//var->func_UpdateVariable = hdl4seUpdateVariableGetValue;
var
->
updatefunc
=
2
;
}
else
{
var
->
func_UpdateVariable
=
hdl4seUpdateVariableNone
;
//var->func_UpdateVariable = hdl4seUpdateVariableNone;
var
->
updatefunc
=
0
;
}
}
...
...
hdl4secell/src/hdl4se_variable.c
浏览文件 @
d48d070a
...
...
@@ -77,7 +77,8 @@ ModuleVariable* variableCreate(int type, int width, int portdirect, int isunsign
if
(
type
==
VTYPE_REG
)
var
->
data_reg
=
bigintegerCreate2
(
width
,
isunsigned
);
}
var
->
func_UpdateVariable
=
hdl4seUpdateVariableNone
;
//var->func_UpdateVariable = hdl4seUpdateVariableNone;
var
->
updatefunc
=
0
;
var
->
lock
=
threadlockCreate
();
return
var
;
}
...
...
hdl4sesim/src/hdl4sesim.c
浏览文件 @
d48d070a
...
...
@@ -231,7 +231,7 @@ static int hdl4sesim_hdl4se_simulator_SetReset(HOBJECT object, int reset)
return
0
;
}
#define THREADCOUNT
2
#define THREADCOUNT
9
static
int
hdl4sesim_hdl4se_simulator_ClkTick
(
HOBJECT
object
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录