Skip to content

Commit 4205bca

Browse files
committed
Merge branch 'dev' into main
2 parents eb7f0ac + 71c751e commit 4205bca

File tree

10 files changed

+130
-1
lines changed

10 files changed

+130
-1
lines changed

LICENSE_3RD_PARTY.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Open Source License Acknowledgements and Third-Party Copyrights
2+
3+
TreeCore CPU utilizes third party software from various sources. Portions of this software are copyrighted by their respective owners as indicated in the copyright notices below.
4+
5+
The following acknowledgements pertain to this software license.
6+
7+
## Main components used by TreeCore CPU
8+
These components are installed via composer or via npm. You can check all the dependencies using the instructions from the section Libraries dynamically referenced via Composer and Libraries dynamically referenced via npm.
9+
10+
### verilator
11+
* maintainer: [verilator](https://github.com/verilator)
12+
* License: [LGPL-3.0](https://github.com/verilator/verilator/blob/master/LICENSE)
13+
* repo: https://github.com/verilator/verilator
14+
15+
### mill
16+
* maintainer: [com-lihaoyi](https://github.com/com-lihaoyi)
17+
* License: [MIT](https://github.com/com-lihaoyi/mill/blob/main/LICENSE)
18+
* repo: https://github.com/com-lihaoyi/mill
19+
20+
### riscv-test
21+
* maintainer: [NJU-ProjectN](https://github.com/NJU-ProjectN)
22+
* License: [custom](https://github.com/NJU-ProjectN/riscv-tests/blob/master/LICENSE)
23+
* repo: https://github.com/NJU-ProjectN/riscv-tests
24+
25+
### difftest
26+
* maintainer: [oscpu](https://gitee.com/oscpu)
27+
* License: [MulanPSL-2.0](https://gitee.com/oscpu/difftest/blob/master/LICENSE)
28+
* repo: https://gitee.com/oscpu/difftest
29+
30+
### NEMU
31+
* maintainer: [oscpu](https://gitee.com/oscpu)
32+
* License: [MulanPSL-2.0](https://gitee.com/oscpu/difftest/blob/master/LICENSE)
33+
* repo: https://gitee.com/oscpu/NEMU
34+
35+
### DRAMsim3
36+
* maintainer: [OpenXiangShan](https://github.com/OpenXiangShan)
37+
* License: [MIT](https://github.com/OpenXiangShan/DRAMsim3/blob/co-simulation/LICENSE)
38+
* repo: https://github.com/OpenXiangShan/DRAMsim3
39+
40+
### ysyxSoC
41+
* maintainer: [oscpu](https://github.com/OSCPU)
42+
* License: [custom](https://github.com/OSCPU/ysyxSoC/blob/master/LICENSE.Berkeley)
43+
* repo: https://github.com/OSCPU/ysyxSoC
44+
45+
## Libraries modified for TreeCore CPU
46+
These libraries derive from [NJU-ProjectN](https://github.com/NJU-ProjectN) and are modified specifically for TreeCore CPU.
47+
48+
### abstract-machine
49+
* maintainer: [maksyuki](https://github.com/maksyuki)
50+
* License: [GPL-3.0](https://github.com/maksyuki/ysyx-software-file/blob/master/LICENSE)
51+
* repo: https://github.com/maksyuki/ysyx-software-file/tree/master/abstract-machine
52+
53+
### am-kernels
54+
* maintainer: [maksyuki](https://github.com/maksyuki)
55+
* License: [GPL-3.0](https://github.com/maksyuki/ysyx-software-file/blob/master/LICENSE)
56+
* repo: https://github.com/maksyuki/ysyx-software-file/tree/master/am-kernels

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ $ make template
282282
## Update
283283

284284
## License
285-
All of the TreeCore codes are release under the [GPL-3.0 License](LICENSE).
285+
TreeCore CPU's codes are release under the [GPL-3.0 License](LICENSE) and compliance with other open source agreements. You can find all 3rd party libraries licenses in [LICENSE_3RD_PARTY.md](LICENSE_3RD_PARTY).
286286

287287
## Acknowledgement
288288
1. [oscpu-framework](https://github.com/OSCPU/oscpu-framework)

rtl/scripts/install.sh

100644100755
File mode changed.

rtl/scripts/record.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+

rtl/tc_l1/hello/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comp:
2+
verilator -Wall --cc --exe --build hello.cpp hello.v -o emu -Mdir build
3+
4+
run:
5+
./build/emu
6+
7+
.PHONY:
8+
comp run

rtl/tc_l1/hello/hello.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "Vhello.h"
2+
#include "verilated.h"
3+
4+
int main(int argc, char **argv, char **env)
5+
{
6+
VerilatedContext *contextp = new VerilatedContext;
7+
contextp->commandArgs(argc, argv);
8+
Vhello *top = new Vhello{contextp};
9+
while (!contextp->gotFinish())
10+
{
11+
top->eval();
12+
}
13+
delete top;
14+
delete contextp;
15+
return 0;
16+
}

rtl/tc_l1/hello/hello.v

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module hello;
2+
initial begin
3+
$display("Hello World");
4+
$finish;
5+
end
6+
endmodule

rtl/tc_l1/switch/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comp:
2+
verilator -Wall --cc --exe --build top.cpp top.v -o emu -Mdir build
3+
4+
run:
5+
./build/emu
6+
7+
.PHONY:
8+
comp run

rtl/tc_l1/switch/top.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <assert.h>
4+
5+
#include "Vtop.h"
6+
#include "verilated.h"
7+
8+
int main(int argc, char **argv, char **env)
9+
{
10+
VerilatedContext *contextp = new VerilatedContext;
11+
contextp->commandArgs(argc, argv);
12+
Vtop *top = new Vtop{contextp};
13+
while (!contextp->gotFinish())
14+
{
15+
int a = rand() & 1;
16+
int b = rand() & 1;
17+
top->a = a;
18+
top->b = b;
19+
top->eval();
20+
printf("a = %d, b = %d, f = %d\n", a, b, top->f);
21+
assert(top->f == a ^ b);
22+
}
23+
delete top;
24+
delete contextp;
25+
return 0;
26+
}

rtl/tc_l1/switch/top.v

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module top(
2+
input a,
3+
input b,
4+
output f
5+
);
6+
assign f = a ^ b;
7+
endmodule

0 commit comments

Comments
 (0)