Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Fix anno in backend #428

Merged
merged 3 commits into from
Feb 2, 2017
Merged

Fix anno in backend #428

merged 3 commits into from
Feb 2, 2017

Conversation

chick
Copy link
Contributor

@chick chick commented Feb 1, 2017

moving backend compilation utilities inadvertently lost the addition of a the black box verilog file list.
This fixes, that as well, as a couple of implementation bugs that slipped in. Motivated by chisel PR Move Backend Compilation Utilities

Only create .f file if some files have been moved
Some small style fixes in Driver
Restored lost functionality to add -f argument in verilogToCpp
Fixed loadAnnotations to add targetDir regardless of annotations arriving from file or through options
file.getAbsolutePath == "/" ||
file.getPath.startsWith("/")) {
Driver.dramaticError(s"delete directory ${file.getPath} will not delete absolute paths")
false
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteOnExit only deletes a directory if it is empty. I don't see any particular value to using it over delete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what I mean is rather than having this function to delete things, we just mark every single file we make with deleteOnExit(), that's generally what you do with temporary test files I believe. Regardless, I'm not going to block on it, just might be a better approach

else {
Seq.empty[String]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced that this is the right way to do this. Looking at the function, this adds some magical arguments from a file with a certain name, would it not be better to have the caller pass the filename to the function itself?

Copy link
Contributor Author

@chick chick Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackkoenig I agree this could be more elegant, but this works and there are things backed up behind this. The problem is one we have discussed about the bottom of the toolchain needing to pass stuff back up. Annotations are a candidate mechanism, there are probably others. In this case firrtl moves the files, because it knows about what's going on and there is stuff inline that it is well qualified to see. It does not know that these files are being placed there for some subset of the available backends, so the backend currently has to know that if such a file exists then it needs to add a command line options to use them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can discuss improving in the future, I'm fine with merging this to get stuff working. Hopefully once we find a solution for how to pass data back "up" we can refactor this as well.

@chick
Copy link
Contributor Author

chick commented Feb 2, 2017

@jackkoenig can you change your review to approve then, please

@chick chick merged commit 32af1d4 into master Feb 2, 2017
@jackkoenig jackkoenig deleted the fix-anno-in-backend branch February 9, 2017 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants