|
16 | 16 | from litex.soc.cores.clock import * |
17 | 17 | from litex.soc.integration.soc import * |
18 | 18 | from litex.soc.integration.builder import * |
19 | | -from litex.soc.integration.soc import SoCRegion |
20 | | -from litex.soc.interconnect import wishbone |
21 | | - |
22 | | -from litex.soc.cores.hyperbus import HyperRAM |
23 | 19 |
|
24 | 20 | from liteeth.phy.titaniumrgmii import LiteEthPHYRGMII |
25 | 21 |
|
@@ -87,35 +83,16 @@ def __init__(self, sys_clk_freq=200e6, |
87 | 83 |
|
88 | 84 | # HyperRAM --------------------------------------------------------------------------------- |
89 | 85 | if with_hyperram: |
90 | | - # HyperRAM Parameters. |
91 | | - hyperram_device = "W958D6NW" |
92 | | - hyperram_size = 32 * MEGABYTE |
93 | | - hyperram_cache_size = 16 * KILOBYTE |
94 | | - |
95 | | - # HyperRAM Bus/Slave Interface. |
96 | | - hyperram_bus = wishbone.Interface(data_width=32, address_width=32, addressing="word") |
97 | | - self.bus.add_slave(name="main_ram", slave=hyperram_bus, region=SoCRegion(origin=0x40000000, size=hyperram_size, mode="rwx")) |
98 | | - |
99 | | - # HyperRAM L2 Cache. |
100 | | - hyperram_cache = wishbone.Cache( |
101 | | - cachesize = hyperram_cache_size//4, |
102 | | - master = hyperram_bus, |
103 | | - slave = wishbone.Interface(data_width=32, address_width=32, addressing="word") |
104 | | - ) |
105 | | - hyperram_cache = FullMemoryWE()(hyperram_cache) |
106 | | - self.hyperram_cache = hyperram_cache |
107 | | - self.add_config("L2_SIZE", hyperram_cache_size) |
108 | | - |
109 | | - # HyperRAM Core. |
110 | | - self.hyperram = HyperRAM( |
111 | | - pads = platform.request("hyperram"), |
112 | | - latency = 7, |
113 | | - latency_mode = "variable", |
114 | | - sys_clk_freq = sys_clk_freq, |
115 | | - clk_ratio = "2:1", |
116 | | - dq_i_cd = "sys2x_ps", |
| 86 | + self.add_hyperram( |
| 87 | + region_name = "main_ram", |
| 88 | + origin = self.mem_map["main_ram"], |
| 89 | + size = 32*MEGABYTE, |
| 90 | + l2_cache_size = 16*KILOBYTE, |
| 91 | + latency = 7, |
| 92 | + latency_mode = "variable", |
| 93 | + clk_ratio = "2:1", |
| 94 | + dq_i_cd = "sys2x_ps", |
117 | 95 | ) |
118 | | - self.comb += self.hyperram_cache.slave.connect(self.hyperram.bus) |
119 | 96 |
|
120 | 97 | # Ethernet / Etherbone --------------------------------------------------------------------- |
121 | 98 | if with_ethernet or with_etherbone: |
|
0 commit comments