Skip to content

Conversation

@naure
Copy link
Contributor

@naure naure commented Nov 19, 2024

@naure naure requested a review from hero78119 November 19, 2024 18:35
@naure naure mentioned this pull request Nov 19, 2024
Copy link
Collaborator

@hero78119 hero78119 left a comment

Choose a reason for hiding this comment

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

The revert back version look correct to me!

Btw @naure I am curious, does it make sense to switch fabonacci static_mem to dyn ram ?

@hero78119 hero78119 merged commit 25920cf into master Nov 21, 2024
6 checks passed
@hero78119 hero78119 deleted the revert-dyn-ram branch November 21, 2024 03:25
@naure
Copy link
Contributor Author

naure commented Nov 21, 2024

@hero78119 The layout of even that simple program is like:

ELF segment 0: R-- vaddr=0x00010000 file_size=276 mem_size=276
ELF segment 1: R-X vaddr=0x00200800 file_size=35088 mem_size=35088
ELF segment 2: R-- vaddr=0x0020a110 file_size=5608 mem_size=5608
ELF segment 3: RW- vaddr=0x0020c6f8 file_size=0 mem_size=220
Stack:             vaddr=0x0020_0400 size=1024

Which works really well with a single fixed set of addresses.


// set padding with well-form address
if final_mem.len().next_power_of_two() - final_mem.len() > 0 {
let paddin_entry_start = final_mem.len();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this has implicit assumption that

  1. addr in final_mem is mononically increasing and is divisible by 4;
  2. final_mem[0].addr == DVRAM::addr(0);
  3. final_mem.last().unwrap().addr == DVRAM::addr(final_mem.len()-1);

Therefore we should add assertion to avoid this issue.

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