-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
241 changed files
with
3,173 additions
and
3,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
__pycache__ | ||
build/* | ||
*.o | ||
*.d | ||
*.a | ||
*.elf | ||
*.bin | ||
*.fbi | ||
tools/flterm | ||
tools/byteswap | ||
software/include/generated/*.h | ||
software/include/generated/*.ld | ||
software/include/generated/*.mak | ||
*.vcd | ||
outgoing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
[submodule "extcores/lm32/submodule"] | ||
path = extcores/lm32/submodule | ||
[submodule "misoc/cores/lm32/verilog/submodule"] | ||
path = misoc/cores/lm32/verilog/submodule | ||
url = https://github.com/m-labs/lm32.git | ||
[submodule "extcores/mor1kx/submodule"] | ||
path = extcores/mor1kx/submodule | ||
url = https://github.com/openrisc/mor1kx.git | ||
[submodule "software/compiler-rt"] | ||
path = software/compiler-rt | ||
[submodule "misoc/cores/mor1kx/verilog"] | ||
path = misoc/cores/mor1kx/verilog | ||
url = https://github.com/openrisc/mor1kx.git | ||
[submodule "misoc/software/compiler_rt"] | ||
path = misoc/software/compiler_rt | ||
url = http://llvm.org/git/compiler-rt.git | ||
[submodule "software/unwinder"] | ||
path = software/unwinder | ||
[submodule "misoc/software/unwinder"] | ||
path = misoc/software/unwinder | ||
url = https://github.com/whitequark/libunwind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
language: python | ||
python: | ||
- "3.5" | ||
|
||
env: | ||
global: | ||
- PATH=$HOME/miniconda/bin:$PATH | ||
|
||
before_install: | ||
# Install Miniconda | ||
- wget https://raw.githubusercontent.com/m-labs/artiq/master/.travis/get-anaconda.sh | ||
- chmod +x get-anaconda.sh | ||
- ./get-anaconda.sh | ||
- source $HOME/miniconda/bin/activate py35 | ||
- conda install anaconda-client | ||
install: | ||
# workaround for https://github.com/conda/conda-build/issues/466 | ||
- "mkdir -p /home/travis/miniconda/conda-bld/linux-64" | ||
- "conda index /home/travis/miniconda/conda-bld/linux-64" | ||
- "conda build --python 3.5 conda/misoc" | ||
- "conda install $(conda build --output --python 3.5 conda/misoc)" | ||
script: | ||
- true | ||
|
||
after_success: | ||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then anaconda login --hostname $(hostname) --username $binstar_login --password $binstar_password; fi | ||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then anaconda upload --user $binstar_login --channel dev --force $HOME/miniconda/conda-bld/noarch/misoc-*.tar.bz2; fi | ||
|
||
notifications: | ||
email: false | ||
irc: | ||
channels: | ||
- chat.freenode.net#m-labs | ||
template: | ||
- "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" | ||
- "Build details : %{build_url}" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
graft misoc/software | ||
graft misoc/cores/lm32/verilog | ||
graft misoc/cores/mor1kx/verilog | ||
include misoc/cores/mxcrg.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
%PYTHON% setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package: | ||
name: misoc | ||
version: {{ environ.get("GIT_DESCRIBE_TAG", "") }} | ||
|
||
source: | ||
git_url: https://github.com/m-labs/misoc | ||
git_tag: new | ||
|
||
build: | ||
noarch_python: true | ||
number: {{ environ.get("GIT_DESCRIBE_NUMBER", 0) }} | ||
string: py_{{ environ.get("GIT_DESCRIBE_NUMBER", 0) }}+git{{ environ.get("GIT_DESCRIBE_HASH", "")[1:] }} | ||
script: $PYTHON setup.py install | ||
|
||
requirements: | ||
build: | ||
- migen | ||
- python | ||
run: | ||
- migen | ||
- python | ||
|
||
about: | ||
home: http://m-labs.hk/gateware.html | ||
license: 3-clause BSD | ||
summary: 'A high performance and small footprint SoC based on Migen' |
Empty file.
Submodule submodule
deleted from
95fc8e
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.dvi_sampler.core import DVISampler |
7 changes: 3 additions & 4 deletions
7
misoclib/video/dvisampler/analysis.py → misoc/cores/dvi_sampler/analysis.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
misoclib/video/dvisampler/clocking.py → misoc/cores/dvi_sampler/clocking.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
22 changes: 11 additions & 11 deletions
22
misoclib/video/dvisampler/__init__.py → misoc/cores/dvi_sampler/core.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
misoclib/video/dvisampler/datacapture.py → misoc/cores/dvi_sampler/datacapture.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
misoclib/video/dvisampler/debug.py → misoc/cores/dvi_sampler/debug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
misoclib/video/dvisampler/decoding.py → misoc/cores/dvi_sampler/decoding.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
misoclib/video/dvisampler/dma.py → misoc/cores/dvi_sampler/dma.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
misoclib/video/dvisampler/edid.py → misoc/cores/dvi_sampler/edid.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.framebuffer.core import Framebuffer |
8 changes: 4 additions & 4 deletions
8
misoclib/video/framebuffer/__init__.py → misoc/cores/framebuffer/core.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
misoclib/video/framebuffer/format.py → misoc/cores/framebuffer/format.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
misoclib/video/framebuffer/phy.py → misoc/cores/framebuffer/phy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from migen import * | ||
|
||
from misoc.interconnect.csr import * | ||
|
||
|
||
class Identifier(Module, AutoCSR): | ||
def __init__(self, sysid, frequency, revision=None): | ||
self._sysid = CSRStatus(16) | ||
self._frequency = CSRStatus(32) | ||
|
||
### | ||
|
||
self.comb += [ | ||
self._sysid.status.eq(sysid), | ||
self._frequency.status.eq(frequency) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.lasmicon.core import ControllerSettings, LASMIcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
misoclib/mem/sdram/core/lasmicon/perf.py → misoc/cores/lasmicon/perf.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.cores.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")) | ||
) |
8 changes: 4 additions & 4 deletions
8
misoclib/mem/sdram/test/bankmachine_tb.py → misoc/cores/lasmicon/test_bankmachine.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
misoclib/mem/sdram/test/common.py → misoc/cores/lasmicon/test_common.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
misoclib/mem/sdram/test/lasmicon_df_tb.py → misoc/cores/lasmicon/test_df.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
misoclib/mem/sdram/test/lasmicon_tb.py → misoc/cores/lasmicon/test_lasmi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
misoclib/mem/sdram/test/refresher.py → misoc/cores/lasmicon/test_refresher.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
misoclib/mem/sdram/test/lasmicon_wb.py → misoc/cores/lasmicon/test_wb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
misoclib/com/liteethmini/mac/__init__.py → misoc/cores/liteeth_mini/mac/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
misoclib/com/liteethmini/mac/core/last_be.py → misoc/cores/liteeth_mini/mac/core/last_be.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...clib/com/liteethmini/mac/core/preamble.py → ...c/cores/liteeth_mini/mac/core/preamble.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
.../com/liteethmini/mac/frontend/wishbone.py → ...res/liteeth_mini/mac/frontend/wishbone.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
misoclib/com/liteethmini/phy/__init__.py → misoc/cores/liteeth_mini/phy/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
from misoclib.com.liteethmini.common import * | ||
from misoc.cores.liteeth_mini.common import * | ||
|
||
|
||
def LiteEthPHY(clock_pads, pads, clk_freq=None, **kwargs): | ||
# Autodetect PHY | ||
if hasattr(pads, "source_stb"): | ||
# This is a simulation PHY | ||
from misoclib.com.liteethmini.phy.sim import LiteEthPHYSim | ||
return LiteEthPHYSim(pads) | ||
elif hasattr(clock_pads, "gtx") and flen(pads.tx_data) == 8: | ||
if hasattr(clock_pads, "gtx") and len(pads.tx_data) == 8: | ||
if hasattr(clock_pads, "tx"): | ||
# This is a 10/100/1G PHY | ||
from misoclib.com.liteethmini.phy.gmii_mii import LiteEthPHYGMIIMII | ||
from misoc.cores.liteeth_mini.phy.gmii_mii import LiteEthPHYGMIIMII | ||
return LiteEthPHYGMIIMII(clock_pads, pads, clk_freq=clk_freq, **kwargs) | ||
else: | ||
# This is a pure 1G PHY | ||
from misoclib.com.liteethmini.phy.gmii import LiteEthPHYGMII | ||
from misoc.cores.liteeth_mini.phy.gmii import LiteEthPHYGMII | ||
return LiteEthPHYGMII(clock_pads, pads, **kwargs) | ||
elif hasattr(pads, "rx_ctl"): | ||
# This is a 10/100/1G RGMII PHY | ||
raise ValueError("RGMII PHYs are specific to vendors (for now), use direct instantiation") | ||
elif flen(pads.tx_data) == 4: | ||
elif len(pads.tx_data) == 4: | ||
# This is a MII PHY | ||
from misoclib.com.liteethmini.phy.mii import LiteEthPHYMII | ||
from misoc.cores.liteeth_mini.phy.mii import LiteEthPHYMII | ||
return LiteEthPHYMII(clock_pads, pads, **kwargs) | ||
else: | ||
raise ValueError("Unable to autodetect PHY from platform file, use direct instantiation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.lm32.core import LM32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.minicon.core import Minicon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.mor1kx.core import MOR1KX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 3 additions & 2 deletions
5
misoclib/mem/flash/norflash16.py → misoc/cores/nor_flash_16.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from misoc.cores.sdram_phy.gensdrphy import GENSDRPHY | ||
from misoc.cores.sdram_phy.s6ddrphy import S6HalfRateDDRPHY, S6QuarterRateDDRPHY | ||
from misoc.cores.sdram_phy.k7ddrphy import K7DDRPHY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.spi.core import SPIMaster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
misoclib/com/spi/test/spi_master_tb.py → misoc/cores/spi/test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from misoc.cores.uart.core import UART, RS232PHY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from misoc.integration.soc_core import SoCCore | ||
from misoc.integration.soc_sdram import SoCSDRAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
import os | ||
import subprocess | ||
import struct | ||
|
||
from misoc.integration import cpu_interface, soc_sdram, sdram_init | ||
|
||
|
||
__all__ = ["misoc_software_packages", "misoc_directory", | ||
"Builder", "builder_args", "builder_argdict"] | ||
|
||
|
||
# in build order (for dependencies) | ||
misoc_software_packages = [ | ||
"libbase", | ||
"libcompiler_rt", | ||
"libdyld", | ||
"libnet", | ||
"libunwind", | ||
"bios" | ||
] | ||
|
||
|
||
misoc_directory = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | ||
|
||
|
||
def _makefile_escape(s): | ||
return s.replace("\\", "\\\\") | ||
|
||
|
||
class Builder: | ||
def __init__(self, soc, output_dir=None, | ||
compile_software=True, compile_gateware=True, | ||
gateware_toolchain_path=None, | ||
csr_csv=None): | ||
self.soc = soc | ||
if output_dir is None: | ||
output_dir = "misoc_{}_{}".format( | ||
soc.__class__.__name__.lower(), | ||
soc.platform.name) | ||
# From Python doc: makedirs() will become confused if the path | ||
# elements to create include '..' | ||
self.output_dir = os.path.abspath(output_dir) | ||
self.compile_software = compile_software | ||
self.compile_gateware = compile_gateware | ||
self.gateware_toolchain_path = gateware_toolchain_path | ||
self.csr_csv = csr_csv | ||
|
||
self.software_packages = [] | ||
for name in misoc_software_packages: | ||
self.add_software_package( | ||
name, os.path.join(misoc_directory, "software", name)) | ||
|
||
def add_software_package(self, name, src_dir): | ||
self.software_packages.append((name, src_dir)) | ||
|
||
def _generate_includes(self): | ||
cpu_type = self.soc.cpu_type | ||
memory_regions = self.soc.get_memory_regions() | ||
flash_boot_address = getattr(self.soc, "flash_boot_address", None) | ||
csr_regions = self.soc.get_csr_regions() | ||
constants = self.soc.get_constants() | ||
if isinstance(self.soc, soc_sdram.SoCSDRAM) and self.soc._sdram_phy: | ||
sdram_phy_settings = self.soc._sdram_phy[0].settings | ||
else: | ||
sdram_phy_settings = None | ||
|
||
buildinc_dir = os.path.join(self.output_dir, "software", "include") | ||
generated_dir = os.path.join(buildinc_dir, "generated") | ||
os.makedirs(generated_dir, exist_ok=True) | ||
with open(os.path.join(generated_dir, "variables.mak"), "w") as f: | ||
def define(k, v): | ||
f.write("{}={}\n".format(k, _makefile_escape(v))) | ||
for k, v in cpu_interface.get_cpu_mak(cpu_type): | ||
define(k, v) | ||
define("MISOC_DIRECTORY", misoc_directory) | ||
define("BUILDINC_DIRECTORY", buildinc_dir) | ||
for name, src_dir in self.software_packages: | ||
define(name.upper() + "_DIRECTORY", src_dir) | ||
|
||
with open(os.path.join(generated_dir, "output_format.ld"), "w") as f: | ||
f.write(cpu_interface.get_linker_output_format(cpu_type)) | ||
with open(os.path.join(generated_dir, "regions.ld"), "w") as f: | ||
f.write(cpu_interface.get_linker_regions(memory_regions)) | ||
|
||
with open(os.path.join(generated_dir, "mem.h"), "w") as f: | ||
f.write(cpu_interface.get_mem_header(memory_regions, flash_boot_address)) | ||
with open(os.path.join(generated_dir, "csr.h"), "w") as f: | ||
f.write(cpu_interface.get_csr_header(csr_regions, constants)) | ||
|
||
if sdram_phy_settings is not None: | ||
with open(os.path.join(generated_dir, "sdram_phy.h"), "w") as f: | ||
f.write(sdram_init.get_sdram_phy_header(sdram_phy_settings)) | ||
|
||
if self.csr_csv is not None: | ||
with open(self.csr_csv, "w") as f: | ||
f.write(cpu_interface.get_csr_csv(csr_regions)) | ||
|
||
def _generate_software(self): | ||
for name, src_dir in self.software_packages: | ||
dst_dir = os.path.join(self.output_dir, "software", name) | ||
os.makedirs(dst_dir, exist_ok=True) | ||
src = os.path.join(src_dir, "Makefile") | ||
dst = os.path.join(dst_dir, "Makefile") | ||
try: | ||
os.remove(dst) | ||
except FileNotFoundError: | ||
pass | ||
os.symlink(src, dst) | ||
if self.compile_software: | ||
subprocess.check_call(["make", "-C", dst_dir]) | ||
|
||
def _initialize_rom(self): | ||
bios_file = os.path.join(self.output_dir, "software", "bios", | ||
"bios.bin") | ||
if self.soc.integrated_rom_size: | ||
with open(bios_file, "rb") as boot_file: | ||
boot_data = [] | ||
while True: | ||
w = boot_file.read(4) | ||
if not w: | ||
break | ||
boot_data.append(struct.unpack(">I", w)[0]) | ||
self.soc.initialize_rom(boot_data) | ||
|
||
def build(self): | ||
self.soc.finalize() | ||
|
||
if self.soc.integrated_rom_size and not self.compile_software: | ||
raise ValueError("Software must be compiled in order to " | ||
"intitialize integrated ROM") | ||
|
||
self._generate_includes() | ||
self._generate_software() | ||
self._initialize_rom() | ||
if self.gateware_toolchain_path is None: | ||
kwargs = dict() | ||
else: | ||
kwargs = {"toolchain_path": self.gateware_toolchain_path} | ||
self.soc.build(build_dir=os.path.join(self.output_dir, "gateware"), | ||
run=self.compile_gateware, **kwargs) | ||
|
||
|
||
def builder_args(parser): | ||
parser.add_argument("--output-dir", default=None, | ||
help="output directory for generated " | ||
"source files and binaries") | ||
parser.add_argument("--no-compile-software", action="store_true", | ||
help="do not compile the software, only generate " | ||
"build infrastructure") | ||
parser.add_argument("--no-compile-gateware", action="store_true", | ||
help="do not compile the gateware, only generate " | ||
"HDL source files and build scripts") | ||
parser.add_argument("--gateware-toolchain-path", default=None, | ||
help="set gateware toolchain (ISE, Quartus, etc.) " | ||
"installation path") | ||
parser.add_argument("--csr-csv", default=None, | ||
help="store CSR map in CSV format into the " | ||
"specified file") | ||
|
||
|
||
def builder_argdict(args): | ||
return { | ||
"output_dir": args.output_dir, | ||
"compile_software": not args.no_compile_software, | ||
"compile_gateware": not args.no_compile_gateware, | ||
"gateware_toolchain_path": args.gateware_toolchain_path, | ||
"csr_csv": args.csr_csv | ||
} |
20 changes: 13 additions & 7 deletions
20
misoclib/soc/cpuif.py → misoc/integration/cpu_interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
misoclib/mem/sdram/phy/initsequence.py → misoc/integration/sdram_init.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from migen.fhdl.std import log2_int | ||
from migen import log2_int | ||
|
||
|
||
def get_sdram_phy_header(sdram_phy_settings): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
from migen import * | ||
from migen.genlib.record import * | ||
|
||
from misoc.interconnect import wishbone, wishbone2lasmi, lasmi_bus | ||
from misoc.interconnect.csr import AutoCSR | ||
from misoc.cores import dfii, minicon, lasmicon | ||
from misoc.integration.soc_core import * | ||
|
||
|
||
__all__ = ["SoCSDRAM", "soc_sdram_args", "soc_sdram_argdict"] | ||
|
||
|
||
class ControllerInjector(Module, AutoCSR): | ||
def __init__(self, phy, controller_type, geom_settings, timing_settings): | ||
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) | ||
|
||
if controller_type == "lasmicon": | ||
self.submodules.controller = controller = lasmicon.LASMIcon(phy.settings, | ||
geom_settings, | ||
timing_settings) | ||
self.comb += Record.connect(controller.dfi, self.dfii.slave) | ||
|
||
self.submodules.crossbar = lasmi_bus.LASMIxbar([controller.lasmic], | ||
controller.nrowbits) | ||
elif controller_type == "minicon": | ||
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, | ||
"l2_cache": 9 | ||
} | ||
csr_map.update(SoCCore.csr_map) | ||
|
||
def __init__(self, platform, clk_freq, l2_size=8192, **kwargs): | ||
SoCCore.__init__(self, platform, clk_freq, **kwargs) | ||
self.l2_size = l2_size | ||
|
||
self._sdram_phy = [] | ||
self._wb_sdram_ifs = [] | ||
self._wb_sdram = wishbone.Interface() | ||
|
||
def add_wb_sdram_if(self, interface): | ||
if self.finalized: | ||
raise FinalizeError | ||
self._wb_sdram_ifs.append(interface) | ||
|
||
def register_sdram(self, phy, sdram_controller_type, geom_settings, timing_settings): | ||
assert not self._sdram_phy | ||
self._sdram_phy.append(phy) # encapsulate in list to prevent CSR scanning | ||
|
||
self.submodules.sdram = ControllerInjector( | ||
phy, sdram_controller_type, geom_settings, timing_settings) | ||
|
||
dfi_databits_divisor = 1 if phy.settings.memtype == "SDR" else 2 | ||
sdram_width = phy.settings.dfi_databits//dfi_databits_divisor | ||
main_ram_size = 2**(geom_settings.bankbits + | ||
geom_settings.rowbits + | ||
geom_settings.colbits)*sdram_width//8 | ||
# XXX: Limit main_ram_size to 256MB, we should modify mem_map to allow larger memories. | ||
main_ram_size = min(main_ram_size, 256*1024*1024) | ||
if self.l2_size: | ||
self.add_constant("L2_SIZE", self.l2_size) | ||
|
||
# add a Wishbone interface to the DRAM | ||
wb_sdram = wishbone.Interface() | ||
self.add_wb_sdram_if(wb_sdram) | ||
self.register_mem("main_ram", self.mem_map["main_ram"], wb_sdram, main_ram_size) | ||
|
||
if sdram_controller_type == "lasmicon": | ||
if self.l2_size: | ||
lasmim = self.sdram.crossbar.get_master() | ||
l2_cache = wishbone.Cache(self.l2_size//4, self._wb_sdram, wishbone.Interface(lasmim.dw)) | ||
# XXX Vivado ->2015.1 workaround, Vivado is not able to map correctly our L2 cache. | ||
# Issue is reported to Xilinx and should be fixed in next releases (2015.2?). | ||
# Remove this workaround when fixed by Xilinx. | ||
from migen.build.xilinx.vivado import XilinxVivadoToolchain | ||
if isinstance(self.platform.toolchain, XilinxVivadoToolchain): | ||
from migen.fhdl.simplify import FullMemoryWE | ||
self.submodules.l2_cache = FullMemoryWE()(l2_cache) | ||
else: | ||
self.submodules.l2_cache = l2_cache | ||
self.submodules.wishbone2lasmi = wishbone2lasmi.WB2LASMI(self.l2_cache.slave, lasmim) | ||
elif sdram_controller_type == "minicon": | ||
if self.l2_size: | ||
l2_cache = wishbone.Cache(self.l2_size//4, self._wb_sdram, self.sdram.controller.bus) | ||
# XXX Vivado ->2015.1 workaround, Vivado is not able to map correctly our L2 cache. | ||
# Issue is reported to Xilinx and should be fixed in next releases (2015.2?). | ||
# Remove this workaround when fixed by Xilinx. | ||
from migen.build.xilinx.vivado import XilinxVivadoToolchain | ||
if isinstance(self.platform.toolchain, XilinxVivadoToolchain): | ||
from migen.fhdl.simplify import FullMemoryWE | ||
self.submodules.l2_cache = FullMemoryWE()(l2_cache) | ||
else: | ||
self.submodules.l2_cache = l2_cache | ||
else: | ||
self.submodules.converter = wishbone.Converter(self._wb_sdram, self.sdram.controller.bus) | ||
else: | ||
raise ValueError | ||
|
||
def do_finalize(self): | ||
if not self.integrated_main_ram_size: | ||
if not self._sdram_phy: | ||
raise FinalizeError("Need to call SDRAMSoC.register_sdram()") | ||
|
||
# arbitrate wishbone interfaces to the DRAM | ||
self.submodules.wb_sdram_con = wishbone.Arbiter(self._wb_sdram_ifs, | ||
self._wb_sdram) | ||
SoCCore.do_finalize(self) | ||
|
||
|
||
soc_sdram_args = soc_core_args | ||
soc_sdram_argdict = soc_core_argdict |
File renamed without changes.
Oops, something went wrong.