Skip to content

Commit

Permalink
sdram: disable by default bandwidth_measurement on lasmicon
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Mar 2, 2015
1 parent ca42611 commit 410a162
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions misoclib/mem/sdram/core/__init__.py
Expand Up @@ -7,14 +7,14 @@
from misoclib.mem.sdram.core.lasmicon.crossbar import Crossbar

class SDRAMCore(Module, AutoCSR):
def __init__(self, phy, ramcon_type, sdram_geom, sdram_timing):
def __init__(self, phy, ramcon_type, sdram_geom, sdram_timing, **kwargs):
# DFI
self.submodules.dfii = dfii.DFIInjector(phy, sdram_geom.mux_a, sdram_geom.bank_a)
self.comb += Record.connect(self.dfii.master, phy.dfi)

# LASMICON
if ramcon_type == "lasmicon":
self.submodules.controller = controller = lasmicon.LASMIcon(phy, sdram_geom, sdram_timing)
self.submodules.controller = controller = lasmicon.LASMIcon(phy, sdram_geom, sdram_timing, **kwargs)
self.comb += Record.connect(controller.dfi, self.dfii.slave)

self.submodules.crossbar = crossbar = Crossbar([controller.lasmic], controller.nrowbits)
Expand Down
5 changes: 3 additions & 2 deletions misoclib/mem/sdram/core/lasmicon/__init__.py
Expand Up @@ -6,7 +6,7 @@
from misoclib.mem.sdram.core.lasmicon.multiplexer import *

class LASMIcon(Module):
def __init__(self, phy, geom_settings, timing_settings):
def __init__(self, phy, geom_settings, timing_settings, **kwargs):
if phy.settings.memtype in ["SDR"]:
burst_length = phy.settings.nphases*1 # command multiplication*SDR
elif phy.settings.memtype in ["DDR", "LPDDR", "DDR2", "DDR3"]:
Expand Down Expand Up @@ -35,7 +35,8 @@ def __init__(self, phy, geom_settings, timing_settings):
for i in range(2**geom_settings.bank_a)]
self.submodules.multiplexer = Multiplexer(phy, geom_settings, timing_settings,
self.bank_machines, self.refresher,
self.dfi, self.lasmic)
self.dfi, self.lasmic,
**kwargs)

def get_csrs(self):
return self.multiplexer.get_csrs()
6 changes: 4 additions & 2 deletions misoclib/mem/sdram/core/lasmicon/multiplexer.py
Expand Up @@ -89,7 +89,8 @@ def stb_and(cmd, attr):
]

class Multiplexer(Module, AutoCSR):
def __init__(self, phy, geom_settings, timing_settings, bank_machines, refresher, dfi, lasmic):
def __init__(self, phy, geom_settings, timing_settings, bank_machines, refresher, dfi, lasmic,
with_bandwidth_measurement=False):
assert(phy.settings.nphases == len(dfi.phases))

# Command choosing
Expand Down Expand Up @@ -211,4 +212,5 @@ def steerer_sel(steerer, phy, r_w_n):
fsm.finalize()
self.comb += refresher.ack.eq(fsm.state == fsm.encoding["REFRESH"])

self.submodules.bandwidth = Bandwidth(choose_req.cmd)
if with_bandwidth_measurement:
self.submodules.bandwidth = Bandwidth(choose_req.cmd)

2 comments on commit 410a162

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this break gensoc's with_memtest?

@enjoy-digital
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed, it's now automatically inserted with -Ot whith_memtest True or can be inserted manually with -Ot with_bandwidth True.

Please sign in to comment.