LvNA是国内一个基于Rocket Chip的RISC-V核项目, 为处理器设计和开发提供方便的仿真和上板支持, 跳转链接. 本文将介绍如何在FPGA zcu102上复现LvNA项目, 前半部分是上板步骤, 后面列举了复现时本人遇到的问题, 希望帮助后来的同学缩短调试时间. 文章基于官方提供的上板指导, 和另一位同学的复现指南. 但因为本人的使用环境和已有的两份指导不完全一致, 直接照搬官方指导无法上板, 造成了一些困惑和麻烦, 因此有必要记录本人的详细环境, 遇到的问题和解决办法, 仅供参考.
用Docker容器虚拟化开发环境 (Virtualizing Linux Environment with Docker Containers)
At most times, we want to prepare different files, dependent packages, and environment variables for different projects. Simply mixing everything in the base environment would obviously make the only environment cumbersome and troublesome. For python packages we have venv
tool to manage multiple python package environments. For general Linux OS, docker containers can be used for the similar purpose. In this blog we discuss with two specific Docker use cases: develop without sudo and isolate different users without adduser.
SSH Port Forwarding 简介 (SSH Port Forwarding is All You Need)
SSH Port forwarding is a technique used to tunnel your network traffic from the local (remote) network to the remote (local) network. Although it has several limitations, SSH port forwarding is powerful, flexible and sufficient to facilitate your server/client workflow. In this blog I briefly introduce this technique and several scenarios I have used.
lyric-sharing-04.md
失败者的飞翔
你知道吗 听你说话
我只需要 听你说话
在你的声音中 安全的让我害怕
这是一个 快乐的警告 警告我别想逃
这个特别的时刻 判断绝不会是你想要
你的温柔 包围而我 像个没人爱的傻瓜
你的影子巨大 像喧嚣的脏话
在一片欢乐的景象之中 我却觉得勉强
在离别的前夕 找不忧伤的台阶下
一起看电影的web应用 | A private movie theater design
COVID-19 has greatly impacted the way of our lives. What’s more, I have been going through a very painful period of quarantine. In the state of being isolated, I am eager to watch a movie with my friends, to get myself involved. Unfortunately, I could not find a satisfying product. There is no other way except I made an online movie theater myself.
Expected features
- Coplay: Let me watch a movie with my friends
- Rich resources: I like interesting and in-depth films
- Broad platform support: It can be accessed from either laptops or computers, since my friends have different devices
- Availability: It should provide a fluent movie stream from clients in both America and Asia.
Related works
RISC-V的独到之处 (How is RISC-V different from what I know)
Due to my PhD program, this term I have to be the TA of an undergraduate course one more time. Fortunately since the course is started by my supervisor and the students I meet are all carefully selected as the most clever students, it gives me much freedom to try new architecture ideas and help me gain teaching skills significantly. This year is the second time since we opened this course, so we decided to switch the teaching instruction set architecture (ISA) from MIPS to RISC-V. Therefore, I have started to learn RISC-V from scratch recently. In this post I want to put up my thoughts of for what I am surprised by the popular RISC-V, as a role of MIPS learner for many years.
Reference books
代码回迁历程:从c++17到pincrt (Paradiams for rebasing recent c++ code to out-dated pincrt)
Recently I have finished some code refactoring, reverting a third-party project following c++17 standard to an out-dated pincrt fashion. More accurately, I was integrating the most recent NVM simulation work VANS with zsim. During this code migration process, I have learned to handle many implementation issues related to C++ STL and would like to share it.
Brief Glossary
zsim
: a fast and accurate core simulator. The runtime is based onpincrt
. I have been using zsim as my primary experiment tool but for simplicity it does not directly support any detailed DDR memory models.VANS
: an Optane-oriented NVM memory simulator. It is claimed to be written in C++17 fashion and have the most accurate result against the actual Optane NVM hardware. This time I want to integrate it with zsim, supporting simulating app behaviors on a core+NVM system.pincrt
: The basic C runtime specialized for a pintool like zsim, derived from stlport, now “maintained” by intel. It also contains several C++ STL support. Based on the official manual (only 11-page long) and my hands-on experience, pincrt only supports limited C++11 standards and no support for more recent standards. Pincrt does not support exceptions and RTTI (Run-time type information).
Motivation
打破国内音乐的版权藩篱 Owning rights to music playing all by yourself
I have done with switching my audio player between multiple applications.
Generally the workflow of my listening to a new song always starts from hearing it from somewhere, then recursively searching it from one player to another. The copyrights of a commercial music was initially intended to protect the interests of composers and incentivize them for more and better works. However, they have developed on a mistaken road and now produced a barrier, prohibiting multiple organizations sharing. What’s worse, more and more exclusively paid music demobilizes people from hearing them, at least works for me. It is the software companies who finally benefit from this trend.
Therefore I have tried several approaches bypassing the conventional music playing and found the solution.
Conventional music playing
I used to stream music from popular applications. They have their exclusive music repositories, plus the following additional features favored by myself:
- Multi-device support
- Song recommendations
- Notifications of recent songs (of the customized singers)
- Cloud storage
Bypassing music playing
如何将你的树莓派变成强大的云办公设备 How to make your Raspberry Pi a powerful edge device to WFH
As we know, Raspberry Pi is getting even more popular with its cheap cost and highly customized functions. Now the most powerful Raspberry Pi 4B model has 4GB memory and quad-A72 cores. This is even better than my first smartphone in 2015. As the coronavirus has deeply reformed our daily lives, it is time to buy a raspberry pi, to work from home. I have spent some time finding useful tools and writing scripts to help me study in the dorm conveniently and elegantly.
Reasons Why Raspberry 4B
- Its hardware is rather outstanding.
- It supports two 4K monitors.
- As Apple turns to using arm on their macbook, there will be much more available softwares in this ecosystem.
Before Booting
Build zsim-nvmain
I have spent much time building nvmain-zsim (2nd times!), and here is what I did (common errors).
What is zsim-nvmain?
ZSim is an emulator made by stanford, which is originally used to evaluate the implementation of ZCache.
NVMain is a set of interfaces based on ZSim or Gem5, which provides support on emulating Non-Volatile Memory. Now we can easily add a 3d stacked DRAM or PCM Main Memory to the system…
ZSim github repo: https://github.com/s5z/zsim
NVMain github repo: https://github.com/AXLEproject/axle-zsim-nvmain
Before you read…
I finish my building mostly from this blog: https://blog.csdn.net/qqq_11101/article/details/78481377
I built zsim-nvmain into a docker, avoiding most meaningless dependencies problems. I have pushed my docker image to hub: leepoly/zsim-nvmain
How to build nvmain-zsim
download source code
git clone https://github.com/cyjseagull/SHMA
deal with depenencies
My environment:- ubuntu 18.04 (linux kernel 4.4.0)
gcc, g++ 4.8.5
How to deal with multiple gcc/g++ version?
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
, where 10 is a number indicating the priority
we should do the same to g++pin-2.13-61206-gcc.4.4.7-linux (which is embedded in SHMA project)
- boost 1.59
if you have encountered “fatal error: bzlib.h: No such file or directory”, tryapt install libboost-all-dev libbz2-dev
- libconfig 1.7.2
- hdf5 1.10.5
most of those tools are installed in/usr/local/
by default.
configure env.sh
Now we should modify env.sh to assign where we install our dependencies. I recommend set aBASEPATH
and use that indirect path.
Thensource env.sh
to export those parameters into environmentbuild nvmain-zsim
cd $BASEPATH
scons -j4
encounting “fatal error: src/memory_hierarchy.h: No such file or directory”
go tobuild/opt/tlb/common_func.h
, change header into"#include "memory_hierarchy.h"
encounting “fatal error: src/nvmain_mem_ctrl.h: No such file or directory”
go tobuild/opt/tlb/page_table_walker.h
and change the header in the same wayencounting “fatal error: glog/logging.h: No such file or directory”
tryapt-get install libgoogle-glog-dev
encounting “build/opt/version.h:1:4: error: stray ‘#’ in program”
change “echo -e” into “echo” in SConstruct(docker-only) [H] Panic on build/opt/zsim_harness.cpp:292: Could not change personality to disable address space randomization!
try rerun docker with privileged modedocker run -it --privileged CONTAINER_ID bash
echo 0 | tee /proc/sys/kernel/randomize_va_space
E:4.4 is not a supported linux release
insert atpin_cmd.cpp:52
1
2
3args.push_back("-injection");
args.push_back("child");
args.push_back("-ifeellucky");
build until you see scons: done reading SConscript files.
Check installation
./bin/zsim config/shma-static.cfg
congrats!A known problem
according to this issue: https://github.com/s5z/zsim/issues/154
zsim is not supported to runls
.
If you have any question, feel free to comment here.