forked from M-Labs/artiq
1
0
Fork 0

rtio: collision_error -> collision

This commit is contained in:
Sebastien Bourdeauducq 2016-03-08 15:38:08 +08:00
parent 59d7f5f1e3
commit 71105fd0d7
9 changed files with 27 additions and 25 deletions

View File

@ -10,3 +10,5 @@ Release notes
* Core device flash storage has moved due to increased runtime size. * Core device flash storage has moved due to increased runtime size.
This requires reflashing the runtime and the flash storage filesystem image This requires reflashing the runtime and the flash storage filesystem image
or erase and rewrite its entries. or erase and rewrite its entries.
* RTIOCollisionError has been renamed to RTIOCollision

View File

@ -1,12 +1,12 @@
from artiq.coredevice import exceptions, dds, spi from artiq.coredevice import exceptions, dds, spi
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError, from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError,
RTIOCollisionError, RTIOOverflow, RTIOCollision, RTIOOverflow,
DDSBatchError, CacheError) DDSBatchError, CacheError)
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE, from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE,
PHASE_MODE_TRACKING) PHASE_MODE_TRACKING)
__all__ = [] __all__ = []
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollisionError", __all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollision",
"RTIOOverflow", "DDSBatchError", "CacheError"] "RTIOOverflow", "DDSBatchError", "CacheError"]
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE", __all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE",
"PHASE_MODE_TRACKING"] "PHASE_MODE_TRACKING"]

View File

@ -86,7 +86,7 @@ class RTIOSequenceError(Exception):
""" """
artiq_builtin = True artiq_builtin = True
class RTIOCollisionError(Exception): class RTIOCollision(Exception):
"""Raised when an event is submitted on a given channel with the same """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. coarse timestamp as the previous one but with a different fine timestamp.

View File

@ -82,7 +82,7 @@ class MessageEncoder(Module, AutoCSR):
rtio_core.counter.value_sys << rtio_core.fine_ts_width), rtio_core.counter.value_sys << rtio_core.fine_ts_width),
] ]
for ename in ("o_underflow_reset", "o_sequence_error_reset", 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 += \ self.comb += \
If(getattr(kcsrs, ename).re, If(getattr(kcsrs, ename).re,
exception_stb.eq(1), exception_stb.eq(1),

View File

@ -103,7 +103,7 @@ class _OutputManager(Module):
self.underflow = Signal() # valid 1 cycle after we, pulsed self.underflow = Signal() # valid 1 cycle after we, pulsed
self.sequence_error = Signal() self.sequence_error = Signal()
self.collision_error = Signal() self.collision = Signal()
# # # # # #
@ -126,7 +126,7 @@ class _OutputManager(Module):
# Special cases # Special cases
replace = Signal() replace = Signal()
sequence_error = Signal() sequence_error = Signal()
collision_error = Signal() collision = Signal()
any_error = Signal() any_error = Signal()
nop = Signal() nop = Signal()
self.sync.rsys += [ self.sync.rsys += [
@ -140,10 +140,10 @@ class _OutputManager(Module):
< buf.timestamp[fine_ts_width:]) < buf.timestamp[fine_ts_width:])
] ]
if fine_ts_width: 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.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.comb += any_error.eq(sequence_error | collision)
if interface.suppress_nop: if interface.suppress_nop:
# disable NOP at reset: do not suppress a first write with all 0s # disable NOP at reset: do not suppress a first write with all 0s
nop_en = Signal(reset=0) nop_en = Signal(reset=0)
@ -163,7 +163,7 @@ class _OutputManager(Module):
] ]
self.comb += [ self.comb += [
self.sequence_error.eq(self.we & sequence_error), 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 # Buffer read and FIFO write
@ -335,7 +335,7 @@ class _KernelCSRs(AutoCSR):
self.o_status = CSRStatus(4) self.o_status = CSRStatus(4)
self.o_underflow_reset = CSR() self.o_underflow_reset = CSR()
self.o_sequence_error_reset = CSR() self.o_sequence_error_reset = CSR()
self.o_collision_error_reset = CSR() self.o_collision_reset = CSR()
if data_width: if data_width:
self.i_data = CSRStatus(data_width) self.i_data = CSRStatus(data_width)
@ -422,22 +422,22 @@ class RTIO(Module):
underflow = Signal() underflow = Signal()
sequence_error = Signal() sequence_error = Signal()
collision_error = Signal() collision = Signal()
self.sync.rsys += [ self.sync.rsys += [
If(selected & self.kcsrs.o_underflow_reset.re, If(selected & self.kcsrs.o_underflow_reset.re,
underflow.eq(0)), underflow.eq(0)),
If(selected & self.kcsrs.o_sequence_error_reset.re, If(selected & self.kcsrs.o_sequence_error_reset.re,
sequence_error.eq(0)), sequence_error.eq(0)),
If(selected & self.kcsrs.o_collision_error_reset.re, If(selected & self.kcsrs.o_collision_reset.re,
collision_error.eq(0)), collision.eq(0)),
If(o_manager.underflow, underflow.eq(1)), If(o_manager.underflow, underflow.eq(1)),
If(o_manager.sequence_error, sequence_error.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, o_statuses.append(Cat(~o_manager.writable,
underflow, underflow,
sequence_error, sequence_error,
collision_error)) collision))
if channel.interface.i is not None: if channel.interface.i is not None:
i_manager = _InputManager(channel.interface.i, self.counter, i_manager = _InputManager(channel.interface.i, self.counter,

View File

@ -15,6 +15,6 @@ class ExceptionType(Enum):
o_underflow_reset = 0b010000 o_underflow_reset = 0b010000
o_sequence_error_reset = 0b010001 o_sequence_error_reset = 0b010001
o_collision_error_reset = 0b010010 o_collision_reset = 0b010010
i_overflow_reset = 0b100000 i_overflow_reset = 0b100000

View File

@ -33,10 +33,10 @@ static void rtio_process_exceptional_status(
"RTIO sequence error at {0} mu, channel {1}", "RTIO sequence error at {0} mu, channel {1}",
timestamp, channel, 0); timestamp, channel, 0);
} }
if(status & RTIO_O_STATUS_COLLISION_ERROR) { if(status & RTIO_O_STATUS_COLLISION) {
rtio_o_collision_error_reset_write(1); rtio_o_collision_reset_write(1);
artiq_raise_from_c("RTIOCollisionError", artiq_raise_from_c("RTIOCollision",
"RTIO collision error at {0} mu, channel {1}", "RTIO collision at {0} mu, channel {1}",
timestamp, channel, 0); timestamp, channel, 0);
} }
} }

View File

@ -6,7 +6,7 @@
#define RTIO_O_STATUS_FULL 1 #define RTIO_O_STATUS_FULL 1
#define RTIO_O_STATUS_UNDERFLOW 2 #define RTIO_O_STATUS_UNDERFLOW 2
#define RTIO_O_STATUS_SEQUENCE_ERROR 4 #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_EMPTY 1
#define RTIO_I_STATUS_OVERFLOW 2 #define RTIO_I_STATUS_OVERFLOW 2

View File

@ -150,7 +150,7 @@ class SequenceError(EnvExperiment):
self.ttl_out.pulse(25*us) self.ttl_out.pulse(25*us)
class CollisionError(EnvExperiment): class Collision(EnvExperiment):
def build(self): def build(self):
self.setattr_device("core") self.setattr_device("core")
self.setattr_device("ttl_out_serdes") self.setattr_device("ttl_out_serdes")
@ -220,9 +220,9 @@ class CoredeviceTest(ExperimentCase):
with self.assertRaises(RTIOSequenceError): with self.assertRaises(RTIOSequenceError):
self.execute(SequenceError) self.execute(SequenceError)
def test_collision_error(self): def test_collision(self):
with self.assertRaises(RTIOCollisionError): with self.assertRaises(RTIOCollision):
self.execute(CollisionError) self.execute(Collision)
def test_watchdog(self): def test_watchdog(self):
# watchdog only works on the device # watchdog only works on the device