Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
c491d5fa
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,发现更多精彩内容 >>
提交
c491d5fa
编写于
8月 10, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202108100628
上级
d48d070a
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
595 addition
and
525 deletion
+595
-525
examples/counter/src/counter_main.c
examples/counter/src/counter_main.c
+176
-82
examples/counter/verilog/counter_main_dump.v
examples/counter/verilog/counter_main_dump.v
+26
-0
examples/digitled/src/digitled.c
examples/digitled/src/digitled.c
+9
-7
examples/hdl4secnn/cnn/cnncell/CMakeLists.txt
examples/hdl4secnn/cnn/cnncell/CMakeLists.txt
+0
-1
examples/hdl4secnn/cnn/cnncell/cnncell.c
examples/hdl4secnn/cnn/cnncell/cnncell.c
+0
-2
examples/hdl4secnn/cnn/cnncell/cnncell_buf.c
examples/hdl4secnn/cnn/cnncell/cnncell_buf.c
+0
-193
examples/terris/src/terris_main_module.c
examples/terris/src/terris_main_module.c
+235
-235
examples/terris/verilog/terris_main_asm.v
examples/terris/verilog/terris_main_asm.v
+26
-0
parser/verilog_expr.c
parser/verilog_expr.c
+114
-0
parser/verilog_module.c
parser/verilog_module.c
+6
-3
parser/verilog_parsetree.h
parser/verilog_parsetree.h
+1
-0
testparser/main.c
testparser/main.c
+2
-2
未找到文件。
examples/counter/src/counter_main.c
浏览文件 @
c491d5fa
此差异已折叠。
点击以展开。
examples/counter/verilog/counter_main_dump.v
浏览文件 @
c491d5fa
...
...
@@ -185,6 +185,32 @@ endmodule
(
*
HDL4SE
=
"LCOM"
,
CLSID
=
"230946EF-3EC1-43EC-A841-CDE8A9E97314"
,
softmodule
=
"hdl4se"
*
)
module
hdl4se_fifo
#(
parameter
WIDTH
=
32'h10
,
parameter
DEPTH
=
32'h80
)
(
input
wClk
,
input
nwReset
,
input
wRead
,
output
wDataValid
,
output
[(
WIDTH
-
32'h1
)
:
32'h0
]
bReadData
,
output
wWriteEnable
,
input
wWrite
,
input
[(
WIDTH
-
32'h1
)
:
32'h0
]
bWriteData
)
;
endmodule
(
*
HDL4SE
=
"LCOM"
,
CLSID
=
"dffb1080-8b92-4b42-a607-d1b377c27bb1"
,
...
...
examples/digitled/src/digitled.c
浏览文件 @
c491d5fa
...
...
@@ -56,7 +56,7 @@
#define LEDCOUNT 10
static
int
keypressed
=
0
;
static
int
__
keypressed
=
0
;
void
key_callback
(
GLFWwindow
*
window
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
...
...
@@ -64,10 +64,10 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
return
;
if
(
key
>=
GLFW_KEY_F1
&&
key
<=
GLFW_KEY_F10
)
{
key
-=
GLFW_KEY_F1
;
if
(
keypressed
&
(
1
<<
key
))
keypressed
&=
~
(
1
<<
key
);
if
(
__
keypressed
&
(
1
<<
key
))
__
keypressed
&=
~
(
1
<<
key
);
else
keypressed
|=
(
1
<<
key
);
__
keypressed
|=
(
1
<<
key
);
}
}
...
...
@@ -92,6 +92,7 @@ IDLIST
VID
(
wRead_reg
),
VID
(
bReadAddr_reg
),
VID
(
keypressed
),
END_IDLIST
MODULE_DECLARE
(
digitled
)
...
...
@@ -117,7 +118,7 @@ DEFINE_FUNC(digitled_store_bReadAddr) {
}
END_DEFINE_FUNC
DEFINE_FUNC
(
digitled_gen_bReadData
)
{
vput
(
bReadData
,
pobj
->
keypressed
);
VAssign
(
bReadData
,
keypressed
);
}
END_DEFINE_FUNC
#define LEDWIDTH 0.11f
...
...
@@ -266,14 +267,14 @@ DEFINE_FUNC(digitled_clktick) {
/* 读nwReset信号,看是否复位 */
int
i
,
j
;
int
reset
=
VREAD_U32
(
nwReset
);
pobj
->
keypressed
=
keypressed
;
pobj
->
keypressed
=
__
keypressed
;
if
(
reset
==
0
)
{
pobj
->
keypressed
=
0
;
for
(
i
=
0
;
i
<
LEDCOUNT
;
i
++
)
{
pobj
->
ledvalue
[
i
]
=
0
;
}
}
vput
(
keypressed
,
pobj
->
keypressed
);
/* 读写命令,看是否写 */
if
(
reset
!=
0
)
{
int
wWrite
=
VREAD_U32
(
wWrite
);
...
...
@@ -351,6 +352,7 @@ MODULE_INIT(digitled)
GREG
(
wRead_reg
,
1
,
digitled_store_wRead
);
GREG
(
bReadAddr_reg
,
32
,
digitled_store_bReadAddr
);
REG
(
keypressed
,
32
);
CLKTICK_FUNC
(
digitled_clktick
);
DEINIT_FUNC
(
M_ID
(
deinit
));
...
...
examples/hdl4secnn/cnn/cnncell/CMakeLists.txt
浏览文件 @
c491d5fa
...
...
@@ -11,7 +11,6 @@ add_library(cnncell STATIC
"cnncell_datasource.c"
"cnncell_coeffbuf.c"
"cnncell_buf_r4.c"
"cnncell_buf.c"
"cnncell_dataoutput.c"
"cnncell_pooling.c"
"cnncell_lrn.c"
...
...
examples/hdl4secnn/cnn/cnncell/cnncell.c
浏览文件 @
c491d5fa
...
...
@@ -45,7 +45,6 @@
static
int
cnncell_registed
=
0
;
extern
OFUNCPTR
A_u_t_o_registor_cnncell_buf
;
extern
OFUNCPTR
A_u_t_o_registor_cnncell_buf_r4
;
extern
OFUNCPTR
A_u_t_o_registor_cnncell_coeffbuf
;
extern
OFUNCPTR
A_u_t_o_registor_cnncell_concat
;
...
...
@@ -61,7 +60,6 @@ int cnnInit()
{
if
(
cnncell_registed
)
return
0
;
A_u_t_o_registor_cnncell_buf
();
A_u_t_o_registor_cnncell_buf_r4
();
A_u_t_o_registor_cnncell_coeffbuf
();
A_u_t_o_registor_cnncell_concat
();
...
...
examples/hdl4secnn/cnn/cnncell/cnncell_buf.c
已删除
100644 → 0
浏览文件 @
d48d070a
/*
** HDL4SE: 软件Verilog综合仿真平台
** Copyright (C) 2021-2021, raoxianhong<raoxianhong@163.net>
** LCOM: 轻量级组件对象模型
** Copyright (C) 2021-2021, raoxianhong<raoxianhong@163.net>
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
** * Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** * The name of the author may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
** THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* cnncell_buf.c
修改记录:
202107061537: rxh, initial version
202107180947: rxh, macro version
*/
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "object.h"
#include "dlist.h"
#include "cnncell.h"
#include "bignumber.h"
#include "hdl4secell.h"
#include "threadlock.h"
#define M_ID(id) cnncell_buf##id
#define cnncell_buf_MODULE_VERSION_STRING "0.4.0-20210718.0947 CNN buf cell"
#define cnncell_buf_MODULE_CLSID CLSID_CNN_BUF
IDLIST
VID
(
wClk
),
VID
(
nwReset
),
VID
(
wDataReadEnable
),
VID
(
wDataRead
),
VID
(
wDataReadValid
),
VID
(
bDataReadAddr
),
VID
(
bDataReadData
),
VID
(
wDataReadComplete
),
VID
(
wDataWriteEnable
),
VID
(
wDataWrite
),
VID
(
bDataWriteAddr
),
VID
(
bDataWriteData
),
VID
(
wDataWriteComplete
),
VID
(
wDataReadEnable_reg
),
VID
(
wDataReadValid_reg
),
VID
(
bDataReadData_reg
),
VID
(
wDataWriteEnable_reg
),
VID
(
wDataRead_reg
),
VID
(
bDataReadAddr_reg
),
END_IDLIST
MODULE_DECLARE
(
cnncell_buf
)
unsigned
int
wordsize
,
wordcount
,
words
;
unsigned
int
*
buf
;
END_MODULE_DECLARE
(
cnncell_buf
)
DEFINE_FUNC
(
cnncell_buf_deinit
)
{
if
(
pobj
->
buf
!=
NULL
)
free
(
pobj
->
buf
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_clktick
)
{
unsigned
int
write
;
unsigned
int
addr
;
write
=
vget
(
wDataWrite
);
if
(
write
)
{
addr
=
vget
(
bDataWriteAddr
);
if
(
addr
<
pobj
->
wordcount
)
{
unsigned
int
j
;
var
wd
=
Var
(
bDataWriteData
);
for
(
j
=
0
;
j
<
pobj
->
words
;
j
++
)
{
pobj
->
buf
[
addr
*
pobj
->
words
+
j
]
=
varGetBits32
(
wd
,
j
);
}
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_bDataReadData
)
{
VAssign
(
bDataReadData
,
bDataReadData_reg
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataReadValid
)
{
VAssign
(
wDataReadValid
,
wDataReadValid_reg
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataWriteEnable
)
{
VAssign
(
wDataWriteEnable
,
wDataWriteEnable_reg
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataReadEnable
)
{
VAssign
(
wDataReadEnable
,
wDataReadEnable_reg
);
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataReadEnable_reg
)
{
if
(
vget
(
nwReset
)
==
0
)
{
vput
(
wDataReadEnable_reg
,
0
);
}
else
{
if
(
vget
(
wDataReadEnable_reg
)
&&
vget
(
wDataReadComplete
))
{
vput
(
wDataReadEnable_reg
,
0
);
}
else
if
(
vget
(
wDataWriteEnable_reg
)
&&
vget
(
wDataWriteComplete
))
{
vput
(
wDataReadEnable_reg
,
1
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataWriteEnable_reg
)
{
if
(
vget
(
nwReset
)
==
0
)
{
vput
(
wDataWriteEnable_reg
,
1
);
}
else
{
if
(
vget
(
wDataReadEnable_reg
)
&&
vget
(
wDataReadComplete
))
{
vput
(
wDataWriteEnable_reg
,
1
);
}
else
if
(
vget
(
wDataWriteEnable_reg
)
&&
vget
(
wDataWriteComplete
))
{
vput
(
wDataWriteEnable_reg
,
0
);
}
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_wDataReadValid_reg
)
{
if
(
vget
(
nwReset
)
==
0
)
{
vput
(
wDataReadValid_reg
,
0
);
}
else
{
vput
(
wDataReadValid_reg
,
vget
(
wDataRead
)
&&
vget
(
wDataReadEnable_reg
));
}
}
END_DEFINE_FUNC
DEFINE_FUNC
(
cnncell_buf_gen_bDataReadData_reg
)
{
unsigned
int
readaddr
=
vget
(
bDataReadAddr
);
if
(
readaddr
<
pobj
->
wordcount
)
{
var
readdata
=
Var
(
bDataReadData_reg
);
unsigned
int
j
;
for
(
j
=
0
;
j
<
pobj
->
words
;
j
++
)
{
varSetBits32
(
readdata
,
j
,
pobj
->
buf
[
readaddr
*
pobj
->
words
+
j
]);
}
}
}
END_DEFINE_FUNC
MODULE_INIT
(
cnncell_buf
)
pobj
->
wordsize
=
(
int
)
MODULE_PARAM
(
0
);
pobj
->
wordcount
=
(
int
)
MODULE_PARAM
(
1
);
pobj
->
words
=
(
pobj
->
wordsize
+
31
)
/
32
;
pobj
->
buf
=
(
unsigned
int
*
)
malloc
((
pobj
->
words
*
pobj
->
wordcount
)
*
4
);
if
(
pobj
->
buf
==
NULL
)
return
-
1
;
PORT_IN
(
wClk
,
1
);
PORT_IN
(
nwReset
,
1
);
GPORT_OUT
(
wDataReadEnable
,
1
,
cnncell_buf_gen_wDataReadEnable
);
PORT_IN
(
wDataRead
,
1
);
GPORT_OUT
(
wDataReadValid
,
1
,
cnncell_buf_gen_wDataReadValid
);
PORT_IN
(
bDataReadAddr
,
32
);
GPORT_OUT
(
bDataReadData
,
pobj
->
wordsize
,
cnncell_buf_gen_bDataReadData
);
PORT_IN
(
wDataReadComplete
,
1
);
GPORT_OUT
(
wDataWriteEnable
,
1
,
cnncell_buf_gen_wDataWriteEnable
);
PORT_IN
(
wDataWrite
,
1
);
PORT_IN
(
bDataWriteAddr
,
32
);
PORT_IN
(
bDataWriteData
,
pobj
->
wordsize
);
PORT_IN
(
wDataWriteComplete
,
1
);
GREG
(
wDataReadEnable_reg
,
1
,
cnncell_buf_gen_wDataReadEnable_reg
);
GREG
(
wDataWriteEnable_reg
,
1
,
cnncell_buf_gen_wDataWriteEnable_reg
);
GREG
(
wDataReadValid_reg
,
1
,
cnncell_buf_gen_wDataReadValid_reg
);
GREG
(
bDataReadData_reg
,
pobj
->
wordsize
,
cnncell_buf_gen_bDataReadData_reg
);
DEINIT_FUNC
(
cnncell_buf_deinit
);
CLKTICK_FUNC
(
cnncell_buf_clktick
);
END_MODULE_INIT
(
cnncell_buf
)
examples/terris/src/terris_main_module.c
浏览文件 @
c491d5fa
此差异已折叠。
点击以展开。
examples/terris/verilog/terris_main_asm.v
浏览文件 @
c491d5fa
...
...
@@ -185,6 +185,32 @@ endmodule
(
*
HDL4SE
=
"LCOM"
,
CLSID
=
"230946EF-3EC1-43EC-A841-CDE8A9E97314"
,
softmodule
=
"hdl4se"
*
)
module
hdl4se_fifo
#(
parameter
WIDTH
=
32'h10
,
parameter
DEPTH
=
32'h80
)
(
input
wClk
,
input
nwReset
,
input
wRead
,
output
wDataValid
,
output
[(
WIDTH
-
32'h1
)
:
32'h0
]
bReadData
,
output
wWriteEnable
,
input
wWrite
,
input
[(
WIDTH
-
32'h1
)
:
32'h0
]
bWriteData
)
;
endmodule
(
*
HDL4SE
=
"LCOM"
,
CLSID
=
"dffb1080-8b92-4b42-a607-d1b377c27bb1"
,
...
...
parser/verilog_expr.c
浏览文件 @
c491d5fa
...
...
@@ -2032,6 +2032,120 @@ const char * verilogparseGenExprStr(HOBJECT expr, HOBJECT module)
return
NULL
;
}
const
char
*
verilogparseGenExprDependStr
(
HOBJECT
expr
,
HOBJECT
module
)
{
int
width
;
sExpr
*
pobj
;
pobj
=
(
sExpr
*
)
objectThis
(
expr
);
if
(
pobj
==
NULL
)
return
0
;
expr_verilognode_procheck
(
expr
,
module
,
NULL
);
width
=
verilogparseGenExprWidth
(
expr
,
module
);
switch
(
pobj
->
data
.
exprtype
)
{
case
EXPRTYPE_BINOP
:
{
const
char
*
rst
;
char
*
src0
;
char
*
src1
;
rst
=
verilogparseGenExprDependStr
(
pobj
->
data
.
expr0
,
module
);
if
(
rst
==
NULL
)
return
NULL
;
src0
=
STRDUP
(
rst
);
rst
=
verilogparseGenExprDependStr
(
pobj
->
data
.
expr1
,
module
);
if
(
rst
==
NULL
)
{
free
(
src0
);
return
NULL
;
}
src1
=
STRDUP
(
rst
);
sprintf
(
hdl4se_parse_logbuf
(),
"%s, %s"
,
src0
,
src1
);
free
(
src0
);
free
(
src1
);
return
hdl4se_parse_logbuf
();
break
;
}
case
EXPRTYPE_UNOP
:
{
return
verilogparseGenExprDependStr
(
pobj
->
data
.
expr
,
module
);
}
case
EXPRTYPE_IFOP
:
{
const
char
*
rst
;
char
*
src0
;
char
*
src1
;
char
*
src2
;
rst
=
verilogparseGenExprDependStr
(
pobj
->
data
.
expr0
,
module
);
if
(
rst
==
NULL
)
return
NULL
;
src0
=
STRDUP
(
rst
);
rst
=
verilogparseGenExprDependStr
(
pobj
->
data
.
expr1
,
module
);
if
(
rst
==
NULL
)
{
free
(
src0
);
return
NULL
;
}
src1
=
STRDUP
(
rst
);
rst
=
verilogparseGenExprDependStr
(
pobj
->
data
.
expr2
,
module
);
if
(
rst
==
NULL
)
{
free
(
src0
);
free
(
src1
);
return
NULL
;
}
src2
=
STRDUP
(
rst
);
sprintf
(
hdl4se_parse_logbuf
(),
"%s, %s, %s"
,
src0
,
src1
,
src2
);
free
(
src0
);
free
(
src1
);
free
(
src2
);
return
hdl4se_parse_logbuf
();
break
;
}
case
EXPRTYPE_HIERARCHICAL_IDENT
:
{
int
index
=
-
1
;
/* 目前只取第一个名称 */
verilogVarSel
*
select
;
select
=
verilogVarSelGetData
(
pobj
->
data
.
hierarchical_identifier
->
__dlist_pNext
);
if
(
select
!=
NULL
)
{
index
=
verilogModuleGetParamIndex
(
module
,
select
->
name
->
string
);
}
if
(
index
<
0
)
return
select
->
name
->
string
;
return
""
;
break
;
}
case
EXPRTYPE_CONCAT
:
{
char
*
buf
;
char
*
vbuf
;
buf
=
malloc
(
8192
);
{
IDListVarPtr
pitem
,
pnextitem
;
IDListVarPtr
plist
=
pobj
->
data
.
expr_list
;
pitem
=
plist
->
__dlist_pNext
;
buf
[
0
]
=
0
;
while
(
pitem
!=
plist
)
{
pnextitem
=
pitem
->
__dlist_pNext
;
vbuf
=
buf
+
strlen
(
buf
);
if
(
strlen
(
buf
)
>
0
)
sprintf
(
vbuf
,
", %s"
,
verilogparseGenExprDependStr
(
pitem
,
module
));
else
sprintf
(
vbuf
,
"%s"
,
verilogparseGenExprDependStr
(
pitem
,
module
));
pitem
=
pnextitem
;
}
}
strcpy
(
hdl4se_parse_logbuf
(),
buf
);
free
(
buf
);
return
hdl4se_parse_logbuf
();
}
default:
{
return
""
;
break
;
}
}
return
NULL
;
}
const
char
*
verilogparseGenExprStrVar
(
HOBJECT
expr
,
HOBJECT
module
,
char
*
linehead
)
{
int
width
;
...
...
parser/verilog_module.c
浏览文件 @
c491d5fa
...
...
@@ -663,9 +663,10 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, HOBJE
if
(
verilogparseIsLValueExpr
(
connect
->
expr0
,
pobj
,
NULL
)
==
0
)
{
int
width
=
verilogparseGenExprWidth
(
connect
->
expr0
,
pobj
);
const
char
*
exprstr
=
NULL
;
fprintf
(
pFile
,
"
\n
DEFINE_FUNC
(%s_gen_%s_dot_%s
) { /* port:%s(%s).%s, %d */
\n
"
,
fprintf
(
pFile
,
"
\n
DEFINE_FUNC
_DEPEND(%s_gen_%s_dot_%s,
\"
%s
\"
) { /* port:%s(%s).%s, %d */
\n
"
,
pobj
->
data
.
name
->
string
,
moduleinst
->
instname
->
string
,
port
->
name
->
string
,
verilogparseGenExprDependStr
(
connect
->
expr0
,
pobj
),
moduleinst
->
instname
->
string
,
moduleinfo
->
name
->
string
,
port
->
name
->
string
,
port
->
index
);
if
(
width
<=
64
)
...
...
@@ -707,9 +708,11 @@ static int verilogmodule_verilognode_gencode(HOBJECT object, FILE * pFile, HOBJE
int
width
=
verilogparseGenExprWidth
(
assignment
->
expr
,
pobj
);
pitemtemp
=
pitem
->
__dlist_pNext
;
/*if (isWireLValue(&pobj->data, lvalue)) */
{
fprintf
(
pFile
,
"
\n
DEFINE_FUNC
(%s_gen_%s
) {
\n
"
,
fprintf
(
pFile
,
"
\n
DEFINE_FUNC
_DEPEND(%s_gen_%s,
\"
%s
\"
) {
\n
"
,
pobj
->
data
.
name
->
string
,
lvalue
->
name
->
string
);
lvalue
->
name
->
string
,
verilogparseGenExprDependStr
(
assignment
->
expr
,
pobj
)
);
if
(
width
<=
64
)
exprstr
=
verilogparseGenExprStr
(
assignment
->
expr
,
pobj
);
if
(
exprstr
!=
NULL
)
{
...
...
parser/verilog_parsetree.h
浏览文件 @
c491d5fa
...
...
@@ -693,6 +693,7 @@ verilogExpr* verilogExprGetData(HOBJECT object);
int
verilogparseGenConstExpr
(
FILE
*
pFile
,
const
char
*
pre
,
HOBJECT
expr
,
HOBJECT
module
);
const
char
*
verilogparseGenExprStr
(
HOBJECT
expr
,
HOBJECT
module
);
const
char
*
verilogparseGenExprDependStr
(
HOBJECT
expr
,
HOBJECT
module
);
const
char
*
verilogparseGenExprStrVar
(
HOBJECT
expr
,
HOBJECT
module
,
char
*
linehead
);
const
char
*
verilogparseGenExprWidthStr
(
HOBJECT
expr
,
HOBJECT
module
);
int
verilogparseGenExprWidth
(
HOBJECT
expr
,
HOBJECT
module
);
...
...
testparser/main.c
浏览文件 @
c491d5fa
...
...
@@ -18,9 +18,9 @@ extern char* yytext;
static
char
logbuf
[
64
*
1024
];
#define GOOGLENET
1
#define GOOGLENET
0
#define TERRIS 0
#define COUNTER
0
#define COUNTER
1
#ifdef WIN32
#define WORKDIR "d:/gitwork"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录