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

Change size of memories from Int to BigInt #1076

Merged
merged 3 commits into from
Apr 23, 2019
Merged

Change size of memories from Int to BigInt #1076

merged 3 commits into from
Apr 23, 2019

Conversation

jackkoenig
Copy link
Contributor

Relies on chipsalliance/firrtl#1075

Related issue: Fixes #856

Type of change: other enhancement

Impact: API addition (no impact on existing code)

Development Phase: implementation

Release Notes
Support memories larger than 2^(31)-1 (not supported by most simulators)

@jackkoenig jackkoenig requested a review from a team as a code owner April 20, 2019 01:43
@aswaterman
Copy link
Member

It looks like this can break some code, both because it relies on an implicit conversion from BigInt to Int, and because length is a public field whose type has changed.

I'd suggest fixing the first set of problems by adding new apply methods that accept Int (both for the companion-object factories and for the class methods used for indexing the structure).

The dependence on length is fundamentally backwards incompatible (it breaks code like for (i <- 0 until mem.length)), but I guess we have to suck it up.

@ducky64
Copy link
Contributor

ducky64 commented Apr 20, 2019

For reference, looking through Bits.scala indicates that many (if not all) of the methods that take BigInt as an argument also have Int counterparts, so having an Int version of apply here would be consistent with the rest of the codebase.

@jackkoenig
Copy link
Contributor Author

Yeah y’all are right of course, will do

@jackkoenig
Copy link
Contributor Author

I added back Int versions of the apply methods. It appears unnecessary to have them for the do_applys as well, although if y'all think I should add those too to be safe I will.

@jackkoenig
Copy link
Contributor Author

retest this please

1 similar comment
@jackkoenig
Copy link
Contributor Author

retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for [Sparse] Mems larger than 2^31 - 1 [for Simulation Purposes]
3 participants