Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
9d69d016
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 搜索 >>
提交
9d69d016
编写于
6月 12, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202106122123: 编译器终于能够将俄罗斯方块的verilog代码编译为正确的目标代码了,还差表达式求值部分的代码,可以尝试做计数器这边的网表文件编译。
上级
50f7ad30
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
294 addition
and
501 deletion
+294
-501
bignumber/src/bignumber.c
bignumber/src/bignumber.c
+1
-3
examples/counter/src/main_gen.c
examples/counter/src/main_gen.c
+160
-419
examples/counter/verilog/main_asm.v
examples/counter/verilog/main_asm.v
+14
-14
examples/counter/verilog/main_asm_dump.v
examples/counter/verilog/main_asm_dump.v
+14
-14
examples/terris/src/main.c
examples/terris/src/main.c
+1
-1
examples/terris/src/topmodule.c
examples/terris/src/topmodule.c
+13
-40
hdl4secell/src/hdl4secell.c
hdl4secell/src/hdl4secell.c
+1
-1
parser/verilog_expr.c
parser/verilog_expr.c
+36
-1
parser/verilog_module.c
parser/verilog_module.c
+52
-8
parser/verilog_parsetree.h
parser/verilog_parsetree.h
+2
-0
未找到文件。
bignumber/src/bignumber.c
浏览文件 @
9d69d016
...
@@ -336,14 +336,12 @@ static int bigint_bn_GetStr(HOBJECT object, int base, char* str, int buflen)
...
@@ -336,14 +336,12 @@ static int bigint_bn_GetStr(HOBJECT object, int base, char* str, int buflen)
i
=
((
bc
+
(
CELL_WIDTH
-
1
))
/
CELL_WIDTH
)
-
1
;
i
=
((
bc
+
(
CELL_WIDTH
-
1
))
/
CELL_WIDTH
)
-
1
;
ac
=
actualwidth
(
pobj
->
buf
[
i
]);
ac
=
actualwidth
(
pobj
->
buf
[
i
]);
ac
=
(
ac
+
7
)
/
8
;
ac
=
(
ac
+
7
)
/
8
;
sprintf
(
fmt
,
"%%%dx
_
"
,
ac
);
sprintf
(
fmt
,
"%%%dx"
,
ac
);
sprintf
(
buf
,
fmt
,
pobj
->
buf
[
i
]);
sprintf
(
buf
,
fmt
,
pobj
->
buf
[
i
]);
strcat
(
str
,
buf
);
strcat
(
str
,
buf
);
for
(
i
=
((
bc
+
(
CELL_WIDTH
-
1
))
/
CELL_WIDTH
)
-
2
;
i
>=
0
;
i
--
)
{
for
(
i
=
((
bc
+
(
CELL_WIDTH
-
1
))
/
CELL_WIDTH
)
-
2
;
i
>=
0
;
i
--
)
{
sprintf
(
buf
,
"%08x"
,
pobj
->
buf
[
i
]);
sprintf
(
buf
,
"%08x"
,
pobj
->
buf
[
i
]);
strcat
(
str
,
buf
);
strcat
(
str
,
buf
);
if
(
i
>
0
)
strcat
(
str
,
"_"
);
}
}
return
0
;
return
0
;
}
}
...
...
examples/counter/src/main_gen.c
浏览文件 @
9d69d016
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
/*
/*
* Created by HDL4SE @ Sat Jun 12
18:30:32
2021
* Created by HDL4SE @ Sat Jun 12
21:20:54
2021
* Don't edit it.
* Don't edit it.
*/
*/
...
@@ -82,7 +82,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -82,7 +82,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -100,7 +100,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -100,7 +100,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -116,7 +116,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -116,7 +116,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -132,7 +132,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -132,7 +132,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -149,7 +149,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -149,7 +149,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -165,7 +165,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -165,7 +165,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -182,7 +182,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -182,7 +182,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -198,7 +198,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -198,7 +198,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -214,7 +214,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -214,7 +214,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -233,7 +233,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -233,7 +233,7 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0
_
"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_MINUS
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"1"
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
{.
exprtype
=
EXPRTYPE_BINOP
,
.
op
=
OP_PLUS
},
...
@@ -249,79 +249,100 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
...
@@ -249,79 +249,100 @@ IHDL4SEUnit** hdl4seCreate_0010(IHDL4SEModule** parent, const char* instancepara
{
/* 模块实例化 */
{
/* 模块实例化 */
/* 0 hdl4se_reg bCurrentCounter*/
/* 0 hdl4se_reg bCurrentCounter*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"bCurrentCounter"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
const_expr_list_eval
(
2
,
expr_info
,
3
,
parameters
),
"bCurrentCounter"
);
}
}
/* 1 hdl4se_const const_MAXVALUE*/
/* 1 hdl4se_const const_MAXVALUE*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_MAXVALUE"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
1
},
/* MAXVALUE */
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
const_expr_list_eval
(
4
,
expr_info
,
3
,
parameters
),
"const_MAXVALUE"
);
}
}
/* 2 hdl4se_const const_RESETVALUE*/
/* 2 hdl4se_const const_RESETVALUE*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_RESETVALUE"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
2
},
/* RESETVALUE */
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
const_expr_list_eval
(
4
,
expr_info
,
3
,
parameters
),
"const_RESETVALUE"
);
}
}
/* 3 hdl4se_binop binop_EQ_bCurrentCounter_MAXVALUE*/
/* 3 hdl4se_binop binop_EQ_bCurrentCounter_MAXVALUE*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"binop_EQ_bCurrentCounter_MAXVALUE"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
}
{.
exprtype
=
EXPRTYPE_EMIT
},
/* 4 hdl4se_binop binop_counter_overfloat*/
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{
{.
exprtype
=
EXPRTYPE_EMIT
},
char
*
instanceparam
;
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h1"
},
modules
[
4
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"binop_counter_overfloat"
);
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"4'h4"
},
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
const_expr_list_eval
(
8
,
expr_info
,
3
,
parameters
),
"binop_EQ_bCurrentCounter_MAXVALUE"
);
}
}
modules
[
4
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'ha"
,
"binop_counter_overfloat"
);
/* 5 hdl4se_const const_One*/
/* 5 hdl4se_const const_One*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
5
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_One"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h1"
},
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
5
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
const_expr_list_eval
(
4
,
expr_info
,
3
,
parameters
),
"const_One"
);
}
}
/* 6 hdl4se_binop binop_bCurrentCounterInc*/
/* 6 hdl4se_binop binop_bCurrentCounterInc*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
6
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"binop_bCurrentCounterInc"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h1"
},
{.
exprtype
=
EXPRTYPE_EMIT
},
{.
exprtype
=
EXPRTYPE_NUMBER
,
.
value
=
"2'h0"
},
{.
exprtype
=
EXPRTYPE_EMIT
},
};
modules
[
6
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
const_expr_list_eval
(
8
,
expr_info
,
3
,
parameters
),
"binop_bCurrentCounterInc"
);
}
}
/* 7 hdl4se_mux2 mux_bCurrentCounter_if_wCounterIt*/
/* 7 hdl4se_mux2 mux_bCurrentCounter_if_wCounterIt*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
7
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bCurrentCounter_if_wCounterIt"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
}
{.
exprtype
=
EXPRTYPE_EMIT
},
/* 8 hdl4se_const const_1*/
};
{
modules
[
7
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
const_expr_list_eval
(
2
,
expr_info
,
3
,
parameters
),
"mux_bCurrentCounter_if_wCounterIt"
);
char
*
instanceparam
;
modules
[
8
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_1"
);
}
/* 9 hdl4se_const const_0*/
{
char
*
instanceparam
;
modules
[
9
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_0"
);
}
/* 10 hdl4se_mux2 mux_wOverflow_if_wCounterIt*/
{
char
*
instanceparam
;
modules
[
10
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_wOverflow_if_wCounterIt"
);
}
}
modules
[
8
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"2'h1, 2'h1"
,
"const_1"
);
modules
[
9
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"2'h1, 2'h0"
,
"const_0"
);
modules
[
10
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"2'h1"
,
"mux_wOverflow_if_wCounterIt"
);
/* 11 hdl4se_mux2 mux_bCurrentCounter_if_nwReset*/
/* 11 hdl4se_mux2 mux_bCurrentCounter_if_nwReset*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
11
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bCurrentCounter_if_nwReset"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
}
{.
exprtype
=
EXPRTYPE_EMIT
},
/* 12 hdl4se_mux2 mux_wOverflow_if_nwReset*/
};
{
modules
[
11
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
const_expr_list_eval
(
2
,
expr_info
,
3
,
parameters
),
"mux_bCurrentCounter_if_nwReset"
);
char
*
instanceparam
;
modules
[
12
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_wOverflow_if_nwReset"
);
}
}
modules
[
12
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"2'h1"
,
"mux_wOverflow_if_nwReset"
);
/* 13 hdl4se_mux2 mux_bCurrentCounter*/
/* 13 hdl4se_mux2 mux_bCurrentCounter*/
{
{
char
*
instanceparam
;
const
expr_code
expr_info
[]
=
{
modules
[
13
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bCurrentCounter"
);
{.
exprtype
=
EXPRTYPE_PARAM
,
.
index
=
0
},
/* WIDTH */
}
{.
exprtype
=
EXPRTYPE_EMIT
},
/* 14 hdl4se_mux2 mux_wOverflow*/
};
{
modules
[
13
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
const_expr_list_eval
(
2
,
expr_info
,
3
,
parameters
),
"mux_bCurrentCounter"
);
char
*
instanceparam
;
modules
[
14
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_wOverflow"
);
}
}
modules
[
14
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"2'h1"
,
"mux_wOverflow"
);
}
}
/* 线网连接 */
/* 线网连接 */
...
@@ -440,66 +461,18 @@ IHDL4SEUnit** hdl4seCreate_000F(IHDL4SEModule** parent, const char* instancepara
...
@@ -440,66 +461,18 @@ IHDL4SEUnit** hdl4seCreate_000F(IHDL4SEModule** parent, const char* instancepara
}
}
{
/* 模块实例化 */
{
/* 模块实例化 */
/* 0 hdl4se_const const_cst0*/
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h3f"
,
"const_cst0"
);
{
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h6"
,
"const_cst1"
);
char
*
instanceparam
;
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h5b"
,
"const_cst2"
);
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst0"
);
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h4f"
,
"const_cst3"
);
}
modules
[
4
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h66"
,
"const_cst4"
);
/* 1 hdl4se_const const_cst1*/
modules
[
5
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h6d"
,
"const_cst5"
);
{
modules
[
6
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h7d"
,
"const_cst6"
);
char
*
instanceparam
;
modules
[
7
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h7"
,
"const_cst7"
);
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst1"
);
modules
[
8
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h7f"
,
"const_cst8"
);
}
modules
[
9
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h6f"
,
"const_cst9"
);
/* 2 hdl4se_const const_cst2*/
modules
[
10
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 32'h79"
,
"const_cst10"
);
{
modules
[
11
]
=
hdl4seCreateUnit2
(
module
,
"69B4A095-0644-4B9E-9CF0-295474D7C243"
,
"5'h8"
,
"mux_dec"
);
char
*
instanceparam
;
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst2"
);
}
/* 3 hdl4se_const const_cst3*/
{
char
*
instanceparam
;
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst3"
);
}
/* 4 hdl4se_const const_cst4*/
{
char
*
instanceparam
;
modules
[
4
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst4"
);
}
/* 5 hdl4se_const const_cst5*/
{
char
*
instanceparam
;
modules
[
5
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst5"
);
}
/* 6 hdl4se_const const_cst6*/
{
char
*
instanceparam
;
modules
[
6
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst6"
);
}
/* 7 hdl4se_const const_cst7*/
{
char
*
instanceparam
;
modules
[
7
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst7"
);
}
/* 8 hdl4se_const const_cst8*/
{
char
*
instanceparam
;
modules
[
8
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst8"
);
}
/* 9 hdl4se_const const_cst9*/
{
char
*
instanceparam
;
modules
[
9
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst9"
);
}
/* 10 hdl4se_const const_cst10*/
{
char
*
instanceparam
;
modules
[
10
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_cst10"
);
}
/* 11 hdl4se_mux16 mux_dec*/
{
char
*
instanceparam
;
modules
[
11
]
=
hdl4seCreateUnit2
(
module
,
"69B4A095-0644-4B9E-9CF0-295474D7C243"
,
instanceparam
,
"mux_dec"
);
}
}
}
/* 线网连接 */
/* 线网连接 */
...
@@ -686,306 +659,74 @@ IHDL4SEUnit** hdl4seCreate_main(IHDL4SEModule** parent, const char* instancepara
...
@@ -686,306 +659,74 @@ IHDL4SEUnit** hdl4seCreate_main(IHDL4SEModule** parent, const char* instancepara
}
}
{
/* 模块实例化 */
{
/* 模块实例化 */
/* 0 hdl4se_const const_0_wRead*/
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"2'h1, 2'h1"
,
"const_0_wRead"
);
{
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 32'hf0000000"
,
"const_bReadAddr"
);
char
*
instanceparam
;
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"D5152459-6798-49C8-8376-21EBE8A9EE3C"
,
"7'h20, 2'h1, 2'h0, 2'h1, 2'h1, 2'h1, 3'h2, 2'h1, 3'h3"
,
"bReadData_wButton012"
);
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_0_wRead"
);
modules
[
3
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter0"
);
}
modules
[
4
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter1"
);
/* 1 hdl4se_const const_bReadAddr*/
modules
[
5
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter2"
);
{
modules
[
6
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter3"
);
char
*
instanceparam
;
modules
[
7
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter4"
);
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_bReadAddr"
);
modules
[
8
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter5"
);
}
modules
[
9
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter6"
);
/* 2 hdl4se_split4 bReadData_wButton012*/
modules
[
10
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter7"
);
{
modules
[
11
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter8"
);
char
*
instanceparam
;
modules
[
12
]
=
hdl4seCreate_0010
(
module
,
"4'h4, 5'h9, 2'h0"
,
"counter9"
);
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"D5152459-6798-49C8-8376-21EBE8A9EE3C"
,
instanceparam
,
"bReadData_wButton012"
);
modules
[
13
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"2'h1"
,
"wCounterIt"
);
}
modules
[
14
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
"2'h1, 2'h1, 2'h1"
,
"Button0NotPressed"
);
/* 3 counter counter0*/
modules
[
15
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
"2'h1, 2'h1, 2'h1"
,
"unop_Button1NotPressed"
);
{
modules
[
16
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'ha"
,
"binop_counterit"
);
char
*
instanceparam
;
modules
[
17
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'ha"
,
"binop_resetcounter"
);
modules
[
3
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter0"
);
modules
[
18
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec0"
);
}
modules
[
19
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec1"
);
/* 4 counter counter1*/
modules
[
20
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec2"
);
{
modules
[
21
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec3"
);
char
*
instanceparam
;
modules
[
22
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec4"
);
modules
[
4
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter1"
);
modules
[
23
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec5"
);
}
modules
[
24
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec6"
);
/* 5 counter counter2*/
modules
[
25
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec7"
);
{
modules
[
26
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec8"
);
char
*
instanceparam
;
modules
[
27
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec9"
);
modules
[
5
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter2"
);
modules
[
28
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or98"
);
}
modules
[
29
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or76"
);
/* 6 counter counter3*/
modules
[
30
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or54"
);
{
modules
[
31
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or32"
);
char
*
instanceparam
;
modules
[
32
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or10"
);
modules
[
6
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter3"
);
modules
[
33
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or32"
);
}
modules
[
34
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'hb"
,
"or10"
);
/* 7 counter counter4*/
modules
[
35
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"3'h3"
,
"reg_bCounterChanged"
);
{
modules
[
36
]
=
hdl4seCreateUnit2
(
module
,
"D1F303E2-3ED1-42FD-8762-3AA623DA901E"
,
"2'h1, 2'h1, 2'h1"
,
"bind_wCounterin"
);
char
*
instanceparam
;
modules
[
37
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"3'h3, 2'h0"
,
"const_b3b0"
);
modules
[
7
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter4"
);
modules
[
38
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"3'h3"
,
"mux_if_nwReset"
);
}
modules
[
39
]
=
hdl4seCreateUnit2
(
module
,
"D5152459-6798-49C8-8376-21EBE8A9EE3C"
,
"3'h3, 2'h1, 2'h0, 2'h1, 2'h1, 2'h1, 3'h2, 2'h1, 3'h2"
,
"split4_bCounterChanged"
);
/* 8 counter counter5*/
modules
[
40
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"2'h1"
,
"reg_wWrite"
);
{
modules
[
41
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"7'h20"
,
"reg_bWriteAddr"
);
char
*
instanceparam
;
modules
[
42
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"7'h20"
,
"reg_bWriteData"
);
modules
[
8
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter5"
);
modules
[
43
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
"4'h4"
,
"reg_bWriteMask"
);
}
modules
[
44
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"5'h8, 2'h0"
,
"const_b8b0"
);
/* 9 counter counter6*/
modules
[
45
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"4'h4, 2'h0"
,
"const_b4b0000"
);
{
modules
[
46
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"4'h4, 32'hfffffffc"
,
"const_b4b1100"
);
char
*
instanceparam
;
modules
[
47
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 2'h0"
,
"const_b32b0"
);
modules
[
9
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter6"
);
modules
[
48
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 32'hf0000018"
,
"const_b32hf0000018"
);
}
modules
[
49
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 32'hf0000014"
,
"const_b32hf0000014"
);
/* 10 counter counter7*/
modules
[
50
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 32'hf0000010"
,
"const_b32hf0000018"
);
{
modules
[
51
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
"5'h8, 5'h8, 5'h8, 5'h8"
,
"bind_0098"
);
char
*
instanceparam
;
modules
[
52
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
"5'h8, 5'h8, 5'h8, 5'h8"
,
"bind_7654"
);
modules
[
10
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter7"
);
modules
[
53
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
"5'h8, 5'h8, 5'h8, 5'h8"
,
"bind_3210"
);
}
modules
[
54
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"4'h4"
,
"mux_bWriteMask_if_bCounterChanged0"
);
/* 11 counter counter8*/
modules
[
55
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteAddr_if_bCounterChanged0"
);
{
modules
[
56
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteData_if_bCounterChanged0"
);
char
*
instanceparam
;
modules
[
57
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"4'h4"
,
"mux_bWriteMask_if_bCounterChanged1"
);
modules
[
11
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter8"
);
modules
[
58
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteAddr_if_bCounterChanged1"
);
}
modules
[
59
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteData_if_bCounterChanged1"
);
/* 12 counter counter9*/
modules
[
60
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"4'h4"
,
"mux_bWriteMask_if_bCounterChanged2"
);
{
modules
[
61
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteAddr_if_bCounterChanged1"
);
char
*
instanceparam
;
modules
[
62
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteData_if_bCounterChanged2"
);
modules
[
12
]
=
hdl4seCreate_0010
(
module
,
instanceparam
,
"counter9"
);
modules
[
63
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"4'h4"
,
"mux_bWriteMask_if_nwReset"
);
}
modules
[
64
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteAddr_if_nwReset"
);
/* 13 hdl4se_reg wCounterIt*/
modules
[
65
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
"7'h20"
,
"mux_bWriteData_if_nwReset"
);
{
modules
[
66
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
"3'h3, 2'h1, 3'h3"
,
"or_bCounterChanged"
);
char
*
instanceparam
;
modules
[
67
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
"2'h1, 2'h1, 2'h1, 5'ha"
,
"and_nwReset_bCounterChanged"
);
modules
[
13
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"wCounterIt"
);
}
/* 14 hdl4se_unop Button0NotPressed*/
{
char
*
instanceparam
;
modules
[
14
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
instanceparam
,
"Button0NotPressed"
);
}
/* 15 hdl4se_unop unop_Button1NotPressed*/
{
char
*
instanceparam
;
modules
[
15
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
instanceparam
,
"unop_Button1NotPressed"
);
}
/* 16 hdl4se_binop binop_counterit*/
{
char
*
instanceparam
;
modules
[
16
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"binop_counterit"
);
}
/* 17 hdl4se_binop binop_resetcounter*/
{
char
*
instanceparam
;
modules
[
17
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"binop_resetcounter"
);
}
modules
[
18
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec0"
);
modules
[
19
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec1"
);
modules
[
20
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec2"
);
modules
[
21
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec3"
);
modules
[
22
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec4"
);
modules
[
23
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec5"
);
modules
[
24
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec6"
);
modules
[
25
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec7"
);
modules
[
26
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec8"
);
modules
[
27
]
=
hdl4seCreate_000F
(
module
,
""
,
"dec9"
);
/* 28 hdl4se_binop or98*/
{
char
*
instanceparam
;
modules
[
28
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or98"
);
}
/* 29 hdl4se_binop or76*/
{
char
*
instanceparam
;
modules
[
29
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or76"
);
}
/* 30 hdl4se_binop or54*/
{
char
*
instanceparam
;
modules
[
30
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or54"
);
}
/* 31 hdl4se_binop or32*/
{
char
*
instanceparam
;
modules
[
31
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or32"
);
}
/* 32 hdl4se_binop or10*/
{
char
*
instanceparam
;
modules
[
32
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or10"
);
}
/* 33 hdl4se_binop or32*/
{
char
*
instanceparam
;
modules
[
33
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or32"
);
}
/* 34 hdl4se_binop or10*/
{
char
*
instanceparam
;
modules
[
34
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"or10"
);
}
/* 35 hdl4se_reg reg_bCounterChanged*/
{
char
*
instanceparam
;
modules
[
35
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"reg_bCounterChanged"
);
}
/* 36 hdl4se_bind3 bind_wCounterin*/
{
char
*
instanceparam
;
modules
[
36
]
=
hdl4seCreateUnit2
(
module
,
"D1F303E2-3ED1-42FD-8762-3AA623DA901E"
,
instanceparam
,
"bind_wCounterin"
);
}
/* 37 hdl4se_const const_b3b0*/
{
char
*
instanceparam
;
modules
[
37
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b3b0"
);
}
/* 38 hdl4se_mux2 mux_if_nwReset*/
{
char
*
instanceparam
;
modules
[
38
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_if_nwReset"
);
}
/* 39 hdl4se_split4 split4_bCounterChanged*/
{
char
*
instanceparam
;
modules
[
39
]
=
hdl4seCreateUnit2
(
module
,
"D5152459-6798-49C8-8376-21EBE8A9EE3C"
,
instanceparam
,
"split4_bCounterChanged"
);
}
/* 40 hdl4se_reg reg_wWrite*/
{
char
*
instanceparam
;
modules
[
40
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"reg_wWrite"
);
}
/* 41 hdl4se_reg reg_bWriteAddr*/
{
char
*
instanceparam
;
modules
[
41
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"reg_bWriteAddr"
);
}
/* 42 hdl4se_reg reg_bWriteData*/
{
char
*
instanceparam
;
modules
[
42
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"reg_bWriteData"
);
}
/* 43 hdl4se_reg reg_bWriteMask*/
{
char
*
instanceparam
;
modules
[
43
]
=
hdl4seCreateUnit2
(
module
,
"76FBFD4B-FEAD-45fd-AA27-AFC58AC241C2"
,
instanceparam
,
"reg_bWriteMask"
);
}
/* 44 hdl4se_const const_b8b0*/
{
char
*
instanceparam
;
modules
[
44
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b8b0"
);
}
/* 45 hdl4se_const const_b4b0000*/
{
char
*
instanceparam
;
modules
[
45
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b4b0000"
);
}
/* 46 hdl4se_const const_b4b1100*/
{
char
*
instanceparam
;
modules
[
46
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b4b1100"
);
}
/* 47 hdl4se_const const_b32b0*/
{
char
*
instanceparam
;
modules
[
47
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b32b0"
);
}
/* 48 hdl4se_const const_b32hf0000018*/
{
char
*
instanceparam
;
modules
[
48
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b32hf0000018"
);
}
/* 49 hdl4se_const const_b32hf0000014*/
{
char
*
instanceparam
;
modules
[
49
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b32hf0000014"
);
}
/* 50 hdl4se_const const_b32hf0000018*/
{
char
*
instanceparam
;
modules
[
50
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_b32hf0000018"
);
}
/* 51 hdl4se_bind4 bind_0098*/
{
char
*
instanceparam
;
modules
[
51
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
instanceparam
,
"bind_0098"
);
}
/* 52 hdl4se_bind4 bind_7654*/
{
char
*
instanceparam
;
modules
[
52
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
instanceparam
,
"bind_7654"
);
}
/* 53 hdl4se_bind4 bind_3210*/
{
char
*
instanceparam
;
modules
[
53
]
=
hdl4seCreateUnit2
(
module
,
"0234ECE7-A9C5-406B-9AE7-4841EA0DF7C9"
,
instanceparam
,
"bind_3210"
);
}
/* 54 hdl4se_mux2 mux_bWriteMask_if_bCounterChanged0*/
{
char
*
instanceparam
;
modules
[
54
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteMask_if_bCounterChanged0"
);
}
/* 55 hdl4se_mux2 mux_bWriteAddr_if_bCounterChanged0*/
{
char
*
instanceparam
;
modules
[
55
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteAddr_if_bCounterChanged0"
);
}
/* 56 hdl4se_mux2 mux_bWriteData_if_bCounterChanged0*/
{
char
*
instanceparam
;
modules
[
56
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteData_if_bCounterChanged0"
);
}
/* 57 hdl4se_mux2 mux_bWriteMask_if_bCounterChanged1*/
{
char
*
instanceparam
;
modules
[
57
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteMask_if_bCounterChanged1"
);
}
/* 58 hdl4se_mux2 mux_bWriteAddr_if_bCounterChanged1*/
{
char
*
instanceparam
;
modules
[
58
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteAddr_if_bCounterChanged1"
);
}
/* 59 hdl4se_mux2 mux_bWriteData_if_bCounterChanged1*/
{
char
*
instanceparam
;
modules
[
59
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteData_if_bCounterChanged1"
);
}
/* 60 hdl4se_mux2 mux_bWriteMask_if_bCounterChanged2*/
{
char
*
instanceparam
;
modules
[
60
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteMask_if_bCounterChanged2"
);
}
/* 61 hdl4se_mux2 mux_bWriteAddr_if_bCounterChanged1*/
{
char
*
instanceparam
;
modules
[
61
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteAddr_if_bCounterChanged1"
);
}
/* 62 hdl4se_mux2 mux_bWriteData_if_bCounterChanged2*/
{
char
*
instanceparam
;
modules
[
62
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteData_if_bCounterChanged2"
);
}
/* 63 hdl4se_mux2 mux_bWriteMask_if_nwReset*/
{
char
*
instanceparam
;
modules
[
63
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteMask_if_nwReset"
);
}
/* 64 hdl4se_mux2 mux_bWriteAddr_if_nwReset*/
{
char
*
instanceparam
;
modules
[
64
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteAddr_if_nwReset"
);
}
/* 65 hdl4se_mux2 mux_bWriteData_if_nwReset*/
{
char
*
instanceparam
;
modules
[
65
]
=
hdl4seCreateUnit2
(
module
,
"9B0B3D25-346D-48B9-ABB9-ED755910425D"
,
instanceparam
,
"mux_bWriteData_if_nwReset"
);
}
/* 66 hdl4se_unop or_bCounterChanged*/
{
char
*
instanceparam
;
modules
[
66
]
=
hdl4seCreateUnit2
(
module
,
"E6772805-57BB-4b39-A10D-FDA6A4810E3B"
,
instanceparam
,
"or_bCounterChanged"
);
}
/* 67 hdl4se_binop and_nwReset_bCounterChanged*/
{
char
*
instanceparam
;
modules
[
67
]
=
hdl4seCreateUnit2
(
module
,
"060FB913-1C0F-4704-8EC2-A08BF5387062"
,
instanceparam
,
"and_nwReset_bCounterChanged"
);
}
}
}
/* 线网连接 */
/* 线网连接 */
...
...
examples/counter/verilog/main_asm.v
浏览文件 @
9d69d016
...
@@ -104,14 +104,14 @@ hdl4se_const #(WIDTH, RESETVALUE) const_RESETVALUE(bConst_RESETVALUE);
...
@@ -104,14 +104,14 @@ hdl4se_const #(WIDTH, RESETVALUE) const_RESETVALUE(bConst_RESETVALUE);
wire
wEQ_bCurrentCounter_MAXVALUE
;
wire
wEQ_bCurrentCounter_MAXVALUE
;
/* 比较器 bCurrentCounter == MAXVALUE */
/* 比较器 bCurrentCounter == MAXVALUE */
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
BINOP_EQ
)
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
`
BINOP_EQ
)
binop_EQ_bCurrentCounter_MAXVALUE
(
binop_EQ_bCurrentCounter_MAXVALUE
(
wireout_bCurrentCounter
,
wireout_bCurrentCounter
,
bConst_MAXVALUE
,
bConst_MAXVALUE
,
wEQ_bCurrentCounter_MAXVALUE
wEQ_bCurrentCounter_MAXVALUE
);
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_AND
)
binop_counter_overfloat
(
binop_counter_overfloat
(
wEQ_bCurrentCounter_MAXVALUE
,
wEQ_bCurrentCounter_MAXVALUE
,
wCounterIt
,
wCounterIt
,
...
@@ -123,7 +123,7 @@ hdl4se_binop #(1, 1, 1, BINOP_AND)
...
@@ -123,7 +123,7 @@ hdl4se_binop #(1, 1, 1, BINOP_AND)
wire
[
WIDTH
-
1
:
0
]
bConst_One
;
wire
[
WIDTH
-
1
:
0
]
bConst_One
;
wire
[
WIDTH
-
1
:
0
]
bCurrentCounterPlusOne
;
wire
[
WIDTH
-
1
:
0
]
bCurrentCounterPlusOne
;
hdl4se_const
#(
WIDTH
,
1
)
const_One
(
bConst_One
);
hdl4se_const
#(
WIDTH
,
1
)
const_One
(
bConst_One
);
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
BINOP_ADD
)
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
`
BINOP_ADD
)
binop_bCurrentCounterInc
(
binop_bCurrentCounterInc
(
wireout_bCurrentCounter
,
wireout_bCurrentCounter
,
bConst_One
,
bConst_One
,
...
@@ -249,15 +249,15 @@ assign wCounterin9 = wCounterin8;
...
@@ -249,15 +249,15 @@ assign wCounterin9 = wCounterin8;
wireout_wCounterIt
wireout_wCounterIt
);
);
wire
wButton0NotPressed
;
wire
wButton0NotPressed
;
hdl4se_unop
#(
1
,
1
,
UNOP_NOT
)
Button0NotPressed
(
wButton0Pressed
,
wButton0NotPressed
);
hdl4se_unop
#(
1
,
1
,
`
UNOP_NOT
)
Button0NotPressed
(
wButton0Pressed
,
wButton0NotPressed
);
/*counterit= (~b1) & b2*/
/*counterit= (~b1) & b2*/
wire
wButton1NotPressed
;
wire
wButton1NotPressed
;
hdl4se_unop
#(
1
,
1
,
UNOP_NOT
)
unop_Button1NotPressed
(
wButton1Pressed
,
wButton1NotPressed
);
hdl4se_unop
#(
1
,
1
,
`
UNOP_NOT
)
unop_Button1NotPressed
(
wButton1Pressed
,
wButton1NotPressed
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
binop_counterit
(
wButton1NotPressed
,
wButton2Pressed
,
wirein_wCounterIt
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_AND
)
binop_counterit
(
wButton1NotPressed
,
wButton2Pressed
,
wirein_wCounterIt
);
/*assign nwResetCount = (~b0) & nwReset; */
/*assign nwResetCount = (~b0) & nwReset; */
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
binop_resetcounter
(
wButton0NotPressed
,
nwReset
,
nwResetCount
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_AND
)
binop_resetcounter
(
wButton0NotPressed
,
nwReset
,
nwResetCount
);
/* 以下是译码器连接,十个计数器的输出对应到十个译码器 */
/* 以下是译码器连接,十个计数器的输出对应到十个译码器 */
wire
[
7
:
0
]
code0
;
wire
[
7
:
0
]
code0
;
...
@@ -286,13 +286,13 @@ dec2seg dec9(bCount9, code9);
...
@@ -286,13 +286,13 @@ dec2seg dec9(bCount9, code9);
wire
wCounterin98
,
wCounterin76
,
wCounterin54
,
wCounterin32
,
wCounterin10
,
wire
wCounterin98
,
wCounterin76
,
wCounterin54
,
wCounterin32
,
wCounterin10
,
wCounterin7654
,
wCounterin3210
;
wCounterin7654
,
wCounterin3210
;
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or98
(
wCounterin9
,
wCounterin8
,
wCounterin98
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or98
(
wCounterin9
,
wCounterin8
,
wCounterin98
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or76
(
wCounterin7
,
wCounterin6
,
wCounterin76
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or76
(
wCounterin7
,
wCounterin6
,
wCounterin76
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or54
(
wCounterin5
,
wCounterin4
,
wCounterin54
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or54
(
wCounterin5
,
wCounterin4
,
wCounterin54
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or32
(
wCounterin3
,
wCounterin2
,
wCounterin32
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or32
(
wCounterin3
,
wCounterin2
,
wCounterin32
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or10
(
wCounterin1
,
wCounterin0
,
wCounterin10
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or10
(
wCounterin1
,
wCounterin0
,
wCounterin10
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or32
(
wCounterin76
,
wCounterin54
,
wCounterin7654
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or32
(
wCounterin76
,
wCounterin54
,
wCounterin7654
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or10
(
wCounterin32
,
wCounterin10
,
wCounterin3210
);
hdl4se_binop
#(
1
,
1
,
1
,
`
BINOP_OR
)
or10
(
wCounterin32
,
wCounterin10
,
wCounterin3210
);
wire
[
2
:
0
]
wirein_bCounterChanged
,
wireout_bCounterChanged
;
wire
[
2
:
0
]
wirein_bCounterChanged
,
wireout_bCounterChanged
;
hdl4se_reg
#(
3
)
reg_bCounterChanged
(
hdl4se_reg
#(
3
)
reg_bCounterChanged
(
...
...
examples/counter/verilog/main_asm_dump.v
浏览文件 @
9d69d016
...
@@ -461,10 +461,10 @@ module counter
...
@@ -461,10 +461,10 @@ module counter
hdl4se_reg
#(
WIDTH
)
bCurrentCounter
(
wClk
,
wirein_bCurrentCounter
,
wireout_bCurrentCounter
);
hdl4se_reg
#(
WIDTH
)
bCurrentCounter
(
wClk
,
wirein_bCurrentCounter
,
wireout_bCurrentCounter
);
hdl4se_const
#(
WIDTH
,
MAXVALUE
)
const_MAXVALUE
(
bConst_MAXVALUE
);
hdl4se_const
#(
WIDTH
,
MAXVALUE
)
const_MAXVALUE
(
bConst_MAXVALUE
);
hdl4se_const
#(
WIDTH
,
RESETVALUE
)
const_RESETVALUE
(
bConst_RESETVALUE
);
hdl4se_const
#(
WIDTH
,
RESETVALUE
)
const_RESETVALUE
(
bConst_RESETVALUE
);
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
BINOP_EQ
)
binop_EQ_bCurrentCounter_MAXVALUE
(
wireout_bCurrentCounter
,
bConst_MAXVALUE
,
wEQ_bCurrentCounter_MAXVALUE
);
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
4
)
binop_EQ_bCurrentCounter_MAXVALUE
(
wireout_bCurrentCounter
,
bConst_MAXVALUE
,
wEQ_bCurrentCounter_MAXVALUE
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
binop_counter_overfloat
(
wEQ_bCurrentCounter_MAXVALUE
,
wCounterIt
,
wCounterOverflow
);
hdl4se_binop
#(
1
,
1
,
1
,
10
)
binop_counter_overfloat
(
wEQ_bCurrentCounter_MAXVALUE
,
wCounterIt
,
wCounterOverflow
);
hdl4se_const
#(
WIDTH
,
1
)
const_One
(
bConst_One
);
hdl4se_const
#(
WIDTH
,
1
)
const_One
(
bConst_One
);
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
BINOP_ADD
)
binop_bCurrentCounterInc
(
wireout_bCurrentCounter
,
bConst_One
,
bCurrentCounterPlusOne
);
hdl4se_binop
#(
WIDTH
,
WIDTH
,
1
,
0
)
binop_bCurrentCounterInc
(
wireout_bCurrentCounter
,
bConst_One
,
bCurrentCounterPlusOne
);
hdl4se_mux2
#(
WIDTH
)
mux_bCurrentCounter_if_wCounterIt
(
wEQ_bCurrentCounter_MAXVALUE
,
bCurrentCounterPlusOne
,
bConst_RESETVALUE
,
bCurrentCounter_if_wCounterIt
);
hdl4se_mux2
#(
WIDTH
)
mux_bCurrentCounter_if_wCounterIt
(
wEQ_bCurrentCounter_MAXVALUE
,
bCurrentCounterPlusOne
,
bConst_RESETVALUE
,
bCurrentCounter_if_wCounterIt
);
hdl4se_const
#(
1
,
1
)
const_1
(
wConst_1
);
hdl4se_const
#(
1
,
1
)
const_1
(
wConst_1
);
hdl4se_const
#(
1
,
0
)
const_0
(
wConst_0
);
hdl4se_const
#(
1
,
0
)
const_0
(
wConst_0
);
...
@@ -598,10 +598,10 @@ module main
...
@@ -598,10 +598,10 @@ module main
counter
#(
4
,
9
,
0
)
counter8
(
wClk
,
nwResetCount
,
wCounterin8
,
bCount8
,
wOverflow8
);
counter
#(
4
,
9
,
0
)
counter8
(
wClk
,
nwResetCount
,
wCounterin8
,
bCount8
,
wOverflow8
);
counter
#(
4
,
9
,
0
)
counter9
(
wClk
,
nwResetCount
,
wCounterin9
,
bCount9
,
wnouse
);
counter
#(
4
,
9
,
0
)
counter9
(
wClk
,
nwResetCount
,
wCounterin9
,
bCount9
,
wnouse
);
hdl4se_reg
#(
1
)
wCounterIt
(
wClk
,
wirein_wCounterIt
,
wireout_wCounterIt
);
hdl4se_reg
#(
1
)
wCounterIt
(
wClk
,
wirein_wCounterIt
,
wireout_wCounterIt
);
hdl4se_unop
#(
1
,
1
,
UNOP_NOT
)
Button0NotPressed
(
wButton0Pressed
,
wButton0NotPressed
);
hdl4se_unop
#(
1
,
1
,
1
)
Button0NotPressed
(
wButton0Pressed
,
wButton0NotPressed
);
hdl4se_unop
#(
1
,
1
,
UNOP_NOT
)
unop_Button1NotPressed
(
wButton1Pressed
,
wButton1NotPressed
);
hdl4se_unop
#(
1
,
1
,
1
)
unop_Button1NotPressed
(
wButton1Pressed
,
wButton1NotPressed
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
binop_counterit
(
wButton1NotPressed
,
wButton2Pressed
,
wirein_wCounterIt
);
hdl4se_binop
#(
1
,
1
,
1
,
10
)
binop_counterit
(
wButton1NotPressed
,
wButton2Pressed
,
wirein_wCounterIt
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_AND
)
binop_resetcounter
(
wButton0NotPressed
,
nwReset
,
nwResetCount
);
hdl4se_binop
#(
1
,
1
,
1
,
10
)
binop_resetcounter
(
wButton0NotPressed
,
nwReset
,
nwResetCount
);
dec2seg
dec0
(
bCount0
,
code0
);
dec2seg
dec0
(
bCount0
,
code0
);
dec2seg
dec1
(
bCount1
,
code1
);
dec2seg
dec1
(
bCount1
,
code1
);
dec2seg
dec2
(
bCount2
,
code2
);
dec2seg
dec2
(
bCount2
,
code2
);
...
@@ -612,13 +612,13 @@ module main
...
@@ -612,13 +612,13 @@ module main
dec2seg
dec7
(
bCount7
,
code7
);
dec2seg
dec7
(
bCount7
,
code7
);
dec2seg
dec8
(
bCount8
,
code8
);
dec2seg
dec8
(
bCount8
,
code8
);
dec2seg
dec9
(
bCount9
,
code9
);
dec2seg
dec9
(
bCount9
,
code9
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or98
(
wCounterin9
,
wCounterin8
,
wCounterin98
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or98
(
wCounterin9
,
wCounterin8
,
wCounterin98
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or76
(
wCounterin7
,
wCounterin6
,
wCounterin76
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or76
(
wCounterin7
,
wCounterin6
,
wCounterin76
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or54
(
wCounterin5
,
wCounterin4
,
wCounterin54
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or54
(
wCounterin5
,
wCounterin4
,
wCounterin54
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or32
(
wCounterin3
,
wCounterin2
,
wCounterin32
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or32
(
wCounterin3
,
wCounterin2
,
wCounterin32
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or10
(
wCounterin1
,
wCounterin0
,
wCounterin10
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or10
(
wCounterin1
,
wCounterin0
,
wCounterin10
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or32
(
wCounterin76
,
wCounterin54
,
wCounterin7654
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or32
(
wCounterin76
,
wCounterin54
,
wCounterin7654
);
hdl4se_binop
#(
1
,
1
,
1
,
BINOP_OR
)
or10
(
wCounterin32
,
wCounterin10
,
wCounterin3210
);
hdl4se_binop
#(
1
,
1
,
1
,
11
)
or10
(
wCounterin32
,
wCounterin10
,
wCounterin3210
);
hdl4se_reg
#(
3
)
reg_bCounterChanged
(
wClk
,
wirein_bCounterChanged
,
wireout_bCounterChanged
);
hdl4se_reg
#(
3
)
reg_bCounterChanged
(
wClk
,
wirein_bCounterChanged
,
wireout_bCounterChanged
);
hdl4se_bind3
#(
1
,
1
,
1
)
bind_wCounterin
(
wCounterin98
,
wCounterin7654
,
wCounterin3210
,
bChanged_if_nwReset
);
hdl4se_bind3
#(
1
,
1
,
1
)
bind_wCounterin
(
wCounterin98
,
wCounterin7654
,
wCounterin3210
,
bChanged_if_nwReset
);
hdl4se_const
#(
3
,
0
)
const_b3b0
(
b3b0
);
hdl4se_const
#(
3
,
0
)
const_b3b0
(
b3b0
);
...
...
examples/terris/src/main.c
浏览文件 @
9d69d016
...
@@ -68,7 +68,7 @@ int main(int argc, char* argv[])
...
@@ -68,7 +68,7 @@ int main(int argc, char* argv[])
IHDL4SEUnit
**
sim_unit
;
IHDL4SEUnit
**
sim_unit
;
A_u_t_o_registor_terrisctrl
();
A_u_t_o_registor_terrisctrl
();
sim
=
hdl4sesimCreateSimulator
();
sim
=
hdl4sesimCreateSimulator
();
topmodule
=
hdl4seCreate_main
2
(
NULL
,
""
,
"main"
);
topmodule
=
hdl4seCreate_main
(
NULL
,
""
,
"main"
);
gui
=
guiCreate
(
0xf0000000
,
"terris"
);
gui
=
guiCreate
(
0xf0000000
,
"terris"
);
objectCall1
(
sim
,
SetTopModule
,
topmodule
);
objectCall1
(
sim
,
SetTopModule
,
topmodule
);
objectCall1
(
sim
,
AddDevice
,
gui
);
objectCall1
(
sim
,
AddDevice
,
gui
);
...
...
examples/terris/src/topmodule.c
浏览文件 @
9d69d016
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
/*
/*
* Created by HDL4SE @ Sat Jun 12
15:21:53
2021
* Created by HDL4SE @ Sat Jun 12
21:02:17
2021
* Don't edit it.
* Don't edit it.
*/
*/
...
@@ -47,20 +47,6 @@
...
@@ -47,20 +47,6 @@
#include "verilog_parsetree.h"
#include "verilog_parsetree.h"
typedef
IHDL4SEUnit
**
(
*
hdl4seCreate_Func
)(
IHDL4SEModule
**
parent
,
const
char
*
instanceparam
,
const
char
*
name
);
typedef
struct
s_module_info
{
int
isbasiccell
;
int
moduleindex
;
union
{
const
char
**
clsid
;
hdl4seCreate_Func
*
hdl4seCreate_func
;
};
}
module_info
;
static
const
char
*
softmodule_000F
=
"hdl4se"
;
static
const
char
*
softmodule_000B
=
"hdl4se"
;
IHDL4SEUnit
**
hdl4seCreate_main
(
IHDL4SEModule
**
parent
,
const
char
*
instanceparam
,
const
char
*
name
)
IHDL4SEUnit
**
hdl4seCreate_main
(
IHDL4SEModule
**
parent
,
const
char
*
instanceparam
,
const
char
*
name
)
{
/* module main */
{
/* module main */
IHDL4SEModule
**
module
;
IHDL4SEModule
**
module
;
...
@@ -84,42 +70,29 @@ IHDL4SEUnit** hdl4seCreate_main(IHDL4SEModule** parent, const char* instancepara
...
@@ -84,42 +70,29 @@ IHDL4SEUnit** hdl4seCreate_main(IHDL4SEModule** parent, const char* instancepara
/* 8*/
objectCall3
(
module
,
AddPort
,
PORT_DIRECT_INPUT
,
32
,
"bReadData"
);
/* 8*/
objectCall3
(
module
,
AddPort
,
PORT_DIRECT_INPUT
,
32
,
"bReadData"
);
{
/* 模块实例化 */
{
/* 模块实例化 */
char
instanceparam
[
256
];
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"6f8a9aa6-ec57-4734-a183-7871ed57ea95"
,
""
,
"ctrl"
);
/* 0 teris_ctrl ctrl*/
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"2'h1, 2'h1"
,
"const_wRead"
);
{
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"7'h20, 32'hf0000000"
,
"const_bReadAddr"
);
modules
[
0
]
=
hdl4seCreateUnit2
(
module
,
"6f8a9aa6-ec57-4734-a183-7871ed57ea95"
,
instanceparam
,
"ctrl"
);
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
"2'h1, 2'h1"
,
"const_wWrite"
);
}
/* 1 hdl4se_const const_wRead*/
{
modules
[
1
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_wRead"
);
}
/* 2 hdl4se_const const_bReadAddr*/
{
modules
[
2
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_bReadAddr"
);
}
/* 3 hdl4se_const const_wWrite*/
{
modules
[
3
]
=
hdl4seCreateUnit2
(
module
,
"8FBE5B87-B484-4f95-8291-DBEF86A1C354"
,
instanceparam
,
"const_wWrite"
);
}
}
}
/* 线网连接 */
/* 线网连接 */
/* instance "ctrl", module "teris_ctrl" */
/* instance "ctrl", module "teris_ctrl" */
objectCall3
(
modules
[
0
],
Connect
,
0
,
unit
,
0
);
objectCall3
(
modules
[
0
],
Connect
,
0
,
unit
,
0
);
objectCall3
(
modules
[
0
],
Connect
,
1
,
unit
,
1
);
objectCall3
(
modules
[
0
],
Connect
,
1
,
unit
,
1
);
objectCall3
(
unit
,
Connect
,
3
,
modules
[
0
],
2
);
objectCall3
(
unit
,
Connect
,
3
,
modules
[
0
],
2
);
objectCall3
(
unit
,
Connect
,
4
,
modules
[
0
],
3
);
objectCall3
(
unit
,
Connect
,
4
,
modules
[
0
],
3
);
objectCall3
(
modules
[
0
],
Connect
,
4
,
unit
,
8
);
objectCall3
(
modules
[
0
],
Connect
,
4
,
unit
,
8
);
/* instance "const_wRead", module "hdl4se_const" */
/* instance "const_wRead", module "hdl4se_const" */
objectCall3
(
unit
,
Connect
,
6
,
modules
[
1
],
0
);
objectCall3
(
unit
,
Connect
,
6
,
modules
[
1
],
0
);
/* instance "const_bReadAddr", module "hdl4se_const" */
/* instance "const_bReadAddr", module "hdl4se_const" */
objectCall3
(
unit
,
Connect
,
7
,
modules
[
2
],
0
);
objectCall3
(
unit
,
Connect
,
7
,
modules
[
2
],
0
);
/* instance "const_wWrite", module "hdl4se_const" */
/* instance "const_wWrite", module "hdl4se_const" */
objectCall3
(
unit
,
Connect
,
2
,
modules
[
3
],
0
);
objectCall3
(
unit
,
Connect
,
2
,
modules
[
3
],
0
);
/*释放module接口*/
/*释放module接口*/
objectRelease
(
module
);
objectRelease
(
module
);
...
...
hdl4secell/src/hdl4secell.c
浏览文件 @
9d69d016
...
@@ -110,7 +110,7 @@ IHDL4SEUnit** hdl4seCreateUnit2(IHDL4SEModule** parent, const char* clsid, const
...
@@ -110,7 +110,7 @@ IHDL4SEUnit** hdl4seCreateUnit2(IHDL4SEModule** parent, const char* clsid, const
{
{
unsigned
int
inclsid
[
4
];
unsigned
int
inclsid
[
4
];
str2iid
(
clsid
,
inclsid
);
str2iid
(
clsid
,
inclsid
);
return
hdl4seCreateUnit
2
(
parent
,
inclsid
,
instanceparam
,
name
);
return
hdl4seCreateUnit
(
parent
,
inclsid
,
instanceparam
,
name
);
}
}
...
...
parser/verilog_expr.c
浏览文件 @
9d69d016
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "conststring.h"
#include "conststring.h"
#include "verilog_parsetree.h"
#include "verilog_parsetree.h"
#include "verilog_module.h"
#include "verilog_module.h"
#include "verilog_varsel.h"
#define IMPLEMENT_GUID
#define IMPLEMENT_GUID
#include "verilog_expr.h"
#include "verilog_expr.h"
#undef IMPLEMENT_GUID
#undef IMPLEMENT_GUID
...
@@ -420,42 +421,76 @@ int verilogparseGenConstExpr(FILE* pFile, const char* pre, HOBJECT expr, HOBJECT
...
@@ -420,42 +421,76 @@ int verilogparseGenConstExpr(FILE* pFile, const char* pre, HOBJECT expr, HOBJECT
count
=
1
;
count
=
1
;
switch
(
pobj
->
data
.
exprtype
)
{
switch
(
pobj
->
data
.
exprtype
)
{
case
EXPRTYPE_NUMBER
:
case
EXPRTYPE_NUMBER
:
{
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_NUMBER, .value=
\"
%s
\"
},
\n
"
,
pre
,
pobj
->
data
.
value
->
string
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_NUMBER, .value=
\"
%s
\"
},
\n
"
,
pre
,
pobj
->
data
.
value
->
string
);
break
;
break
;
}
case
EXPRTYPE_BIGNUMBER
:
case
EXPRTYPE_BIGNUMBER
:
{
objectCall3
(
pobj
->
data
.
bignumber
,
GetStr
,
16
,
hdl4se_parse_logbuf
(),
1024
);
objectCall3
(
pobj
->
data
.
bignumber
,
GetStr
,
16
,
hdl4se_parse_logbuf
(),
1024
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_NUMBER, .value=
\"
%s
\"
},
\n
"
,
pre
,
hdl4se_parse_logbuf
());
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_NUMBER, .value=
\"
%s
\"
},
\n
"
,
pre
,
hdl4se_parse_logbuf
());
break
;
break
;
}
case
EXPRTYPE_STRING
:
case
EXPRTYPE_STRING
:
{
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_STRING, .value=%s},
\n
"
,
pre
,
pobj
->
data
.
value
->
string
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_STRING, .value=%s},
\n
"
,
pre
,
pobj
->
data
.
value
->
string
);
break
;
break
;
}
case
EXPRTYPE_PARAM
:
case
EXPRTYPE_PARAM
:
{
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_PARAM, .index=%d},/* %s */
\n
"
,
pre
,
verilogModuleGetParamIndex
(
module
,
pobj
->
data
.
value
->
string
),
pobj
->
data
.
value
->
string
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_PARAM, .index=%d},/* %s */
\n
"
,
pre
,
verilogModuleGetParamIndex
(
module
,
pobj
->
data
.
value
->
string
),
pobj
->
data
.
value
->
string
);
break
;
break
;
}
case
EXPRTYPE_LOCALPARAM
:
case
EXPRTYPE_LOCALPARAM
:
{
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_LOCALPARAM, .index=%d},/* %s */
\n
"
,
pre
,
verilogModuleGetLocalParamIndex
(
module
,
pobj
->
data
.
value
->
string
),
pobj
->
data
.
value
->
string
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_LOCALPARAM, .index=%d},/* %s */
\n
"
,
pre
,
verilogModuleGetLocalParamIndex
(
module
,
pobj
->
data
.
value
->
string
),
pobj
->
data
.
value
->
string
);
break
;
break
;
}
case
EXPRTYPE_BINOP
:
case
EXPRTYPE_BINOP
:
{
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr1
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr1
,
module
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_BINOP, .op=%s},
\n
"
,
pre
,
OPERATOR_name
[
pobj
->
data
.
op
]);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_BINOP, .op=%s},
\n
"
,
pre
,
OPERATOR_name
[
pobj
->
data
.
op
]);
count
++
;
count
++
;
break
;
break
;
}
case
EXPRTYPE_UNOP
:
case
EXPRTYPE_UNOP
:
{
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_UNOP, .op=%s},
\n
"
,
pre
,
OPERATOR_name
[
pobj
->
data
.
op
]);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_UNOP, .op=%s},
\n
"
,
pre
,
OPERATOR_name
[
pobj
->
data
.
op
]);
count
++
;
count
++
;
break
;
break
;
}
case
EXPRTYPE_IFOP
:
case
EXPRTYPE_IFOP
:
{
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
count
=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr0
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr1
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr1
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr2
,
module
);
count
+=
verilogparseGenConstExpr
(
pFile
,
pre
,
pobj
->
data
.
expr2
,
module
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_IFOP, .op=0},
\n
"
,
pre
);
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_IFOP, .op=0},
\n
"
,
pre
);
count
++
;
count
++
;
break
;
break
;
}
case
EXPRTYPE_HIERARCHICAL_IDENT
:
{
int
index
=
-
1
;
/* 目前只取第一个名称 */
verilogVarSel
*
select
;
select
=
verilogVarSelGetData
(
pobj
->
data
.
elementselect
->
__dlist_pNext
);
if
(
select
!=
NULL
)
{
index
=
verilogModuleGetParamIndex
(
module
,
select
->
name
->
string
);
}
if
(
index
>=
0
)
fprintf
(
pFile
,
"%s{.exprtype=EXPRTYPE_PARAM, .index=%d},/* %s */
\n
"
,
pre
,
index
,
select
->
name
->
string
);
else
fprintf
(
pFile
,
"%s{error: can not find parameter %s}
\n
"
,
pre
,
select
->
name
->
string
);
break
;
}
default:
default:
{
fprintf
(
pFile
,
"%s error type %d,
\n
"
,
pre
,
pobj
->
data
.
exprtype
);
count
=
0
;
count
=
0
;
break
;
break
;
}
}
}
return
count
;
return
count
;
}
}
\ No newline at end of file
parser/verilog_module.c
浏览文件 @
9d69d016
...
@@ -277,15 +277,35 @@ int verilogModuleGetLocalParamIndex(HOBJECT object, const char* name)
...
@@ -277,15 +277,35 @@ int verilogModuleGetLocalParamIndex(HOBJECT object, const char* name)
char
*
moduleinstanceGetParameterString
(
verilogModuleInstance
*
moduleinstance
)
char
*
moduleinstanceGetParameterString
(
verilogModuleInstance
*
moduleinstance
)
{
{
/* 目前先简单地假定实参中已经列出所有的参数 */
/* 目前先简单地假定实参中已经列出所有的参数 */
int
index
;
IDListVarPtr
pitem
,
pitemtemp
;
IDListVarPtr
pitem
,
pitemtemp
;
verilogParameterInstance
*
paraminst
;
verilogParameterInstance
*
paraminst
;
IDListVarPtr
plist
=
moduleinstance
->
parameter_value_assignment
;
IDListVarPtr
plist
=
moduleinstance
->
parameter_value_assignment
;
char
*
buf
=
hdl4se_parse_logbuf
();
pitem
=
plist
->
__dlist_pNext
;
pitem
=
plist
->
__dlist_pNext
;
index
=
0
;
while
(
pitem
!=
plist
)
{
while
(
pitem
!=
plist
)
{
verilogExpr
*
expr0
;
paraminst
=
verilogParameterInstanceGetData
(
pitem
);
paraminst
=
verilogParameterInstanceGetData
(
pitem
);
pitemtemp
=
pitem
->
__dlist_pNext
;
pitemtemp
=
pitem
->
__dlist_pNext
;
expr0
=
verilogExprGetData
(
paraminst
->
expr0
);
if
(
expr0
==
NULL
)
return
NULL
;
if
(
expr0
->
exprtype
!=
EXPRTYPE_BIGNUMBER
)
{
return
NULL
;
}
if
(
index
>
0
)
{
*
buf
++
=
','
;
*
buf
++
=
' '
;
}
if
(
0
!=
objectCall3
(
expr0
->
bignumber
,
GetStr
,
16
,
buf
,
1024
))
{
return
NULL
;
}
buf
=
buf
+
strlen
(
buf
);
index
++
;
pitem
=
pitemtemp
;
}
}
return
NULL
;
return
hdl4se_parse_logbuf
()
;
}
}
static
int
verilogmodule_verilognode_gencode
(
HOBJECT
object
,
FILE
*
pFile
,
const
char
*
modulename
,
void
*
opt
)
static
int
verilogmodule_verilognode_gencode
(
HOBJECT
object
,
FILE
*
pFile
,
const
char
*
modulename
,
void
*
opt
)
...
@@ -503,13 +523,13 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
...
@@ -503,13 +523,13 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
moduleinstance
->
index
=
index
++
;
moduleinstance
->
index
=
index
++
;
if
(
dlistItemCount
(
moduleinfo
->
module_parameters
)
<=
0
)
{
if
(
dlistItemCount
(
moduleinfo
->
module_parameters
)
<=
0
)
{
if
(
moduleinfo
->
isbasiccell
)
{
if
(
moduleinfo
->
isbasiccell
)
{
fprintf
(
pFile
,
"
\t\t
modules[%d] = hdl4seCreateUnit2(module, %s,
\"\"
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t
modules[%
3
d] = hdl4seCreateUnit2(module, %s,
\"\"
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
cell_clsid
->
string
,
moduleinfo
->
cell_clsid
->
string
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
}
}
else
{
else
{
fprintf
(
pFile
,
"
\t\t
modules[%d] = hdl4seCreate_%04X(module,
\"\"
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t
modules[%
3
d] = hdl4seCreate_%04X(module,
\"\"
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
moduleindex
,
moduleinfo
->
moduleindex
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
...
@@ -519,14 +539,14 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
...
@@ -519,14 +539,14 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
parameterstring
=
moduleinstanceGetParameterString
(
moduleinstance
);
parameterstring
=
moduleinstanceGetParameterString
(
moduleinstance
);
if
(
parameterstring
!=
NULL
)
{
if
(
parameterstring
!=
NULL
)
{
if
(
moduleinfo
->
isbasiccell
)
{
if
(
moduleinfo
->
isbasiccell
)
{
fprintf
(
pFile
,
"
\t\t
\t
modules[%
d] = hdl4seCreateUnit2(module, %s,
\"
%s
\"
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t
modules[%3
d] = hdl4seCreateUnit2(module, %s,
\"
%s
\"
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
cell_clsid
->
string
,
moduleinfo
->
cell_clsid
->
string
,
parameterstring
,
parameterstring
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
}
}
else
{
else
{
fprintf
(
pFile
,
"
\t\t
\t
modules[%
d] = hdl4seCreate_%04X(module,
\"
%s
\"
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t
modules[%3
d] = hdl4seCreate_%04X(module,
\"
%s
\"
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
moduleindex
,
moduleinfo
->
moduleindex
,
parameterstring
,
parameterstring
,
...
@@ -534,22 +554,46 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
...
@@ -534,22 +554,46 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, const
}
}
}
}
else
{
else
{
int
exprcount
;
fprintf
(
pFile
,
"
\t\t
/*%3d %s %s*/
\n
"
,
fprintf
(
pFile
,
"
\t\t
/*%3d %s %s*/
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinstance
->
modulename
->
string
,
moduleinstance
->
modulename
->
string
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
fprintf
(
pFile
,
"
\t\t
{
\n
"
);
fprintf
(
pFile
,
"
\t\t
{
\n
"
);
fprintf
(
pFile
,
"
\t\t\t
char *instanceparam;
\n
"
);
fprintf
(
pFile
,
"
\t\t\t
const expr_code expr_info[] = {
\n
"
);
exprcount
=
0
;
{
IDListVarPtr
pitem
,
pitemtemp
;
verilogParameterInstance
*
paraminst
;
IDListVarPtr
plist
=
moduleinstance
->
parameter_value_assignment
;
pitem
=
plist
->
__dlist_pNext
;
while
(
pitem
!=
plist
)
{
paraminst
=
verilogParameterInstanceGetData
(
pitem
);
pitemtemp
=
pitem
->
__dlist_pNext
;
exprcount
+=
verilogparseGenConstExpr
(
pFile
,
"
\t\t\t\t
"
,
paraminst
->
expr0
,
object
);
fprintf
(
pFile
,
"
\t\t\t\t
{.exprtype=EXPRTYPE_EMIT},
\n
"
);
exprcount
++
;
pitem
=
pitemtemp
;
}
}
fprintf
(
pFile
,
"
\t\t\t
};
\n
"
);
if
(
moduleinfo
->
isbasiccell
)
{
if
(
moduleinfo
->
isbasiccell
)
{
fprintf
(
pFile
,
"
\t\t\t
modules[%
d] = hdl4seCreateUnit2(module, %s, instanceparam
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t\t
modules[%
3d] = hdl4seCreateUnit2(module, %s, const_expr_list_eval(%d, expr_info, %d, %s)
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
cell_clsid
->
string
,
moduleinfo
->
cell_clsid
->
string
,
exprcount
,
paramcount
,
paramcount
>
0
?
"parameters"
:
"NULL"
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
}
}
else
{
else
{
fprintf
(
pFile
,
"
\t\t\t
modules[%
d] = hdl4seCreate_%04X(module, instanceparam
,
\"
%s
\"
);
\n
"
,
fprintf
(
pFile
,
"
\t\t\t
modules[%
3d] = hdl4seCreate_%04X(module, const_expr_list_eval(%d, expr_info, %d, %s)
,
\"
%s
\"
);
\n
"
,
moduleinstance
->
index
,
moduleinstance
->
index
,
moduleinfo
->
moduleindex
,
moduleinfo
->
moduleindex
,
exprcount
,
paramcount
,
paramcount
>
0
?
"parameters"
:
"NULL"
,
moduleinstance
->
instname
->
string
);
moduleinstance
->
instname
->
string
);
}
}
fprintf
(
pFile
,
"
\t\t
}
\n
"
);
fprintf
(
pFile
,
"
\t\t
}
\n
"
);
...
...
parser/verilog_parsetree.h
浏览文件 @
9d69d016
...
@@ -155,6 +155,7 @@ enum exprtype {
...
@@ -155,6 +155,7 @@ enum exprtype {
EXPRTYPE_IFOP
,
EXPRTYPE_IFOP
,
EXPRTYPE_IDENT
,
EXPRTYPE_IDENT
,
EXPRTYPE_HIERARCHICAL_IDENT
,
EXPRTYPE_HIERARCHICAL_IDENT
,
EXPRTYPE_EMIT
,
};
};
enum
RANGE_TYPE
{
enum
RANGE_TYPE
{
...
@@ -300,6 +301,7 @@ typedef struct _expr_code {
...
@@ -300,6 +301,7 @@ typedef struct _expr_code {
}
expr_code
;
}
expr_code
;
int
const_expr_eval
(
int
expr_infosize
,
expr_code
*
expr_info
,
int
paramcount
,
IBigNumber
***
parameters
);
int
const_expr_eval
(
int
expr_infosize
,
expr_code
*
expr_info
,
int
paramcount
,
IBigNumber
***
parameters
);
const
char
*
const_expr_list_eval
(
int
expr_infosize
,
expr_code
*
expr_info
,
int
paramcount
,
IBigNumber
***
parameters
);
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录