Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
nexus-am
提交
e135093b
N
nexus-am
项目概览
OpenXiangShan
/
nexus-am
10 个月 前同步成功
通知
0
Star
21
Fork
25
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nexus-am
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e135093b
编写于
9月 29, 2021
作者:
W
wangkaifan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add cache alias test
上级
c751bfd2
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
2974 addition
and
0 deletion
+2974
-0
tests/aliastest/Makefile
tests/aliastest/Makefile
+4
-0
tests/aliastest/include/aliastest.h
tests/aliastest/include/aliastest.h
+11
-0
tests/aliastest/include/encoding.h
tests/aliastest/include/encoding.h
+2832
-0
tests/aliastest/src/alias.S
tests/aliastest/src/alias.S
+116
-0
tests/aliastest/src/main.c
tests/aliastest/src/main.c
+11
-0
未找到文件。
tests/aliastest/Makefile
0 → 100644
浏览文件 @
e135093b
NAME
:=
aliastest
SRCS
:=
$(
shell
find
-L
./src/
-name
"*.[cS]"
)
include
$(AM_HOME)/Makefile.app
tests/aliastest/include/aliastest.h
0 → 100644
浏览文件 @
e135093b
#ifndef __AMUNIT_H__
#define __AMUNIT_H__
#include <am.h>
#include <klib.h>
#include <klib-macros.h>
#include <encoding.h>
void
do_init
();
#endif
tests/aliastest/include/encoding.h
0 → 100644
浏览文件 @
e135093b
此差异已折叠。
点击以展开。
tests/aliastest/src/alias.S
0 → 100644
浏览文件 @
e135093b
#
See
LICENSE
for
license
details
.
#*****************************************************************************
#
icache
-
alias.S
#-----------------------------------------------------------------------------
#
#
Test
that
instruction
memory
appears
to
be
physically
addressed
,
i
.
e
.
,
#
that
disagreements
in
the
low
-
order
VPN
and
PPN
bits
don
't cause the
#
wrong
instruction
to
be
fetched
.
It
also
tests
that
changing
a
page
#
mapping
takes
effect
without
executing
FENCE
.
I
.
#
#include "encoding.h"
#define TESTNUM gp
.
global
do_init
do_init
:
#
Set
up
intermediate
page
tables
la
t0
,
page_table_3
srl
t0
,
t0
,
RISCV_PGSHIFT
-
PTE_PPN_SHIFT
ori
t0
,
t0
,
PTE_V
sd
t0
,
page_table_2
,
t1
la
t0
,
page_table_2
srl
t0
,
t0
,
RISCV_PGSHIFT
-
PTE_PPN_SHIFT
ori
t0
,
t0
,
PTE_V
sd
t0
,
page_table_1
,
t1
#
Set
up
code
page
la
t0
,
code_page
srl
t0
,
t0
,
RISCV_PGSHIFT
-
PTE_PPN_SHIFT
ori
t0
,
t0
,
PTE_V
| PTE_X |
PTE_A
sd
t0
,
page_table_3
+
0
,
t1
#
Set
up
2
data
page
mapped
to
the
same
physical
page
la
t0
,
data_page
srl
t0
,
t0
,
RISCV_PGSHIFT
-
PTE_PPN_SHIFT
ori
t0
,
t0
,
PTE_V
| PTE_X |
PTE_A
| PTE_D |
PTE_W
|
PTE_R
sd
t0
,
page_table_3
+
8
,
t1
la
t0
,
data_page
srl
t0
,
t0
,
RISCV_PGSHIFT
-
PTE_PPN_SHIFT
ori
t0
,
t0
,
PTE_V
| PTE_X |
PTE_A
| PTE_D |
PTE_W
|
PTE_R
sd
t0
,
page_table_3
+
16
,
t1
#
Turn
on
VM
li
a0
,
(
SATP_MODE
&
~
(
SATP_MODE
<<
1
))
*
SATP_MODE_SV39
la
a1
,
page_table_1
srl
a1
,
a1
,
RISCV_PGSHIFT
or
a1
,
a1
,
a0
csrw
sptbr
,
a1
sfence.vma
#
Enter
supervisor
mode
and
make
sure
correct
page
is
accessed
la
a2
,
1
f
csrwi
mepc
,
0
li
a1
,
((
MSTATUS_MPP
&
~
(
MSTATUS_MPP
<<
1
))
*
PRV_S
)
csrs
mstatus
,
a1
mret
.
align
2
.
global
mtvec_handler
mtvec_handler
:
csrr
t0
,
mcause
add
t0
,
t0
,
-
CAUSE_STORE_PAGE_FAULT
bnez
t0
,
fail
jr
a2
fail
:
1
:
la
a0
,
-
1
.
word
0x0000006b
j
1
b
.
data
.
align
12
page_table_1
:
.
dword
0
.
align
12
page_table_2
:
.
dword
0
.
align
12
page_table_3
:
.
dword
0
.
align
13
code_page
:
la
a0
,
0xbeef
la
a1
,
0x1000
sw
a0
,
(
a1
)
sfence.vma
la
a0
,
0xdead
la
a1
,
0x2000
sw
a0
,
(
a1
)
sfence.vma
la
a1
,
0x1000
lw
a0
,
(
a1
)
#
add
some
nop
to
trigger
difftest
of
$a0
nop
nop
nop
nop
nop
nop
nop
nop
la
a0
,
0
.
word
0x0000006b
.
align
12
data_page
:
.
dword
0
tests/aliastest/src/main.c
0 → 100644
浏览文件 @
e135093b
#include <aliastest.h>
void
map_kernel_page
()
{
}
int
main
()
{
printf
(
"Alias test shall pass when difftest gives no error
\n
"
);
do_init
();
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录