|
1 | 1 | import os
|
2 | 2 | from fractions import Fraction
|
| 3 | +from math import ceil |
3 | 4 |
|
4 | 5 | from migen.fhdl.std import *
|
5 | 6 | from mibuild.generic_platform import ConstraintError
|
@@ -47,21 +48,18 @@ def __init__(self, platform, sdram_controller_settings=LASMIconSettings(), **kwa
|
47 | 48 | self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), MT46V32M16(self.clk_freq),
|
48 | 49 | rd_bitslip=0, wr_bitslip=3, dqs_ddr_alignment="C1")
|
49 | 50 | self.register_sdram_phy(self.ddrphy)
|
50 |
| - |
51 | 51 | self.comb += [
|
52 | 52 | self.ddrphy.clk4x_wr_strb.eq(self.crg.clk4x_wr_strb),
|
53 | 53 | self.ddrphy.clk4x_rd_strb.eq(self.crg.clk4x_rd_strb)
|
54 | 54 | ]
|
55 | 55 |
|
56 |
| - self.submodules.norflash = norflash16.NorFlash16(platform.request("norflash"), |
57 |
| - self.ns(110), self.ns(50)) |
58 |
| - self.flash_boot_address = 0x001a0000 |
59 |
| - |
60 |
| - # If not in ROM, BIOS is in // NOR flash |
61 | 56 | if not self.with_integrated_rom:
|
| 57 | + clk_period_ns = 1000000000/self.clk_freq |
| 58 | + self.submodules.norflash = norflash16.NorFlash16(platform.request("norflash"), |
| 59 | + ceil(110/clk_period_ns), ceil(50/clk_period_ns)) |
| 60 | + self.flash_boot_address = 0x001a0000 |
62 | 61 | self.register_rom(self.norflash.bus)
|
63 | 62 |
|
64 |
| - |
65 | 63 | platform.add_platform_command("""
|
66 | 64 | INST "mxcrg/wr_bufpll" LOC = "BUFPLL_X0Y2";
|
67 | 65 | INST "mxcrg/rd_bufpll" LOC = "BUFPLL_X0Y3";
|
|
0 commit comments