Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pnmainc with diamondc #410

wants to merge 1 commit into from


Copy link

@jeanthom jeanthom commented Jun 22, 2020

According to Lattice support site diamondc sets the env variables required by Lattice tools. pnmainc also tends to fail without emitting logs even when NMIGEN_verbose=1.

Copy link

codecov bot commented Jun 22, 2020

Codecov Report

Merging #410 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #410   +/-   ##
  Coverage   82.02%   82.02%           
  Files          36       36           
  Lines        6114     6114           
  Branches     1237     1237           
  Hits         5015     5015           
  Misses        924      924           
  Partials      175      175           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 706eb03...be20576. Read the comment docs.

Copy link

cr1901 commented Jun 22, 2020

Was this tested on Windows? I have a feeling this is likely to break on Windows based on my own experiences with Diamond, and that pnmainc is in fact the correct binary to use. I've reproduced my notes below. These were determined through testing on a Windows and Linux machine in 2018 and writing down the behavior compared to the documentation:

# Lattice documentation provides 2 ways each for both Windows and Linux
# on how to set up environments so that the command-line tools can be invoked
# either from a TCL prompt or from an OS shell:
# Page 143-144 of Lattice Diamond User Guide (3.10) (UG)
# Page 2358-2359 of Lattice Diamond 3.10 Help (Help)
# The UG and Help give conflicting information wrt what environment variables
# need to be set/are set for you, and what scripts/executables are available
# from TCL or an OS shell after the environment set up. None of the 4
# documented methods are completely correct.
# What I have found works is the following:
# 1. Use pnmainc for everything. It exists even on Linux, which suggests using
# diamondc in the UG (and pnmainc in the Help). Setting up the environment
# variables for each OS (UG) will allow you to run commands from an OS shell.
# But you get that for free from pnmainc, in addition to TCL scripting.
# 2. On Windows, add Diamond binary directory to the path, and run pnmainc.
# pnmainc will set the remaining environment variables for you as suggested
# in the UG and Help, and will find its DLLs automatically by virtue of being
# on the path.
# 3. On Linux, contrary to what Help says, pnmainc will not set the remaining
# required environment variables (not to mention won't find it's shared
# libraries), so you need to source the provided diamond_env script in the
# Diamond binary directory. Set $bindir env variable, run diamond_env, and then
# invoke pnmainc.

Copy link

jeanthom commented Jun 22, 2020

Thanks for sharing your notes. It was effectively only tested on Linux, I thought Lattice would have included a Windows version of diamondc for consistency reasons.

I can't spend time debugging this on Windows so I'm closing the PR.

@jeanthom jeanthom closed this Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants