Skip to content

Conversation

seldridge
Copy link
Member

@seldridge seldridge commented Mar 1, 2024

Change the way ChiselSim moves files to track and not move files which may be duplicated in both the default black box filelist and in the main CIRCT-produced filelist. Previously, this was working because a java.nio exception was being ignored. However, this may have been hiding bugs where the filelist was actually pointing at a file that did not exist.

@seldridge seldridge added the No Release Notes Exclude from release notes, consider using Internal instead label Mar 1, 2024
@seldridge seldridge marked this pull request as ready for review March 1, 2024 18:47
@seldridge seldridge requested a review from jackkoenig March 1, 2024 18:47
Comment on lines 139 to 142
def maybeMoveFiles(filename: String) = try {
moveFiles(filename)
} catch {
case _ @(_: java.nio.file.NoSuchFileException | _: java.io.FileNotFoundException) =>
case _: java.io.FileNotFoundException =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a good opportunity for this to check file existence rather than catching exceptions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to that. This was also starting to push things in the direction of this should be using java.nio.file.Path instead of strings. I then rewrote the moveFiles method to work this way while, I think, preserving the original logic.

Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

A couple of suggestions, feel free to merge when you're ready.

@jackkoenig jackkoenig added this to the 5.x milestone Mar 1, 2024
Change the way ChiselSim moves files to track and not move files which may
be duplicated in both the default black box filelist and in the main
CIRCT-produced filelist.  Previously, this was working because a java.nio
exception was being ignored.  However, this may have been hiding bugs
where the filelist was actually pointing at a file that did not exist.

This commit also does some heavy cleanup of the code for moving files to only
use java.nio methods as opposed to relying on doing string manipulations of
paths.  The logic is intended to be the exact same as before.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge force-pushed the dev/seldridge/more-chiselsim-CIRCT-1.67.0-fixes branch from 722acd4 to 8f3de09 Compare March 1, 2024 20:31
@seldridge seldridge requested a review from jackkoenig March 1, 2024 20:33
Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

LGTM!

@seldridge seldridge merged commit 61df8bb into main Mar 1, 2024
@seldridge seldridge deleted the dev/seldridge/more-chiselsim-CIRCT-1.67.0-fixes branch March 1, 2024 22:15
@mergify mergify bot added the Backported This PR has been backported label Mar 1, 2024
mergify bot pushed a commit that referenced this pull request Mar 1, 2024
Change the way ChiselSim moves files to track and not move files which may
be duplicated in both the default black box filelist and in the main
CIRCT-produced filelist.  Previously, this was working because a java.nio
exception was being ignored.  However, this may have been hiding bugs
where the filelist was actually pointing at a file that did not exist.

This commit also does some heavy cleanup of the code for moving files to only
use java.nio methods as opposed to relying on doing string manipulations of
paths.  The logic is intended to be the exact same as before.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 61df8bb)
mergify bot pushed a commit that referenced this pull request Mar 1, 2024
Change the way ChiselSim moves files to track and not move files which may
be duplicated in both the default black box filelist and in the main
CIRCT-produced filelist.  Previously, this was working because a java.nio
exception was being ignored.  However, this may have been hiding bugs
where the filelist was actually pointing at a file that did not exist.

This commit also does some heavy cleanup of the code for moving files to only
use java.nio methods as opposed to relying on doing string manipulations of
paths.  The logic is intended to be the exact same as before.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 61df8bb)
chiselbot pushed a commit that referenced this pull request Mar 1, 2024
Change the way ChiselSim moves files to track and not move files which may
be duplicated in both the default black box filelist and in the main
CIRCT-produced filelist.  Previously, this was working because a java.nio
exception was being ignored.  However, this may have been hiding bugs
where the filelist was actually pointing at a file that did not exist.

This commit also does some heavy cleanup of the code for moving files to only
use java.nio methods as opposed to relying on doing string manipulations of
paths.  The logic is intended to be the exact same as before.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 61df8bb)

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
chiselbot pushed a commit that referenced this pull request May 2, 2024
)

* [chiselsim] Better fix for CIRCT 1.66- and 1.66+ (#3893)

Change the way ChiselSim moves files to track and not move files which may
be duplicated in both the default black box filelist and in the main
CIRCT-produced filelist.  Previously, this was working because a java.nio
exception was being ignored.  However, this may have been hiding bugs
where the filelist was actually pointing at a file that did not exist.

This commit also does some heavy cleanup of the code for moving files to only
use java.nio methods as opposed to relying on doing string manipulations of
paths.  The logic is intended to be the exact same as before.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 61df8bb)

* Help Scala 2.12 type inferencing with type annotations

---------

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported No Release Notes Exclude from release notes, consider using Internal instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants