Entries from 2022-07-01 to 1 month
First, let's write a simple Pass for Yosys. Let's list the wires and cells in a module. I wrote search_wires() and search_cells() to print out the wires and so on in a module. void search_wires (RTLIL::Module* module) { log(" Wires :\n"); …
It suddenly occurred to me that I did not know much about trace caches, so I decided to read some material and study them. The book I read is the one below. It is old, but it covers the basics and is reliable. Modern Processor Design: Fund…
Continuing with the Branch Prediction Championship Simulator. Reading How Gshare Works It is implemented only in predictor_gshare.h, and it is quite short, so it is easy to read. Structure As many PHT entries as needed are allocated. HIST_…
Continuing with the Branch Prediction Championship Simulator. Building a Local Bimodal Branch Predictor I structured the PREDICTOR as follows. It has 4096 m_local entries (really 2 bits each) as member variables, used as the local branch p…
Continuing with the Branch Prediction Championship Simulator. Building a Static Predictor Let's build a Predictor that always predicts a jump. #include <stdlib.h> #include <string.h> #include <assert.h> #include <inttypes.h> #include <math.h> #include "utils.h" #include <vector> class PREDICTOR {</vector></math.h></inttypes.h></assert.h></string.h></stdlib.h>…
Continuing with the Branch Prediction Championship Simulator. Let's analyze the contents of the Branch Prediction Simulator trace file. Reading the Contents of the Trace File For example, the contents of SHORT_MOBILE-24.bt9.trace.gz look l…
Let's start by building a simple Pass for Yosys. We will write a Pass that lists the names of the modules. We obtain the names of the modules registered in the design. yosys/passes/tests/mypass.cc void execute(std::vector<std::string> args, RTLIL::Desi</std::string>…
Let's start by building a simple Pass for Yosys. It is called mypass, and it is a Pass that does nothing. yosys/passes/tests/mypass.cc struct MyPass : public Pass { MyPass() : Pass("mypass", "My Pass") { } void help() override { // |---v--…
I used Ubuntu 20.04 LTS. It seems Boost is required to build it. jilp.org sudo apt install libboost-dev libboost-iostreams-dev Download the Championship Kit and build it. curl -L http://hpca23.cse.tamu.edu/cbp2016/cbp2016.final.tar.gz | ta…
I'm studying MLIR. Hmm, the PassManager just won't get applied no matter what. I can't figure out why the optimizer refuses to run with -opt. How does toyc do it? b SimplifyRedundantTranspose::matchAndRewrite * frame #0: 0x000000010007c77c…
I have been looking at Yosys's RTLIL. The RTLIL code defines several structs. /yosys/kernel/rtlil.h namespace RTLIL /* ...omitted... */ struct Const; struct AttrObject; struct Selection; struct Monitor; struct Design; struct Module; struct…
I started reading the paper on the Alpha EV8 branch predictor. https://ieeexplore.ieee.org/document/1003587ieeexplore.ieee.org https://msyksphinz-en.hatenablog.com/entry/2022/06/19/040000msyksphinz-en.hatenablog.com Someone pointed out a m…
I'm studying MLIR. Hmm, the PassManager just won't get applied no matter what. Even when I display the Passes with -debug, it is clear that no Pass is being applied. When I run toy-ch3 with the -debug option, the Pass is applied properly. …
I'm studying MLIR. I'd like to implement a few optimizations. For example, something that automatically turns A-A into 0 looks easy to build, but it seems you have to use MLIR's rewriter for that. /// This method attempts to match a patter…
I ran a few test cases through the RTLIL intermediate representation to see what kind of output gets generated. The difference between always_comb and assign assign out0 = in0; always_comb begin out1 = in1; end The generated RTLIL was iden…
I want to look at Yosys's passes. In the Yosys repository, the passes are placed in directories like the following. . ├── cmds ├── equiv ├── fsm ├── hierarchy ├── memory ├── opt ├── pmgen ├── proc ├── sat ├── techmap └── tests 11 directori…
I have started reading the paper on the Alpha EV8 branch predictor. https://ieeexplore.ieee.org/document/1003587ieeexplore.ieee.org https://msyksphinz-en.hatenablog.com/entry/2022/06/19/040000msyksphinz-en.hatenablog.com I am re-reading it…
"Learning Computer Architecture by Building" (作って学ぶコンピュータアーキテクチャ) had already exceeded 500 pages at the time of writing, so I reluctantly cut two chapters. The first appendix, "Appendix 1. Variations of Function Calls and…
Next, I want to have Yosys read the Rocket-Chip implementation generated by Chipyard. To load the Rocket-Chip implementation generated by Chipyard into Yosys and elaborate it, run the following commands. synth.cmd read -sv chipyard.TestHar…
It has been quite a while. For now, let's set up a Yosys environment and try to compile a simple Verilog design built with Chipyard. Installation git clone https://github.com/YosysHQ/yosys.git git co yosys-0.19 make -j$(nproc) make install…
I wanted to set up a Chipyard environment on M1 macOS, and while looking around I found that someone has already tried it. qiita.com I used Chipyard version 1.6.2. On an M1 Mac, OpenJDK has to be downloaded separately. curl -L https://cdn.…
I am studying MLIR. I am taking on the challenge of creating my own language and expressing its intermediate representation using MLIR. In the previous test, optimization was too aggressive and variables got merged together, so I couldn't …
"Learn by Building: Computer Architecture" had already exceeded 500 pages at the time of writing, so I reluctantly had to cut two chapters. I have released one of them, "Appendix 1: Variations of Function Calls and Advanced Features", for …
I am studying MLIR. I got stuck a bit on Type, so I am re-reading the documentation. mlir.llvm.org MLIR is designed to be a completely extensible infrastructure; there is no closed set of attributes (think: constant metadata), operations, …
When I tried to implement GShare for the first time in a while, I found I had forgotten a lot of things, so this is a memo to help me remember. By the way, I think the current front-end configuration summarized below is not good at all. I …
I don't have much room for physical books, so I bought the electronic version. I bought the PDF from Tatsu-zine (Tatsumi Publishing). tatsu-zine.com I had also bought the English edition, so now I have both the Japanese and English version…
I am studying MLIR. I am taking on the challenge of creating my own language and expressing its intermediate representation with MLIR. The flow I have in mind is as follows: Read my own language (MYSV: an original modified version of Syste…
I have started reading the paper on the Alpha EV8 branch predictor. https://ieeexplore.ieee.org/document/1003587ieeexplore.ieee.org https://msyksphinz-en.hatenablog.com/entry/2022/06/19/040000msyksphinz-en.hatenablog.com I roughly translat…