Skip to content

Commit

Permalink
soc: enforce cpu_reset_address to 0 when with_rom is True
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Mar 6, 2015
1 parent 2b9397f commit bee8ccf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions misoclib/soc/__init__.py
Expand Up @@ -51,7 +51,10 @@ def __init__(self, platform, clk_freq, cpu_or_bridge=None,

self.with_cpu = with_cpu
self.cpu_type = cpu_type
self.cpu_reset_address = cpu_reset_address
if with_rom:
self.cpu_reset_address = 0
else:
self.cpu_reset_address = cpu_reset_address
self.cpu_boot_file = cpu_boot_file

self.with_rom = with_rom
Expand Down Expand Up @@ -80,9 +83,9 @@ def __init__(self, platform, clk_freq, cpu_or_bridge=None,

if with_cpu:
if cpu_type == "lm32":
self.submodules.cpu = lm32.LM32(platform, cpu_reset_address)
self.submodules.cpu = lm32.LM32(platform, self.cpu_reset_address)
elif cpu_type == "or1k":
self.submodules.cpu = mor1kx.MOR1KX(platform, cpu_reset_address)
self.submodules.cpu = mor1kx.MOR1KX(platform, self.cpu_reset_address)
else:
raise ValueError("Unsupported CPU type: "+cpu_type)
self.cpu_or_bridge = self.cpu
Expand Down

0 comments on commit bee8ccf

Please sign in to comment.