-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HW] Draft PR for Implementing Ara on FPGA #146
Conversation
cdf9593
to
1b014ba
Compare
@hossein1387 Please, could you describe how the implementation can be replayed? Because for example I get an parsing error from Fusesoc (version 1.12.0, on Ubuntu 20.04) if I try to add the repository as library or list the cores via "fusesoc --cores-root . list-cores".
I guess this issue is related to the first bullet (different dependencies....) above? |
Hi @poldni you first need to add Ara to Fusesoc. You can do so by:
Then you can try running FPGA implementation. Please let me know if this fixes the issue. |
I tried this too, but the same problem appear like if I do this with the command "fusesoc --cores-root . list-cores". In the ara.core the IP's from "hardware/deps" are referenced. So it is needed to initialize the git submodules from the "ara" repository. As soon as you do this also the toolchain submodules are synchronized. And the submodule riscv-llvm contains files with the ending "*.core" which aren't of course regular fusesoc files. fusesoc recursively searching for core files in sub folders. So it can't parse these files and it messages an parsing error. So I temporary removed the toolchain folder in order to work with fusesoc to build the implementation, but getting a crash of the vivado tool (2022.2) if I use the currently referenced revisions of hardware/deps including your commit on common-cell (3e78959d12173ab1061380de3c496858c72b8ebd). |
Ok so there are two issues. One with Fusesoc and one with For |
Hi @hossein1387 fusesoc library add ara .
fusesoc core list
fusesoc run --target=synth ara However, it seems that no verilog code are generated and the build is failed as Available cores:
Core Cache status Description
================================================================================
::ara:0 : local : Ara is a 64-bit Vector Unit, compatible with the RISC-V Vector Extension Version 0.10, working as a coprocessor to CORE-V's CVA6 core
::ariane:0 : local : <No description>
pulp-platform.org::axi:0.29.1 : local : <No description>
pulp-platform.org::axi_mem_if:0 : local : <No description>
pulp-platform.org::common_cells:1.24.1 : local : <No description>
default:~/workspace/ara$ fusesoc run --target=synth ara
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-linux.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-linux.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/tools/lldb-vscode/coreFile/linux-x86_64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.amd64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/altmain.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-full.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-arm.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-s390x.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64le.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-x86_64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_i386.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-neon.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-i386.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_x86_64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-fpsimd.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-x86_64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-i386.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-x86_64.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-i386.core
WARNING: Unable to determine CAPI version from core file /workspace/ara/toolchain/riscv-llvm/lldb/test/API/functionalities/unwind/noreturn/module-end/test.core
INFO: Preparing pulp-platform.org::common_cells:1.24.1
INFO: Preparing ::ara:0
INFO: Setting up project
INFO: Building
vivado -notrace -mode batch -source ara_0.tcl
****** Vivado v2021.1 (64-bit)
**** SW Build 3247384 on Thu Jun 10 19:36:07 MDT 2021
**** IP Build 3246043 on Fri Jun 11 00:30:35 MDT 2021
** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
source ara_0.tcl -notrace
WARNING: [filemgmt 56-12] File '/workspace/ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/axi/src/axi_cut.sv' cannot be added to the project because it already exists in the project, skipping this file
WARNING: [filemgmt 56-12] File '/workspace/ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/axi/src/axi_dw_converter.sv' cannot be added to the project because it already exists in the project, skipping this file
INFO: [Common 17-206] Exiting Vivado at Sun Feb 12 11:04:44 2023...
vivado -notrace -mode batch -source ara_0_run.tcl ara_0.xpr
****** Vivado v2021.1 (64-bit)
**** SW Build 3247384 on Thu Jun 10 19:36:07 MDT 2021
**** IP Build 3246043 on Fri Jun 11 00:30:35 MDT 2021
** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
open_project ara_0.xpr
WARNING: [filemgmt 56-3] Default IP Output Path : Could not find the directory '/workspace/ara/build/ara_0/synth-vivado/ara_0.gen/sources_1'.
Scanning sources...
Finished scanning sources
source ara_0_run.tcl -notrace
[Sun Feb 12 11:05:08 2023] Launched synth_1...
Run output will be captured here: /workspace/ara/build/ara_0/synth-vivado/ara_0.runs/synth_1/runme.log
[Sun Feb 12 11:05:08 2023] Launched impl_1...
Run output will be captured here: /workspace/ara/build/ara_0/synth-vivado/ara_0.runs/impl_1/runme.log
[Sun Feb 12 11:05:08 2023] Waiting for impl_1 to finish...
[Sun Feb 12 11:05:30 2023] impl_1 finished
WARNING: [Vivado 12-8222] Failed run(s) : 'synth_1'
wait_on_run: Time (s): cpu = 00:00:13 ; elapsed = 00:00:21 . Memory (MB): peak = 2562.031 ; gain = 0.000 ; free physical = 71898 ; free virtual = 119195
Bitstream generation completed
ERROR: Implementation and bitstream generation step failed.
INFO: [Common 17-206] Exiting Vivado at Sun Feb 12 11:05:30 2023...
Makefile:16: recipe for target 'ara_0.bit' failed
make: *** [ara_0.bit] Error 1
ERROR: Failed to build ::ara:0 : '['make']' exited with an error: 2 Can you please tell me if I missed any steps? |
Never mind, my mistake on adding source code. Sorry for making noise |
Great! let us know if you ran into any more issues. |
Thank you @hossein1387 # serial rx
set_property LOC BF18 [get_ports {rx_i}]
set_property IOSTANDARD LVCMOS12 [get_ports {rx_i}]
# serial tx
set_property LOC BB20 [get_ports {tx_o}]
set_property IOSTANDARD LVCMOS12 [get_ports {tx_o}] However, I have not seen anything on ttyUSB console yet. |
We have not yet test our design on FPGA. We are now in the process of testing Ara on Alveo U200 board. That is why you do not see any constraint on I/O pins. |
Thank for your confirmation |
Synthesis results for
|
Hello @elisabethumblet, thanks for the new data! Have you already tried to run the system on FPGA? |
Hi @mp-17, not yet, we are still looking for a board at the moment, but hopefully that will be done soon! |
Hi, I'm also trying to run the system on an FPGA in a chipyard context (CVA6 Tile Wrapper) using this draft as template. Unfortunately I have only a ZCU104 at my disposal. I used the currently minimal NrLanes of 2. In this context the needed LUT's hit the boundaries of the ZCU104 and of course timing doesn't meet at all. I tried to reduce the VLEN, but apparently this doesn't have a big effect on the used LUT's or should it? I get round about 5000 LUT reduction from VLEN=2048 to VLEN=128 using Vivado 2022.2. Is there any other parameter which can be tuned? |
Hi @poldni, to reduce the number of LUT's you use, you can reduce the size of the cache by tuning the L2NumWords parameter. |
Hello, @hossein1387, I try to merge your PR with ara locally, but get error when synthesis. Vivado complains it can't find module ERROR: [Synth 8-439] module 'tc_clk_gating' not found [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/cva6/src/cache_subsystem/cva6_icache.sv:422]
ERROR: [Synth 8-196] conditional expression could not be resolved to a constant [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/cva6/src/cache_subsystem/cva6_icache.sv:415]
ERROR: [Synth 8-6156] failed synthesizing module 'cva6_icache' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/cva6/src/cache_subsystem/cva6_icache.sv:28]
ERROR: [Synth 8-6156] failed synthesizing module 'wt_cache_subsystem' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/cva6/src/cache_subsystem/wt_cache_subsystem.sv:22]
ERROR: [Synth 8-6156] failed synthesizing module 'ariane' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/deps/cva6/src/ariane.sv:26]
ERROR: [Synth 8-6156] failed synthesizing module 'ara_system' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/src/ara_system.sv:9]
ERROR: [Synth 8-6156] failed synthesizing module 'ara_soc' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/hardware/src/ara_soc.sv:9]
ERROR: [Synth 8-6156] failed synthesizing module 'xilinx_ara_soc' [/home/ckf104/tmp/riscv-vector-ara/build/ara_0/synth-vivado/src/ara_0/fpga/src/xilinx_ara_soc.sv:16]
---------------------------------------------------------------------------------
Finished RTL Elaboration : Time (s): cpu = 00:00:08 ; elapsed = 00:00:08 . Memory (MB): peak = 2795.797 ; gain = 466.184 ; free physical = 205 ; free virtual = 20934
Synthesis current peak Physical Memory [PSS] (MB): peak = 2166.562; parent = 1984.971; children = 181.592
Synthesis current peak Virtual Memory [VSS] (MB): peak = 3781.852; parent = 2795.801; children = 986.051
---------------------------------------------------------------------------------
RTL Elaboration failed
INFO: [Common 17-83] Releasing license: Synthesis
383 Infos, 148 Warnings, 29 Critical Warnings and 9 Errors encountered.
synth_design failed
ERROR: [Common 17-69] Command failed: Synthesis failed - please see the console or run log file for details
INFO: [Common 17-206] Exiting Vivado at Mon Apr 17 17:38:10 2023...
[Mon Apr 17 17:38:21 2023] synth_1 finished
WARNING: [Vivado 12-13638] Failed runs(s) : 'synth_1'
wait_on_runs: Time (s): cpu = 00:00:27 ; elapsed = 00:00:37 . Memory (MB): peak = 1331.492 ; gain = 0.000 ; free physical = 2159 ; free virtual = 22888
source ara_0_run.tcl -notrace
ERROR: [Common 17-70] Application Exception: Failed to launch run 'impl_1' due to failures in the following run(s):
synth_1
These failed run(s) need to be reset prior to launching 'impl_1' again.
INFO: [Common 17-206] Exiting Vivado at Mon Apr 17 17:38:21 2023...
make: *** [Makefile:16: ara_0.bit] Error 1
ERROR: Failed to build ::ara:0 : '['make']' exited with an error: 2 By searching, I found that module Extra info: |
8bd0000
to
f2351e6
Compare
Hi @ckf104 , Regarding the merge, many things in Ara have changed since we opened this PR. We do have an updated version of this PR locally and @elisabethumblet's results are based on that using |
Hi, @hossein1387 , I tried to merge the new PR but still got the same error. Finally, I found the problem is that But when running DRC stage of vivado implementation, I got the following error. ERROR: [DRC NSTD-1] Unspecified I/O Standard: 68 out of 68 logical ports use I/O standard (IOSTANDARD) value 'DEFAULT', instead of a user assigned specific value. This may cause I/O contention or incompatibility with the board power or connectivity affecting performance, signal integrity or in extreme cases cause damage to the device or the components to which it is connected. To correct this violation, specify all I/O standards. This design will fail to generate a bitstream unless all logical ports have a user specified I/O standard value defined. To allow bitstream creation with unspecified I/O standard values (not recommended), use this command: set_property SEVERITY {Warning} [get_drc_checks NSTD-1]. NOTE: When using the Vivado Runs infrastructure (e.g. launch_runs Tcl command), add this command to a .tcl file and add that file as a pre-hook for write_bitstream step for the implementation run. Problem ports: exit_o[63:0], clk_i, rst_ni, rx_i, and tx_o.
ERROR: [DRC UCIO-1] Unconstrained Logical Port: 68 out of 68 logical ports have no user assigned specific location constraint (LOC). This may cause I/O contention or incompatibility with the board power or connectivity affecting performance, signal integrity or in extreme cases cause damage to the device or the components to which it is connected. To correct this violation, specify all pin locations. This design will fail to generate a bitstream unless all logical ports have a user specified site LOC constraint defined. To allow bitstream creation with unspecified pin locations (not recommended), use this command: set_property SEVERITY {Warning} [get_drc_checks UCIO-1]. NOTE: When using the Vivado Runs infrastructure (e.g. launch_runs Tcl command), add this command to a .tcl file and add that file as a pre-hook for write_bitstream step for the implementation run. Problem ports: exit_o[63:0], clk_i, rst_ni, rx_i, and tx_o. It may be expected because no IO pin constraints in xdc file. It seems I should add |
Hello @hossein1387 , I recently try to synthesis this design on my genesys2 board. When I tried add a new
Although I am not very understand what this means, I think it something like implicitly adding Edit: another qeustion about |
Hi @ckf104, I am currently testing an The synthesis and implementation haven't finished yet, but for now it seems to work like this. About the NrLanes macro, I'm not exactly sure why we put them there, since in the end it is the value set in the module Once everything is checked, I will update the PR. |
Hi, recently I have generated bitstream on board genesys2 successfully. If my understanding is correct, current soc only has a uart and xilinx sram in place of ddr memory, and ariane's boot pc is the first byte of sram. So if we initialize xilinx sram with apps (test applications in In detail, I convert elf file of application(e.g., Based on these things, I think hardware connection should be correct and my initialization of xilinx sram goes wrong somewhere. So I'm curious that have you ever tried to run test applications in fpga? which may help me find where something goes wrong. Thanks in advance. |
Bringing the discussion here. Let me know if you want to re-open this ;-) |
hello, this pr implements only ara for xcvu9p or with the cva6 too ? if no, how can i implement cva6 with ara for example to genesys 2? |
That's Exactly the point where I am stuck right now. |
The official PR for Ara on FPGA + Linux flow can be found here: pulp-platform/cheshire#160 |
This is a Draft PR for FPGA implementation of Ara. There are several issues that needs to be discussed before merging this PR into main branch:
fpga
folder in Ara's root directory.xcvu9p
FPGA however, supporting new FPGA parts should be straightforward.xcvu9p
is available as follow:Changelog
Added
xcvu9p
(Alveo U200)Checklist