Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
2df26951
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
11 个月 前同步成功
通知
1183
Star
3914
Fork
526
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
XiangShan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2df26951
编写于
12月 19, 2020
作者:
Y
Yinan Xu
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into replay-br-update
上级
ae97381f
77701a78
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
10 deletion
+19
-10
src/test/csrc/emu.cpp
src/test/csrc/emu.cpp
+17
-9
src/test/csrc/emu.h
src/test/csrc/emu.h
+2
-1
未找到文件。
src/test/csrc/emu.cpp
浏览文件 @
2df26951
...
...
@@ -247,6 +247,13 @@ uint64_t Emulator::execute(uint64_t max_cycle, uint64_t max_instr) {
diff
.
wdata
=
wdata
;
diff
.
wdst
=
wdst
;
#if VM_COVERAGE == 1
// we dump coverage into files at the end
// since we are not sure when an emu will stop
// we distinguish multiple dat files by emu start time
time_t
start_time
=
time
(
NULL
);
#endif
while
(
!
Verilated
::
gotFinish
()
&&
trapCode
==
STATE_RUNNING
)
{
if
(
!
(
max_cycle
>
0
&&
max_instr
>
0
&&
instr_left_last_cycle
>=
max_instr
/* handle overflow */
))
{
trapCode
=
STATE_LIMIT_EXCEEDED
;
...
...
@@ -336,7 +343,7 @@ uint64_t Emulator::execute(uint64_t max_cycle, uint64_t max_instr) {
#endif
#if VM_COVERAGE == 1
save_coverage
();
save_coverage
(
start_time
);
#endif
display_trapinfo
();
...
...
@@ -370,15 +377,16 @@ inline char* Emulator::waveform_filename(time_t t) {
#if VM_COVERAGE == 1
inline
void
Emulator
::
save_coverage
(
void
)
{
char
*
noop_home
=
getenv
(
"NOOP_HOME"
);
assert
(
noop_home
!=
NULL
);
inline
char
*
Emulator
::
coverage_filename
(
time_t
t
)
{
static
char
buf
[
1024
];
char
*
p
=
timestamp_filename
(
t
,
buf
);
strcpy
(
p
,
".coverage.dat"
);
return
buf
;
}
char
buf
[
1024
];
snprintf
(
buf
,
1024
,
"%s/build/logs"
,
noop_home
);
Verilated
::
mkdir
(
buf
);
snprintf
(
buf
,
1024
,
"%s/build/logs/coverage.dat"
,
noop_home
);
VerilatedCov
::
write
(
buf
);
inline
void
Emulator
::
save_coverage
(
time_t
t
)
{
char
*
p
=
coverage_filename
(
t
);
VerilatedCov
::
write
(
p
);
}
#endif
...
...
src/test/csrc/emu.h
浏览文件 @
2df26951
...
...
@@ -56,11 +56,12 @@ class Emulator {
void
display_trapinfo
();
inline
char
*
timestamp_filename
(
time_t
t
,
char
*
buf
);
inline
char
*
snapshot_filename
(
time_t
t
);
inline
char
*
coverage_filename
(
time_t
t
);
void
snapshot_save
(
const
char
*
filename
);
void
snapshot_load
(
const
char
*
filename
);
inline
char
*
waveform_filename
(
time_t
t
);
#if VM_COVERAGE == 1
inline
void
save_coverage
(
void
);
inline
void
save_coverage
(
time_t
t
);
#endif
public:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录