6

I am looking for .gitignore file for the Lattice Diamond IDE. I've been trying to only add what I need, but it would be nice to have a .gitignore that just ignores all of the automatically generated files for build/documentation/etc. Yes, I could sit down and make one myself, but a ready-made already existing file would be ideal.

The build process that Diamond runs through, plus any IP thats included from their included tools, all generate a lot of files, some necessary, many not. I've not come across a clear definition of what is needed and what is not, nor have I been able to find a boilerplate .gitignore for the IDE.

I debated where to place this question, I apologize if it is off topic here, however electronics SE seemed like a best fit since it involves an FPGA IDE.

EDIT: I would really like an explanation as to why this is being downvoted. If anyone has resources I am missing about what files Diamond generates that are temporary, then by all means please downvote. But I would also appreciate a point in the right direction. I spent a good while searching through Diamond documentation, and would love to be proven as an idiot, so long as it means I get a good answer.

Kris Bahnsen
  • 1,758
  • 12
  • 17

2 Answers2

8

It took me a few hours of guess and check to figure out what exactly is needed and what isn't. The project I inherited used the project directory as the implementation directory (where it dumps most of the temporary files). See below with what I came up with. Note that this is by no means complete, there are lots of features to Diamond that I am not using, so there may be other files and folders created that I am not aware of; which is why I was asking for something more complete.

This comes with no warranty, and assumes that the implementation directory matches "impl*/" as is the default setting when creating a new project. If I come up with anything else, I will edit this over time to keep it current.

*.html
impl*/
*.xml
.build_status
.run_manager.ini
.recovery
.spread_sheet.ini
.spreadsheet_view.ini
*.dir/
*.log
*.tcl
*.ccl
*.srp
*.dmp
._Real_._Math_.vhd

Edits:

  • 20200505 - Added additional files that I've found were generated and not needing to be tracked in git as of some recent Diamond releases.
Kris Bahnsen
  • 1,758
  • 12
  • 17
3

A way to figure out the required files is to use the "File"->"Save Project As..." and to specify a new folder where to save it. It look like Diamond then create a minimum of files while still allow to rebuild all the others files.

Then you can choose if you want to track the GUI setting related files or not.

  • While not entirely true (I just tried it and it brought along the implementation directory with .html files, made sure "copy generated files" was unchecked), this is a fantastic way to get rid of various generated files. Albeit a little roundabout. – Kris Bahnsen Oct 13 '16 at 20:56
  • I also just noticed that, while it does copy over .xcf project files, it misses .ddt Diamond Deployment Tool files. – Kris Bahnsen Oct 13 '16 at 21:03