Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/misoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 83509163df9f
Choose a base ref
...
head repository: m-labs/misoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ecdc4101b410
Choose a head ref
  • 3 commits
  • 92 files changed
  • 1 contributor

Commits on Sep 24, 2015

  1. cores directory

    sbourdeauducq committed Sep 24, 2015
    Copy the full SHA
    0f410e4 View commit details
  2. Copy the full SHA
    9b08b03 View commit details
  3. Copy the full SHA
    ecdc410 View commit details
Showing with 130 additions and 185 deletions.
  1. +4 −4 .gitmodules
  2. 0 misoc/{liteethmini → cores}/__init__.py
  3. 0 misoc/{mem/sdram/phy → cores}/dfii.py
  4. 0 misoc/{dvisampler → cores/dvi_sampler}/__init__.py
  5. 0 misoc/{dvisampler → cores/dvi_sampler}/analysis.py
  6. 0 misoc/{dvisampler → cores/dvi_sampler}/chansync.py
  7. 0 misoc/{dvisampler → cores/dvi_sampler}/charsync.py
  8. 0 misoc/{dvisampler → cores/dvi_sampler}/clocking.py
  9. 0 misoc/{dvisampler → cores/dvi_sampler}/common.py
  10. 0 misoc/{dvisampler → cores/dvi_sampler}/core.py
  11. 0 misoc/{dvisampler → cores/dvi_sampler}/datacapture.py
  12. 0 misoc/{dvisampler → cores/dvi_sampler}/debug.py
  13. 0 misoc/{dvisampler → cores/dvi_sampler}/decoding.py
  14. 0 misoc/{dvisampler → cores/dvi_sampler}/dma.py
  15. 0 misoc/{dvisampler → cores/dvi_sampler}/edid.py
  16. 0 misoc/{dvisampler → cores/dvi_sampler}/wer.py
  17. 0 misoc/{ → cores}/framebuffer/__init__.py
  18. 0 misoc/{ → cores}/framebuffer/core.py
  19. 0 misoc/{ → cores}/framebuffer/dvi.py
  20. 0 misoc/{ → cores}/framebuffer/format.py
  21. 0 misoc/{ → cores}/framebuffer/phy.py
  22. 0 misoc/{ → cores}/gpio.py
  23. 0 misoc/{ → cores}/identifier.py
  24. 0 misoc/{liteethmini/mac/frontend → cores/lasmicon}/__init__.py
  25. 0 misoc/{mem/sdram/core → cores}/lasmicon/bankmachine.py
  26. +2 −4 misoc/{mem/sdram/core/lasmicon/__init__.py → cores/lasmicon/core.py}
  27. 0 misoc/{mem/sdram/core → cores}/lasmicon/multiplexer.py
  28. 0 misoc/{mem/sdram/core → cores}/lasmicon/perf.py
  29. +69 −0 misoc/cores/lasmicon/refresher.py
  30. +1 −1 misoc/{mem/sdram/test/bankmachine_tb.py → cores/lasmicon/test_bankmachine.py}
  31. 0 misoc/{mem/sdram/test/common.py → cores/lasmicon/test_common.py}
  32. +1 −1 misoc/{mem/sdram/test/lasmicon_df_tb.py → cores/lasmicon/test_df.py}
  33. +1 −1 misoc/{mem/sdram/test/lasmicon_tb.py → cores/lasmicon/test_lasmi.py}
  34. 0 misoc/{mem/sdram/test/refresher.py → cores/lasmicon/test_refresher.py}
  35. +1 −1 misoc/{mem/sdram/test/lasmicon_wb.py → cores/lasmicon/test_wb.py}
  36. 0 misoc/{liteethmini → cores/liteeth_mini}/LICENSE
  37. 0 misoc/{liteethmini → cores/liteeth_mini}/README
  38. 0 misoc/{mem/sdram/frontend → cores/liteeth_mini}/__init__.py
  39. 0 misoc/{liteethmini → cores/liteeth_mini}/common.py
  40. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/__init__.py
  41. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/__init__.py
  42. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/crc.py
  43. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/gap.py
  44. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/last_be.py
  45. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/padding.py
  46. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/core/preamble.py
  47. 0 misoc/{mem/sdram/phy → cores/liteeth_mini/mac/frontend}/__init__.py
  48. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/frontend/sram.py
  49. 0 misoc/{liteethmini → cores/liteeth_mini}/mac/frontend/wishbone.py
  50. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/__init__.py
  51. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/gmii.py
  52. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/gmii_mii.py
  53. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/loopback.py
  54. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/mii.py
  55. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/s6rgmii.py
  56. 0 misoc/{liteethmini → cores/liteeth_mini}/phy/sim.py
  57. 0 misoc/{ → cores}/lm32/core.py
  58. 0 misoc/{ → cores}/lm32/verilog/lm32_config.v
  59. +1 −0 misoc/cores/minicon/__init__.py
  60. +0 −1 misoc/{mem/sdram/core/minicon/__init__.py → cores/minicon/core.py}
  61. 0 misoc/{mem/sdram/test/minicon_tb.py → cores/minicon/test.py}
  62. 0 misoc/{ → cores}/mor1kx/__init__.py
  63. 0 misoc/{ → cores}/mor1kx/core.py
  64. 0 misoc/{ → cores}/mxcrg.v
  65. 0 misoc/{norflash16.py → cores/nor_flash_16.py}
  66. +0 −1 misoc/{mem/sdram/phy/simphy.py → cores/sdram_model.py}
  67. +3 −0 misoc/cores/sdram_phy/__init__.py
  68. 0 misoc/{mem/sdram/phy → cores/sdram_phy}/gensdrphy.py
  69. 0 misoc/{mem/sdram/phy → cores/sdram_phy}/k7ddrphy.py
  70. 0 misoc/{mem/sdram/phy → cores/sdram_phy}/s6ddrphy.py
  71. +18 −11 misoc/{mem/sdram/module.py → cores/sdram_settings.py}
  72. 0 misoc/{mem/sdram/frontend/memtest.py → cores/sdram_tester.py}
  73. 0 misoc/{ → cores}/spi/__init__.py
  74. 0 misoc/{ → cores}/spi/core.py
  75. 0 misoc/{ → cores}/spi/test.py
  76. 0 misoc/{spiflash.py → cores/spi_flash.py}
  77. 0 misoc/{ → cores}/timer.py
  78. 0 misoc/{ → cores}/uart/__init__.py
  79. 0 misoc/{ → cores}/uart/core.py
  80. 0 misoc/{ → cores}/uart/test.py
  81. 0 misoc/integration/{cpuif.py → cpu_interface.py}
  82. 0 misoc/{mem/sdram/phy/initsequence.py → integration/sdram_init.py}
  83. +29 −1 misoc/integration/soc_sdram.py
  84. 0 misoc/{mem/sdram/phy → interconnect}/dfi.py
  85. 0 misoc/{mem/sdram/frontend → interconnect}/dma_lasmi.py
  86. 0 misoc/{mem/sdram/core → interconnect}/lasmibus.py
  87. 0 misoc/{mem/sdram/core → interconnect}/lasmixbar.py
  88. 0 misoc/{mem/sdram/frontend → interconnect}/wishbone2lasmi.py
  89. +0 −11 misoc/mem/sdram/__init__.py
  90. +0 −36 misoc/mem/sdram/core/__init__.py
  91. +0 −70 misoc/mem/sdram/core/lasmicon/refresher.py
  92. +0 −42 misoc/mem/sdram/test/abstract_transactions_lasmi.py
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "misoc/lm32/verilog/submodule"]
path = misoc/lm32/verilog/submodule
[submodule "misoc/cores/lm32/verilog/submodule"]
path = misoc/cores/lm32/verilog/submodule
url = https://github.com/m-labs/lm32.git
[submodule "misoc/mor1kx/verilog"]
path = misoc/mor1kx/verilog
[submodule "misoc/cores/mor1kx/verilog"]
path = misoc/cores/mor1kx/verilog
url = https://github.com/openrisc/mor1kx.git
[submodule "software/compiler-rt"]
path = software/compiler-rt
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -12,8 +12,7 @@ def __init__(self, req_queue_size=8,
read_time=32, write_time=16,
l2_size=8192,
with_bandwidth=False,
with_memtest=False,
with_refresh=True):
with_memtest=False):
self.req_queue_size = req_queue_size
self.read_time = read_time
self.write_time = write_time
@@ -23,7 +22,6 @@ def __init__(self, req_queue_size=8,
else:
self.with_bandwidth = with_bandwidth
self.with_memtest = with_memtest
self.with_refresh = with_refresh


class LASMIcon(Module):
@@ -50,7 +48,7 @@ def __init__(self, phy_settings, geom_settings, timing_settings, controller_sett
###

self.submodules.refresher = Refresher(geom_settings.addressbits, geom_settings.bankbits,
timing_settings.tRP, timing_settings.tREFI, timing_settings.tRFC, enabled=controller_settings.with_refresh)
timing_settings.tRP, timing_settings.tREFI, timing_settings.tRFC)
self.submodules.bank_machines = [BankMachine(geom_settings, timing_settings, controller_settings, address_align, i,
getattr(self.lasmic, "bank"+str(i)))
for i in range(2**geom_settings.bankbits)]
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions misoc/cores/lasmicon/refresher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from migen import *
from migen.genlib.misc import timeline
from migen.genlib.fsm import FSM

from misoc.mem.sdram.core.lasmicon.multiplexer import *


class Refresher(Module):
def __init__(self, a, ba, tRP, tREFI, tRFC):
self.req = Signal()
self.ack = Signal() # 1st command 1 cycle after assertion of ack
self.cmd = CommandRequest(a, ba)

###

# Refresh sequence generator:
# PRECHARGE ALL --(tRP)--> AUTO REFRESH --(tRFC)--> done
seq_start = Signal()
seq_done = Signal()
self.sync += [
self.cmd.a.eq(2**10),
self.cmd.ba.eq(0),
self.cmd.cas_n.eq(1),
self.cmd.ras_n.eq(1),
self.cmd.we_n.eq(1),
seq_done.eq(0)
]
self.sync += timeline(seq_start, [
(1, [
self.cmd.ras_n.eq(0),
self.cmd.we_n.eq(0)
]),
(1+tRP, [
self.cmd.cas_n.eq(0),
self.cmd.ras_n.eq(0)
]),
(1+tRP+tRFC, [
seq_done.eq(1)
])
])

# Periodic refresh counter
counter = Signal(max=tREFI)
start = Signal()
self.sync += [
start.eq(0),
If(counter == 0,
start.eq(1),
counter.eq(tREFI - 1)
).Else(
counter.eq(counter - 1)
)
]

# Control FSM
fsm = FSM()
self.submodules += fsm
fsm.act("IDLE", If(start, NextState("WAIT_GRANT")))
fsm.act("WAIT_GRANT",
self.req.eq(1),
If(self.ack,
seq_start.eq(1),
NextState("WAIT_SEQ")
)
)
fsm.act("WAIT_SEQ",
self.req.eq(1),
If(seq_done, NextState("IDLE"))
)
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
from misoc.mem.sdram.code import lasmibus
from misoc.mem.sdram.core.lasmicon.bankmachine import *

from common import sdram_phy, sdram_geom, sdram_timing, CommandLogger
from test_common import sdram_phy, sdram_geom, sdram_timing, CommandLogger


def my_generator():
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
from misoc.mem.sdram.core.lasmicon import *
from misoc.mem.sdram.frontend import dma_lasmi

from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
from test_common import sdram_phy, sdram_geom, sdram_timing, DFILogger


class TB(Module):
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
from misoc.mem.sdram.core import lasmibus
from misoc.mem.sdram.core.lasmicon import *

from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
from test_common import sdram_phy, sdram_geom, sdram_timing, DFILogger


def my_generator_r(n):
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
from misoc.mem.sdram.core.lasmicon import *
from misoc.mem.sdram.frontend import wishbone2lasmi

from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
from test_common import sdram_phy, sdram_geom, sdram_timing, DFILogger

l2_size = 8192 # in bytes

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions misoc/cores/minicon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from misoc.cores.minicon.core import Minicon, MiniconSettings
Original file line number Diff line number Diff line change
@@ -96,7 +96,6 @@ def __init__(self, phy_settings, geom_settings, timing_settings):
address_align)

# Manage banks
bank_open = Signal()
bank_idle = Signal()
bank_hit = Signal()

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -158,7 +158,6 @@ def __init__(self, module, settings):

# bank reads
reads = Signal(len(phases))
read_data = Signal(data_width)
cases = {}
for np, phase in enumerate(phases):
self.comb += reads[np].eq(phase.read)
3 changes: 3 additions & 0 deletions misoc/cores/sdram_phy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from misoc.cores.sdramphy.gensdrphy import GENSDRPHY
from misoc.cores.sdramphy.s6ddrphy import S6HalfRateDDRPHY, S6QuarterRateDDRPHY
from misoc.cores.sdramphy.k7ddrphy import K7DDRPHY
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 18 additions & 11 deletions misoc/mem/sdram/module.py → misoc/cores/sdram_settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# SDRAM memory modules library
#
# This library avoid duplications of memory modules definitions in targets and
# ease SDRAM usage. (User can only select an already existing module or create
# one for its board and contribute to this library)
#
from math import ceil
from collections import namedtuple

from migen import *
from misoc.mem import sdram


PhySettingsT = namedtuple("PhySettings", "memtype dfi_databits nphases rdphase wrphase rdcmdphase wrcmdphase cl cwl read_latency write_latency")
def PhySettings(memtype, dfi_databits, nphases, rdphase, wrphase, rdcmdphase, wrcmdphase, cl, read_latency, write_latency, cwl=0):
return PhySettingsT(memtype, dfi_databits, nphases, rdphase, wrphase, rdcmdphase, wrcmdphase, cl, cwl, read_latency, write_latency)

GeomSettingsT = namedtuple("_GeomSettings", "bankbits rowbits colbits addressbits")
def GeomSettings(bankbits, rowbits, colbits):
return GeomSettingsT(bankbits, rowbits, colbits, max(rowbits, colbits))

TimingSettings = namedtuple("TimingSettings", "tRP tRCD tWR tWTR tREFI tRFC")


# TODO:
# Try to share the maximum information we can between modules:
# - ex: MT46V32M16 and MT46H32M16 are almost identical (V=DDR, H=LPDDR)
@@ -14,11 +26,6 @@
# - Modules can have different speedgrades, add support for it (and also add
# a check to verify clk_freq is in the supported range)

from math import ceil

from migen import *
from misoc.mem import sdram


class SDRAMModule:
def __init__(self, clk_freq, memtype, geom_settings, timing_settings):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 29 additions & 1 deletion misoc/integration/soc_sdram.py
Original file line number Diff line number Diff line change
@@ -2,13 +2,41 @@
from migen.bus import wishbone
from migen.genlib.record import *

from misoc.mem.sdram.core import SDRAMCore
from misoc.mem.sdram.core.lasmicon import LASMIconSettings
from misoc.mem.sdram.core.minicon import MiniconSettings
from misoc.mem.sdram.frontend import memtest, wishbone2lasmi
from misoc.integration.soc_core import SoCCore


class SDRAMCore(Module, AutoCSR):
def __init__(self, phy, geom_settings, timing_settings, controller_settings, **kwargs):
# DFI
self.submodules.dfii = dfii.DFIInjector(geom_settings.addressbits, geom_settings.bankbits,
phy.settings.dfi_databits, phy.settings.nphases)
self.comb += Record.connect(self.dfii.master, phy.dfi)

# LASMICON
if isinstance(controller_settings, lasmicon.LASMIconSettings):
self.submodules.controller = controller = lasmicon.LASMIcon(phy.settings,
geom_settings,
timing_settings,
controller_settings,
**kwargs)
self.comb += Record.connect(controller.dfi, self.dfii.slave)

self.submodules.crossbar = lasmixbar.LASMIxbar([controller.lasmic],
controller.nrowbits)

# MINICON
elif isinstance(controller_settings, minicon.MiniconSettings):
self.submodules.controller = controller = minicon.Minicon(phy.settings,
geom_settings,
timing_settings)
self.comb += Record.connect(controller.dfi, self.dfii.slave)
else:
raise ValueError("Unsupported SDRAM controller type")


class SoCSDRAM(SoCCore):
csr_map = {
"sdram": 8,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions misoc/mem/sdram/__init__.py

This file was deleted.

36 changes: 0 additions & 36 deletions misoc/mem/sdram/core/__init__.py

This file was deleted.

70 changes: 0 additions & 70 deletions misoc/mem/sdram/core/lasmicon/refresher.py

This file was deleted.

Loading