chisel-bootcamp中的所有实例,可直接在本地运行,无需配置jupyter环境。
这里只包含了chisel-bootcamp的第2-4章,每章都放在一个package中,第i章放在了package weeki 中。
sbt在国内可能会比较慢,建议切换成阿里源配置如下:
-
~/.sbt中创建
repositories文件,并添加如下内容[repositories] local osc: https://maven.aliyun.com/nexus/content/groups/public/ typesafe: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly sonatype-oss-releases maven-central sonatype-oss-snapshots -
添加
-Dsbt.override.build.repos=true到sbt软件的配置文件中,如果是Linux系统,添加到
path_to_installation/sbt/conf/sbtopts末尾. 如果是windows,添加到path_to_installation/sbt/conf/sbtconfig.txt末尾.
-
打开sbt
-
测试week2包中Sort4
test:runMain week2.Week2Main sort4
最后一行会出现[Success]
-
生成Sort4的Verilog代码
test:runMain utils.getVerilog sort4
最终会在该项目的根目录中生成三个文件:
Sort4.v, Sort4.fir, Sort4.anno.json
-
格式
test:runMain [package name].[main name] [testfile name]
-
说明
-
package name : 包名称,这里有
week2,week3,week4 -
main name : 每个包中都有一个包含main函数的object文件,用于测试根据[testfilen name]测试选择测试文件的
-
testfile name : 测试文件姓名,需要自己到[main name]的文件中指定。
例如,如果想测试week2中的GradLife,Week2Main中的test添加相应的映射,然后打开sbt,执行
test:runMain week2.WeekMain gradlife
-
生成Verilog的步骤:
-
在utils中getVerilog中添加相应的子项
-
打开sbt,生成Verilog
test:runMain utils.getVerilog 文件名