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/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 73fed53c09a0
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d0f500301c1
Choose a head ref
  • 7 commits
  • 88 files changed
  • 1 contributor

Commits on Nov 3, 2015

  1. Copy the full SHA
    644a410 View commit details
  2. Copy the full SHA
    e26147b View commit details

Commits on Nov 4, 2015

  1. Copy the full SHA
    3404a65 View commit details
  2. Copy the full SHA
    087c2fd View commit details
  3. Copy the full SHA
    38740a4 View commit details
  4. Copy the full SHA
    6490699 View commit details
  5. Copy the full SHA
    4d0f500 View commit details
Showing with 402 additions and 359 deletions.
  1. +0 −1 .gitignore
  2. +2 −2 .gitmodules
  3. +0 −1 .travis.yml
  4. +0 −4 .travis/get-misoc.sh
  5. +3 −3 .travis/get-xilinx.sh
  6. +16 −21 artiq/frontend/artiq_flash.sh
  7. +3 −6 artiq/frontend/artiq_gui.py
  8. +10 −2 artiq/frontend/thorlabs_tcube_controller.py
  9. +21 −30 artiq/gateware/ad9xxx.py
  10. +7 −9 artiq/gateware/amp/kernel_cpu.py
  11. +2 −2 artiq/gateware/amp/mailbox.py
  12. +1 −1 artiq/gateware/nist_qc1.py
  13. +1 −1 artiq/gateware/nist_qc2.py
  14. +38 −22 artiq/gateware/rtio/core.py
  15. +5 −5 artiq/gateware/rtio/moninj.py
  16. +9 −9 artiq/gateware/rtio/phy/dds.py
  17. +1 −1 artiq/gateware/rtio/phy/ttl_serdes_7series.py
  18. +5 −5 artiq/gateware/rtio/phy/ttl_serdes_generic.py
  19. +1 −1 artiq/gateware/rtio/phy/ttl_serdes_spartan6.py
  20. +1 −1 artiq/gateware/rtio/phy/ttl_simple.py
  21. +5 −5 artiq/gateware/rtio/phy/wishbone.py
  22. +2 −2 artiq/gateware/rtio/rtlink.py
  23. +3 −3 artiq/gateware/soc.py
  24. +61 −19 soc/targets/artiq_kc705.py → artiq/gateware/targets/kc705.py
  25. +36 −12 soc/targets/artiq_pipistrello.py → artiq/gateware/targets/pipistrello.py
  26. +67 −0 artiq/runtime/Makefile
  27. 0 {soc → artiq}/runtime/bridge.c
  28. 0 {soc → artiq}/runtime/bridge.h
  29. 0 {soc → artiq}/runtime/bridge_ctl.c
  30. 0 {soc → artiq}/runtime/bridge_ctl.h
  31. 0 {soc → artiq}/runtime/clock.c
  32. 0 {soc → artiq}/runtime/clock.h
  33. 0 {soc → artiq}/runtime/dds.c
  34. 0 {soc → artiq}/runtime/dds.h
  35. 0 {soc → artiq}/runtime/elf_loader.c
  36. 0 {soc → artiq}/runtime/elf_loader.h
  37. 0 {soc → artiq}/runtime/exception_jmp.S
  38. 0 {soc → artiq}/runtime/exceptions.c
  39. 0 {soc → artiq}/runtime/exceptions.h
  40. 0 {soc → artiq}/runtime/flash_storage.c
  41. 0 {soc → artiq}/runtime/flash_storage.h
  42. 0 {soc → artiq}/runtime/gen_service_table.py
  43. 0 {soc → artiq}/runtime/isr.c
  44. 0 {soc → artiq}/runtime/kloader.c
  45. 0 {soc → artiq}/runtime/kloader.h
  46. 0 {soc → artiq}/runtime/ksupport.c
  47. 0 {soc → artiq}/runtime/ksupport.ld
  48. +66 −0 artiq/runtime/liblwip/Makefile
  49. 0 {soc → artiq}/runtime/liblwip/arch/cc.h
  50. 0 {soc → artiq}/runtime/liblwip/arch/perf.h
  51. 0 {soc → artiq}/runtime/liblwip/arch/sys_arch.h
  52. +1 −1 {soc/runtime/liblwip/netif → artiq/runtime/liblwip}/liteethif.c
  53. 0 {soc/runtime/liblwip/netif → artiq/runtime/liblwip}/liteethif.h
  54. 0 {soc → artiq}/runtime/liblwip/lwipopts.h
  55. 0 {soc → artiq}/runtime/linker.ld
  56. 0 {soc → artiq}/runtime/log.c
  57. 0 {soc → artiq}/runtime/log.h
  58. 0 {soc → artiq}/runtime/lwip
  59. 0 {soc → artiq}/runtime/mailbox.c
  60. 0 {soc → artiq}/runtime/mailbox.h
  61. +2 −2 {soc → artiq}/runtime/main.c
  62. 0 {soc → artiq}/runtime/messages.h
  63. 0 {soc → artiq}/runtime/moninj.c
  64. 0 {soc → artiq}/runtime/moninj.h
  65. +2 −2 {soc → artiq}/runtime/net_server.c
  66. 0 {soc → artiq}/runtime/net_server.h
  67. 0 {soc → artiq}/runtime/rtio.c
  68. 0 {soc → artiq}/runtime/rtio.h
  69. 0 {soc → artiq}/runtime/rtiocrg.c
  70. 0 {soc → artiq}/runtime/rtiocrg.h
  71. +1 −1 {soc → artiq}/runtime/services.c
  72. 0 {soc → artiq}/runtime/services.h
  73. +1 −0 {soc → artiq}/runtime/session.c
  74. 0 {soc → artiq}/runtime/session.h
  75. 0 {soc → artiq}/runtime/test_mode.c
  76. 0 {soc → artiq}/runtime/test_mode.h
  77. 0 {soc → artiq}/runtime/ttl.c
  78. 0 {soc → artiq}/runtime/ttl.h
  79. +3 −1 artiq/tools.py
  80. +7 −18 conda/artiq-kc705-nist_qc1/build.sh
  81. +2 −1 conda/artiq-kc705-nist_qc1/meta.yaml
  82. +7 −18 conda/artiq-kc705-nist_qc2/build.sh
  83. +2 −1 conda/artiq-kc705-nist_qc2/meta.yaml
  84. +6 −17 conda/artiq-pipistrello-nist_qc1/build.sh
  85. +2 −1 conda/artiq-pipistrello-nist_qc1/meta.yaml
  86. +0 −1 conda/artiq/meta.yaml
  87. +0 −72 soc/runtime/Makefile
  88. +0 −55 soc/runtime/liblwip/Makefile
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ __pycache__
*.bin
*.elf
*.fbi
soc/runtime/service_table.h
doc/manual/_build
/build
/dist
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "soc/runtime/lwip"]
path = soc/runtime/lwip
[submodule "artiq/runtime/lwip"]
path = artiq/runtime/lwip
url = git://git.savannah.nongnu.org/lwip.git
ignore = untracked
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ install:
- if [ $TRAVIS_PULL_REQUEST != false ]; then BUILD_SOC=none; fi
- if [ $BUILD_SOC != none ]; then ./.travis/get-xilinx.sh; fi
- if [ $BUILD_SOC != none ]; then ./.travis/get-toolchain.sh; fi
- if [ $BUILD_SOC != none ]; then ./.travis/get-misoc.sh; fi
- . ./.travis/get-anaconda.sh
- source $HOME/miniconda/bin/activate py35
- conda install -q pip coverage anaconda-client cython
4 changes: 0 additions & 4 deletions .travis/get-misoc.sh

This file was deleted.

6 changes: 3 additions & 3 deletions .travis/get-xilinx.sh
Original file line number Diff line number Diff line change
@@ -26,13 +26,13 @@ echo "$secret" | gpg --passphrase-fd 0 Xilinx.lic.gpg
mkdir -p ~/.Xilinx
mv Xilinx.lic ~/.Xilinx/Xilinx.lic

git clone https://github.com/fallen/impersonate_macaddress
git clone https://github.com/m-labs/impersonate_macaddress
make -C impersonate_macaddress
# Tell mibuild where Xilinx toolchains are installed
# and feed it the mac address corresponding to the license
cat >> $HOME/.m-labs/build_settings.sh << EOF
MISOC_EXTRA_VIVADO_CMDLINE="-Ob vivado_path $HOME/Xilinx/Vivado"
MISOC_EXTRA_ISE_CMDLINE="-Ob ise_path $HOME/opt/Xilinx/"
MISOC_EXTRA_ISE_CMDLINE="--gateware-toolchain-path $HOME/opt/Xilinx/"
MISOC_EXTRA_VIVADO_CMDLINE="--gateware-toolchain-path $HOME/Xilinx/Vivado"
export MACADDR=$macaddress
export LD_PRELOAD=$PWD/impersonate_macaddress/impersonate_macaddress.so
EOF
37 changes: 16 additions & 21 deletions artiq/frontend/artiq_flash.sh
Original file line number Diff line number Diff line change
@@ -11,17 +11,14 @@ def run(script):
file.close()

run("""
# exit on error
set -e
# print commands
#set -x
ARTIQ_PREFIX=$(python3 -c "import artiq; print(artiq.__path__[0])")
# Default is kc705
BOARD=kc705
# Default mezzanine board is nist_qc1
MEZZANINE_BOARD=nist_qc1
# Default hardware adapter is qc1
HARDWARE_ADAPTER=qc1
while getopts "bBrht:d:f:m:" opt
do
@@ -67,14 +64,14 @@ do
fi
;;
m)
if [ "$OPTARG" == "nist_qc1" ]
if [ "$OPTARG" == "qc1" ]
then
MEZZANINE_BOARD=nist_qc1
elif [ "$OPTARG" == "nist_qc2" ]
HARDWARE_ADAPTER=qc1
elif [ "$OPTARG" == "qc2" ]
then
MEZZANINE_BOARD=nist_qc2
HARDWARE_ADAPTER=qc2
else
echo "KC705 mezzanine board is either nist_qc1 or nist_qc2"
echo "Hardware adapter should be qc1 or qc2"
exit 1
fi
;;
@@ -88,8 +85,8 @@ do
echo "-B Flash BIOS"
echo "-r Flash ARTIQ runtime"
echo "-h Show this help message"
echo "-t Target (kc705, pipistrello, default is: kc705)"
echo "-m Mezzanine board (nist_qc1, nist_qc2, default is: nist_qc1)"
echo "-t Target (kc705/pipistrello, default: kc705)"
echo "-m Hardware adapter (qc1/qc2, default: qc1)"
echo "-f Flash storage image generated with artiq_mkfs"
echo "-d Directory containing the binaries to be flashed"
exit 1
@@ -129,30 +126,28 @@ fi
if [ "$BOARD" == "kc705" ]
then
UDEV_RULES=99-kc705.rules
BITSTREAM=artiq_kc705-${MEZZANINE_BOARD}-kc705.bit
CABLE=jtaghs1_fast
PROXY=bscan_spi_kc705.bit
BIOS_ADDR=0xaf0000
RUNTIME_ADDR=0xb00000
RUNTIME_FILE=runtime.fbi
FS_ADDR=0xb40000
if [ -z "$BIN_PREFIX" ]
then
RUNTIME_FILE=${MEZZANINE_BOARD}/runtime.fbi
BIN_PREFIX=$ARTIQ_PREFIX/binaries/kc705
BIN_PREFIX=$ARTIQ_PREFIX/binaries/kc705-$HARDWARE_ADAPTER
fi
search_for_proxy $PROXY
elif [ "$BOARD" == "pipistrello" ]
then
UDEV_RULES=99-papilio.rules
BITSTREAM=artiq_pipistrello-nist_qc1-pipistrello.bit
CABLE=papilio
PROXY=bscan_spi_lx45_csg324.bit
BIOS_ADDR=0x170000
RUNTIME_ADDR=0x180000
RUNTIME_FILE=runtime.fbi
FS_ADDR=0x1c0000
if [ -z "$BIN_PREFIX" ]; then BIN_PREFIX=$ARTIQ_PREFIX/binaries/pipistrello; fi
if [ -z "$BIN_PREFIX" ];
then
BIN_PREFIX=$ARTIQ_PREFIX/binaries/pipistrello-$HARDWARE_ADAPTER
fi
search_for_proxy $PROXY
fi
@@ -195,7 +190,7 @@ fi
if [ "${FLASH_BITSTREAM}" == "1" ]
then
echo "Flashing FPGA bitstream..."
xc3sprog -v -c $CABLE -I$PROXY_PATH/$PROXY $BIN_PREFIX/$BITSTREAM:w:0x0:BIT
xc3sprog -v -c $CABLE -I$PROXY_PATH/$PROXY $BIN_PREFIX/top.bit:w:0x0:BIT
fi
if [ "${FLASH_BIOS}" == "1" ]
@@ -207,7 +202,7 @@ fi
if [ "${FLASH_RUNTIME}" == "1" ]
then
echo "Flashing ARTIQ runtime..."
xc3sprog -v -c $CABLE -I$PROXY_PATH/$PROXY $BIN_PREFIX/${RUNTIME_FILE}:w:$RUNTIME_ADDR:BIN
xc3sprog -v -c $CABLE -I$PROXY_PATH/$PROXY $BIN_PREFIX/runtime.fbi:w:$RUNTIME_ADDR:BIN
fi
echo "Done."
xc3sprog -v -c $CABLE -R > /dev/null 2>&1
9 changes: 3 additions & 6 deletions artiq/frontend/artiq_gui.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from quamash import QEventLoop, QtGui, QtCore
from pyqtgraph import dockarea

from artiq.tools import verbosity_args, init_logger
from artiq.tools import verbosity_args, init_logger, artiq_dir
from artiq.protocols.pc_rpc import AsyncioClient
from artiq.gui.state import StateManager
from artiq.gui.explorer import ExplorerDock
@@ -21,10 +21,6 @@
from artiq.gui.console import ConsoleDock


data_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)),
"..", "gui")


def get_argparser():
parser = argparse.ArgumentParser(description="ARTIQ GUI client")
parser.add_argument(
@@ -46,7 +42,8 @@ def get_argparser():
class MainWindow(QtGui.QMainWindow):
def __init__(self, app, server):
QtGui.QMainWindow.__init__(self)
self.setWindowIcon(QtGui.QIcon(os.path.join(data_dir, "icon.png")))
icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "icon.png"))
self.setWindowIcon(icon)
self.setWindowTitle("ARTIQ - {}".format(server))
self.exit_request = asyncio.Event()

12 changes: 10 additions & 2 deletions artiq/frontend/thorlabs_tcube_controller.py
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
def get_argparser():
parser = argparse.ArgumentParser()
parser.add_argument("-P", "--product", required=True,
help="type of the Thorlabs T-Cube device to control",
choices=["tdc001", "tpz001"])
help="type of the Thorlabs T-Cube device to control: "
"tdc001/tpz001")
parser.add_argument("-d", "--device", default=None,
help="serial device. See documentation for how to "
"specify a USB Serial Number.")
@@ -39,11 +39,19 @@ def main():
dev = TdcSim()
elif product == "tpz001":
dev = TpzSim()
else:
print("Invalid product string (-P/--product), "
"choose from tdc001 or tpz001")
sys.exit(1)
else:
if product == "tdc001":
dev = Tdc(args.device)
elif product == "tpz001":
dev = Tpz(args.device)
else:
print("Invalid product string (-P/--product), "
"choose from tdc001 or tpz001")
sys.exit(1)

try:
simple_server_loop({product: dev}, args.bind, args.port)
51 changes: 21 additions & 30 deletions artiq/gateware/ad9xxx.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
from migen.fhdl.std import *
from migen import *
from migen.genlib.fsm import *
from migen.genlib.misc import WaitTimer
from migen.bus import wishbone
from migen.bus.transactions import *
from migen.sim.generic import run_simulation
from misoc.interconnect import wishbone


class AD9xxx(Module):
"""Wishbone interface to the AD9858 and AD9914 DDS chips.
Addresses 0-2**flen(pads.a)-1 map the AD9xxx registers.
Addresses 0-2**len(pads.a)-1 map the AD9xxx registers.
Write to address 2**flen(pads.a) to pulse the FUD signal.
Address 2**flen(pads.a)+1 is a GPIO register that controls the
Write to address 2**len(pads.a) to pulse the FUD signal.
Address 2**len(pads.a)+1 is a GPIO register that controls the
sel and reset signals. rst is mapped to bit 0, followed by sel.
Write timing:
@@ -38,15 +36,15 @@ def __init__(self, pads,
read_wait_cycles=10, hiz_wait_cycles=3,
bus=None):
if bus is None:
bus = wishbone.Interface(data_width=flen(pads.d))
bus = wishbone.Interface(data_width=len(pads.d))
self.bus = bus

# # #

dts = TSTriple(flen(pads.d))
dts = TSTriple(len(pads.d))
self.specials += dts.get_tristate(pads.d)
hold_address = Signal()
dr = Signal(flen(pads.d))
dr = Signal(len(pads.d))
rx = Signal()
self.sync += [
If(~hold_address, pads.a.eq(bus.adr)),
@@ -56,9 +54,9 @@ def __init__(self, pads,
]

if hasattr(pads, "sel"):
sel_len = flen(pads.sel)
sel_len = len(pads.sel)
else:
sel_len = flen(pads.sel_n)
sel_len = len(pads.sel_n)
gpio = Signal(sel_len + 1)
gpio_load = Signal()
self.sync += If(gpio_load, gpio.eq(bus.dat_w))
@@ -98,7 +96,7 @@ def __init__(self, pads,

fsm.act("IDLE",
If(bus.cyc & bus.stb,
If(bus.adr[flen(pads.a)],
If(bus.adr[len(pads.a)],
If(bus.adr[0],
NextState("GPIO")
).Else(
@@ -157,20 +155,20 @@ def __init__(self, pads,
)


def _test_gen():
def _test_gen(bus):
# Test external bus writes
yield TWrite(4, 2)
yield TWrite(5, 3)
yield from bus.write(4, 2)
yield from bus.write(5, 3)
yield
# Test external bus reads
yield TRead(14)
yield TRead(15)
yield from bus.read(14)
yield from bus.read(15)
yield
# Test FUD
yield TWrite(64, 0)
yield from bus.write(64, 0)
yield
# Test GPIO
yield TWrite(65, 0xff)
yield from bus.write(65, 0xff)
yield


@@ -185,14 +183,7 @@ def __init__(self):
self.rst_n = Signal()


class _TB(Module):
def __init__(self):
pads = _TestPads()
self.submodules.dut = AD9xxx(pads, drive_fud=True)
self.submodules.initiator = wishbone.Initiator(_test_gen())
self.submodules.interconnect = wishbone.InterconnectPointToPoint(
self.initiator.bus, self.dut.bus)


if __name__ == "__main__":
run_simulation(_TB(), vcd_name="ad9xxx.vcd")
pads = _TestPads()
dut = AD9xxx(pads)
run_simulation(dut, _test_gen(dut.bus), vcd_name="ad9xxx.vcd")
16 changes: 7 additions & 9 deletions artiq/gateware/amp/kernel_cpu.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from migen.fhdl.std import *
from migen.bank.description import *
from migen.bus import wishbone

from misoclib.cpu import mor1kx
from misoclib.soc import mem_decoder
from migen import *
from misoc.interconnect.csr import *
from misoc.interconnect import wishbone
from misoc.cores import mor1kx
from misoc.integration.soc_core import mem_decoder


class KernelCPU(Module):
@@ -23,9 +22,8 @@ def __init__(self, platform,
self.cd_sys_kernel.clk.eq(ClockSignal()),
self.cd_sys_kernel.rst.eq(self._reset.storage)
]
self.submodules.cpu = RenameClockDomains(
mor1kx.MOR1KX(platform, exec_address),
"sys_kernel")
self.submodules.cpu = ClockDomainsRenamer("sys_kernel")(
mor1kx.MOR1KX(platform, exec_address))

# DRAM access
self.wb_sdram = wishbone.Interface()
4 changes: 2 additions & 2 deletions artiq/gateware/amp/mailbox.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from migen.fhdl.std import *
from migen.bus import wishbone
from migen import *
from misoc.interconnect import wishbone


class Mailbox(Module):
2 changes: 1 addition & 1 deletion artiq/gateware/nist_qc1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mibuild.generic_platform import *
from migen.build.generic_platform import *


papilio_adapter_io = [
2 changes: 1 addition & 1 deletion artiq/gateware/nist_qc2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mibuild.generic_platform import *
from migen.build.generic_platform import *


fmc_adapter_io = [
Loading