据说SpinalHDL相比chisel更具优势,这让我有了兴趣,今天开始安装搭建。平常用的linux系统的,但是Intel IDEA安装在Ubuntu上的时候总是卡的不行,就放弃了,其实SpinalHDL可以不用IDE的运行。教学文档中说需要安装的软件如下

.. _requirements:

Requirements / Things to download to get started
-------------------------------------------------

Before you download the SpinalHDL tools, you need to install:


* A Java JDK, which can be downloaded from `here <https://www.oracle.com/au/java/technologies/javase-downloads.html>`__ for instance.
* A Scala 2.11.X distribution, which can be downloaded `here <https://scala-lang.org/download/>`__ (not required if you use SBT).
* The SBT build tool, which can be downloaded `here <https://www.scala-sbt.org/download.html>`__.

 也就是需要安装java SDK 1.8,Scala建议采用2.11.12版本 https://www.scala-lang.org/download/2.11.12.html,sbt 

spinalHDL的例子我们现在下来。查看里面的build.sbt

https://codeload.github.com/SpinalHDL/SpinalTemplateSbt/zip/master

name := "SpinalTemplateSbt"
version := "1.0"
scalaVersion := "2.11.12"
val spinalVersion = "1.4.2"

libraryDependencies ++= Seq(
  "com.github.spinalhdl" % "spinalhdl-core_2.11" % spinalVersion,
  "com.github.spinalhdl" % "spinalhdl-lib_2.11" % spinalVersion,
  compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % spinalVersion)
)

fork := true
EclipseKeys.withSource := true

 看出scala version =2.11.12

不用IDE的sbt的方式 linux版本是这样

   sudo apt-get install openjdk-8-jdk
   sudo apt-get install scala
   echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
   sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
   sudo apt-get update
   sudo apt-get install sbt
   git clone https://github.com/SpinalHDL/SpinalTemplateSbt.git SpinalTemplateSbt
   cd SpinalTemplateSbt
   sbt run   # select "mylib.MyTopLevelVhdl" in the menu
   ls MyTopLevel.vhd

我们选择用Windows的基于IDE的开发。所以建议先下载安装好IDEA。这个网上随便看看教程就行了。容易的很。

安装Scala的插件 使用idea的plugins下载Scala,直接点击安装就行

然后Windows上装好jdk1.8 和Scala。为了sim要安装msys2 https://www.msys2.org/ 尽量安装MSYS2到C盘。下载安装软件太慢了。我上传了安装文件https://download.csdn.net/download/AS7062031/13543346

msys2-x86_64-20150916.exe

没什么好说的,双击,开始安装。这个装c盘。msys2下载文件的时候回出现下载速度奇慢说以更新为国内源。

修改\etc\pacman.d目录下的三个文件,参考https://mirrors.tuna.tsinghua.edu.cn/help/msys2/

pacman 的配置
编辑 /etc/pacman.d/mirrorlist.mingw32 ,在文件开头添加:

Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686
编辑 /etc/pacman.d/mirrorlist.mingw64 ,在文件开头添加:

Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
编辑 /etc/pacman.d/mirrorlist.msys ,在文件开头添加:

Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch

也可以是ustc的
编辑 /etc/pacman.d/mirrorlist.mingw32 ,在文件开头添加:

  Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
编辑 /etc/pacman.d/mirrorlist.mingw64 ,在文件开头添加:

  Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64
编辑 /etc/pacman.d/mirrorlist.msys ,在文件开头添加:

  Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch
然后执行 pacman -Sy 刷新软件包数据即可。

 mirrorlist.mingw64 文件

##
## 64-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
## Server = http://repo.msys2.org/mingw/x86_64
## Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/x86_64
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/x86_64/

Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64

mirrorlist.mingw32 文件

##
## 32-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
## Server = http://repo.msys2.org/mingw/i686
## Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/i686
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/i686/

Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686

mirrorlist.msys 文件

##
## MSYS2 repository mirrorlist
##

## Primary
## msys2.org
## Server = http://repo.msys2.org/msys/$arch
## Server = http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/$arch
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch

设置窗体修改颜色

目录下etc 文件 pacman.conf

将其中的 #Color 注释去掉。

安装verilator

spinalHDL simulation教程如下

   pacman -Syuu
   # Close the MSYS2 shell once you're asked to
   pacman -Syuu
   pacman -S --needed base-devel mingw-w64-x86_64-toolchain \
                      git flex\
                      mingw-w64-x86_64-cmake

   pacman -S mingw-w64-x86_64-verilator
   
   # Add C:\msys64\usr\bin;C:\msys64\mingw64\bin to your Windows PATH

有时候会出错没有安装make

pacman -S make 安装后就可以了

设置环境变量 Path添加

C:\msys64\mingw64\bin

变量MINGW_HOM

C:\msys64\mingw32

变量C_INCLUDE_PATH

%MINGW_HOME%\include

变量LIBRARY_PATH

%MINGW_HOME%\lib

变量Path中添加如下值

%MINGW_HOME%\bin;

 

Logo

更多推荐