Giter VIP home page Giter VIP logo

wujian100_open's Introduction

wujian100_open

wujian100_open is a MCU base SoC. We can simulate by EDA tools and emulate by FPGA. Also we can develop the IPs and software in this platform. We wish more and more developers building the open MCU ecosystem with T-Head. IC design and development should be faster simpler and more reliable
Directory Structure
|--Project                //open source project work directory  
  |--riscv_toolchain      //tool chain install directory download from t-head.cn
  |--wujian100_open       //wujian100_open project get from github
    |--case               //test case example for simulation
    |--doc                //wujian100_open user guide
    |--fpga               //FPGA script
    |--lib                //compile script for simulation
    |--regress            //regression result
    |--sdk                //software design kit
    |--soc                //Soc RTL source code
    |--tb                 //test bench
    |--tools              //simulation script and setup file
    |--workdir            //simulation directory
    |--LICENSE
    |--README.md

Get Started

1. prepare a project work directory just like 'Project'
2. cd Project
3. git clone https://github.com/T-head-Semi/wujian100_open.git or git clone [email protected]:T-head-Semi/wujian100_open.git

Download C/C++ Compiler

1. prepare a tool chain install directory named 'riscv_toolchain'  // use the c shell command like 'mkdir riscv_toolchain'
2. download the tool chain from the url https://occ.t-head.cn/community/download?id=3913221581316624384
3. install the tool chain to the riscv_toolchain dirctory

Get open source EDA tools

centos7/rhel7:  sudo yum install iverilog verilator gtkwave
ubuntu/debian:  sudo apt-get install iverilog verilator gtkwave

Get ready for simulation

1. cd wujian100_open/tools
2. vim setup.csh then add the vcs path and license
3. source setup.csh         //if not success you can touch a new file named setup.csh and copy the content to the new file. then source the new file
4. cd wujian100_open/workdir
5. if you want to use iverilog as simulation tool please execute the command '../tools/run_case -sim_tool iverilog ../case/timer/timer_test.c' or if you want to use vcs as simulation tool please execute the command '../tools/run_case -sim_tool vcs ../case/timer/timer_test.c'

Get ready for FPGA bit generation

1. make sure you have the synplify and license
2. cd wujian100_open/fpga/synplify
3. execute the synplify and load the wujian100_open_200t_3b.prj file
4. input the command 'sdc2fdc' in synplify
5. start the synplify
6. after synplify generated the netlist we will use vivado for P&R and generated the bit file
7. make sure you have the vivado and licese
8. cd wujian100_open/fpga/vivado
9. run tcl use file 'wujian100_open_200t_3b_prj.tcl'
10. program the bit file to the fpga board
11. enjoy the application development

How to get the debug tool

download from the url https://occ.t-head.cn/community/download?id=616215132330000384 

How to get the IDE for development

download from the url https://occ.t-head.cn/community/download?id=575997419775328256  

How to use the sdk

wujian100_open SDK is wujian100_open software development kit, the software follows the CSI interface specification. Through the SDK users can quickly wujian100_open test and evaluation. At the same time users can refer to the SDK integration of various commonly used components and sample procedures for application development quickly form a product solution.

SDK directory structure:
|--sdk
 |--csi_core 	//CSI-Core related interface definition, and interface implementation on
                //E902.
 |--csi_dirver  //CSI-Driver related interface definition, and peripheral Driver
                //implementation.
 |--csi_kernel  //CSI-Kernel related interface definition, and Rhino, FreeRTOSv8.2.3
                //ucos-iii and other real-time operating system docking example code
 |--libs        //Store common library implementations
 |--projicet	//Store a variety of reference examples including benchmark test
                //program, driver example program, rtos example program. The relevant
                //project documents are also included.
 |--utilites	//Store project config files.
 |--VERSION
1. Download and install the CDK
2. Open a project using CDK, for example open the hello project:
  projects/examples/hello_world/CDK/wj100-open-hello_world.cdkproj
3. Build the project:
Click "project" on the toolbar,and select "build all". After successful compilation, you will see the following:
Build target ' wujian100_open-hello_world BuildSet '
----------Building project:[ wujian100_open-hello_world - BuildSet ]----------
make[1]: Entering directory 'D:/release/Wujian100_open-V1.0.0/Wujian100_open-V1.0.0/projects/examples/hello_world/CDK'
make[1]: Leaving directory 'D:/release/Wujian100_open-V1.0.0/Wujian100_open-V1.0.0/projects/examples/hello_world/CDK'
make[1]: Entering directory 'D:/release/Wujian100_open-V1.0.0/Wujian100_open-V1.0.0/projects/examples/hello_world/CDK'
linking...
size of target:
   text	   data	    bss	    dec	    hex	filename
  22680	   1628	   6660	  30968	   78f8	D:/release/Wujian100_open-V1.0.0/Wujian100_open-V1.0.0/projects/examples/hello_world/CDK/Obj/wujian100_open-hello_world.elf
checksum value of target:  0xE2B2C769 (491,388)
make[1]: Leaving directory 'D:/release/Wujian100_open-V1.0.0/Wujian100_open-V1.0.0/projects/examples/hello_world/CDK'
Executing Post Build commands ...
Done
====0 errors, 0 warnings, total time : 20s263ms====
4. Run the project:
Click "Debug" on the toolbar,and select "Start/Stop Debugger".

Dicussion

If you want to discuss about the wujian100_open project. You can scan the DingDing QR code below:

Wujian100

Reference and Thanks

The program model of GPIO refer to the DesignWare of Synopsys 
The program model of Timer refer to the DesignWare of Synopsys 
The program model of WDT refer to the DesignWare of Synopsys 

wujian100_open's People

Contributors

birdshanshan avatar handsomeassassin avatar iclite avatar ifnfn avatar mballackh13 avatar sequoiar avatar shangyunhai avatar xqbumu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wujian100_open's Issues

平头哥适配过的工具链有开源链接么

因为 wujian100 使用 E902 cpu core,看 E902 手册,里面有平头哥的扩展指令。
从平头哥网站上下载的工具链只有二进制,没有源码。

请问哪里有平头哥适配过的工具链的源码?

语法错误

这里语法是说英语语法,README.md满是语法错误,貌似头一句就挂了。如果要走向世界,是不是改改。

Core is not modifiable

The core E902_20191018.v appears to be generated code, with no way to modify it. This will be an issue for it's more wider adoption.

Ideally the original source and the tools to regenerate the verilog would be included in this repository.

建议支持 iverilog + gtkwave

在setup.csh 中需要手动配置 vcs等仿真环境,vcs作为一种商业软件不符合开源社区精神
建议使用iverilog+gtkwave作为仿真环境。
如果issues通过,稍后可提交pull requests。

关于ip核配置

请问SOC相关的verilog代码在移植到vivado后需要自己配置ip核吗,还是说有现成的使用呢?

verilog的命名规则、缩写规范

请问有没有关于e902代码命名规则,module 命名规范的文件,方便理解、阅读,在没有注释的情况下看代码真的太难了

about annotation

wujian100_open 30/105029*100%=0.03%

$ find . -type f | xargs cat | wc -l
105029
$ grep -rn "//" |wc -l
30
$ pwd
~/wujian100_open/soc

$ grep -rn "//" 
sms.v:466:casex ({resp_cfg[3:2], rty_first, resp_cfg[1:0]})  // synopsys parallel_case
sms.v:555:  case (ram_size[2:0])   // synopsys parallel_case
sms.v:557:      case (ram_addr[1:0])   // synopsys parallel_case
sms.v:568:      case (ram_addr[1])     // synopsys parallel_case
common.v:28:  case(clk_sel) // synopsys infer_mux
E902_20191018.v:194:  //  `define HAD_MBKPT_9 
E902_20191018.v:197:    //`define DBG_EXP 
usi0.v:1066:                case({i2cm_hs, i2cm_sbyte}) // synopsys parallel_case
usi0.v:2839:        case(txcnt_bits[4:1]) // synopsys parallel_case
usi0.v:2866:    case(spi_data_size[3:0]) // synopsys parallel_case
usi0.v:2916:        case(txcnt_bits[4:1]) // synopsys parallel_case
usi0.v:2981:        case(cnt_bits[3:0]) // synopsys parallel_case
usi0.v:3071:    case(spi_data_size[3:0]) // synopsys parallel_case
usi0.v:3555:                case(txcnt_bits[2:0]) // synopsys parallel_case
usi0.v:3581:    case(uart_dbit[1:0])  // synopsys parallel_case
usi0.v:3616:        case(uart_pbit[1:0]) // synopsys parallel_case
usi0.v:3669:    case(uart_dbit[1:0]) // synopsys parallel_case
matrix.v:224:// synopsys translate_off
matrix.v:237:// synopsys translate_on
matrix.v:452:// synopsys translate_off
matrix.v:465:// synopsys translate_on
dmac.v:933:    case(data_chnl_cd)  // synopsys parallel_case
dmac.v:957:        //data_chnl_cd[3:0] <= 4'b00 ; 
dmac.v:965:    case(busy_chn_code)  // synopsys parallel_case
dmac.v:986:    case(busy_chn_code)  // synopsys parallel_case
dmac.v:1007:    case(busy_chn_code)  // synopsys parallel_case
dmac.v:1029:    case(busy_chn_code)  // synopsys parallel_case
dmac.v:15707:assign   cntr_blk_decen = ( is_wr_ctrlstt ) & current_rcvvld & (~blk_nu_eql0) ; //& is_blk_src |  
dmac.v:15808:                               //src_single_inten & is_rd_ctrlstt & current_rcvvld   |     
dmac.v:15809:                               //dst_single_inten & is_wr_ctrlstt & current_rcvvld  

rocketchip 3256/45594*100% = 7.14%

$ find . -type f | xargs cat | wc -l
45594
$ grep -rn "//" |wc -l
3256
$ pwd
~/rocket-chip/src

e203 6797/77766*100%=8.74%

$ find . -type f | xargs cat | wc -l
77766
$ grep -rn "//" |wc -l
6797
$ pwd
~/e200_opensource/rtl/e203

synthesis failed

In apb0_params. v

Error: Verilog 2000 keyword parameter used in incorrect context
Please tell me why and how to solve this.

开发文档的一些建议

看了XC7A——FPGA开发板用户手册v1.0。文档感觉主要讲的是一些软件方面,还有一些简单的硬件连接关系。因为想借助这个平台,在FPGA上做一些有意思的电路,应用在比如边缘计算领域。能不能在今后的项目更新中更新如下内容
1. 整个开发板的原理图,以及PCB文件。
2.在用户手册更新中单列一章,简要说明一下wujian100的架构,提供一些系统的简要框图。
3.在用户手册粗劣说明一下两个stm32的主要工作流程。能否顺便将stm32的源程序开源出来。
4.在用户手册中说明一下板载资源,以及主要用处。

GPIO cannot clear interrupt

there is a RTL bug in /soc/gpio.v line 344 . It caused CPU can not clear GPIO interrupt
//code// if(paddr[`GPIO_ADDR_LHS:2] == GPIO_INT_LEVEL_SYNC_OFFSET)

suggetion:
//code// if(paddr[`GPIO_ADDR_LHS:2] == GPIO_INT_CLR_OFFSET )

Readme information update

There r several issues about the readme file, please update relative information.

  1. the download link of riscv toolchain/debug tool/IDE is not accurate or out of date.
  2. setup.csh not support csh shell, there is a need of sh configuration script.
  3. the QR code of Dingtalk is out of date.

Write_bitstream failed!

Synplify Pro J-2015.03
Vivado 2017.4

ERROR: [DRC RTSTAT-6] Partial route conflicts: 746 net(s) have a partial conflict. The problem bus(es) and/or net(s) are x_cpu_top/CPU/x_cr_had_top/A15d/A13e[0], x_cpu_top/CPU/x_cr_had_top/A15d/A13e[3], x_cpu_top/CPU/x_cr_had_top/A15d/A13e[6], x_cpu_top/CPU/x_cr_had_top/A15d/A13e[12], x_cpu_top/CPU/x_cr_had_top/A18545/A91, x_cpu_top/CPU/x_cr_had_top/A18545/A145[9], x_cpu_top/CPU/x_cr_had_top/A18545/A145[19], x_cpu_top/CPU/x_cr_had_top/A18545/A146[2], x_cpu_top/CPU/x_cr_had_top/A18545/A147[12], x_cpu_top/CPU/x_cr_had_top/A18545/A147[27], x_cpu_top/CPU/x_cr_had_top/A18545/A147[30], x_cpu_top/CPU/x_cr_had_top/A18545/A148[5], x_cpu_top/CPU/x_cr_had_top/A18545/A1855b[5], x_cpu_top/CPU/x_cr_had_top/A18545/A1855b[7], x_cpu_top/CPU/x_cr_had_top/A18545/A1861c[4:0]... and (the first 15 of 738 listed).

About Driver of CK-Linker for WIN10

Firtly, Thanks for T-HEAD team, I have got the amazing FPGA board! :)
It's very easy to kickstart with the help of user guide....
Got only one problem, the provided driver of CSKY Debug Server is based on libusb-win32! :(
libusb-win32 is very yesterday, not supported well by win8/win10 (signature), libusb-win32 now is replaced by libusb1.0 (which also support winusb).
So I generate a new libusbK based driver package by LibusbK -> Driver install Creator Wizard
It drives ck-link work well under windows 10

LibusbK package: https://sourceforge.net/projects/libusbk/
You can also use Zadig: https://zadig.akeo.ie

Failed to load program while simulating

WARNING: File inst.pat referenced on E:/RiscV/wujian100/wujian100/wujian100.srcs/sim_1/imports/tb/tb.v at line 256 cannot be opened for reading. Please ensure that this file is available in the current working directory.
######time: 0, Dump start######
START TO LOAD PROGRAM

WARNING: File data.pat referenced on E:/RiscV/wujian100/wujian100/wujian100.srcs/sim_1/imports/tb/tb.v at line 275 cannot be opened for reading. Please ensure that this file is available in the current working directory.
run: Time (s): cpu = 00:00:08 ; elapsed = 00:00:38 . Memory (MB): peak = 1899.332 ; gain = 0.000

As the problems showed in the quotes, how can I get the files inst.pat and data.pat?

Verilog 语言文件只有顶层文件开源,内部实现不开源么~

wujian100_open_fpga_top.v 文件内部只有接口描述,没有内部逻辑实现么?很少看到大厂的verilog代码:)希望能开源一些观摩下~另外请问现在平头哥的fpga产品相当于altera哪条产品线上的产品呢?总之,感谢开源,希望看到更多verilog和vhdl代码

几个问题,最后一个问题比较急,谢谢

1.为什么CDK只有Windows版本?
2.不用synplify只用vivado可不可以?synplify实在是弄不到软件和license
3.source setup,csh的时候一直报语法错误,不太懂这个,请问怎么解决呢?报错如下
syntax error near unexpected token '('

request for spec of hardware side

Hi wujian100 owners, thanks for your contribution to open the source code of wujian.
But I met some trouble when I want to know more about its architecture or details inside.
Could you release some document like instruction set(ISA) and illustration of module level inside it ?
It looks like a user guide for software engineers more than for hardware engineers in the folder of doc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.