Entries from 2023-05-01 to 1 month

Checking RVV 1.0 in the RISC-V Vectorized Benchmark Suite (RiVec)

RiVec, i.e. the RISC-V Vectorized Benchmark Suite, is a benchmark suite made by porting benchmark suites to RISC-V Vector. github.com The main repository has three branches: master: the intrinsics are EPI-specific (quite old) rvv-0.7: the …

Trying Ocelot, Tenstorrent's Open-Source RISC-V Vector Processor Implementation (10. Checking the Test Cases)

github.com Continuing from last time, I'll extract the vector instructions to check what the test cases that actually PASSed are doing. rvv_int_arithmetic_1_3828467586_2: Hmm, it's doing nothing but vslideup, isn't it? 3 0x000000008000139c…

Trying Ocelot, Tenstorrent's Open-Source RISC-V Vector Processor Implementation (9. Upgrading to the Latest Version and Trying Again)

github.com I happened to check, and the revision of Tenstorrent's RISC-V Vector core Ocelot had gone up again. I wonder if at least some of the testbenches pass now? Chipyard revision: 2a9a844e1fbf4958cf10f69810a8febac065c100 BOOM revision…

Trying Ocelot, Tenstorrent's Open-Source RISC-V Vector Processor Implementation (8. Upgrading to the Latest Version and Trying Again)

github.com I happened to check, and the revision of Tenstorrent's RISC-V Vector core Ocelot had gone up again. I wonder if at least some of the testbenches pass now? Chipyard revision: 2a9a844e1fbf4958cf10f69810a8febac065c100 BOOM revision…

How to Set an ROI (Region of Interest) in gem5 (2. Defining It as a Macro)

https://msyksphinz-en.hatenablog.com/entry/2023/05/23/040000msyksphinz-en.hatenablog.com You can also take the approach above, but macros are defined as well. #ifdef ENABLE_GEM5 m5_reset_stats(0,0); m5_dump_stats(0,0); #endif // ENABLE_GEM…

Investigating the configure Options of GCC for Linux in riscv-gnu-toolchain

I want to reproduce the same thing with Official GCC. What happens if I use Newlib? First, I want to check how things behave in riscv-gnu-toolchain. build-binutils-linux build-gdb-linux build-gcc-linux-stage1 build-glibc-linux-headers buil…

How to Set an ROI (Region of Interest) in gem5

gem5 can run cycle-level simulations, and depending on the mode it can output information called an O3 trace file, which lets you see how the pipeline behaves. When you want to output somewhat more statistical information, the m5out/stats.…

Trying to Install gem5 and Run Benchmarks (Running NEON Instructions on gem5)

There are a few things I need to check, so I'm trying out gem5 with AArch64 support and measuring cycle performance. I want to write a loop like the following and observe what the latency of FMLA turns out to be. for (int i = 0; i < N / 4;…

Looking at the C-Series Cores of Alibaba's RISC-V Processor XuanTie

I was putting together a summary of the XuanTie RISC-V core series released by Alibaba (T-Head), and there turned out to be so many of them that I got confused. E series (E902 / E906): for embedded use C series (C906 / C908 / C910 / C920):…

Trying RISC-V Vectorized FFTW3 (2. Building for RISC-V with GCC 13)

Last time, the reason I built RISC-V GCC from the official release packages was that I wanted to use the RVV 1.0 intrinsics that match the latest version. https://msyksphinz-en.hatenablog.com/entry/2023/05/19/040000msyksphinz-en.hatenablog…

How to Set Up a RISC-V Compilation Environment with Official GCC

Here are my notes on how to build a compiler and libraries for RISC-V using the official GCC 13 packages. Building Binutils curl -L ftp://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz | tar xz cd binutils-2.40 mkdir build cd build export R…

Trying RISC-V Vectorized FFTW3 (1. Trying to Build for RISC-V)

FFTW3 is a well-known FFT library, and it includes versions that use SIMD instructions for several architectures. After looking into it, it seems that volunteers are also developing an FFTW3 that supports RISC-V RVV 1.0, so I decided to tr…

Reading the Paper "Sparse Stream Semantic Registers: A Lightweight ISA Extension Accelerating General Sparse Linear Algebra" 2

arxiv.org https://arxiv.org/pdf/2305.05559v1.pdf 4. Performance Evaluation Quoted from Figure 4 of this paper Operations between sparse and dense elements : Figure 4a shows the FPU utilization of the kernel as the nonzero count nnz of the …

Reading the Paper "Sparse Stream Semantic Registers: A Lightweight ISA Extension Accelerating General Sparse Linear Algebra" 1

I'm reading a paper published by ETH Zurich. It's a paper about an accelerator for sparse matrix computation. arxiv.org https://arxiv.org/pdf/2305.05559v1.pdf Overview A proposal of a hardware acceleration technique for speeding up sparse …

Reworking the Instruction Issue Unit of My Own CPU (3. Checking the Logic Synthesis Results with Vivado)

The instruction issue unit of my own CPU is not very efficient at the moment, so I want to improve it. I've finished testing, at least for now, so I ran logic synthesis in Vivado. The left side is the result before the improvement and the …

About Cache Coloring / Page Coloring (2. Techniques for Increasing the Cache Size in VIPT)

So how can we make the cache bigger in a VIPT design? The first method is to increase the number of cache ways. In the configuration above, changing from 2-way associative to 8-way associative quadruples the number of ways without changing…

About Cache Coloring / Page Coloring

I've spent the past few days reading through materials on cache coloring (Cache Colouring), so I'd like to put together a summary. I think the following is useful as a base reference. community.arm.com To understand the technique known as …

Trying Ara, an Open-Source CPU Supporting RISC-V Vector 1.0 (3. Running Benchmarks)

github.com I wanted to run a vectorized memcpy benchmark on Ara, and after a fair amount of trial and error I've figured out how to add a test. Suppose we want to run the following test program. void *memcpy_vec(void *dst, void *src, size_…

Trying gem5 with RVV 1.0 Support (1. Building and Debugging)

gem5 is an architecture simulator, a tool that can simulate subsystems including CPUs. It supports architectures such as RISC-V and is also capable of cycle-accurate simulation. I wanted to check the state of gem5's support for simulating …

Trying Ara, an Open-Source CPU Supporting RISC-V Vector 1.0 (2. How to Capture Waveforms)

github.com To capture waveforms, you need to specify trace=1 at build time. cd hardware make verilate trace=1 Here is how to run the simulation. app=rv64uv-ara-vle8 make simv trace=1 The following files are generated. trace_hart_00.dasm si…

Trying Ara, an Open-Source CPU Supporting RISC-V Vector 1.0 (1. Investigating the Build Procedure)

github.com Ara is CVA6 with a vector unit added. It supports RVV 1.0. git clone https://github.com/pulp-platform/ara.git git submodule update --init --recursive Build the toolchain. # Build the LLVM toolchain make toolchain-llvm After the …

Reworking the Instruction Issue Unit of My Own CPU (2. Debugging with Test Patterns)

The instruction issue unit of my own CPU is not very efficient at the moment, so I want to improve it. I needed to debug the inside of the BRU. When an issue entry in the BRU is freed, the timing at which the Resource Allocator is freed al…

Reworking the Instruction Issue Unit of My Own CPU

CPU

The instruction issue unit of my own CPU isn't very efficient at the moment, so I want to improve it. Normally, an instruction issue unit can free an entry once the instruction has been issued and things like operand speculation have been …

Trying to Build an SoC Environment with LiteX (13. How to Use LiteX CPU Variants)

Until now, the LiteX support for my own CPU has targeted only the smallest configuration, but on closer inspection it turns out that LiteX lets you specify a CPU configuration and synthesize it. For example, in the case of VexRiscv, you ca…

How to Specify Vector Registers in Extended Inline Assembly Syntax

About inline assembly for vector instructions. This is the syntax for putting a vector register into an operand constraint in extended inline assembly. A search turned up nothing at all, but it was written up on the LLVM forum. https://rev…

Trying to Build an SoC Environment with LiteX (12. Checking LiteX's Memory Bandwidth in Waveforms)

Even with last time's test program, memset() and memcpy() just seemed far too slow, so I decided to check the waveforms to be sure. $ litex_sim --cpu-type=scariv --output scariv_build --trace --trace-fst --trace-end 100000000000 --integrat…

Trying to Build an SoC Environment with LiteX (11. Adding Custom Software to the SoC Environment of My Own CPU)

This time, let's put an app that I wrote myself, rather than the demo app, into the LiteX SoC environment for my own CPU. Although I call it an app, it's just a test that simply reads and writes memory. I created a test that only writes to…

Investigating RVVI, the RISC-V Core Verification Interface (3. The Trace Interface RVVI-API)

I've been investigating RVVI, a verification environment for RISC-V cores. RVVI-API is the interface for passing the captured trace data on to the DV (verification) environment. https://github.com/riscv-verification/RVVI/blob/main/RVVI-API…