﻿______________________________________________________________________
         GOWIN Serial RapidIO IP参考设计阅读指南
----------------------------------------------------------------------
目标器件：GW5AT-LV138FPG676AES
----------------------------------------------------------------------
文件列表
----------------------------------------------------------------------
.
|-- doc
|   `-- readme.txt                              -->  自述文件
|-- tb                                          
|   `-- tc_srio.v                               -->  GOWIN Serial RapidIO IP 仿真TestBench文件
|   `-- tc_srio_mod.v                           -->  GOWIN Serial RapidIO IP 仿真TestBench文件
|   |-- simlib                                  
|       |-- gw5a                                
|           `-- prim_sim.v                      -->  GOWIN GW5A系列FPGA仿真库文件
|-- simulation                                  -->  Simulation File
|   |-- modelsim_sim                            
|       `-- path.f                              -->  GOWIN Serial RapidIO IP 仿真Filelist
|       `-- readme.txt                          -->  GOWIN Serial RapidIO IP Modelsim仿真自述文件
|       `-- sim.bat                             -->  GOWIN Serial RapidIO IP windows bat执行文件
|       `-- sim.do                              -->  GOWIN Serial RapidIO IP Modelsim.do文件
|       `-- sim_tcl.tcl                         -->  GOWIN Serial RapidIO IP Modelsim.tcl文件
|       `-- rx_req_data_compare.txt             -->  GOWIN Serial RapidIO IP 接收请求事务数据参照文件
|       `-- rx_resp_data_compare.txt            -->  GOWIN Serial RapidIO IP 接收响应事务数据参照文件
|       `-- tx_req_data_compare.txt             -->  GOWIN Serial RapidIO IP 发送请求事务数据参照文件
|       `-- tx_resp_data_compare.txt            -->  GOWIN Serial RapidIO IP 发送响应事务数据参照文件
|   |-- vcs_sim                                 
|       `-- readme.txt                          -->  GOWIN Serial RapidIO IP VCS仿真自述文件
|       `-- makefile                            -->  GOWIN Serial RapidIO IP VCS仿真Makefile文件
|-- project                                     
|   `-- srio_ed_prj.gprj              	        -->  参考设计工程文件
|   `-- srio_ed_prj.gprj.gprj.user              -->  参考设计工程文件
|   |-- impl                                    -->  参考设计工程编译生成文件
|   |-- src                                     -->  参考设计源码
|       `-- srio_board.v                        -->  参考设计工程顶层文件
|       `-- srio_ed_prj.cst                     -->  参考设计工程管脚约束文件
|       `-- srio_ed_prj.sdc                     -->  参考设计工程时序约束文件
|       `-- srio_ed_prj.gao                     -->  参考设计工程在线调试文件
|       |-- serdes                                       
|           `-- serdes.csr                      -->  GOWIN Serdes IP 文件
|           `-- serdes.ipc                      -->  GOWIN Serdes IP 文件
|           `-- serdes.mod                      -->  GOWIN Serdes IP 文件
|           `-- serdes.toml                     -->  GOWIN Serdes IP 文件
|           `-- serdes.v                        -->  GOWIN Serdes IP 文件
|           `-- serdes_temp.csr                 -->  GOWIN Serdes IP 文件
|           `-- serdes_temp.toml                -->  GOWIN Serdes IP 文件
|           `-- serdes_tmp.v                    -->  GOWIN Serdes IP 文件
|           |-- srio                                    
|               `-- srio.v                      -->  GOWIN Serial RapidIO IP 文件(Encrypted)
|               `-- srio.vo                     -->  GOWIN Serial RapidIO IP 文件
|               `-- srio.ipc                    -->  GOWIN Serial RapidIO IP 文件
|               `-- srio_tmp.v                  -->  GOWIN Serial RapidIO IP 文件
|               |-- temp                                
|       |-- debug                               
|           `-- cfg_2to1.v                      -->  参考设计调测相关文件                          
|           `-- testreg.v                       -->  参考设计调测相关文件                                                
|       |-- fifo_sc_top                         
|           `-- fifo_sc_top.v                   -->  GOWIN fifo IP 文件(Encrypted)
|           `-- fifo_sc_top.vo                  -->  GOWIN fifo IP 文件
|           `-- fifo_sc_top.ipc                 -->  GOWIN fifo IP 文件
|           `-- fifo_sc_top_tmp.v               -->  GOWIN fifo IP 文件
|           |-- temp                                
|       |-- uart_to_bus                         
|           `-- uart_to_bus.v                   -->  GOWIN Uart to Bus IP 文件(Encrypted)
|           `-- uart_to_bus.vo                  -->  GOWIN Uart to Bus IP 文件
|           `-- uart_to_bus.ipc                 -->  GOWIN Uart to Bus IP 文件
|           `-- uart_to_bus_tmp.v               -->  GOWIN Uart to Bus IP 文件
|           |-- temp                                
|       |-- gowin_pll                           
|           `-- gowin_pll.ipc                   -->  GOWIN PLL IP 文件                          
|           `-- gowin_pll.vo                    -->  GOWIN PLL IP 文件                          
|           `-- gowin_pll.v                     -->  GOWIN PLL IP 文件                          
|           `-- gowin_pll_tmp.v                 -->  GOWIN PLL IP 文件                                 
|           `-- gowin_serdes_pll_1p25g.ipc      -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_1p25g.vo       -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_1p25g.v        -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_1p25g_tmp.v    -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_2p5g.ipc       -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_2p5g.vo        -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_2p5g.v         -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_2p5g_tmp.v     -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_3p125g.ipc     -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_3p125g.vo      -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_3p125g.v       -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_3p125g_tmp.v   -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_5g.ipc         -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_5g.vo          -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_5g.v           -->  GOWIN PLL IP 文件                          
|           `-- gowin_serdes_pll_5g_tmp.v       -->  GOWIN PLL IP 文件                          
|       |-- test                                   
|           `-- gowin_sdpram.v                  -->  GOWIN Serial RapidIO IP 测试文件
|           `-- gowin_srio_maints.v             -->  GOWIN Serial RapidIO IP 测试文件
|           `-- gowin_srio_request_gen.v        -->  GOWIN Serial RapidIO IP 测试文件
|           `-- gowin_srio_response_gen.v       -->  GOWIN Serial RapidIO IP 测试文件
---------------------------------------------------------------------------------------------------------------
如何在云源软件里打开工程：
---------------------------------------------------------------------------------------------------------------
1. 解压已压缩的设计文件。
2. 启动云源软件并选择“File -> Open”。
3. 在已打开的“Open File”窗口中进入对应工程所在路径，选择工程文件“srio_ed_prj.gprj”。
4. 点击“打开”，则工程即可加载。 

---------------------------------------------------------------------------------------------------------------
如何在云源软件中运行综合，布局布线及时序分析：
---------------------------------------------------------------------------------------------------------------
1. 点击云源软件界面中Process面板中的Process选项卡，双击Synthsize(GowinSynthesis)，这将使设计运行综合。
2. 点击”Project -> Configuration -> Place & Route”以设置生成Post-place文件及SDF文件等。
3. 点击云源软件界面中Process面板中的Process选项卡，双击Place & Route，这将使设计运行映射及布局布线。
4. 当布局布线完成时，用户可以双击Timing Analysis Report得到时序分析结果。

----------------------------------------------------------------------------------------------------------------
如何运行工程仿真：
----------------------------------------------------------------------------------------------------------------
1. 在windows系统下，用鼠标双击./simulation/modelsim_sim/sim.bat,执行文件。
2. 脚本自动打开modelsim并进行仿真。
3. 在Modelsim软件中查看仿真波形。
4. 仿真过程会将总线上的数据存储生成四个文件rx_req_data.txt、rx_resp_data.txt、tx_req_data.txt和tx_resp_data.txt。
   将生成的四个txt与./simulation/modelsim_sim目录下已经包含的四个文件比对，即可确认数据是否符合预期。
   ./simulation/modelsim_sim目录下包含的对比文件分别为：rx_req_data_compare.txt、rx_resp_data_compare.txt、
   tx_req_data_compare.txt和tx_resp_data_compare.txt。


________________________________________________________________________
	  GOWIN Serial RapidIO IP Design Example Readme
------------------------------------------------------------------------
Object device: GW5AT-LV138FPG676AES
---------------------------------------------------------------------------
File List:
---------------------------------------------------------------------------
.
|-- doc
|   `-- readme.txt                              -->  Read Me file (this file)
|-- tb                                          
|   `-- tc_srio.v                               -->  TestBench for GOWIN Serial RapidIO Ref design
|   `-- tc_srio_mod.v                           -->  TestBench for GOWIN Serial RapidIO Ref design
|   |-- simlib                                  
|       |-- gw5a                                
|           `-- prim_sim.v                      -->  GOWIN GW5A FPGA simulation library file
|-- simulation                                  -->  Simulation File
|   |-- modelsim_sim                            
|       `-- path.f                              -->  Filelist for modelsim simulation
|       `-- readme.txt                          -->  Read Me file for modelsim simulation
|       `-- sim.bat                             -->  Windows bat for modelsim simulation
|       `-- sim.do                              -->  File for Simulation run command
|       `-- sim_tcl.tcl                         -->  Tcl for Simulation run command
|       `-- rx_req_data_compare.txt             -->  Used for comparison with generated test data
|       `-- rx_resp_data_compare.txt            -->  Used for comparison with generated test data
|       `-- tx_req_data_compare.txt             -->  Used for comparison with generated test data
|       `-- tx_resp_data_compare.txt            -->  Used for comparison with generated test data
|   |-- vcs_sim                                 
|       `-- readme.txt                          -->  Read Me file for modelsim simulation
|       `-- makefile                            -->  File for Simulation run command
|-- project                                     
|   `-- srio_ed_prj.gprj              	        -->  Design Example Project File
|   `-- srio_ed_prj.gprj.gprj.user              -->  Design Example Project File
|   |-- impl                                    -->  Design Example Project File
|   |-- src                                     -->  Design Example Project File
|       `-- srio_board.v                        -->  Design Example Project File
|       `-- srio_ed_prj.cst                     -->  Design Example Project File
|       `-- srio_ed_prj.sdc                     -->  Design Example Project File
|       `-- srio_ed_prj.gao                     -->  Design Example Project File
|       |-- serdes                                       
|           `-- serdes.csr                      -->  File for Gowin Project
|           `-- serdes.ipc                      -->  File for Gowin Project
|           `-- serdes.mod                      -->  File for Gowin Project
|           `-- serdes.toml                     -->  File for Gowin Project
|           `-- serdes.v                        -->  File for Gowin Project
|           `-- serdes_temp.csr                 -->  File for Gowin Project
|           `-- serdes_temp.toml                -->  File for Gowin Project
|           `-- serdes_tmp.v                    -->  File for Gowin Project
|           |-- srio                                    
|               `-- srio.v                      -->  File for Gowin Project(Encrypted)
|               `-- srio.vo                     -->  File for Gowin Project
|               `-- srio.ipc                    -->  File for Gowin Project
|               `-- srio_tmp.v                  -->  File for Gowin Project
|               |-- temp                            
|       |-- debug                               
|           `-- cfg_2to1.v                      -->  File for Gowin Project                          
|           `-- testreg.v                       -->  File for Gowin Project                                                
|       |-- fifo_sc_top                         
|           `-- fifo_sc_top.v                   -->  File for Gowin Project(Encrypted)
|           `-- fifo_sc_top.vo                  -->  File for Gowin Project
|           `-- fifo_sc_top.ipc                 -->  File for Gowin Project
|           `-- fifo_sc_top_tmp.v               -->  File for Gowin Project
|           |-- temp                                
|       |-- uart_to_bus                         
|           `-- uart_to_bus.v                   -->  File for Gowin Project(Encrypted)
|           `-- uart_to_bus.vo                  -->  File for Gowin Project
|           `-- uart_to_bus.ipc                 -->  File for Gowin Project
|           `-- uart_to_bus_tmp.v               -->  File for Gowin Project
|           |-- temp                                
|       |-- gowin_pll                           
|           `-- gowin_pll.ipc                   -->  File for Gowin Project                          
|           `-- gowin_pll.vo                    -->  File for Gowin Project                          
|           `-- gowin_pll.v                     -->  File for Gowin Project                          
|           `-- gowin_pll_tmp.v                 -->  File for Gowin Project                                 
|           `-- gowin_serdes_pll_1p25g.ipc      -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_1p25g.vo       -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_1p25g.v        -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_1p25g_tmp.v    -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_2p5g.ipc       -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_2p5g.vo        -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_2p5g.v         -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_2p5g_tmp.v     -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_3p125g.ipc     -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_3p125g.vo      -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_3p125g.v       -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_3p125g_tmp.v   -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_5g.ipc         -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_5g.vo          -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_5g.v           -->  File for Gowin Project                          
|           `-- gowin_serdes_pll_5g_tmp.v       -->  File for Gowin Project                          
|       |-- test                               
|           `-- gowin_sdpram.v                  -->  Test File for GOWIN Serial RapidIO Ref design
|           `-- gowin_srio_maints.v             -->  Test File for GOWIN Serial RapidIO Ref design
|           `-- gowin_srio_request_gen.v        -->  Test File for GOWIN Serial RapidIO Ref design
|           `-- gowin_srio_response_gen.v       -->  Test File for GOWIN Serial RapidIO Ref design
---------------------------------------------------------------------------------------------------------------
HOW TO OPEN A PROJECT IN GOWIN EDA:
---------------------------------------------------------------------------------------------------------------
1. Unzip the compressed design files.
2. Start the GOWIN EDA and select "File -> Open"
3. In the Open File dialog, enter the Project location, select the project "srio_ed_prj.gprj".
4. Click "Open". Then the project could be loaded. 

---------------------------------------------------------------------------------------------------------------
HOW TO RUN SYNTHESIZE, PLACE&ROUTE AND TIMING ANALYSIS IN GOWIN EDA:
---------------------------------------------------------------------------------------------------------------
1. Click the Process tab in the process panel of the GOWIN EDA dashboard. 
   Double click on Synthsize(GowinSynthesis). This will bring the design through synthesis.
2. Click on "Project -> Configuration -> Place & Route" to configurate the generation of the Post-Place File 
   and SDF File,etc.
3. Click the Process tab in the process panel of the GOWIN EDA dashboard. 
   Double click on Place & Route. This will bring the design through mapping, place and route.
4. Once Place & Route is done, user can double click on Timing Analysis Report to get 
   the timing analysis result.

----------------------------------------------------------------------------------------------------------------
HOW TO RUN SIMULATION
----------------------------------------------------------------------------------------------------------------
1. Run the script(./simulation/modelsim_sim/sim.bat) in the windows.
2. The script automatically opens modelsim and performs simulation.
3. Check waveform by software Modelsim.
4. Compare test data generated by simulation with Reference test data.
    `-- test data generated by simulation(./simulation/modelsim_sim/*): rx_req_data.txt, rx_resp_data.txt, 
        tx_req_data.txt and tx_resp_data.txt.
    `-- Reference test data(./simulation/modelsim_sim/*): rx_req_data_compare.txt, rx_resp_data_compare.txt, 
        tx_req_data_compare.txt and tx_resp_data_compare.txt.

