Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 71 files changed
  • 0 commit comments
  • 2 contributors
Showing with 178 additions and 223 deletions.
  1. +1 −2  .gitignore
  2. +1 −1  LICENSE
  3. +12 −18 README
  4. +0 −6 common/version.h
  5. +3 −3 make.py
  6. +0 −29 milkymist/identifier/__init__.py
  7. 0  {milkymist → misoclib}/__init__.py
  8. 0  {milkymist → misoclib}/counteradc/__init__.py
  9. 0  {milkymist → misoclib}/cpuif.py
  10. 0  {milkymist → misoclib}/dfii/__init__.py
  11. +9 −9 {milkymist → misoclib}/dvisampler/__init__.py
  12. +1 −1  {milkymist → misoclib}/dvisampler/analysis.py
  13. +1 −1  {milkymist → misoclib}/dvisampler/chansync.py
  14. +1 −1  {milkymist → misoclib}/dvisampler/charsync.py
  15. 0  {milkymist → misoclib}/dvisampler/clocking.py
  16. 0  {milkymist → misoclib}/dvisampler/common.py
  17. 0  {milkymist → misoclib}/dvisampler/datacapture.py
  18. +3 −3 {milkymist → misoclib}/dvisampler/debug.py
  19. +1 −1  {milkymist → misoclib}/dvisampler/decoding.py
  20. +1 −1  {milkymist → misoclib}/dvisampler/dma.py
  21. 0  {milkymist → misoclib}/dvisampler/edid.py
  22. +1 −1  {milkymist → misoclib}/dvisampler/wer.py
  23. +2 −2 {milkymist → misoclib}/framebuffer/__init__.py
  24. 0  {milkymist → misoclib}/framebuffer/dvi.py
  25. 0  {milkymist → misoclib}/framebuffer/format.py
  26. +2 −2 {milkymist → misoclib}/framebuffer/phy.py
  27. 0  {milkymist → misoclib}/gpio/__init__.py
  28. +21 −0 misoclib/identifier/__init__.py
  29. +5 −0 misoclib/identifier/git.py
  30. +3 −3 {milkymist → misoclib}/lasmicon/__init__.py
  31. +1 −1  {milkymist → misoclib}/lasmicon/bankmachine.py
  32. +1 −1  {milkymist → misoclib}/lasmicon/multiplexer.py
  33. 0  {milkymist → misoclib}/lasmicon/perf.py
  34. +1 −1  {milkymist → misoclib}/lasmicon/refresher.py
  35. 0  {milkymist → misoclib}/lm32/__init__.py
  36. 0  {milkymist → misoclib}/memtest/__init__.py
  37. 0  {milkymist → misoclib}/minimac3/__init__.py
  38. 0  {milkymist → misoclib}/mxcrg/__init__.py
  39. 0  {milkymist → misoclib}/norflash/__init__.py
  40. +34 −26 {milkymist → misoclib}/s6ddrphy/__init__.py
  41. 0  {milkymist → misoclib}/s6ddrphy/initsequence.py
  42. 0  {milkymist → misoclib}/timer/__init__.py
  43. 0  {milkymist → misoclib}/uart/__init__.py
  44. +11 −11 software/bios/Makefile
  45. +6 −13 software/bios/main.c
  46. +4 −2 software/common.mak
  47. +0 −3  software/include/base/id.h
  48. +1 −1  software/include/base/stdlib.h
  49. +1 −1  software/include/base/string.h
  50. +2 −2 software/libbase/Makefile
  51. +1 −28 software/libbase/id.c
  52. +1 −1  software/libbase/libc.c
  53. +1 −1  software/libbase/vsnprintf.c
  54. +2 −2 software/libcompiler-rt/Makefile
  55. +2 −2 software/libnet/Makefile
  56. +10 −10 software/memtest/Makefile
  57. +11 −11 software/videomixer/Makefile
  58. +1 −1  tb/dvisampler/chansync.py
  59. +1 −1  tb/framebuffer/framebuffer.py
  60. +1 −1  tb/lasmicon/bankmachine.py
  61. +1 −1  tb/lasmicon/common.py
  62. +1 −1  tb/lasmicon/lasmicon.py
  63. +1 −1  tb/lasmicon/lasmicon_df.py
  64. +1 −1  tb/lasmicon/lasmicon_wb.py
  65. +1 −1  tb/lasmicon/refresher.py
  66. +2 −2 tools/Makefile
  67. +1 −1  tools/byteswap.c
  68. +2 −2 tools/flterm.c
  69. +3 −3 tools/{mkmmimg.c → mkmscimg.c}
  70. +3 −5 top.py
  71. +1 −1  verilog/lm32/submodule
3  .gitignore
View
@@ -6,9 +6,8 @@ build/*
*.elf
*.bin
*.fbi
-tools/bin2hex
tools/flterm
-tools/mkmmimg
+tools/mkmscimg
tools/byteswap
software/include/hw/csr.h
software/include/hw/sdram_phy.h
2  LICENSE
View
@@ -1,4 +1,4 @@
-Unless otherwise noted, milkymist-ng is copyright (C) 2011-2013 Sebastien Bourdeauducq.
+Unless otherwise noted, MiSoC is copyright (C) 2011-2013 Sebastien Bourdeauducq.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
30 README
View
@@ -1,17 +1,10 @@
-[> Milkymist-ng system-on-chip
+[> MiSoC system-on-chip
------------------------------
-This is the next-generation Milkymist(tm) system-on-chip design,
-introducing two key features:
- * Built on the powerful Migen VLSI logic design system.
- * Increased system memory performance thanks to LASMI.
+A high performance system-on-chip design based on Migen.
-This translates to more development productivity, better video resolution
-and quality, ease of designing complex hardware accelerators, and much
-more flexibility in hardware designs.
-
-The milkymist-ng SoC supports the Mixxeo and the Milkymist One.
-Obtain yours at http://milkymist.org
+MiSoC supports the Mixxeo and the Milkymist One.
+Obtain your development system at http://milkymist.org
[> Instructions (software)
--------------------------
@@ -53,28 +46,29 @@ Once this is done, build the bitstream with:
This will generate the build/soc-<platform>.bit programming file
and load it with UrJTAG.
-A new BIOS needs to be built and flashed for the -ng SoC.
+A new BIOS needs to be built and flashed for MiSoC.
+There is no compatibility with Milkymist SoC.
Enjoy!
[> Misc
-------
Code repository:
- https://github.com/milkymist/milkymist-ng
+ https://github.com/milkymist/misoc
Send questions, comments and patches to devel [AT] lists.milkymist.org
We are also on IRC: #milkymist on the Freenode network.
-Milkymist-ng is released under the very permissive two-clause BSD license. Under
-the terms of this license, you are authorized to use milkymist-ng for
+MiSoC is released under the very permissive two-clause BSD license. Under
+the terms of this license, you are authorized to use MiSoC for
closed-source proprietary designs.
Even though we do not require you to do so, those things are awesome, so please
do them if possible:
- * tell us that you are using milkymist-ng
- * cite milkymist-ng in publications related to research it has helped
+ * tell us that you are using MiSoC
+ * cite MiSoC in publications related to research it has helped
* send us feedback and suggestions for improvements
* send us bug reports when something goes wrong
- * send us the modifications and improvements you have done to milkymist-ng.
+ * send us the modifications and improvements you have done to MiSoC.
The use of "git format-patch" is recommended. If your submission is large and
complex and/or you are not sure how to proceed, feel free to discuss it on
the mailing list or IRC (#milkymist on Freenode) beforehand.
6 common/version.h
View
@@ -1,6 +0,0 @@
-#ifndef __VERSION_H
-#define __VERSION_H
-
-#define VERSION "2.0"
-
-#endif /* __VERSION_H */
6 make.py
View
@@ -4,8 +4,8 @@
from mibuild.tools import write_to_file
-from milkymist import cpuif
-from milkymist.s6ddrphy import initsequence
+from misoclib import cpuif
+from misoclib.s6ddrphy import initsequence
import top, jtag
def build(platform_name, build_bitstream, build_header, csr_csv_filename, *soc_args, **soc_kwargs):
@@ -57,7 +57,7 @@ def build(platform_name, build_bitstream, build_header, csr_csv_filename, *soc_a
write_to_file(csr_csv_filename, csr_csv)
def main():
- parser = argparse.ArgumentParser(description="milkymist-ng - a high performance SoC built on Migen technology.")
+ parser = argparse.ArgumentParser(description="MiSoC - a high performance SoC based on Migen.")
parser.add_argument("-p", "--platform", default="mixxeo", help="platform to build for")
parser.add_argument("-B", "--no-bitstream", default=False, action="store_true", help="do not build bitstream file")
parser.add_argument("-H", "--no-header", default=False, action="store_true", help="do not build C header files with CSR/IRQ/SDRAM_PHY defs")
29 milkymist/identifier/__init__.py
View
@@ -1,29 +0,0 @@
-import re
-
-from migen.fhdl.std import *
-from migen.bank.description import *
-
-def encode_version(version):
- match = re.match("(\d+)\.(\d+)(\.(\d+))?(rc(\d+))?", version, re.IGNORECASE)
- r = (int(match.group(1)) << 12) | (int(match.group(2)) << 8)
- subminor = match.group(4)
- rc = match.group(6)
- if subminor:
- r |= int(subminor) << 4
- if rc:
- r |= int(rc)
- return r
-
-class Identifier(Module, AutoCSR):
- def __init__(self, sysid, version, frequency):
- self._r_sysid = CSRStatus(16)
- self._r_version = CSRStatus(16)
- self._r_frequency = CSRStatus(32)
-
- ###
-
- self.comb += [
- self._r_sysid.status.eq(sysid),
- self._r_version.status.eq(encode_version(version)),
- self._r_frequency.status.eq(frequency)
- ]
0  milkymist/__init__.py → misoclib/__init__.py
View
File renamed without changes
0  milkymist/counteradc/__init__.py → misoclib/counteradc/__init__.py
View
File renamed without changes
0  milkymist/cpuif.py → misoclib/cpuif.py
View
File renamed without changes
0  milkymist/dfii/__init__.py → misoclib/dfii/__init__.py
View
File renamed without changes
18 milkymist/dvisampler/__init__.py → misoclib/dvisampler/__init__.py
View
@@ -1,15 +1,15 @@
from migen.fhdl.std import *
from migen.bank.description import AutoCSR
-from milkymist.dvisampler.edid import EDID
-from milkymist.dvisampler.clocking import Clocking
-from milkymist.dvisampler.datacapture import DataCapture
-from milkymist.dvisampler.charsync import CharSync
-from milkymist.dvisampler.wer import WER
-from milkymist.dvisampler.decoding import Decoding
-from milkymist.dvisampler.chansync import ChanSync
-from milkymist.dvisampler.analysis import SyncPolarity, ResolutionDetection, FrameExtraction
-from milkymist.dvisampler.dma import DMA
+from misoclib.dvisampler.edid import EDID
+from misoclib.dvisampler.clocking import Clocking
+from misoclib.dvisampler.datacapture import DataCapture
+from misoclib.dvisampler.charsync import CharSync
+from misoclib.dvisampler.wer import WER
+from misoclib.dvisampler.decoding import Decoding
+from misoclib.dvisampler.chansync import ChanSync
+from misoclib.dvisampler.analysis import SyncPolarity, ResolutionDetection, FrameExtraction
+from misoclib.dvisampler.dma import DMA
class DVISampler(Module, AutoCSR):
def __init__(self, pads, asmiport, n_dma_slots=2):
2  milkymist/dvisampler/analysis.py → misoclib/dvisampler/analysis.py
View
@@ -5,7 +5,7 @@
from migen.bank.description import *
from migen.flow.actor import *
-from milkymist.dvisampler.common import channel_layout, frame_layout
+from misoclib.dvisampler.common import channel_layout, frame_layout
class SyncPolarity(Module):
def __init__(self):
2  milkymist/dvisampler/chansync.py → misoclib/dvisampler/chansync.py
View
@@ -5,7 +5,7 @@
from migen.genlib.misc import optree
from migen.bank.description import *
-from milkymist.dvisampler.common import channel_layout
+from misoclib.dvisampler.common import channel_layout
class _SyncBuffer(Module):
def __init__(self, width, depth):
2  milkymist/dvisampler/charsync.py → misoclib/dvisampler/charsync.py
View
@@ -3,7 +3,7 @@
from migen.genlib.misc import optree
from migen.bank.description import *
-from milkymist.dvisampler.common import control_tokens
+from misoclib.dvisampler.common import control_tokens
class CharSync(Module, AutoCSR):
def __init__(self, required_controls=8):
0  milkymist/dvisampler/clocking.py → misoclib/dvisampler/clocking.py
View
File renamed without changes
0  milkymist/dvisampler/common.py → misoclib/dvisampler/common.py
View
File renamed without changes
0  milkymist/dvisampler/datacapture.py → misoclib/dvisampler/datacapture.py
View
File renamed without changes
6 milkymist/dvisampler/debug.py → misoclib/dvisampler/debug.py
View
@@ -4,9 +4,9 @@
from migen.bank.description import AutoCSR
from migen.actorlib import structuring, dma_lasmi, spi
-from milkymist.dvisampler.edid import EDID
-from milkymist.dvisampler.clocking import Clocking
-from milkymist.dvisampler.datacapture import DataCapture
+from misoclib.dvisampler.edid import EDID
+from misoclib.dvisampler.clocking import Clocking
+from misoclib.dvisampler.datacapture import DataCapture
class RawDVISampler(Module, AutoCSR):
def __init__(self, pads, asmiport):
2  milkymist/dvisampler/decoding.py → misoclib/dvisampler/decoding.py
View
@@ -1,7 +1,7 @@
from migen.fhdl.std import *
from migen.genlib.record import Record
-from milkymist.dvisampler.common import control_tokens, channel_layout
+from misoclib.dvisampler.common import control_tokens, channel_layout
class Decoding(Module):
def __init__(self):
2  milkymist/dvisampler/dma.py → misoclib/dvisampler/dma.py
View
@@ -5,7 +5,7 @@
from migen.flow.actor import *
from migen.actorlib import dma_lasmi
-from milkymist.dvisampler.common import frame_layout
+from misoclib.dvisampler.common import frame_layout
# Slot status: EMPTY=0 LOADED=1 PENDING=2
class _Slot(Module, AutoCSR):
0  milkymist/dvisampler/edid.py → misoclib/dvisampler/edid.py
View
File renamed without changes
2  milkymist/dvisampler/wer.py → misoclib/dvisampler/wer.py
View
@@ -3,7 +3,7 @@
from migen.genlib.misc import optree
from migen.genlib.cdc import PulseSynchronizer
-from milkymist.dvisampler.common import control_tokens
+from misoclib.dvisampler.common import control_tokens
class WER(Module, AutoCSR):
def __init__(self, period_bits=24):
4 milkymist/framebuffer/__init__.py → misoclib/framebuffer/__init__.py
View
@@ -4,8 +4,8 @@
from migen.bank.description import CSRStorage, AutoCSR
from migen.actorlib import dma_lasmi, structuring, sim, spi
-from milkymist.framebuffer.format import bpp, pixel_layout, FrameInitiator, VTG
-from milkymist.framebuffer.phy import Driver
+from misoclib.framebuffer.format import bpp, pixel_layout, FrameInitiator, VTG
+from misoclib.framebuffer.phy import Driver
class Framebuffer(Module, AutoCSR):
def __init__(self, pads_vga, pads_dvi, lasmim, simulation=False):
0  milkymist/framebuffer/dvi.py → misoclib/framebuffer/dvi.py
View
File renamed without changes
0  milkymist/framebuffer/format.py → misoclib/framebuffer/format.py
View
File renamed without changes
4 milkymist/framebuffer/phy.py → misoclib/framebuffer/phy.py
View
@@ -4,8 +4,8 @@
from migen.bank.description import *
from migen.flow.actor import *
-from milkymist.framebuffer.format import bpc_phy, phy_layout
-from milkymist.framebuffer import dvi
+from misoclib.framebuffer.format import bpc_phy, phy_layout
+from misoclib.framebuffer import dvi
class _FIFO(Module):
def __init__(self):
0  milkymist/gpio/__init__.py → misoclib/gpio/__init__.py
View
File renamed without changes
21 misoclib/identifier/__init__.py
View
@@ -0,0 +1,21 @@
+from migen.fhdl.std import *
+from migen.bank.description import *
+
+from misoclib.identifier import git
+
+class Identifier(Module, AutoCSR):
+ def __init__(self, sysid, frequency, revision=None):
+ self._r_sysid = CSRStatus(16)
+ self._r_revision = CSRStatus(32)
+ self._r_frequency = CSRStatus(32)
+
+ ###
+
+ if revision is None:
+ revision = git.get_id()
+
+ self.comb += [
+ self._r_sysid.status.eq(sysid),
+ self._r_revision.status.eq(revision),
+ self._r_frequency.status.eq(frequency)
+ ]
5 misoclib/identifier/git.py
View
@@ -0,0 +1,5 @@
+import subprocess
+
+def get_id():
+ output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii")
+ return int(output[:8], 16)
6 milkymist/lasmicon/__init__.py → misoclib/lasmicon/__init__.py
View
@@ -3,9 +3,9 @@
from migen.fhdl.std import *
from migen.bus import dfi, lasmibus
-from milkymist.lasmicon.refresher import *
-from milkymist.lasmicon.bankmachine import *
-from milkymist.lasmicon.multiplexer import *
+from misoclib.lasmicon.refresher import *
+from misoclib.lasmicon.bankmachine import *
+from misoclib.lasmicon.multiplexer import *
PhySettings = namedtuple("PhySettings", "memtype dfi_d nphases rdphase wrphase rdcmdphase wrcmdphase cl read_latency write_latency")
2  milkymist/lasmicon/bankmachine.py → misoclib/lasmicon/bankmachine.py
View
@@ -4,7 +4,7 @@
from migen.genlib.misc import optree
from migen.genlib.fifo import SyncFIFO
-from milkymist.lasmicon.multiplexer import *
+from misoclib.lasmicon.multiplexer import *
class _AddressSlicer:
def __init__(self, col_a, address_align):
2  milkymist/lasmicon/multiplexer.py → misoclib/lasmicon/multiplexer.py
View
@@ -4,7 +4,7 @@
from migen.genlib.fsm import FSM, NextState
from migen.bank.description import AutoCSR
-from milkymist.lasmicon.perf import Bandwidth
+from misoclib.lasmicon.perf import Bandwidth
class CommandRequest:
def __init__(self, a, ba):
0  milkymist/lasmicon/perf.py → misoclib/lasmicon/perf.py
View
File renamed without changes
2  milkymist/lasmicon/refresher.py → misoclib/lasmicon/refresher.py
View
@@ -2,7 +2,7 @@
from migen.genlib.misc import timeline
from migen.genlib.fsm import FSM
-from milkymist.lasmicon.multiplexer import *
+from misoclib.lasmicon.multiplexer import *
class Refresher(Module):
def __init__(self, a, ba, tRP, tREFI, tRFC):
0  milkymist/lm32/__init__.py → misoclib/lm32/__init__.py
View
File renamed without changes
0  milkymist/memtest/__init__.py → misoclib/memtest/__init__.py
View
File renamed without changes
0  milkymist/minimac3/__init__.py → misoclib/minimac3/__init__.py
View
File renamed without changes
0  milkymist/mxcrg/__init__.py → misoclib/mxcrg/__init__.py
View
File renamed without changes
0  milkymist/norflash/__init__.py → misoclib/norflash/__init__.py
View
File renamed without changes
60 milkymist/s6ddrphy/__init__.py → misoclib/s6ddrphy/__init__.py
View
@@ -24,15 +24,14 @@
from migen.bus.dfi import *
from migen.genlib.record import *
-from milkymist import lasmicon
+from misoclib import lasmicon
class S6DDRPHY(Module):
- def __init__(self, pads, memtype, nphases, cl, bitslip):
+ def __init__(self, pads, memtype, nphases, cl, rd_bitslip, wr_bitslip, dqs_ddr_alignment):
if memtype not in ["DDR", "LPDDR", "DDR2"]:
raise NotImplementedError("S6DDRPHY only supports DDR, LPDDR and DDR2")
if cl != 3:
raise NotImplementedError("S6DDRPHY only supports CAS LATENCY 3")
-
a = flen(pads.a)
ba = flen(pads.ba)
d = flen(pads.dq)
@@ -118,7 +117,7 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
bitslip_inc = Signal()
sd_sys += [
- If(bitslip_cnt == bitslip,
+ If(bitslip_cnt == rd_bitslip,
bitslip_inc.eq(0)
).Else(
bitslip_cnt.eq(bitslip_cnt+1),
@@ -148,7 +147,7 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
for i in range(d//8):
# DQS output
self.specials += Instance("ODDR2",
- Instance.Parameter("DDR_ALIGNMENT", "C1"),
+ Instance.Parameter("DDR_ALIGNMENT", dqs_ddr_alignment),
Instance.Parameter("INIT", 0),
Instance.Parameter("SRTYPE", "ASYNC"),
@@ -166,7 +165,7 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
# DQS tristate cmd
self.specials += Instance("ODDR2",
- Instance.Parameter("DDR_ALIGNMENT", "C1"),
+ Instance.Parameter("DDR_ALIGNMENT", dqs_ddr_alignment),
Instance.Parameter("INIT", 0),
Instance.Parameter("SRTYPE", "ASYNC"),
@@ -218,18 +217,20 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
drive_dq = Signal()
- drive_dq_n = Signal()
- d_drive_dq = Signal()
- d_drive_dq_n = Signal()
- self.comb += [
- drive_dq_n.eq(~drive_dq),
- d_drive_dq_n.eq(~d_drive_dq)
- ]
+ drive_dq_n = [Signal() for i in range(2)]
+ self.comb += drive_dq_n[0].eq(~drive_dq)
+ sd_sys += drive_dq_n[1].eq(drive_dq_n[0])
dq_t = Signal(d)
dq_o = Signal(d)
dq_i = Signal(d)
+ dq_wrdata = []
+ for i in range(2):
+ for j in reversed(range(nphases)):
+ dq_wrdata.append(d_dfi[i*nphases+j].wrdata[:d])
+ dq_wrdata.append(d_dfi[i*nphases+j].wrdata[d:])
+
for i in range(d):
# Data serializer
self.specials += Instance("OSERDES2",
@@ -247,15 +248,16 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
Instance.Input("RST", 0),
Instance.Input("CLKDIV", sys_clk),
- Instance.Input("D1", d_dfi[1*nphases+0].wrdata[i]),
- Instance.Input("D2", d_dfi[1*nphases+1].wrdata[i+d]),
- Instance.Input("D3", d_dfi[1*nphases+1].wrdata[i]),
- Instance.Input("D4", d_dfi[0*nphases+0].wrdata[i+d]),
+ Instance.Input("D1", dq_wrdata[wr_bitslip+3][i]),
+ Instance.Input("D2", dq_wrdata[wr_bitslip+2][i]),
+ Instance.Input("D3", dq_wrdata[wr_bitslip+1][i]),
+ Instance.Input("D4", dq_wrdata[wr_bitslip+0][i]),
+
Instance.Output("TQ", dq_t[i]),
- Instance.Input("T1", d_drive_dq_n),
- Instance.Input("T2", d_drive_dq_n),
- Instance.Input("T3", d_drive_dq_n),
- Instance.Input("T4", drive_dq_n),
+ Instance.Input("T1", drive_dq_n[(wr_bitslip+3)//4]),
+ Instance.Input("T2", drive_dq_n[(wr_bitslip+2)//4]),
+ Instance.Input("T3", drive_dq_n[(wr_bitslip+1)//4]),
+ Instance.Input("T4", drive_dq_n[(wr_bitslip+0)//4]),
Instance.Input("TRAIN", 0),
Instance.Input("TCE", 1),
Instance.Input("SHIFTIN1", 0),
@@ -309,6 +311,12 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
Instance.InOut("IO", pads.dq[i])
)
+ dq_wrdata_mask = []
+ for i in range(2):
+ for j in reversed(range(nphases)):
+ dq_wrdata_mask.append(d_dfi[i*nphases+j].wrdata_mask[:d//8])
+ dq_wrdata_mask.append(d_dfi[i*nphases+j].wrdata_mask[d//8:])
+
for i in range(d//8):
# Mask serializer
self.specials += Instance("OSERDES2",
@@ -326,10 +334,11 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
Instance.Input("RST", 0),
Instance.Input("CLKDIV", sys_clk),
- Instance.Input("D1", d_dfi[1*nphases+0].wrdata_mask[i]),
- Instance.Input("D2", d_dfi[1*nphases+1].wrdata_mask[i+d//8]),
- Instance.Input("D3", d_dfi[1*nphases+1].wrdata_mask[i]),
- Instance.Input("D4", d_dfi[0*nphases+0].wrdata_mask[i+d//8]),
+ Instance.Input("D1", dq_wrdata_mask[wr_bitslip+3][i]),
+ Instance.Input("D2", dq_wrdata_mask[wr_bitslip+2][i]),
+ Instance.Input("D3", dq_wrdata_mask[wr_bitslip+1][i]),
+ Instance.Input("D4", dq_wrdata_mask[wr_bitslip+0][i]),
+
Instance.Output("TQ"),
Instance.Input("T1"),
Instance.Input("T2"),
@@ -359,7 +368,6 @@ def __init__(self, pads, memtype, nphases, cl, bitslip):
# DQ/DQS/DM control
#
self.comb += drive_dq.eq(d_dfi[self.phy_settings.wrphase].wrdata_en)
- sd_sys += d_drive_dq.eq(drive_dq)
d_dfi_wrdata_en = Signal()
sd_sys += d_dfi_wrdata_en.eq(d_dfi[self.phy_settings.wrphase].wrdata_en)
0  milkymist/s6ddrphy/initsequence.py → misoclib/s6ddrphy/initsequence.py
View
File renamed without changes
0  milkymist/timer/__init__.py → misoclib/timer/__init__.py
View
File renamed without changes
0  milkymist/uart/__init__.py → misoclib/uart/__init__.py
View
File renamed without changes
22 software/bios/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
OBJECTS=isr.o sdram.o main.o boot-helper.o boot.o dataflow.o
@@ -9,20 +9,20 @@ all: bios.bin
-include $(OBJECTS:.o=.d)
%.bin: %.elf
- $(MAKE) -C $(M2DIR)/tools
+ $(MAKE) -C $(MSCDIR)/tools
$(OBJCOPY) -O binary $< $@
chmod -x $@
- $(M2DIR)/tools/mkmmimg $@ write
+ $(MSCDIR)/tools/mkmscimg $@ write
bios.elf: linker.ld $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) -T $< -N -o $@ \
- $(M2DIR)/software/libbase/crt0.o \
+ $(MSCDIR)/software/libbase/crt0.o \
$(OBJECTS) \
- -L$(M2DIR)/software/libnet \
- -L$(M2DIR)/software/libbase \
- -L$(M2DIR)/software/libcompiler-rt \
+ -L$(MSCDIR)/software/libnet \
+ -L$(MSCDIR)/software/libbase \
+ -L$(MSCDIR)/software/libcompiler-rt \
-lnet -lbase-nofloat -lcompiler-rt
chmod -x $@
@@ -36,9 +36,9 @@ main.o: main.c
$(assemble)
libs:
- $(MAKE) -C $(M2DIR)/software/libcompiler-rt
- $(MAKE) -C $(M2DIR)/software/libbase
- $(MAKE) -C $(M2DIR)/software/libnet
+ $(MAKE) -C $(MSCDIR)/software/libcompiler-rt
+ $(MAKE) -C $(MSCDIR)/software/libbase
+ $(MAKE) -C $(MSCDIR)/software/libnet
flash: bios.bin
m1nor-ng bios.bin
19 software/bios/main.c
View
@@ -6,7 +6,6 @@
#include <system.h>
#include <id.h>
#include <irq.h>
-#include <version.h>
#include <crc.h>
#include <hw/csr.h>
@@ -307,7 +306,7 @@ static void dfs(char *baseaddr)
static void help(void)
{
- puts("Milkymist(tm) BIOS");
+ puts("MiSoC BIOS");
puts("Don't know what to do? Try 'flashboot'.\n");
puts("Available commands:");
puts("mr - read address space");
@@ -319,7 +318,7 @@ static void help(void)
puts("netboot - boot via TFTP");
puts("serialboot - boot via SFL");
puts("flashboot - boot from flash");
- puts("version - display version");
+ puts("revision - display revision");
}
static char *get_token(char **str)
@@ -353,7 +352,7 @@ static void do_command(char *c)
else if(strcmp(token, "serialboot") == 0) serialboot();
else if(strcmp(token, "netboot") == 0) netboot();
- else if(strcmp(token, "version") == 0) puts(VERSION);
+ else if(strcmp(token, "revision") == 0) printf("%08x\n", GIT_ID);
else if(strcmp(token, "help") == 0) help();
@@ -401,14 +400,6 @@ static void crcbios(void)
}
}
-static const char banner[] =
- "\nMILKYMIST(tm) v"VERSION" BIOS http://www.milkymist.org\n"
- "(c) Copyright 2007-2013 Sebastien Bourdeauducq\n"
- "Built "__DATE__" "__TIME__"\n\n"
- "This program is free software: you can redistribute it and/or modify\n"
- "it under the terms of the GNU General Public License as published by\n"
- "the Free Software Foundation, version 3 of the License.";
-
static void readstr(char *s, int size)
{
char c[2];
@@ -494,7 +485,9 @@ int main(int i, char **c)
irq_setmask(0);
irq_setie(1);
uart_init();
- puts(banner);
+ puts("\nMiSoC BIOS http://www.milkymist.org\n"
+ "(c) Copyright 2007-2013 Sebastien Bourdeauducq");
+ printf("Revision %08x built "__DATE__" "__TIME__"\n\n", GIT_ID);
crcbios();
id_print();
ethreset();
6 software/common.mak
View
@@ -18,6 +18,8 @@ LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)ranlib
+GIT_ID:=$(shell echo -e "from misoclib.identifier.git import get_id\nprint(hex(get_id()), end='')" | python)
+
ifeq ($(V),1)
CC = $(CC_normal)
CX = $(CX_normal)
@@ -38,9 +40,9 @@ endif
# Toolchain options
#
-INCLUDES = -I$(M2DIR)/software/include/base -I$(M2DIR)/software/include -I$(M2DIR)/common
+INCLUDES = -I$(MSCDIR)/software/include/base -I$(MSCDIR)/software/include -I$(MSCDIR)/common
COMMONFLAGS = -O3 -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled \
- -Wall -fno-builtin -nostdinc $(INCLUDES)
+ -Wall -fno-builtin -nostdinc -DGIT_ID=$(GIT_ID) $(INCLUDES)
CFLAGS = $(COMMONFLAGS) -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
CXXFLAGS = $(COMMONFLAGS) -fno-exceptions -ffreestanding
LDFLAGS = -nostdlib -nodefaultlibs
3  software/include/base/id.h
View
@@ -6,9 +6,6 @@ extern "C" {
#endif
void get_sysid_formatted(char *sysid);
-void get_soc_version(unsigned int *major, unsigned int *minor, unsigned int *subminor, unsigned int *rc);
-void get_soc_version_formatted(char *version);
-
void id_print(void);
#ifdef __cplusplus
2  software/include/base/stdlib.h
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC (Software)
+ * MiSoC
* Copyright (C) 2007, 2008, 2009, 2011 Sebastien Bourdeauducq
* Copyright (C) Linux kernel developers
*
2  software/include/base/string.h
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC (Software)
+ * MiSoC
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
* Copyright (C) Linus Torvalds and Linux kernel developers
*
4 software/libbase/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
OBJECTS=setjmp.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o
29 software/libbase/id.c
View
@@ -2,7 +2,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <version.h>
#include <id.h>
void get_sysid_formatted(char *sysid)
@@ -12,36 +11,10 @@ void get_sysid_formatted(char *sysid)
sysid[2] = 0;
}
-void get_soc_version(unsigned int *major, unsigned int *minor, unsigned int *subminor, unsigned int *rc)
-{
- unsigned int id;
-
- id = identifier_version_read();
- *major = (id & 0xf000) >> 12;
- *minor = (id & 0x0f00) >> 8;
- *subminor = (id & 0x00f0) >> 4;
- *rc = id & 0x000f;
-}
-
-void get_soc_version_formatted(char *version)
-{
- unsigned int major, minor, subminor, rc;
-
- get_soc_version(&major, &minor, &subminor, &rc);
-
- version += sprintf(version, "%u.%u", major, minor);
- if(subminor != 0)
- version += sprintf(version, ".%u", subminor);
- if(rc != 0)
- sprintf(version, "RC%u", rc);
-}
-
void id_print(void)
{
- char soc_version[13];
char sysid[3];
- get_soc_version_formatted(soc_version);
get_sysid_formatted(sysid);
- printf("Running on Milkymist-ng SoC %s (sysid:%s) at %dMHz\n", soc_version, sysid, identifier_frequency_read()/1000000);
+ printf("Running on MiSoC rev. %08x (sysid:%s) at %dMHz\n", identifier_revision_read(), sysid, identifier_frequency_read()/1000000);
}
2  software/libbase/libc.c
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC (Software)
+ * MiSoC
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
* Copyright (C) Linus Torvalds and Linux kernel developers
*
2  software/libbase/vsnprintf.c
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC (Software)
+ * MiSoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
* Copyright (C) Linux kernel developers
*
4 software/libcompiler-rt/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
CFLAGS+=-D_YUGA_LITTLE_ENDIAN=0 -D_YUGA_BIG_ENDIAN=1 -Wno-missing-prototypes
4 software/libnet/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
OBJECTS=microudp.o tftp.o
20 software/memtest/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
OBJECTS=isr.o main.o
@@ -16,12 +16,12 @@ memtest.elf: $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) \
- -T $(M2DIR)/software/libbase/linker-sdram.ld \
+ -T $(MSCDIR)/software/libbase/linker-sdram.ld \
-N -o $@ \
- $(M2DIR)/software/libbase/crt0.o \
+ $(MSCDIR)/software/libbase/crt0.o \
$(OBJECTS) \
- -L$(M2DIR)/software/libbase \
- -L$(M2DIR)/software/libcompiler-rt \
+ -L$(MSCDIR)/software/libbase \
+ -L$(MSCDIR)/software/libcompiler-rt \
-lbase -lcompiler-rt
chmod -x $@
@@ -35,12 +35,12 @@ main.o: main.c
$(assemble)
libs:
- $(MAKE) -C $(M2DIR)/software/libcompiler-rt
- $(MAKE) -C $(M2DIR)/software/libbase
+ $(MAKE) -C $(MSCDIR)/software/libcompiler-rt
+ $(MAKE) -C $(MSCDIR)/software/libbase
load: memtest.bin
- $(MAKE) -C $(M2DIR)/tools
- $(M2DIR)/tools/flterm --port /dev/ttyUSB0 --kernel memtest.bin
+ $(MAKE) -C $(MSCDIR)/tools
+ $(MSCDIR)/tools/flterm --port /dev/ttyUSB0 --kernel memtest.bin
clean:
22 software/videomixer/Makefile
View
@@ -1,5 +1,5 @@
-M2DIR=../..
-include $(M2DIR)/software/common.mak
+MSCDIR=../..
+include $(MSCDIR)/software/common.mak
OBJECTS=isr.o fb.o dvisampler0.o dvisampler1.o main.o
@@ -13,18 +13,18 @@ all: videomixer.bin videomixer.fbi
chmod -x $@
%.fbi: %.bin
- $(M2DIR)/tools/mkmmimg $< write $@
+ $(MSCDIR)/tools/mkmscimg $< write $@
videomixer.elf: $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) \
- -T $(M2DIR)/software/libbase/linker-sdram.ld \
+ -T $(MSCDIR)/software/libbase/linker-sdram.ld \
-N -o $@ \
- $(M2DIR)/software/libbase/crt0.o \
+ $(MSCDIR)/software/libbase/crt0.o \
$(OBJECTS) \
- -L$(M2DIR)/software/libbase \
- -L$(M2DIR)/software/libcompiler-rt \
+ -L$(MSCDIR)/software/libbase \
+ -L$(MSCDIR)/software/libcompiler-rt \
-lbase -lcompiler-rt
chmod -x $@
@@ -62,12 +62,12 @@ dvisampler0.o: dvisampler0.h
dvisampler1.o: dvisampler1.h
libs:
- $(MAKE) -C $(M2DIR)/software/libcompiler-rt
- $(MAKE) -C $(M2DIR)/software/libbase
+ $(MAKE) -C $(MSCDIR)/software/libcompiler-rt
+ $(MAKE) -C $(MSCDIR)/software/libbase
load: videomixer.bin
- $(MAKE) -C $(M2DIR)/tools
- $(M2DIR)/tools/flterm --port /dev/ttyUSB0 --kernel videomixer.bin
+ $(MAKE) -C $(MSCDIR)/tools
+ $(MSCDIR)/tools/flterm --port /dev/ttyUSB0 --kernel videomixer.bin
flash: videomixer.fbi
m1nor-ng videomixer.fbi
2  tb/dvisampler/chansync.py
View
@@ -1,7 +1,7 @@
from migen.fhdl.std import *
from migen.sim.generic import *
-from milkymist.dvisampler.chansync import ChanSync
+from misoclib.dvisampler.chansync import ChanSync
class TB(Module):
def __init__(self, test_seq_it):
2  tb/framebuffer/framebuffer.py
View
@@ -2,7 +2,7 @@
from migen.bus import asmibus
from migen.sim.generic import Simulator
-from milkymist.framebuffer import *
+from misoclib.framebuffer import *
def main():
hub = asmibus.Hub(16, 128)
2  tb/lasmicon/bankmachine.py
View
@@ -2,7 +2,7 @@
from migen.bus.lasmibus import *
from migen.sim.generic import Simulator, TopLevel
-from milkymist.lasmicon.bankmachine import *
+from misoclib.lasmicon.bankmachine import *
from common import sdram_geom, sdram_timing, CommandLogger
2  tb/lasmicon/common.py
View
@@ -4,7 +4,7 @@
from migen.fhdl.std import *
from migen.sim.generic import Proxy
-from milkymist import lasmicon
+from misoclib import lasmicon
MHz = 1000000
clk_freq = (83 + Fraction(1, 3))*MHz
2  tb/lasmicon/lasmicon.py
View
@@ -2,7 +2,7 @@
from migen.bus.lasmibus import *
from migen.sim.generic import Simulator, TopLevel
-from milkymist.lasmicon import *
+from misoclib.lasmicon import *
from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
2  tb/lasmicon/lasmicon_df.py
View
@@ -3,7 +3,7 @@
from migen.actorlib import dma_lasmi
from migen.sim.generic import Simulator, TopLevel, Proxy
-from milkymist.lasmicon import *
+from misoclib.lasmicon import *
from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
2  tb/lasmicon/lasmicon_wb.py
View
@@ -3,7 +3,7 @@
from migen.bus.transactions import *
from migen.sim.generic import Simulator, TopLevel
-from milkymist.lasmicon import *
+from misoclib.lasmicon import *
from common import sdram_phy, sdram_geom, sdram_timing, DFILogger
2  tb/lasmicon/refresher.py
View
@@ -3,7 +3,7 @@
from migen.fhdl.std import *
from migen.sim.generic import Simulator, TopLevel
-from milkymist.lasmicon.refresher import *
+from misoclib.lasmicon.refresher import *
from common import CommandLogger
4 tools/Makefile
View
@@ -1,4 +1,4 @@
-TARGETS=mkmmimg flterm byteswap
+TARGETS=mkmscimg flterm byteswap
CC=gcc
RM ?= rm -f
@@ -7,7 +7,7 @@ all: $(TARGETS)
%: %.c
$(CC) -O2 -Wall -I../common -s -o $@ $<
-install: mkmmimg flterm
+install: mkmscimg flterm
install -d /usr/local/bin
install -m755 -t /usr/local/bin $^
2  tools/byteswap.c
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC
+ * MiSoC
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
4 tools/flterm.c
View
@@ -1,5 +1,5 @@
/*
- * Milkymist SoC
+ * MiSoC
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
* Copyright (C) 2011 Michael Walle
* Copyright (C) 2004 MontaVista Software, Inc
@@ -645,7 +645,7 @@ static const struct option options[] = {
static void print_usage()
{
- fprintf(stderr, "Serial boot program for Milkymist SoC - v. 2.3\n");
+ fprintf(stderr, "Serial boot program for MiSoC - v. 2.4\n");
fprintf(stderr, "Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq\n");
fprintf(stderr, "Copyright (C) 2011 Michael Walle\n");
fprintf(stderr, "Copyright (C) 2004 MontaVista Software, Inc\n\n");
6 tools/mkmmimg.c → tools/mkmscimg.c
View
@@ -1,8 +1,8 @@
/*
- * CRC32 computation tool and Milkymist image file writer
+ * CRC32 computation tool and MiSoC image file writer
* (c) 2009, 2010, 2012 Sebastien Bourdeauducq
* Released under GNU GPL v3
- * This file is part of Milkymist.
+ * This file is part of MiSoC.
*/
/* crc32.c -- compute the CRC-32 of a data stream
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
if(((argc != 2) && (argc != 3) && (argc != 4))
|| ((argc > 2) && (strcmp(argv[2], "write")))) {
- fprintf(stderr, "Usage: mkmmimg <filename> [write] [dest]\n");
+ fprintf(stderr, "Usage: mkmscimg <filename> [write] [dest]\n");
return 1;
}
8 top.py
View
@@ -8,11 +8,9 @@
from migen.bank import csrgen
from mibuild.generic_platform import ConstraintError
-from milkymist import mxcrg, lm32, norflash, uart, s6ddrphy, dfii, lasmicon, \
+from misoclib import mxcrg, lm32, norflash, uart, s6ddrphy, dfii, lasmicon, \
identifier, timer, minimac3, framebuffer, dvisampler, gpio, memtest
-version = "2.0"
-
clk_freq = (83 + Fraction(1, 3))*1000000
sram_size = 4096 # in bytes
l2_size = 8192 # in bytes
@@ -92,7 +90,7 @@ def __init__(self, platform, platform_name, with_memtest):
#
# DFI
#
- self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), memtype="DDR", nphases=2, cl=3, bitslip=0)
+ self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), memtype="DDR", nphases=2, cl=3, rd_bitslip=0, wr_bitslip=3, dqs_ddr_alignment="C1")
self.submodules.dfii = dfii.DFIInjector(sdram_geom.mux_a, sdram_geom.bank_a,
self.ddrphy.phy_settings.dfi_d, self.ddrphy.phy_settings.nphases)
self.submodules.dficon0 = dfi.Interconnect(self.dfii.master, self.ddrphy.dfi)
@@ -156,7 +154,7 @@ def __init__(self, platform, platform_name, with_memtest):
#
self.submodules.crg = mxcrg.MXCRG(MXClockPads(platform), clk_freq)
self.submodules.uart = uart.UART(platform.request("serial"), clk_freq, baud=115200)
- self.submodules.identifier = identifier.Identifier(0x4D31, version, int(clk_freq))
+ self.submodules.identifier = identifier.Identifier(0x4D31, int(clk_freq))
self.submodules.timer0 = timer.Timer()
if platform_name == "mixxeo":
self.submodules.leds = gpio.GPIOOut(platform.request("user_led"))
2  verilog/lm32/submodule
@@ -1 +1 @@
-Subproject commit 4c0f6c51253b4482fe7685e77d4d5549207a098c
+Subproject commit 90651f0dcb02565bd69c634f4a811e94671d21ef

No commit comments for this range

Something went wrong with that request. Please try again.