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: 59d7f5f1e31b
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: 2953b069dcb4
Choose a head ref
  • 2 commits
  • 9 files changed
  • 1 contributor

Commits on Mar 8, 2016

  1. Copy the full SHA
    71105fd View commit details
  2. Copy the full SHA
    2953b06 View commit details
2 changes: 2 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -10,3 +10,5 @@ Release notes
* Core device flash storage has moved due to increased runtime size.
This requires reflashing the runtime and the flash storage filesystem image
or erase and rewrite its entries.
* RTIOCollisionError has been renamed to RTIOCollision

4 changes: 2 additions & 2 deletions artiq/coredevice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from artiq.coredevice import exceptions, dds, spi
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError,
RTIOCollisionError, RTIOOverflow,
RTIOCollision, RTIOOverflow,
DDSBatchError, CacheError)
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE,
PHASE_MODE_TRACKING)

__all__ = []
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollisionError",
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollision",
"RTIOOverflow", "DDSBatchError", "CacheError"]
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE",
"PHASE_MODE_TRACKING"]
2 changes: 1 addition & 1 deletion artiq/coredevice/exceptions.py
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ class RTIOSequenceError(Exception):
"""
artiq_builtin = True

class RTIOCollisionError(Exception):
class RTIOCollision(Exception):
"""Raised when an event is submitted on a given channel with the same
coarse timestamp as the previous one but with a different fine timestamp.
2 changes: 1 addition & 1 deletion artiq/gateware/rtio/analyzer.py
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ def __init__(self, rtio_core):
rtio_core.counter.value_sys << rtio_core.fine_ts_width),
]
for ename in ("o_underflow_reset", "o_sequence_error_reset",
"o_collision_error_reset", "i_overflow_reset"):
"o_collision_reset", "i_overflow_reset"):
self.comb += \
If(getattr(kcsrs, ename).re,
exception_stb.eq(1),
34 changes: 19 additions & 15 deletions artiq/gateware/rtio/core.py
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):

self.underflow = Signal() # valid 1 cycle after we, pulsed
self.sequence_error = Signal()
self.collision_error = Signal()
self.collision = Signal()

# # #

@@ -126,24 +126,28 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
# Special cases
replace = Signal()
sequence_error = Signal()
collision_error = Signal()
collision = Signal()
any_error = Signal()
nop = Signal()
self.sync.rsys += [
# Note: replace does not perform any RTLink address checks,
# i.e. a write to a different address will be silently replaced
# as well.
# Note: replace may be asserted at the same time as collision
# when addresses are different. In that case, it is a collision.
replace.eq(self.ev.timestamp == buf.timestamp),
# Detect sequence errors on coarse timestamps only
# so that they are mutually exclusive with collision errors.
sequence_error.eq(self.ev.timestamp[fine_ts_width:]
< buf.timestamp[fine_ts_width:])
]
if hasattr(self.ev, "a"):
different_addresses = self.ev.a != buf.a
else:
different_addresses = 0
if fine_ts_width:
self.sync.rsys += collision_error.eq(
self.sync.rsys += collision.eq(
(self.ev.timestamp[fine_ts_width:] == buf.timestamp[fine_ts_width:])
& (self.ev.timestamp[:fine_ts_width] != buf.timestamp[:fine_ts_width]))
self.comb += any_error.eq(sequence_error | collision_error)
& ((self.ev.timestamp[:fine_ts_width] != buf.timestamp[:fine_ts_width])
|different_addresses))
self.comb += any_error.eq(sequence_error | collision)
if interface.suppress_nop:
# disable NOP at reset: do not suppress a first write with all 0s
nop_en = Signal(reset=0)
@@ -163,7 +167,7 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
]
self.comb += [
self.sequence_error.eq(self.we & sequence_error),
self.collision_error.eq(self.we & collision_error)
self.collision.eq(self.we & collision)
]

# Buffer read and FIFO write
@@ -335,7 +339,7 @@ def __init__(self, chan_sel_width,
self.o_status = CSRStatus(4)
self.o_underflow_reset = CSR()
self.o_sequence_error_reset = CSR()
self.o_collision_error_reset = CSR()
self.o_collision_reset = CSR()

if data_width:
self.i_data = CSRStatus(data_width)
@@ -422,22 +426,22 @@ def __init__(self, channels, full_ts_width=63, guard_io_cycles=20):

underflow = Signal()
sequence_error = Signal()
collision_error = Signal()
collision = Signal()
self.sync.rsys += [
If(selected & self.kcsrs.o_underflow_reset.re,
underflow.eq(0)),
If(selected & self.kcsrs.o_sequence_error_reset.re,
sequence_error.eq(0)),
If(selected & self.kcsrs.o_collision_error_reset.re,
collision_error.eq(0)),
If(selected & self.kcsrs.o_collision_reset.re,
collision.eq(0)),
If(o_manager.underflow, underflow.eq(1)),
If(o_manager.sequence_error, sequence_error.eq(1)),
If(o_manager.collision_error, collision_error.eq(1))
If(o_manager.collision, collision.eq(1))
]
o_statuses.append(Cat(~o_manager.writable,
underflow,
sequence_error,
collision_error))
collision))

if channel.interface.i is not None:
i_manager = _InputManager(channel.interface.i, self.counter,
2 changes: 1 addition & 1 deletion artiq/protocols/analyzer.py
Original file line number Diff line number Diff line change
@@ -15,6 +15,6 @@ class ExceptionType(Enum):

o_underflow_reset = 0b010000
o_sequence_error_reset = 0b010001
o_collision_error_reset = 0b010010
o_collision_reset = 0b010010

i_overflow_reset = 0b100000
8 changes: 4 additions & 4 deletions artiq/runtime/rtio.c
Original file line number Diff line number Diff line change
@@ -33,10 +33,10 @@ static void rtio_process_exceptional_status(
"RTIO sequence error at {0} mu, channel {1}",
timestamp, channel, 0);
}
if(status & RTIO_O_STATUS_COLLISION_ERROR) {
rtio_o_collision_error_reset_write(1);
artiq_raise_from_c("RTIOCollisionError",
"RTIO collision error at {0} mu, channel {1}",
if(status & RTIO_O_STATUS_COLLISION) {
rtio_o_collision_reset_write(1);
artiq_raise_from_c("RTIOCollision",
"RTIO collision at {0} mu, channel {1}",
timestamp, channel, 0);
}
}
2 changes: 1 addition & 1 deletion artiq/runtime/rtio.h
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
#define RTIO_O_STATUS_FULL 1
#define RTIO_O_STATUS_UNDERFLOW 2
#define RTIO_O_STATUS_SEQUENCE_ERROR 4
#define RTIO_O_STATUS_COLLISION_ERROR 8
#define RTIO_O_STATUS_COLLISION 8
#define RTIO_I_STATUS_EMPTY 1
#define RTIO_I_STATUS_OVERFLOW 2

23 changes: 19 additions & 4 deletions artiq/test/coredevice/test_rtio.py
Original file line number Diff line number Diff line change
@@ -150,7 +150,7 @@ def run(self):
self.ttl_out.pulse(25*us)


class CollisionError(EnvExperiment):
class Collision(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("ttl_out_serdes")
@@ -163,6 +163,17 @@ def run(self):
delay_mu(1)


class AddressCollision(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("loop_in")

@kernel
def run(self):
self.loop_in.input()
self.loop_in.pulse(10*us)


class TimeKeepsRunning(EnvExperiment):
def build(self):
self.setattr_device("core")
@@ -220,9 +231,13 @@ def test_sequence_error(self):
with self.assertRaises(RTIOSequenceError):
self.execute(SequenceError)

def test_collision_error(self):
with self.assertRaises(RTIOCollisionError):
self.execute(CollisionError)
def test_collision(self):
with self.assertRaises(RTIOCollision):
self.execute(Collision)

def test_address_collision(self):
with self.assertRaises(RTIOCollision):
self.execute(AddressCollision)

def test_watchdog(self):
# watchdog only works on the device