For WSL2, Windows 10 should be version 2004 or higher.
You can check the version of Windows from the following.
[Settings]-> [Update and Security]-> [Windows Update]-> [OS Build Information (right side of window, [Related Links] column)]
Reference to enable WSL2
procedure:
Check [Control Panel]-> [Programs]-> [Turn Windows features on or off]-> [Windows Subsystem for Linux]. (Restart)
From Windows Powershell (administrator privileges)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
From Windows Powershell (administrator privileges)
wsl --set-default-version 2
Kernel component updates are required to run WSL 2. For more information https://aka.ms/See wsl2kernel For the main differences from WSL 2, https://aka.ms/See wsl2 ```
Is displayed, access https://aka.ms/wsl2 and download / install the latest WSL2 Linux kernel update package. 4. Install Ubuntu 20.04 LTS from the Microsoft Store. 5. Start Ubuntu and complete the initial settings. Execute the following command.
```bash
sudo apt update
sudo apt upgrade -y
```
Reference 1, Reference 2 Install Docker according to / docker-in-wsl2)
Install Docker Desktop Stable 2.3.0.2 or later from Docker Desktop WSL2 backend.
In [Settings]-> [General], make sure that ʻUse the WSL 2 based engine` is checked.
Enable ʻUbuntu-20.04 of ʻEnable integration with additional distros:
in [Settings]-> [Resources]-> [WSL INTEGRATION].
Reference 1, Reference 2 Enable WSL2 and Docker on VS Code according to / docker-in-wsl2).
Install Remote --WSL
, Remote --Containers
from [Extensions] of VS Code
Click the green > <
mark (Open a Remote Window) at the bottom left of VS Code and select Remote --WSL: New Window Using Distro ...
-> ʻUbuntu 20.04`.
After that, work with VS Code on the WSL side.
Install Docker
from [Extensions]
Select Terminal
-> New Terminal
from the tab at the top of VS Code to open the terminal.
Execute the following command (set the development folder)
mkdir workspace
mkdir workspace/chisel
Open \ home \ <user_name> \ workspace \ chisel
from [Explorer]-> [Open Folder] of VS Code.
Create Dockerfile
from [New File] and write the following contents.
# Reference: https://github.com/freechipsproject/chisel3/blob/master/SETUP.md
FROM ubuntu:20.04
# Install sbt
RUN apt update
RUN apt upgrade -y
RUN apt install -y gnupg2
RUN apt install -y default-jdk
RUN echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
RUN apt update
RUN apt install -y sbt
RUN apt install -y git make autoconf g++ flex bison
# Install Verilator
WORKDIR /tmp
RUN git clone http://git.veripool.org/git/verilator verilator
WORKDIR /tmp/verilator
RUN git pull
RUN git checkout v4.016
RUN unset VERILATOR_ROOT
RUN autoconf
RUN ./configure
RUN make
RUN make install
# Set volume
VOLUME [ "/volume" ]
WORKDIR /volume
Click the green > <WSL: Ubuntu-20.04
at the bottom right, then click Remote-containers: Reopen in Container
-> From Dockerfile
After that, work with VS Code in the Docker container
Scala (Metals)
from [Extensions](ʻInstall on Dev Container: Existing Dockerfile` button)Reference, download the Chisel project template and try it.
Download the template.
git clone https://github.com/ucb-bar/chisel-template.git MyChiselProject
cd MyChiselProject
Clear the Git history.
rm -rf git
git init
git add .gitignore *
Rename the Project.
Open build.sbt
and change the part wherename: = "my-chisel-project"
.
Change README.md
as appropriate
Commit your changes.
git commit -m "Starting MyChiselProject"
Check the operation
sbt test
Success if [Success] Total time: ...
is displayed on the last line
Recommended Posts