Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
e77f64f8
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,发现更多精彩内容 >>
提交
e77f64f8
编写于
8月 14, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202108141611
上级
045b9e7a
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
2357 addition
and
2452 deletion
+2357
-2452
examples/CMakeLists.txt
examples/CMakeLists.txt
+0
-1
examples/hdl4secnn/googlenet/CMakeLists.txt
examples/hdl4secnn/googlenet/CMakeLists.txt
+1
-1
examples/hdl4secnn/googlenet/model2verilog/main.c
examples/hdl4secnn/googlenet/model2verilog/main.c
+1
-1
examples/hdl4secnn/googlenet/verilog/CMakeLists.txt
examples/hdl4secnn/googlenet/verilog/CMakeLists.txt
+10
-2
examples/systemctest/CMakeLists.txt
examples/systemctest/CMakeLists.txt
+0
-12
examples/systemctest/main.cpp
examples/systemctest/main.cpp
+0
-103
hdl4secell/src/hdl4se_variable.c
hdl4secell/src/hdl4se_variable.c
+3
-1
hdl4sesim/src/hdl4sesim.c
hdl4sesim/src/hdl4sesim.c
+1
-3
hdl4seutils/include/threadlock.h
hdl4seutils/include/threadlock.h
+2
-0
hdl4seutils/src/threadlock.c
hdl4seutils/src/threadlock.c
+0
-1
parser/verilog_expr.c
parser/verilog_expr.c
+2
-0
parser/verilog_parser.c
parser/verilog_parser.c
+2126
-2126
parser/verilog_parser.h
parser/verilog_parser.h
+7
-7
parser/verilog_scanner.c
parser/verilog_scanner.c
+204
-194
未找到文件。
examples/CMakeLists.txt
浏览文件 @
e77f64f8
...
...
@@ -8,7 +8,6 @@ add_subdirectory ("terris")
add_subdirectory
(
"digitled"
)
add_subdirectory
(
"testbignumber"
)
add_subdirectory
(
"hdl4secnn"
)
add_subdirectory
(
"systemctest"
)
add_subdirectory
(
"testmacro"
)
add_subdirectory
(
"testvariable"
)
\ No newline at end of file
examples/hdl4secnn/googlenet/CMakeLists.txt
浏览文件 @
e77f64f8
...
...
@@ -181,6 +181,6 @@ add_executable(googlenet
include_directories
(
"../../../hdl4seutils/include"
)
include_directories
(
"../cnn/include"
)
target_link_libraries
(
googlenet cnn hdl4seutils
)
target_link_libraries
(
googlenet cnn hdl4seutils
m
)
add_definitions
(
-D_CRT_SECURE_NO_WARNINGS
)
\ No newline at end of file
examples/hdl4secnn/googlenet/model2verilog/main.c
浏览文件 @
e77f64f8
...
...
@@ -40,7 +40,7 @@
#include "time.h"
#include "cnn.h"
#include "threadlock.h"
#include "windows.h"
#include "keyboard.txt"
...
...
examples/hdl4secnn/googlenet/verilog/CMakeLists.txt
浏览文件 @
e77f64f8
...
...
@@ -8,7 +8,15 @@ add_executable (googlenetsim
"main.c"
)
target_link_libraries
(
googlenetsim cnncell hdl4sesim hdl4secell bignumber hdl4seutils verilog_preprocess verilog_parser lcom
)
target_link_libraries
(
googlenetsim cnncell hdl4sesim hdl4secell bignumber hdl4seutils verilog_preprocess verilog_parser lcom m pthread
)
FIND_PACKAGE
(
OpenMP REQUIRED
)
if
(
OPENMP_FOUND
)
message
(
"OPENMP FOUND"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
OpenMP_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
OpenMP_CXX_FLAGS
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
${
OpenMP_EXE_LINKER_FLAGS
}
"
)
endif
()
include_directories
(
"../../../../../lcom/include"
)
include_directories
(
"../../../../hdl4secell/include"
)
...
...
@@ -16,4 +24,4 @@ include_directories("../../../../hdl4sesim/include")
include_directories
(
"../../../../hdl4seutils/include"
)
include_directories
(
"../../../../parser"
)
include_directories
(
"../../../../bignumber/include"
)
add_definitions
(
-D_CRT_SECURE_NO_WARNINGS
)
\ No newline at end of file
add_definitions
(
-D_CRT_SECURE_NO_WARNINGS -fopenmp
)
\ No newline at end of file
examples/systemctest/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
045b9e7a
# CMakeList.txt: 顶层 CMake 项目文件,在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required
(
VERSION 3.8
)
add_executable
(
systemctest
"main.cpp"
)
target_link_libraries
(
systemctest SystemC::systemc
)
include_directories
(
"../../../systemc/src"
)
examples/systemctest/main.cpp
已删除
100644 → 0
浏览文件 @
045b9e7a
#include "systemc.h"
SC_MODULE
(
half_adder
)
{
sc_in
<
bool
>
a
,
b
;
sc_out
<
bool
>
sum
,
carry
;
void
prc_half_adder
();
SC_CTOR
(
half_adder
)
{
SC_METHOD
(
prc_half_adder
);
sensitive
<<
a
<<
b
;
}
};
void
half_adder
::
prc_half_adder
()
{
sum
=
a
^
b
;
carry
=
a
&
b
;
}
SC_MODULE
(
full_adder
)
{
sc_in
<
bool
>
a
,
b
,
carry_in
;
sc_out
<
bool
>
sum
,
carry_out
;
sc_signal
<
bool
>
c1
,
s1
,
c2
;
void
prc_or
();
half_adder
*
ha1_ptr
,
*
ha2_ptr
;
SC_CTOR
(
full_adder
)
{
ha1_ptr
=
new
half_adder
(
"ha1"
);
/*端口连接,命名方式连接*/
ha1_ptr
->
a
(
a
);
ha1_ptr
->
b
(
b
);
ha1_ptr
->
sum
(
s1
);
ha1_ptr
->
carry
(
c1
);
ha2_ptr
=
new
half_adder
(
"ha2"
);
/*端口连接,位置方式连接*/
(
*
ha2_ptr
)(
s1
,
carry_in
,
sum
,
c2
);
SC_METHOD
(
prc_or
);
sensitive
<<
c1
<<
c2
;
}
~
full_adder
()
{
delete
ha1_ptr
;
delete
ha2_ptr
;
}
};
void
full_adder
::
prc_or
()
{
carry_out
=
c1
|
c2
;
}
SC_MODULE
(
driver
)
{
sc_out
<
bool
>
clk
,
d_a
,
d_b
,
d_cin
;
void
prc_driver
();
SC_CTOR
(
driver
)
{
SC_THREAD
(
prc_driver
);
}
};
void
driver
::
prc_driver
()
{
sc_uint
<
3
>
pattern
;
pattern
=
0
;
while
(
1
)
{
d_a
=
pattern
[
0
];
d_b
=
pattern
[
1
];
d_cin
=
pattern
[
2
];
clk
=
0
;
wait
(
5
,
SC_NS
);
clk
=
1
;
wait
(
5
,
SC_NS
);
pattern
++
;
}
}
SC_MODULE
(
monitor
)
{
sc_in
<
bool
>
clk
,
m_a
,
m_b
,
m_cin
,
m_sum
,
m_cout
;
void
prc_monitor
();
SC_CTOR
(
monitor
)
{
SC_METHOD
(
prc_monitor
);
//sensitive << m_a << m_b << m_cin << m_sum << m_cout;
sensitive_pos
<<
clk
;
}
};
void
monitor
::
prc_monitor
()
{
cout
<<
"At time"
<<
sc_time_stamp
()
<<
"::"
;
cout
<<
"(a, b, carry_in):"
;
cout
<<
m_a
<<
m_b
<<
m_cin
;
cout
<<
"(sum, carry_out): "
<<
m_sum
<<
m_cout
<<
endl
;
}
int
sc_main
(
int
argc
,
char
*
argv
[])
{
sc_signal
<
bool
>
t_a
,
t_b
,
t_cin
,
t_sum
,
t_cout
,
clk
;
//加法器
full_adder
adderobj
(
"FullAdder"
);
adderobj
(
t_a
,
t_b
,
t_cin
,
t_sum
,
t_cout
);
//驱动器
driver
driverobj
(
"drider"
);
driverobj
(
clk
,
t_a
,
t_b
,
t_cin
);
//记录仪
monitor
monitorobj
(
"monitor"
);
monitorobj
(
clk
,
t_a
,
t_b
,
t_cin
,
t_sum
,
t_cout
);
//开始仿真,持续100ns
sc_start
(
100
,
SC_NS
);
return
(
0
);
}
hdl4secell/src/hdl4se_variable.c
浏览文件 @
e77f64f8
...
...
@@ -39,11 +39,13 @@
#include "stdio.h"
#include "string.h"
#include "object.h"
#include "
dlist
.h"
#include "
stdarg
.h"
#include "bignumber.h"
#include "hdl4secell.h"
#include "pointerarray.h"
#define max(x, y) (((x)>(y))?(x):(y))
#define HDL4SE_DEBUG 0
static
void
hdl4seUpdateVariableNone
(
ModuleVariable
*
var
)
...
...
hdl4sesim/src/hdl4sesim.c
浏览文件 @
e77f64f8
...
...
@@ -47,8 +47,6 @@
#include "hdl4secell.h"
#include "threadlock.h"
#include "windows.h"
#define IMPLEMENT_GUID
#include "hdl4sesim.h"
#undef IMPLEMENT_GUID
...
...
@@ -243,7 +241,7 @@ static int hdl4sesim_hdl4se_simulator_SetReset(HOBJECT object, int reset)
return
0
;
}
#define THREADCOUNT
8
#define THREADCOUNT
4
static
int
hdl4sesim_hdl4se_simulator_ClkTick
(
HOBJECT
object
)
{
...
...
hdl4seutils/include/threadlock.h
浏览文件 @
e77f64f8
...
...
@@ -44,6 +44,8 @@ extern "C" {
#ifndef _ASMLANGUAGE
#include "string.h"
typedef
void
*
THREADLOCK
;
THREADLOCK
threadlockCreate
();
...
...
hdl4seutils/src/threadlock.c
浏览文件 @
e77f64f8
...
...
@@ -117,7 +117,6 @@ THREADLOCK threadlockCreate()
pSection
=
(
ThreadLock
*
)
mt_malloc
(
sizeof
(
ThreadLock
));
if
(
pSection
!=
NULL
)
{
pthread_mutexattr_t
attr
;
pSection
->
mutex
=
PTHREAD_MUTEX_INITIALIZER
;
pthread_mutexattr_init
(
&
attr
);
pthread_mutexattr_settype
(
&
attr
,
PTHREAD_MUTEX_RECURSIVE_NP
);
pthread_mutex_init
(
&
pSection
->
mutex
,
&
attr
);
...
...
parser/verilog_expr.c
浏览文件 @
e77f64f8
...
...
@@ -53,6 +53,8 @@
#include "verilog_expr.h"
#undef IMPLEMENT_GUID
#define max(x, y) (((x) > (y)) ? (x) : (y))
typedef
struct
_sExpr
{
OBJECT_HEADER
INTERFACE_DECLARE
(
IVerilogNode
)
...
...
parser/verilog_parser.c
浏览文件 @
e77f64f8
此差异已折叠。
点击以展开。
parser/verilog_parser.h
浏览文件 @
e77f64f8
...
...
@@ -35,8 +35,8 @@
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_YY_
D
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED
# define YY_YY_
D
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED
#ifndef YY_YY_
MEDIA_RAOXIANHONG_DDE_DATA
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED
# define YY_YY_
MEDIA_RAOXIANHONG_DDE_DATA
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
...
...
@@ -45,7 +45,7 @@
extern
int
yydebug
;
#endif
/* "%code requires" blocks. */
#line 81 "
D:
/gitwork/hdl4se/parser/verilog_parser.y"
#line 81 "
/media/raoxianhong/_dde_data
/gitwork/hdl4se/parser/verilog_parser.y"
#include "stdio.h"
#include "object.h"
...
...
@@ -68,7 +68,7 @@ extern int yydebug;
#include "verilog_assignment.h"
#include "verilog_statement.h"
#line 72 "
D:
/gitwork/hdl4se/parser/verilog_parser.h"
#line 72 "
/media/raoxianhong/_dde_data
/gitwork/hdl4se/parser/verilog_parser.h"
/* Token kinds. */
#ifndef YYTOKENTYPE
...
...
@@ -271,7 +271,7 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union
YYSTYPE
{
#line 105 "
D:
/gitwork/hdl4se/parser/verilog_parser.y"
#line 105 "
/media/raoxianhong/_dde_data
/gitwork/hdl4se/parser/verilog_parser.y"
HOBJECT
treenode
;
HOBJECT
obj
;
...
...
@@ -290,7 +290,7 @@ union YYSTYPE
int
ival
;
IDListVar
*
list
;
#line 294 "
D:
/gitwork/hdl4se/parser/verilog_parser.h"
#line 294 "
/media/raoxianhong/_dde_data
/gitwork/hdl4se/parser/verilog_parser.h"
};
typedef
union
YYSTYPE
YYSTYPE
;
...
...
@@ -303,4 +303,4 @@ extern YYSTYPE yylval;
int
yyparse
(
void
);
#endif
/* !YY_YY_
D
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED */
#endif
/* !YY_YY_
MEDIA_RAOXIANHONG_DDE_DATA
_GITWORK_HDL4SE_PARSER_VERILOG_PARSER_H_INCLUDED */
parser/verilog_scanner.c
浏览文件 @
e77f64f8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录