简体   繁体   English

凿子:在Windows上编译凿子库

[英]Chisel: Compiling Chisel library on Windows

I have been using sbt on windows and a custom build.sbt script in conjunction with an import Chisel._ in the top-level file in order to generate Verilog from my Chisel source successfully. 我一直在Windows上使用sbt,并将自定义build.sbt脚本与顶级文件中的import Chisel._结合使用,以便从我的Chisel源成功生成Verilog。

I'm trying to get an IDE working on Windows to expedite Chisel development. 我正在尝试使IDE在Windows上运行以加快Chisel开发。 I've gone with the Eclipse based SCALA IDE http://scala-ide.org/download/sdk.html/ 我已经使用了基于Eclipse的SCALA IDE http://scala-ide.org/download/sdk.html/

I want to compile the Chisel library so that the import Chisel._ can be resolved locally, without having to go off and download the source from the repository each timeand recompile the source. 我想编译Chisel库,以便可以在本地解析导入的Chisel._,而不必每次都从存储库中下载并下载源代码并重新编译源代码。 When I download the Chisel-master repo from Git and include the src\\main folder in my SCALA project in the SCALA IDE, I get lots of syntax errors in the Chisel SCALA files that prevent me from building the project. 当我从Git下载Chisel-master存储库,并将src \\ main文件夹包含在SCALA IDE中的SCALA项目中时,Chisel SCALA文件中出现很多语法错误,使我无法构建项目。

Has anyone done anything like this before on Windows or have any knowledge of working with the SCALA IDE as it may just be a case of undefined symbols in the project configuration? 以前有人在Windows上做过这样的事情吗,或者有任何关于SCALA IDE的知识,因为这可能只是项目配置中未定义符号的情况?

Not sure exactly what you did with build.sbt respect to recompile (I think it download it only the first time, then it caches it for the future). 不知道您对build.sbt做了什么方面的重新编译(我认为它只是第一次下载它,然后将其缓存以备将来使用)。 But I'm using ScalaIDE for Chisel on linux, using the default build.sbt files, maybe you can try to get it working out of the box first to help narrow down the issue. 但是我在Linux上使用ScalaIDE for Chisel,使用默认的build.sbt文件,也许您可​​以尝试使其立即可用,以缩小问题范围。

Here are the steps I took in order to get ScalaIDE work with Chisel: 这是我为了使ScalaIDE与Chisel一起使用而采取的步骤:

  1. the latest Scala IDE uses 2.11.8, the current Chisel repository defaults to 2.11.7. 最新的Scala IDE使用2.11.8,当前的Chisel存储库默认为2.11.7。 So I had to change all the build.sbt reference to scalaVersion from 2.11.7 to 2.11.8 所以我不得不将所有对scalaVersion的build.sbt引用从2.11.7更改为2.11.8

  2. I used sbteclipse https://github.com/typesafehub/sbteclipse To create importable the workspace to setup the compilation dependencies. 我使用sbteclipse https://github.com/typesafehub/sbteclipse创建可导入的工作空间来设置编译依赖项。

  3. Except for chiselFrontEnd. 除了chiselFrontEnd。 For some reason, this package is not added to the dependency. 由于某些原因,此程序包未添加到依赖项。 I have to Add chiselFrontEnd as a javabuildpath dependency manually (Properties/JavaBuildPath, under Projects) for my own projects. 我必须为自己的项目手动将chiselFrontEnd添加为javabuildpath依赖项(“ Properties / JavaBuildPath”,在Projects下)。

To resolve undefined symbols, you can also add a JAR onto the project build path using Project Properties > Java Build Path > Libraries > Add External JARs... 要解析未定义的符号,还可以使用项目属性> Java构建路径>库>添加外部JAR将JAR添加到项目构建路径中。

If you are getting your JARs through Maven / SBT, they should be in: 如果要通过Maven / SBT获取JAR,则它们应该位于:

C:\\Users\\<name>\\.ivy2\\local\\edu.berkeley.cs\\chisel3_2.11\\jars

If you are using publish-local with chisel3, your JARs should be in 如果您将chisel3与publish-local一起使用,则JAR应位于

C:\\Users\\<name>\\.ivy2\\cache\\edu.berkeley.cs\\chisel3_2.11\\jars

Note that chisel3 is compiled into one JAR, including coreMacros and chiselFrontend sub-projects 请注意,chisel3被编译为一个JAR,包括coreMacros和chiselFrontend子项目

Of course, this is a more quick-and-dirty solution compared to something that can parse SBT files. 当然,与可以解析SBT文件的解决方案相比,这是一个更加快捷和肮脏的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM