platformio / platform-lattice_ice40

Lattice iCE40: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/lattice_ice40
Apache License 2.0
39 stars 15 forks source link

Icarus Verilog support #4

Closed Jesus89 closed 8 years ago

Jesus89 commented 8 years ago

Using toolchain-verilog package requires passing some paths to the binaries iverilog and vvp because it is a local installation:

Use cases:

There is a standard way to pass these paths to the builder?

ivankravets commented 8 years ago

Yes, it's possible. With PlatformIO 3.0 you have full control on PlatformIO. In this case, in main script main.py need to add

from os.path import join

platform = env.PioPlatform()
env.PrependENVPath("PATH", join(platform.get_package_dir("toolchain-verilog ", "lib", "ivl")))

In this case, PlatformIO Core will manage packages using semantic versioning and depended packages will be automatically loaded.

Jesus89 commented 8 years ago

Ok! Thanks for the information.

ivankravets commented 8 years ago

I granted you with full permissions to this repo. You can work on it without PR.

Jesus89 commented 8 years ago

Great. Thanks!

Jesus89 commented 8 years ago

I suppose that correct syntax is:

join(platform.get_package_dir("toolchain-verilog"), "lib", "ivl"))

instead of join(platform.get_package_dir("toolchain-verilog ", "lib", "ivl"))

Also, I can not access to _platform.get_packagedir("toolchain-iverilog") because there is no toolchain-iverilog version in appstate.json although package is installed. Same with toolchain-icestorm.

ivankravets commented 8 years ago

join(platform.get_package_dir("toolchain-verilog"), "lib", "ivl"))

This is correct syntax.

platform.get_package_dir("toolchain-iverilog")

While package isn't installed yet, need to use join(platform.get_package_dir("toolchain-verilog") or "", "lib", "ivl"))

appstate.json

PlatformIO 3.0 doesn't use appstate.json for package registry. It relays on real manifests located in the packages. Please check that toolchain-iverilog has package.json.

Jesus89 commented 8 years ago

Yes. It contains the package.json. Just everything reinstalled and it works.