Skip to content

Commit fa9940c

Browse files
wu-kanhowardlau1999
wu-kan
authored andcommitted
first commit
0 parents  commit fa9940c

13 files changed

+637
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish docs via GitHub Pages
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build:
9+
name: Deploy docs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout master
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Deploy docs
18+
uses: mhausenblas/mkdocs-deploy-gh-pages@master
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
TZ: "Asia/Shanghai"

LICENSE

+427
Large diffs are not rendered by default.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Yat-CPU-Docs
2+
3+
在线阅读:<https://scc.sysu.tech/YatCPU-docs/>

docs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 前言
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)

docs/arch/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Coming soon
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)

docs/faq/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Coming soon
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)

docs/lab/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Coming soon
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)

docs/lab/lab1.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Coming soon
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)

docs/quick_start/Environment.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# 开发环境
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)
4+
5+
本项目主要搭建在 Linux 或 WSL (Windows Subsystem for Linux)环境中。~~Windows 环境和 MacOS 理论上也可以,但需要读者自行摸索。~~[这里](https://liuhaohua.com/server-programming-guide/appendix/build-env/)给出搭建相关环境的一个参照。
6+
7+
这里假设你使用的 Linux 或 WSL 系统是 Debian 11。对于使用其他 Linux 系统的同学,操作是类似的,相信你有足够的能力参考下面的指令搭建环境。
8+
9+
## 必要工具
10+
11+
```bash
12+
sudo apt install git # 用于将本项目 clone 下来
13+
sudo apt install gcc-riscv64-unknown-elf # 用于生成 risc-v 的测试指令
14+
sudo apt install make # build-essential
15+
sudo apt install curl gnupg2 # 下载工具
16+
sudo apt install scala # 本项目的语言
17+
sudo apt install libtinfo5 # vivado 需要一个这个,否则启动报错
18+
```
19+
20+
## 包管理器 SBT
21+
22+
[sbt](https://packages.debian.org/sid/sbt)目前仍然在 Debian 的[不稳定](https://www.debian.org/releases/sid/)版本中。对于不希望使用 sid 系统的同学,可以按照[文档](https://www.scala-sbt.org/1.x/docs/zh-cn/Installing-sbt-on-Linux.html#Ubuntu%E5%92%8C%E5%85%B6%E4%BB%96%E5%9F%BA%E4%BA%8EDebian%E7%9A%84%E5%8F%91%E8%A1%8C%E7%89%88)的指示下载安装。
23+
24+
```bash
25+
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
26+
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
27+
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
28+
sudo apt update
29+
sudo apt install sbt
30+
```
31+
32+
## Vivado
33+
34+
中山大学组成原理实验课使用的 [Basys3](https://www.stepfpga.com/doc/_media/basys3_ss.pdf) 实验板型号为 XC7A35T,需要 Xilinx 的工具进行烧板。这里安装 `Vivado HL WebPACK`即可,不需要许可或激活许可密钥。
35+
36+
中山大学校园网内下载 Vivado 安装包,可以使用我们提供的镜像。
37+
38+
```bash
39+
curl -O https://mirrors.matrix.moe/software/Xilinx_Unified_2020.1_0602_1208.tar.gz
40+
# 也可以在 Xilinx 的官网下载
41+
# <https://china.xilinx.com/support/download/index.html/content/xilinx/zh/downloadNav/vivado-design-tools/archive.html>
42+
tar -zxf Xilinx_Unified_2020.1_0602_1208.tar.gz
43+
cd Xilinx_Unified_2020.1_0602_1208
44+
./xsetup -b ConfigGen
45+
```
46+
47+
先输入 `2` 再输入 `1`,这时会选中 `Vivado HL WebPACK`。最后会产生一个默认配置文件 `~/.Xilinx/install_config.txt`
48+
49+
随后再次执行下述指令,安装`Vivado HL WebPACK`
50+
51+
```bash
52+
./xsetup -a XilinxEULA,3rdPartyEULA,WebTalkTerms -b Install -c ~/.Xilinx/install_config.txt -l ~/Xilinx
53+
```
54+
55+
其中`~/Xilinx`是安装目录,可以自行定义。

docs/quick_start/Program.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 烧板验证
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)
4+
5+
## 生成二进制文件
6+
7+
假设你的 Vivado 安装目录是 `~/Xilinx`(其他目录自行修改),执行下述指令,可以根据 `verilog/Top.v` 生成二进制文件 `vivado/riscv-basys3/riscv-basys3.runs/impl_1/Top.bit`
8+
9+
```bash
10+
cd vivado
11+
~/Xilinx/Vivado/2020.1/bin/vivado -mode batch -source ./generate_bitstream.tcl
12+
```
13+
14+
## 烧板
15+
16+
由于 WSL 下暂时不可以使用 USB 设备,因此不可以直接烧板。解决方案有两个。
17+
18+
### 方案一:使用 USB 方式烧板(WIP)
19+
20+
需要一个 Fat32 格式的 U 盘。
21+
22+
### 方案二:在 Windows 下烧板
23+
24+
由于 WSL 下可以调用 powershell,我们可以回到 Windows 下烧板。Windows 下可以只装 Vivado_Lab,和完整版的 Vivado 相比只有烧板功能,精简很多。
25+
26+
```bash
27+
# 假设你在 vivado 目录下,同时 Windows 下 Vivado_Lab 安装在 `C:\Xilinx`
28+
powershell.exe 'C:\Xilinx\Vivado_Lab\2020.1\bin\vivado_lab.bat -mode batch -source .\program_device.tcl'
29+
```
30+
31+
中山大学校园网内下载 Vivado_Lab 安装包,也可以使用我们提供的的镜像。

docs/quick_start/Test.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# 快速测试
2+
3+
By: [:material-github: wu-kan](https://github.com/wu-kan)
4+
5+
执行下述指令可以模拟运行本项目的测试,首次运行时需要联网自动下载必要的组件。
6+
7+
```bash
8+
# git clone [email protected]:SYSU-SCC/YatCPU.git
9+
# cd YatCPU
10+
sbt test
11+
```
12+
13+
如果成功执行,你会看到类似这样的输出。
14+
15+
```bash
16+
[success] Total time: 385 s (06:25), completed Dec 15, 2021, 8:45:25 PM
17+
```
18+
19+
输入如下指令,可以编译生成 verilog 代码 `verilog/Top.v`
20+
21+
```bash
22+
sbt run
23+
```

mkdocs.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
nav:
2+
- 前言: "README.md"
3+
- Quick Start:
4+
- 开发环境: "quick_start/Environment.md"
5+
- 快速测试: "quick_start/Test.md"
6+
- 写板验证: "quick_start/Program.md"
7+
- 架构: "arch/README.md"
8+
- 实验: "lab/README.md"
9+
- 实验一: "lab/labs1.md"
10+
- Faqs: "faq/README.md"
11+
12+
site_name: YatCPU documentation
13+
site_url: https://scc.sysu.tech/YatCPU-docs/
14+
repo_url: https://github.com/SYSU-SCC/YatCPU/
15+
copyright: |
16+
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
17+
theme:
18+
icon:
19+
repo: fontawesome/brands/github
20+
name: material
21+
custom_dir: docs/overrides
22+
language: zh
23+
features:
24+
- navigation.top
25+
palette:
26+
- media: "(prefers-color-scheme: light)"
27+
scheme: default
28+
toggle:
29+
icon: material/weather-night
30+
name: 夜间模式
31+
- media: "(prefers-color-scheme: dark)"
32+
scheme: slate
33+
toggle:
34+
icon: material/weather-sunny
35+
name: 白天模式
36+
plugins:
37+
- search
38+
- git-authors
39+
- git-revision-date-localized:
40+
type: iso_datetime
41+
timezone: Asia/Shanghai
42+
markdown_extensions:
43+
- pymdownx.highlight
44+
- pymdownx.details
45+
- pymdownx.superfences
46+
- pymdownx.tabbed
47+
- pymdownx.keys
48+
- pymdownx.snippets
49+
- pymdownx.inlinehilite
50+
- footnotes
51+
- admonition
52+
- toc:
53+
permalink: true
54+
slugify: !!python/name:pymdownx.slugs.uslugify
55+
- pymdownx.emoji:
56+
emoji_index: !!python/name:materialx.emoji.twemoji
57+
emoji_generator: !!python/name:materialx.emoji.to_svg

requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mkdocs==1.2.2
2+
mkdocs-material==7.2.5
3+
mkdocs-material-extensions==1.0.1
4+
mkdocs-git-revision-date-localized-plugin==0.9.2
5+
mkdocs-git-authors-plugin==0.3.3

0 commit comments

Comments
 (0)