Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
06ad7477
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,体验更适合开发者的 AI 搜索 >>
提交
06ad7477
编写于
8月 04, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202108041801
上级
ea5e24b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
81 addition
and
19 deletion
+81
-19
examples/hdl4secnn/cnn/cnncell/cnncell_concat.c
examples/hdl4secnn/cnn/cnncell/cnncell_concat.c
+81
-6
hdl4secell/src/hdl4se_fifo.c
hdl4secell/src/hdl4se_fifo.c
+0
-13
未找到文件。
examples/hdl4secnn/cnn/cnncell/cnncell_concat.c
浏览文件 @
06ad7477
...
...
@@ -118,6 +118,81 @@ DEFINE_FUNC(cncell_concat_gen_read_write) {
vput
(
wDataWrite
,
write
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_write_data
)
{
int
index
=
vget
(
index
);
vput
(
bDataWriteData
,
0xcdcdcdcd
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(((
index
>=
0
)
&&
(
index
<
pobj
->
c0
)
&&
vget
(
wDataReadValid_0
)))
{
VAssign
(
bDataWriteData
,
bDataReadData_0
);
}
else
if
(((
index
>=
pobj
->
c0
)
&&
(
index
<
pobj
->
c1
)
&&
vget
(
wDataReadValid_1
)))
{
VAssign
(
bDataWriteData
,
bDataReadData_1
);
}
else
if
(((
index
>=
pobj
->
c1
)
&&
(
index
<
pobj
->
c2
)
&&
vget
(
wDataReadValid_2
)))
{
VAssign
(
bDataWriteData
,
bDataReadData_2
);
}
else
if
(((
index
>=
pobj
->
c2
)
&&
(
index
<
pobj
->
c3
)
&&
vget
(
wDataReadValid_3
)))
{
VAssign
(
bDataWriteData
,
bDataReadData_3
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_write
)
{
int
index
=
vget
(
index
);
vput
(
wDataWrite
,
0
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(
((
index
>=
0
)
&&
(
index
<
pobj
->
c0
)
&&
vget
(
wDataReadValid_0
))
||
((
index
>=
pobj
->
c0
)
&&
(
index
<
pobj
->
c1
)
&&
vget
(
wDataReadValid_1
))
||
((
index
>=
pobj
->
c1
)
&&
(
index
<
pobj
->
c2
)
&&
vget
(
wDataReadValid_2
))
||
((
index
>=
pobj
->
c2
)
&&
(
index
<
pobj
->
c3
)
&&
vget
(
wDataReadValid_3
))
)
{
vput
(
wDataWrite
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_read_0
)
{
int
index
=
vget
(
index
);
vput
(
wDataRead_0
,
0
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(((
index
>=
0
)
&&
(
index
<
pobj
->
c0
)
&&
vget
(
wDataReadValid_0
)))
{
vput
(
wDataRead_0
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_read_1
)
{
int
index
=
vget
(
index
);
vput
(
wDataRead_1
,
0
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(((
index
>=
pobj
->
c0
)
&&
(
index
<
pobj
->
c1
)
&&
vget
(
wDataReadValid_1
)))
{
vput
(
wDataRead_1
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_read_2
)
{
int
index
=
vget
(
index
);
vput
(
wDataRead_2
,
0
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(((
index
>=
pobj
->
c1
)
&&
(
index
<
pobj
->
c2
)
&&
vget
(
wDataReadValid_2
)))
{
vput
(
wDataRead_2
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_read_3
)
{
int
index
=
vget
(
index
);
vput
(
wDataRead_3
,
0
);
if
(
vget
(
nwReset
)
&&
vget
(
wDataWriteEnable
))
{
if
(((
index
>=
pobj
->
c2
)
&&
(
index
<
pobj
->
c3
)
&&
vget
(
wDataReadValid_3
)))
{
vput
(
wDataRead_3
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cncell_concat_gen_clktick
)
{
int
index
=
vget
(
index
);
if
(
vget
(
nwReset
)
==
0
)
{
...
...
@@ -156,25 +231,25 @@ MODULE_INIT(cnncell_concat)
PORT_IN
(
wClk
,
1
);
PORT_IN
(
nwReset
,
1
);
GPORT_OUT
(
wDataRead_0
,
1
,
cncell_concat_gen_read_
write
);
GPORT_OUT
(
wDataRead_0
,
1
,
cncell_concat_gen_read_
0
);
PORT_IN
(
wDataReadValid_0
,
1
);
PORT_IN
(
bDataReadData_0
,
32
);
GPORT_OUT
(
wDataRead_1
,
1
,
cncell_concat_gen_read_
write
);
GPORT_OUT
(
wDataRead_1
,
1
,
cncell_concat_gen_read_
1
);
PORT_IN
(
wDataReadValid_1
,
1
);
PORT_IN
(
bDataReadData_1
,
32
);
GPORT_OUT
(
wDataRead_2
,
1
,
cncell_concat_gen_read_
write
);
GPORT_OUT
(
wDataRead_2
,
1
,
cncell_concat_gen_read_
2
);
PORT_IN
(
wDataReadValid_2
,
1
);
PORT_IN
(
bDataReadData_2
,
32
);
GPORT_OUT
(
wDataRead_3
,
1
,
cncell_concat_gen_read_
write
);
GPORT_OUT
(
wDataRead_3
,
1
,
cncell_concat_gen_read_
3
);
PORT_IN
(
wDataReadValid_3
,
1
);
PORT_IN
(
bDataReadData_3
,
32
);
PORT_IN
(
wDataWriteEnable
,
1
);
GPORT_OUT
(
wDataWrite
,
1
,
cncell_concat_gen_
read_
write
);
GPORT_OUT
(
bDataWriteData
,
32
,
cncell_concat_gen_
read_write
);
GPORT_OUT
(
wDataWrite
,
1
,
cncell_concat_gen_write
);
GPORT_OUT
(
bDataWriteData
,
32
,
cncell_concat_gen_
write_data
);
REG
(
index
,
32
);
...
...
hdl4secell/src/hdl4se_fifo.c
浏览文件 @
06ad7477
...
...
@@ -82,23 +82,10 @@ DEFINE_FUNC(hdl4se_fifo_gen_bReadData) {
}
END_DEFINE_FUNC
DEFINE_FUNC
(
hdl4se_fifo_gen_wDataValid
)
{
/*unsigned int readaddr = vget(readpos);
unsigned int writeaddr = vget(writepos);
vput(wDataValid, readaddr == writeaddr ? 0 : 1);*/
VAssign
(
wDataValid
,
wReadEn
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
hdl4se_fifo_gen_wWriteEnable
)
{
/*
unsigned int readaddr = vget(readpos);
unsigned int writeaddr = vget(writepos);
unsigned int datacount;
if (writeaddr < readaddr)
datacount = writeaddr + pobj->depth - readaddr;
else
datacount = writeaddr - readaddr;
vput(wWriteEnable, (datacount >= pobj->depth - 4) ? 0 : 1);
*/
VAssign
(
wWriteEnable
,
wWriteEn
);
}
END_DEFINE_FUNC
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录