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

Test memory loading #206

Merged
merged 4 commits into from
Sep 3, 2018
Merged

Test memory loading #206

merged 4 commits into from
Sep 3, 2018

Conversation

chick
Copy link
Contributor

@chick chick commented Jul 19, 2018

Adds functional tests for simple and complex memories being loaded from
file using $readmemh or $readmemb using binding files.

chick added 2 commits July 5, 2018 16:25
- Added memory test resource files
- Tests now use resource files
- Complex test does not use suffixes on mem files
- Other test does use suffixes
- Both tests now actually test values in addition to printing them out
- Use nicer interface for loadMemory from chisel.util
Copy link
Contributor

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

This looks good, @chick. Very cool to see this in action.

Only nits and one test, ClockCrossingSpec.scala, that seems to have been accidentally committed?

1
0
1

Copy link
Contributor

Choose a reason for hiding this comment

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

[super-nit] extra newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, I think I added it playing around to see if it caused a problem

import firrtl.FileUtils
import org.scalatest.{FreeSpec, Matchers}

//noinspection TypeAnnotation
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] I'm against letting editor-specific settings/comments leak into mainline code when I expect that this could be accomplished with a user-local setting. It creates confusion unless you know what this does. I'd be similarly against Emacs file variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is an editor specific setting, it is a standard directive to the scala style-checker which we are supposed to be supporting.

Copy link
Contributor

Choose a reason for hiding this comment

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

See what you think. I had never seen this before. From what I could dig up online, I concluded that it was IntelliJ adding code comments:

Scalastyle directives (which I thought, perhaps incorrectly, all started with scalastyle) I'm fine with, on the other hand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I didn't think it through I will change it to the scalastyle directive, sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll just get rid of it for now. It's an unfortunate scalastyle collision that I don't think there is a great way to fix. I'm not sure that we should change the style rules for this situation because other than IO I think this is a good thing to flag.

- Fixes based on review
- remove extra newline at EOF from mem3 input file
- remove un-related and leaked file: ClockCrossingSpec
- change imports to reflect this moving to experimental
- remove extra license line
- remove //noinspection, in general use //scalastyle, here use nothing
- bump scala version so it will compile with rest of stack
Copy link
Contributor

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

lgtm

@chick chick merged commit 7218873 into master Sep 3, 2018
@ucbjrl ucbjrl modified the milestones: 1.3.0, 1.2.6 Dec 12, 2018
ucbjrl pushed a commit that referenced this pull request Dec 13, 2018
* Add tests for clock crossing and memory loading

* LoadMemory test examples
- Added memory test resource files
- Tests now use resource files
- Complex test does not use suffixes on mem files
- Other test does use suffixes
- Both tests now actually test values in addition to printing them out

* LoadMemory test examples
- Use nicer interface for loadMemory from chisel.util

* Load memory from a file
- Fixes based on review
- remove extra newline at EOF from mem3 input file
- remove un-related and leaked file: ClockCrossingSpec
- change imports to reflect this moving to experimental
- remove extra license line
- remove //noinspection, in general use //scalastyle, here use nothing
- bump scala version so it will compile with rest of stack

(cherry picked from commit 7218873)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants