Skip to content

Commit eb7f0ac

Browse files
committed
Merge branch 'dev' into main
2 parents 8ad4da1 + 65b3798 commit eb7f0ac

File tree

3 files changed

+85
-16
lines changed

3 files changed

+85
-16
lines changed

.github/workflows/check-style.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: check-style
2+
3+
on:
4+
push:
5+
branches: [ main, dev, tc-l1, tc-l2, tc-l3 ]
6+
7+
jobs:
8+
check-style:
9+
name: Check Code Style
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install dependencies
14+
run: |
15+
echo "fake action"

README.md

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ List!!!!
6464
IMG!!!!
6565

6666
**TreeCoreL2**<span id="id_tcl2"></span>
67+
<p align="center">
68+
<img src="https://raw.githubusercontent.com/microdynamics-cpu/tree-core-cpu-res/main/treecore-l2-arch.drawio.svg"/>
69+
<p align="center">
70+
TreeCoreL2 data flow graph
71+
</p>
72+
</p>
73+
6774
* 64-bits single-issue, five-stage pipeline riscv core
6875
* written by chisel3
6976
* support RISCV integer(I) instruction set
@@ -86,8 +93,8 @@ IMG!!!!!!!!!!!!!!!
8693
## Develop Schedule
8794
Now, the develop schedule of TreeCore is recorded by the **Tencent Document**. You can click below link to view it:
8895

89-
1. TreeCoreL1&2: [schedule table link, state: frozen](https://docs.qq.com/sheet/DY3lORW5Pa3pLRFpT?newPad=1&newPadType=clone&tab=BB08J2)
90-
2. TreeCoreL3&4: [schedule table link, state: in progress](https://docs.qq.com/sheet/DY3lORW5Pa3pLRFpT?newPad=1&newPadType=clone&tab=BB08J2)
96+
1. TreeCoreL1&2(**frozen**): [link](https://docs.qq.com/sheet/DY3lORW5Pa3pLRFpT?newPad=1&newPadType=clone&tab=BB08J2)
97+
2. TreeCoreL3&4(**in progress**): [link](https://docs.qq.com/sheet/DY2dpdHBlSmZ2UVlX?tab=BB08J2)
9198

9299
### Memory Map
93100
To compatible with SoC test, All types of TreeCore have same memory map range:
@@ -132,7 +139,7 @@ tools ->
132139
```
133140

134141
### Enviroment Setup
135-
> NOTE: All of the components and tools are installed under linux operation system. To gurantee the compatibility and stability, I strongly recommend using `ubuntu 20.04 LTS`. `ubuntu 18.04` and `ubuntu 16.04` is not supported official.
142+
> NOTE: All of the components and tools are installed under linux operation system. To gurantee the compatibility and stability, I **STRONGLY** recommend using `ubuntu 20.04 LTS`. `ubuntu 18.04` and `ubuntu 16.04` is not supported official.
136143
137144
If you're new to TreeCore project, we suggest you start with the install section. Remeber you **ONLY** need to install the below libraries once. Now all of operations(config, compile, test) have been automated by Makefile. You can visit [unit-test.yml](.github/workflows/unit-test.yml) to get more information.
138145
> NOTE: In order to download and configure all libraries successful, you **NEED** to be able to visit github.com and gitee.com.
@@ -156,7 +163,7 @@ $ echo export NOOP_HOME=$(pwd)/dependency >> ~/.bashrc
156163
$ source ~/.bashrc
157164
```
158165

159-
Running the ISA test don't need 8G memory, so you can configure the `memory size` to reduce the simulation memory usage. Achieving that, you need to type `make menuconfig` as follow:
166+
Running the ISA test don't need 8G memory, so you can reconfigure the `memory size` to reduce the simulation memory usage. Achieving that, you need to type `make menuconfig` as follow:
160167

161168
```bash
162169
$ cd dependency/NEMU
@@ -199,7 +206,7 @@ $ make riscvTestBuild
199206
$ make cpuTestBuild
200207
$ make amTestBuild
201208
```
202-
> NOTE: you need enough memory to compile the application binaries.
209+
> NOTE: you need enough memory to compile the application binaries. Generally speaking, you need at least 4GB of memory.
203210
204211
### Recursive test
205212
After you modify the processor design, you need to run recursive unit test to gurantee the modification is correct.
@@ -226,19 +233,50 @@ $ chmod +x ~/.cache/mill/download/0.9.9
226233
```
227234

228235
### Software test
236+
Software test, also called application test, can provide integrated test for interrupt. You need to recompile the amtest with specific `AM_TARGET` when you want to change the software target.
229237
```bash
230-
$ make
238+
# the 'AM_TARGET' option value(default h):
239+
# h => "hello"
240+
# H => "display this help message"
241+
# i => "interrupt/yield test"
242+
# d => "scan devices"
243+
# m => "multiprocessor test"
244+
# t => "real-time clock test"
245+
# k => "readkey test"
246+
# v => "display test"
247+
# a => "audio test"
248+
# p => "x86 virtual memory test"
249+
$ make amTestBuild AM_TARGET=i
250+
$ make amTest
251+
```
252+
253+
### Benchmark test
254+
First, you need to compile the benchmark programs.
255+
```bash
256+
$ make coremarkTestBuild
257+
$ make dhrystoneTestBuild
258+
$ make microbenchTestBuild
259+
```
260+
```bash
261+
$ make coremakrTest
262+
$ make dhrystoneTest
263+
$ make microbenchTest
231264
```
232265

233266
### SoC test
234267
SoC test is based on ysyxSoC project. SoC test provides more accurate simulation environment for processor design.
235268

236269
```bash
237-
$ make socBuild
238-
$ make socTest
270+
$ make CHIP_TARGET=tc_l2 socBuild
271+
# SOC_APP_TYPE: flash, loader
272+
# SOC_APP_NAME: hello, memtest, rtthread
273+
$ make CHIP_TARGET=tc_l2 SOC_APP_TYPE=flash SOC_APP_NAME=hello socTest
239274
```
240275
### Add and Customize new project
241-
276+
```bash
277+
# First modify the `CHIP_TARGET` in Makefile to your custom name which create folder.
278+
$ make template
279+
```
242280
## Plan
243281

244282
## Update

rtl/Makefile

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ cpuTestBuild:
156156

157157
###### (am)am-tests target ######
158158
# now only test the rtl-time and interrupt
159+
AM_TARGET ?=h
159160
amTestBuild:
160-
$(MAKE) -C $(AMTEST_HOME) ARCH=riscv64-mycpu mainargs=i
161+
$(MAKE) -C $(AMTEST_HOME) ARCH=riscv64-mycpu mainargs=$(AM_TARGET)
161162

162163
###### (am)coremark target ######
163164
coremarkTestBuild:
@@ -261,6 +262,19 @@ endif
261262

262263
unit-test: simBuild riscvRecursiveTest cpuRecursiveTest postTest
263264

265+
###### benchmark(application) rule test target ######
266+
# BUG: some error
267+
amTest:
268+
$(BUILD_DIR)/emu -i $(AMTEST_HOME)/build/amtest-riscv64-mycpu.bin
269+
270+
coremakrTest:
271+
echo "hello1"
272+
273+
dhrystoneTest:
274+
echo "hello22"
275+
276+
microbenchTest:
277+
echo "hello2"
264278
###### soc name rule test target ######
265279
socTopModify:
266280
@mkdir -p $(BUILD_DIR)/soc
@@ -295,13 +309,14 @@ socPrevBuild: changeTargetToSoCTop chiselBuild socNameCheck
295309
socBuild: socPrevBuild
296310
$(MAKE) VM_PARALLEL_BUILDS=1 OPT_FAST="-O3" -C $(SOC_COMPILE_HOME) -f V$(SOC_VSRC_TOP).mk -j1
297311

312+
# flash, loader
313+
SOC_APP_TYPE ?= flash
314+
# hello, memtest, rtthread
315+
SOC_APP_NAME ?= hello
316+
SOC_TARGET := $(SOC_APP_NAME)-$(SOC_APP_TYPE)
298317
socTest:
299-
$(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/flash/hello-flash.bin
300-
# $(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/flash/memtest-flash.bin
301-
# $(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/flash/rtthread-flash.bin
302-
# $(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/loader/hello-loader.bin
303-
# $(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/loader/memtest-loader.bin
304-
# $(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/loader/rtthread-loader.bin
318+
# TODO: check if the bin exist!
319+
$(SOC_VSRC_HOME)/emu -i $(YSYXSOC_HOME)/program/bin/$(SOC_APP_TYPE)/$(SOC_TARGET).bin
305320

306321
socSubmit:
307322
@cp $(BUILD_DIR)/soc/ysyx_210324.v ../../oscpu-submit/projects/soc/vsrc/
@@ -326,5 +341,6 @@ cleanAll: cleanBuild cleanMillOut cleanDepRepo
326341
simpleTestBuild riscvTestBuild cpuTestBuild amTestBuild coremarkTestBuild \
327342
dhrystoneTestBuild microbenchTestBuild fecmuxTestBuild demoTest \
328343
simpleRecursiveTest riscvRecursiveTest cpuRecursiveTest postTest unit-test \
344+
amTest coremakrTest dhrystoneTest microbenchTest \
329345
socTopModify socNameCheck socLintCheck socPrevBuild socBuild socSubmit socTest\
330346
cleanBuild cleanMillOut cleanDepRepo cleanAll

0 commit comments

Comments
 (0)