Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
maksyuki committed Mar 20, 2022
2 parents eb7f0ac + 71c751e commit 4205bca
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 1 deletion.
56 changes: 56 additions & 0 deletions LICENSE_3RD_PARTY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Open Source License Acknowledgements and Third-Party Copyrights

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.

The following acknowledgements pertain to this software license.

## Main components used by TreeCore CPU
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.

### verilator
* maintainer: [verilator](https://github.com/verilator)
* License: [LGPL-3.0](https://github.com/verilator/verilator/blob/master/LICENSE)
* repo: https://github.com/verilator/verilator

### mill
* maintainer: [com-lihaoyi](https://github.com/com-lihaoyi)
* License: [MIT](https://github.com/com-lihaoyi/mill/blob/main/LICENSE)
* repo: https://github.com/com-lihaoyi/mill

### riscv-test
* maintainer: [NJU-ProjectN](https://github.com/NJU-ProjectN)
* License: [custom](https://github.com/NJU-ProjectN/riscv-tests/blob/master/LICENSE)
* repo: https://github.com/NJU-ProjectN/riscv-tests

### difftest
* maintainer: [oscpu](https://gitee.com/oscpu)
* License: [MulanPSL-2.0](https://gitee.com/oscpu/difftest/blob/master/LICENSE)
* repo: https://gitee.com/oscpu/difftest

### NEMU
* maintainer: [oscpu](https://gitee.com/oscpu)
* License: [MulanPSL-2.0](https://gitee.com/oscpu/difftest/blob/master/LICENSE)
* repo: https://gitee.com/oscpu/NEMU

### DRAMsim3
* maintainer: [OpenXiangShan](https://github.com/OpenXiangShan)
* License: [MIT](https://github.com/OpenXiangShan/DRAMsim3/blob/co-simulation/LICENSE)
* repo: https://github.com/OpenXiangShan/DRAMsim3

### ysyxSoC
* maintainer: [oscpu](https://github.com/OSCPU)
* License: [custom](https://github.com/OSCPU/ysyxSoC/blob/master/LICENSE.Berkeley)
* repo: https://github.com/OSCPU/ysyxSoC

## Libraries modified for TreeCore CPU
These libraries derive from [NJU-ProjectN](https://github.com/NJU-ProjectN) and are modified specifically for TreeCore CPU.

### abstract-machine
* maintainer: [maksyuki](https://github.com/maksyuki)
* License: [GPL-3.0](https://github.com/maksyuki/ysyx-software-file/blob/master/LICENSE)
* repo: https://github.com/maksyuki/ysyx-software-file/tree/master/abstract-machine

### am-kernels
* maintainer: [maksyuki](https://github.com/maksyuki)
* License: [GPL-3.0](https://github.com/maksyuki/ysyx-software-file/blob/master/LICENSE)
* repo: https://github.com/maksyuki/ysyx-software-file/tree/master/am-kernels
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ $ make template
## Update

## License
All of the TreeCore codes are release under the [GPL-3.0 License](LICENSE).
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).

## Acknowledgement
1. [oscpu-framework](https://github.com/OSCPU/oscpu-framework)
Expand Down
Empty file modified rtl/scripts/install.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions rtl/scripts/record.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash

8 changes: 8 additions & 0 deletions rtl/tc_l1/hello/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comp:
verilator -Wall --cc --exe --build hello.cpp hello.v -o emu -Mdir build

run:
./build/emu

.PHONY:
comp run
16 changes: 16 additions & 0 deletions rtl/tc_l1/hello/hello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "Vhello.h"
#include "verilated.h"

int main(int argc, char **argv, char **env)
{
VerilatedContext *contextp = new VerilatedContext;
contextp->commandArgs(argc, argv);
Vhello *top = new Vhello{contextp};
while (!contextp->gotFinish())
{
top->eval();
}
delete top;
delete contextp;
return 0;
}
6 changes: 6 additions & 0 deletions rtl/tc_l1/hello/hello.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module hello;
initial begin
$display("Hello World");
$finish;
end
endmodule
8 changes: 8 additions & 0 deletions rtl/tc_l1/switch/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comp:
verilator -Wall --cc --exe --build top.cpp top.v -o emu -Mdir build

run:
./build/emu

.PHONY:
comp run
26 changes: 26 additions & 0 deletions rtl/tc_l1/switch/top.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include "Vtop.h"
#include "verilated.h"

int main(int argc, char **argv, char **env)
{
VerilatedContext *contextp = new VerilatedContext;
contextp->commandArgs(argc, argv);
Vtop *top = new Vtop{contextp};
while (!contextp->gotFinish())
{
int a = rand() & 1;
int b = rand() & 1;
top->a = a;
top->b = b;
top->eval();
printf("a = %d, b = %d, f = %d\n", a, b, top->f);
assert(top->f == a ^ b);
}
delete top;
delete contextp;
return 0;
}
7 changes: 7 additions & 0 deletions rtl/tc_l1/switch/top.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module top(
input a,
input b,
output f
);
assign f = a ^ b;
endmodule

0 comments on commit 4205bca

Please sign in to comment.