Skip to content

Commit

Permalink
targets/simple: make it generic (no default_platform, use platform's …
Browse files Browse the repository at this point in the history
…default_clk_name/default_clk_period)
enjoy-digital committed Feb 26, 2015
1 parent 02b3f51 commit 554731a
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion make.py
Original file line number Diff line number Diff line change
@@ -69,7 +69,10 @@ def _get_args():
top_class = target_module.default_subtarget

if args.platform is None:
platform_name = top_class.default_platform
if hasattr(top_class, "default_platform"):
platform_name = top_class.default_platform
else:
raise ValueError("Target has no default platform, specify a platform with -p your_platform")
else:
platform_name = args.platform
platform_module = misoc_import("mibuild.platforms", external_platform, platform_name)
8 changes: 2 additions & 6 deletions targets/simple.py
Original file line number Diff line number Diff line change
@@ -18,17 +18,13 @@ def __init__(self, clk_in):
]

class SimpleSoC(GenSoC, IntegratedBIOS):
default_platform = "de0nano" # /!\ Adapt this!
clk_name = "clk50" # /!\ Adapt this!
clk_freq = 50*1000000 # /!\ Adapt this!

def __init__(self, platform):
GenSoC.__init__(self, platform,
clk_freq=self.clk_freq,
clk_freq=int((1/(platform.default_clk_period))*1000000000),
cpu_reset_address=0)
IntegratedBIOS.__init__(self)

self.submodules.crg = _CRG(platform.request(self.clk_name))
self.submodules.crg = _CRG(platform.request(platform.default_clk_name))

# use on-board SRAM as SDRAM
sys_ram_size = 16*1024

0 comments on commit 554731a

Please sign in to comment.