0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Chisel 本を手元でBuildする

Posted at

ハードウェア記述言語Chiselの入門書「Digital Design with Chisel」はAmazonで買えます。電子版は無料でダウンロードできます。ソースコードもGithubで公開されています。多分Ubuntuだともっと簡単だと思いますが、手持ちのLinuxマシンがRHEL7.7しかなかったので少し面倒でした。なので面倒な部分をここに記録しておきます。

RHEL7.7 上でビルドする前の準備

ソースコードからPDFを生成するには、Java8,Scala,SBT,Pdflatex が必要です。

Java 8

Java8はインストール済み

$ java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

Scala

いくつか方法があるが、ここではRPMファイルをとってきてインストール

$ wget http://downloads.lightbend.com/scala/2.11.8/scala-2.11.8.rpm
$ sudo yum install scala-2.11.8.rpm

SBT

SBTのレポを追加してYumでインストール

$ curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
$ sudo yum install sbt

Latex

色々古いので、ディストロのLinuxは消す。

$ sudo  yum erase texlive texlive*

最新版をCTANのスクリプトでインストール(結構時間がかかります)

$ wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
$ tar xvf install-tl-unx.tar.gz
$ cd install-tl-20200301/
$ sudo ./install-tl

RHEL7.7 上でビルドする

以上で、準備ができたので、Chisel本のソースコードをCloneしてビルド

$ git clone https://github.com/schoeberl/chisel-book.git
$ cd chisel-book

だけど、一箇所修正が必要。

diff --git a/figures/Makefile b/figures/Makefile
index 3698ef5..8cf3b1c 100644
--- a/figures/Makefile
+++ b/figures/Makefile
@@ -7,3 +7,4 @@ all:
        pdflatex ready_valid1.tex
        pdflatex ready_valid2.tex
        pdflatex ready_valid3.tex
+       pdflatex tick_count_wave.tex

あとは Make一発でPDFができる(はず)

$ make

以上。これでいつでも最新版を手元に!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?