Skip to content

Commit 4f21e22

Browse files
authored
fix html tag (#38)
1 parent ffee2cd commit 4f21e22

7 files changed

+598
-166
lines changed

en/preliminary/CompletePA1.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Complete PA1
6+
7+
PA is the first and the only simulator lab in China for the course "Computer System Fundamentals" at Nanjing University. We introduced PA into "One Student One Chip" for the following reasons:
8+
9+
- PA covers most of the tasks of system engineering skills development: from hardware simulators, ISAs, and runtime environments, to homebrew OSes, libraries, and applications, it gives you a deep understanding of every detail of how a program runs on a computer.
10+
- If you choose to build your system software directly on an RTL-implemented processor, you first need to make sure that your processor is the implemented correct: if your pipeline has problems interacting with the bus in some extreme scenario, your homebrew OS and complex applications (such as complex games) won't run. In contrast, it is much easier to implement a simulator correctly than to implement RTL correctly.
11+
- The simulator is an important component of processor verification: we want you to understand every detail of the simulator, to customize it when you need to, and not to treat it as an external tool that has nothing to do with you.
12+
13+
:::info[Course resources for "Fundamentals of computer systems"]
14+
In the process of completing the PA, if you need to complement some theoretical knowledge, you can refer to Ms. Yuan Chunfeng's course on China University MOOC: [Part 1][mooc1], [Part 2][mooc2], [Part 3][mooc3]
15+
:::
16+
[mooc1]: https://www.icourse163.org/course/NJU-1001625001
17+
18+
[mooc2]: https://www.icourse163.org/course/NJU-1001964032
19+
20+
[mooc3]: https://www.icourse163.org/course/NJU-1002532004
21+
22+
:::warning[Read the FAQ (Frequently Asked Questions) in the PA handout.]
23+
Before doing the PA, we strongly recommend that you read [FAQ in the PA handout][PA FAQ] to get a better understanding of the PA.
24+
:::
25+
<!-- [PA FAQ]: ../../ics-pa/FAQ.html -->
26+
27+
:::warning[Complete PA1]
28+
Complete the content according to the PA handout (ISA chose the default `riscv32`) until you see the following prompt box:
29+
30+
- [Infrastructure: Simple Debugger][gdb]
31+
- [Expression evaluation][expr]
32+
- [Watchpoint][watchpoint]
33+
- Complete the required exercises in PA1 until you see the following prompt box:
34+
35+
#### flag::hint
36+
37+
This is the end of PA1...
38+
:::
39+
40+
<!-- [gdb]: ../../ics-pa/1.4.md
41+
42+
[expr]: ../../ics-pa/1.5.html
43+
44+
[watchpoint]: ../../ics-pa/1.6.html -->
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Basic Digital Circuit Lab
6+
7+
Digital Circuits is the introductory course of "One Student One Chip", we have listed some of the knowledge points that you need to master, you not only need to know their concepts, but also need to learn to use the hardware description language to implement the circuit module respectively.
8+
9+
- Binary encoding of information
10+
- Combinational Logic Design: Multiplexers, Decoders, Priority Encoders, Adders, Comparators
11+
- Timing logic design: clocks, D-flip-flops, counters, SRAM and DRAM, finite state machines, timing analysis
12+
13+
:::info[Digital Circuit Study Materials]
14+
- [Digital Design and Computer Architecture: RISC-V Edition][book] ch1-5
15+
- [HDLBits — Verilog Practice][hdlbits], recommand to read and practice in same time
16+
- [USTC Verilog OA][ustc verilog oj]\(Chinese, need registration and login), recommand to read and practice in same time
17+
- Verilog Advanced Digital System Design Techniques and Case Studies
18+
:::
19+
[book]: https://pages.hmc.edu/harris/ddca/ddcarv.html
20+
21+
:::info[Chisel Study Materials]
22+
It is recommended to study in the following order:
23+
24+
1. [Chisel Bootcamp][bootcamp] It is a very good chisel tutorial, also supports running chisel code online, you can write chisel code while learning. Among them are
25+
- Chapter 1 is an introduction to scala.
26+
- Chapter 2 is chisel basics.
27+
- Chapter 3 is a mix of advanced scala features and chisel.
28+
- Chapter 4 is about the FIRRTL backend You will need to complete the first two chapters, and we strongly recommend that you take Chapter 3. Chapter 4 is not directly related to this course and can be used as extra reading material.
29+
2. [Chisel Users Guide][users guide] It's a good introduction to chisel, as it organizes the features of chisel in a more systematic way.
30+
3. [Chisel cheatsheet][cheatsheet] A concise list of common uses cases of the chisel language.
31+
4. [Chisel API][api] All APIs of the chisel library are listed in detail for reference.
32+
33+
Then try to use Chisel to complete the above digital circuit experiments, you just need to connect the compiled Verilog code to the verilator and NVBoard.
34+
35+
Welcome to join the Chisel communication group (scan the QR code below on WeChat to contact the teaching assistant to join the group).
36+
37+
![Wang Rui](/ysyx-img/zh/preliminary/wangrui.jpg)
38+
:::
39+
[bootcamp]: https://mybinder.org/v2/gh/freechipsproject/chisel-bootcamp/master
40+
41+
[users guide]: https://www.chisel-lang.org/docs
42+
43+
[cheatsheet]: https://github.com/freechipsproject/chisel-cheatsheet/releases/latest/download/chisel_cheatsheet.pdf
44+
45+
[api]: https://www.chisel-lang.org/api/latest/
46+
47+
:::info[verilog learning materials]
48+
What we need to cultivate is hardware thinking. We need to have circuits in our minds before writing code by hand. The essence of verilog is a hardware description language rather than a hardware design language. You can watch [verilog introductory video][verilog1] and [Introduction to syntax][verilog2] Get started.
49+
:::
50+
[verilog1]: https://www.bilibili.com/video/BV1PS4y1s7XW
51+
52+
[verilog2]: https://vlab.ustc.edu.cn/guide/doc_verilog.html
53+
54+
:::info[vscode automatic jump plugin]
55+
- If you choose chisel programming, metals plugin is recommended.
56+
- If you choose verilog programming, we recommend the [digital ide](https://digital-eda.github.io/DIDE-doc-Cn/#/?id=digital-ide-version-030) plugin.
57+
:::
58+
[hdlbits]: https://hdlbits.01xz.net/wiki/Main_Page
59+
60+
[ustc verilog oj]: https://verilogoj.ustc.edu.cn/oj/
61+
62+
:::warning[Complete digital circuit experiments with NVBoard]
63+
We first recommend Nanjing University’s [Digital Circuit and Computer Composition Experiment][dlco].
64+
65+
Nanjing University has carried out teaching reforms and integrated the two courses of "Digital Circuits" and "Principles of Computer Composition". The experimental content runs from the basics of digital circuits to simple processor design. Recently, it has tried to add content related to the program runtime environment, which is related to The main content of "One Student One Chip" fits very well.
66+
67+
The following parts are **required exercises**:
68+
69+
- Experiment 1 Selector
70+
- Experiment 2 Decoder and Encoder
71+
- Experiment 3 Adder and ALU
72+
- Experiment 6 Shift Register and Barrel Shifter
73+
- Experiment 7 State Machine and Keyboard Input
74+
75+
Other contents are optional for understanding and are not specified in the preliminary part. With NVBoard, you can use it as an FPGA and use it to implement experimental content that requires FPGA support.
76+
:::
77+
[dlco]: https://nju-projectn.github.io/dlco-lecture-note/index.html
78+
79+
:::warning[Evaluate timing after circuit synthesis]
80+
We provide a post-synthesis timing evaluation project based on open source EDA. This project synthesizes the RTL design through the [open source RTL synthesizer yosys][yosys] and maps it to a 45nm open source process library [nangate45][nangate45], and then synthesizes the synthesized netlist file and process library The standard unit information file in is input into the [open source static timing analysis tool iSTA][ista]. iSTA will quickly evaluate the timing paths in the RTL design and provide several paths with the smallest timing margin for reference by RTL designers. Through the above method, RTL Designers can quickly learn the timing of RTL designs and quickly iterate on RTL designs.
81+
82+
You can clone the project with the following command. Please read the README in the project for specific instructions.
83+
84+
```bash
85+
git clone [email protected]:OSCPU/yosys-sta.git
86+
```
87+
88+
Try evaluating your digital circuit experiments with the above items.
89+
:::
90+
[yosys]: https://yosyshq.net/yosys
91+
92+
[nangate45]: https://mflowgen.readthedocs.io/en/latest/stdlib-freepdk45.html
93+
94+
[ista]: https://github.com/OSCC-Project/iEDA/tree/master/src/operation/iSTA
95+
96+
:::info[Limitations of open source EDA tools]
97+
Of course, the above evaluation projects are not perfect. At least for now, they have the following shortcomings:
98+
99+
- The synthesis quality of the open source synthesizer yosys is not high. According to the evaluation work of the open source EDA team, for a certain RTL design, the standard unit area synthesized by yosys is 1.8 times that of the commercial synthesizer, and the circuit frequency synthesized by the commercial synthesizer is 153.8MHz. The circuit frequency synthesized by yosys is only 52MHz.
100+
- nangate45 is a process library for academic research. The quantity and quality of standard units are also somewhat different from those of commercial process libraries.
101+
- nangate45 cannot be used for tape-out, no factory uses it in the production line.
102+
103+
However, in the post-synthesis timing evaluation scenario, the above defects will not have a significant impact: even if the synthesis quality of yosys is not high, we can guide the direction of RTL optimization through the relative improvement of the synthesis results.
104+
:::
105+
<!-- -->
106+
107+
:::info[So do you still need FPGA to learn "One Student One Chip"?]
108+
Basically no need:
109+
110+
- In terms of accuracy, Yosys' comprehensive process is geared towards ASIC design. Compared to the FPGA process, its principles and reporting accuracy are more suitable for "One Student One Chip".
111+
- In terms of time, the main function of FPGA is simulation acceleration. That is to say, if the simulation task does not take a long time to complete, the advantage of using FPGA is not obvious. In fact, from the perspective of the simulation process, when the following inequality When established, the advantages of FPGA can be realized:
112+
```
113+
FPGA_syn_time + FPGA_impl_time + FPGA_run_time < verilator_compile_time + verilator_run_time
114+
```
115+
`FPGA_syn_time + FPGA_impl_time` usually reaches the order of hours, while `verilator_compile_time` can usually be completed within minutes. Therefore, only when `verilator_run_time` reaches the order of hours, the above inequality is possible. However, in the "One Student One Chip" learning, it is difficult for you Encounter simulation tasks that take hours to complete.
116+
- In terms of debugging difficulty, FPGA debugging methods are very limited and can only capture the underlying waveform information under conditions of limited time and space; on the contrary, software simulation is much more flexible, and we can use many software methods to debug it from many aspects. Improve debugging efficiency.
117+
:::

0 commit comments

Comments
 (0)