Skip to content

Conversation

@pranav12321
Copy link
Contributor

No description provided.

Copy link
Member

@rrbutani rrbutani 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!

I think you can also drop the Index/IndexMut impl from MemoryStub.


// Changes written with commit_page persist when reset is called.
// Changes written with write_word must not.
pub trait Memory: Index<Addr, Output = Word> + IndexMut<Addr, Output = Word> {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub trait Memory: Index<Addr, Output = Word> + IndexMut<Addr, Output = Word> {
pub trait Memory {

Comment on lines +42 to +46

fn read_word(&self, addr: Addr) -> Word{0 as u16}

fn write_word(&mut self, addr: Addr, word: Word){}

Copy link
Member

Choose a reason for hiding this comment

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

This is technically a change in behavior from the defaulted read_word/write_word on MemoryStub which would return your last write but that's fine; I don't think we were relying on this anywhere.

@rrbutani rrbutani changed the base branch from master to main August 10, 2022 06:56
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.

3 participants