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

soc_core:allocate correct size for ROM. #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions misoc/integration/soc_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ def register_mem(self, name, origin, length, interface):

def register_rom(self, interface, rom_size=0xa000):
self.add_wb_slave(self.mem_map["rom"], rom_size, interface)
assert self.cpu_reset_address < rom_size
self.add_memory_region("rom", self.cpu_reset_address,
rom_size-self.cpu_reset_address)
if not self.mem_map["rom"] == self.cpu_reset_address:
raise ValueError(
"CPU reset address 0x{:x} is not equal to the rom start addres 0x{:x}"
.format(self.cpu_reset_address,self.mem_map["rom"]))
self.add_memory_region("rom", self.mem_map["rom"],rom_size)
keesj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Author

Choose a reason for hiding this comment

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

I validated that this code now allows to map the rom section to a different address and that the code still works and believe all comments stated where resolved.

Copy link
Member

@sbourdeauducq sbourdeauducq Feb 6, 2019

Choose a reason for hiding this comment

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

Style issues:

  • != and not not ==
  • space after comma

I believe that many targets and ARTIQ in particular have a reset address within the ROM (beginning of the ROM is the FPGA bitstream), so your change will break them.
If the reset address was always the ROM start, we would not need two parameters.


def get_memory_regions(self):
return self._memory_regions
Expand Down