Create Chisel development environment with Windows10 + WSL2 + VScode + Docker

Related Links

Windows 10 version

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)]

WSL2 setup

Reference to enable WSL2

procedure:

  1. Check [Control Panel]-> [Programs]-> [Turn Windows features on or off]-> [Windows Subsystem for Linux]. (Restart)

  2. From Windows Powershell (administrator privileges)

    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    
  3. 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
```

Docker setup

Reference 1, Reference 2 Install Docker according to / docker-in-wsl2)

  1. Install Docker Desktop Stable 2.3.0.2 or later from Docker Desktop WSL2 backend.

  2. In [Settings]-> [General], make sure that ʻUse the WSL 2 based engine` is checked.

  3. Enable ʻUbuntu-20.04 of ʻEnable integration with additional distros: in [Settings]-> [Resources]-> [WSL INTEGRATION].

VS Code setup

Reference 1, Reference 2 Enable WSL2 and Docker on VS Code according to / docker-in-wsl2).

  1. Install Remote --WSL, Remote --Containers from [Extensions] of VS Code

  2. 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.

  1. Install Docker from [Extensions]

  2. 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
    
  3. Open \ home \ <user_name> \ workspace \ chisel from [Explorer]-> [Open Folder] of VS Code.

  4. 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
    
  5. 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

  1. Install Scala (Metals) from [Extensions](ʻInstall on Dev Container: Existing Dockerfile` button)

Checking the operation of Chisel

Reference, download the Chisel project template and try it.

  1. Download the template.

    git clone https://github.com/ucb-bar/chisel-template.git MyChiselProject
    cd MyChiselProject
    
  2. Clear the Git history.

    rm -rf git
    git init
    git add .gitignore *
    
  3. Rename the Project.

Open build.sbt and change the part wherename: = "my-chisel-project".

  1. Change README.md as appropriate

  2. Commit your changes.

    git commit -m "Starting MyChiselProject"
    
  3. Check the operation

    sbt test
    

Success if [Success] Total time: ... is displayed on the last line

Recommended Posts

Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
WSL2 + VSCode + Docker development environment
Create Spring Boot-gradle-mysql development environment with Docker
Build Go development environment with WSL2 + Docker Desktop + VSCode (Remote --Containers)
Build Java development environment with WSL2 Docker VS Code
Debug the VSCode + Docker + PHP development environment with XDebug.
Create a Vue3 environment with Docker!
Create RUNTEQ's environment with Windows DockerDesktop
Build PlantUML environment with VSCode + Docker
Create SolrCloud verification environment with Docker
Create Laravel environment with Docker (docker-compose)
I tried to create a padrino development environment with Docker
Laravel development environment construction with Docker (Mac)
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
Build a PureScript development environment with Docker
Create Rails 6 + MySQL environment with Docker compose
Create a MySQL environment with Docker from 0-> 1
[Docker] Create Node.js + express + webpack environment with Docker
Build a Wordpress development environment with Docker
Lightweight PHP 7.4 development environment created with Docker
Create a java web application development environment with docker for mac part2
Comfortable development life with WSL2 + Docker Desktop + GPU
[Memo] Create a CentOS 8 environment easily with Docker
Self-hosting with Docker of AuteMuteUs in Windows environment
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Build a Laravel / Docker environment with VSCode devcontainer
Prepare the JVM language development environment with WSL
Create Spring Boot environment with Windows + VS Code
Build a development environment for Docker, java, vscode
[First team development ②] Build an environment with Docker
Wordpress local environment construction & development procedure with Docker
Explode Docker with WSL2
Build a development environment to create Ruby on Jets + React apps with Docker
Create an E2E test environment with Docker x Cypress
[First team development ③] Share the development environment created with Docker
[Note] Create a java environment from scratch with docker
Comfortable Docker environment created with WSL2 CentOS7 and Docker Desktop
Pytorch execution environment with Docker
[Docker] Create Elasticsearch, Kibana environment!
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
React environment construction with Docker
Deploying a Java environment with Windows Subsystem for Linux (WSL)
I tried to create a java8 development environment with Chocolatey
Create an AWS IoT EduKit development environment with Ubuntu 20.04 + VirtualBox 6.1
I made a development environment with rails6 + docker + postgreSQL + Materialize.
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
How to build Rails, Postgres, ElasticSearch development environment with Docker
I tried to build the environment of WSL2 + Docker + VSCode
Create Rails5 and postgresql environment with Docker and make pgadmin available
How to create an environment that uses Docker (WSL2) and Vagrant (VirtualBox) together on Windows
[SAP] Create a development environment with NW AS ABAP Developer Edition (1)
[Windows] WSL2 + Ubuntu + Node.js environment construction
Node.js environment construction with Docker Compose
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Let's create Ubuntu environment with vmware
Environment construction with Docker for beginners
Prepare Java development environment with Atom
Procedure for building a Rails application development environment with Docker [Rails, MySQL, Docker]
Build environment with vue.js + rails + docker