list outline

This commit is contained in:
yaozhicheng 2024-04-10 18:54:06 +08:00
parent bd82ca7566
commit e2f6f52da9
1 changed files with 133 additions and 14 deletions

147
Readme.md
View File

@ -1,24 +1,41 @@
# XiangShan Open Verify Class-00-BPU
# 香山微架构开放验证第一期昆明湖BPU模块UT验证实战
This is the first class of XiangShan Open Verify. In this class, we will verify the BPU of XiangShan.
The repository is used to build the verification environment and testcases for the BPU.
本仓库为“香山微架构开放验证第一期昆明湖BPU模块UT验证实战”的验证环境。该验证环境需要在linux系统下运行它包含了如何生成带验证的Python DUT模块、验证示例、验证报告生成等模块。待验证模块对应的香山仓库为[github.com/OpenXiangShan/XiangShan](https://github.com/OpenXiangShan/XiangShan)commit为XXXX
## Environment
**本验证活动官方为:[www.openverify.cc](https://openverify.cc)**
Install the following tools before running the testcases.
**gitlink活动地址为gitlink.com/xxx/xxx**
## 0x0、安装依赖
除去基本的gcc/python3开发环境外本验仓库还依赖RTL仿真器 Verilator4.218 、Picker工具、MLVP库。具体安装方法请参考以下链接。
1. [Verilator](https://www.veripool.org/projects/verilator/wiki/Installing)
2. [Picker](https://github.com/XS-MLVP/picker)
3. [mlvp](https://github.com/XS-MLVP/mlvp)
## Build
通过以下命令安装python依赖
```bash
pip3 install XXXX XXXX XXXX
```
### uFTB
## 0x1、生成待验证模块
下载仓库
```bash
git clone https://github.com/XS-MLVP/env-xs-ov-00-bpu.git
cd env-xs-ov-00-bpu.git
```
### 生成 uFTB
```bash
make uftb TL=python
```
Then you will see the following files in the `out` directory. The whole directory is the python module of uFTB of XiangShan.
上述命令会在当前目录中生成out目录其中 picker_out_uFTB 目录下的 UT_FauFTB 即为待验证的Python Module。可以在python环境中直接导入。因为待验证的python DUT与python版本相关所以无法提供通用版本的python-dut需要自行编译。
```bash
out
@ -42,21 +59,26 @@ out
4 directories, 13 files
```
The `UT_FauFTB` is the python module of uFTB of XiangShan which can be imported in the testcases. For example, you can import the module by the following code when your python file is in the `picker_out_uFTB` directory.
当导入模块UT_FauFTB后可以在Python环境中进行简单测试。
```python
from UT_FauFTB import *
if __name__ == "__main__":
uFTB = DUTFauFTB()
dut.init_clock("clk")
# Create DUT
uftb = DUTFauFTB()
# Init DUT with clock pin name
uftb.init_clock("clock")
# Your testcases here
# ...
uFTB.finalize()
# Destroy DUT
utb.finalize()
```
The other modules such as Tage_SC are similar to uFTB. You can import them in the same way.
其他待验证模块,例如 TAGE-SCFTB也可以通过类似命令生成。
### Tage SC
@ -68,4 +90,101 @@ make tage_sc TL=python
```bash
make ftb TL=python
```
```
**支持的模块名称有uftb、tage_sc、ftb、ras。也可以通过如下命令一次性生成所有DUT模块。**
```bash
make all TL=python
```
## 0x2、BPU外围环境
BPU是CPU中的一个模块单独无法运行为了对BPU中的子模块进行验证本环境提供了其所需的外围环境来驱动BPU中的各个模块。
### Fake-FTQ
TBD
### 分支Trace
TBD
## 0x3、验证示例
本仓库基于uFTB模块提供了验证示例其中包含了如何编写测试用例、发送激励、定义功能覆盖率、生成测试报告等。
### 编写TestCase
TBD
#### 创建测试函数
本验证环境基于Pytest进行搭建因此如何编写test请参考文档XXXXX。在本示例中编写了如下test
```bash
xxxx/test_xxx.py
```
#### 发送激励
TDB
#### 运行测试
TBD
#### 生成测试报告
在运行
## 0x4、如何参与本活动
参与本验证活动取得名次能够获得丰厚大奖获得地址为XXXX。
### 流程介绍
参与验证的流程如下图所示:
【图】
#### 0报名
TBD
#### 1资格认证
TBD
#### 2fork 本仓库
TBD
#### 3领取任务
TBD
#### 4分解测试点
TBD
#### 5编写测试用例
TBD
#### 6编写测试代码&测试发现bug
TBD
#### 7通过Issue和PR汇报bug获得积分
TBD
#### 8编写测试文档
TBD
#### 9提交测试文档获得最终积分
TBD