![Aeroflex Gaisler RT-SPW-ROUTER Скачать руководство пользователя страница 23](http://html1.mh-extra.com/html/aeroflex-gaisler/rt-spw-router/rt-spw-router_user-manual_2862505023.webp)
AEROFLEX GAISLER
23
RT-SPW-ROUTER
Copyright Aeroflex Gaisler AB
June 2012, Version 1.2
Received Time-codes are stored to the same time-ctrl and time-counter registers which are used for
transmission. The timerxen bit in the control register is used for enabling time-code reception. No
time-codes will be received if this bit is zero.
The two enable bits are used for ensuring that a node will not (accidentally) both transmit and receive
time-codes which violates the SpaceWire standard. It also ensures that a master sending time-codes
on a network will not have its time-counter overwritten if another (faulty) node starts sending time-
codes.
The time-counter register is set to 0 after reset and is incremented each time the tick-in signal is
asserted for one clock-period and the timetxen bit is set. This also causes the new value to be sent to
the router (which will propagate the time-code to the other ports if valid just as if it was transmitted on
a normal SpW link). Tick-in can be generated either by writing a one to the register field or by assert-
ing the tick-in signal. A Tick-in should not be generated too often since if the time-code after the pre-
vious Tick-in has not been sent the register will not be incremented and no new value will be sent. The
tick-in field is automatically cleared when the value has been sent and thus no new ticks should be
generated until this field is zero. If the tick-in signal is used there should be at least 4 system-clock
plus 25 transmit-clock cycles between each assertion.
A tick-out is generated each time a valid time-code is received and the timerxen bit is set. When the
tick-out is generated the tick-out signal will be asserted one clock-cycle and the tick-out register field
is asserted until it is cleared by writing a one to it.
The current time counter value can be read from the time register. It is updated each time a Time-code
is received and the timerxen bit is set. The same register is used for transmissions and can also be
written directly from the APB interface.
The control bits of the Time-code are stored to the time-ctrl register when a Time-code is received
whose time-count is one more than the nodes current time-counter register. The time-ctrl register can
be read through the APB interface. The same register is used during time-code transmissions.
It is possible to have both the time-transmission and reception functions enabled at the same time.
3.5.3
Receiver DMA channels
The receiver DMA engine handles reception of data from the SpaceWire network to different DMA
channels.
3.5.3.1
Address comparison and channel selection
Packets are received to different channels based on the address and whether a channel is enabled or
not. When the receiver N-Char FIFO contains one or more characters, N-Chars are read by the
receiver DMA engine. The first character is interpreted as the logical address and is compared with
the addresses of each channel starting from 0. The packet will be stored to the first channel with an
matching address. The complete packet including address and protocol ID but excluding EOP/EEP is
stored to the memory address pointed to by the descriptors (explained later in this section) of the
channel.
Each SpaceWire address register has a corresponding mask register. Only bits at an index containing a
zero in the corresponding mask register are compared. This way a DMA channel can accept a range of
addresses. There is a default address register which is used for address checking in all implemented
DMA channels that do not have separate addressing enabled and for RMAP commands in the RMAP
target. With separate addressing enabled the DMA channels’ own address/mask register pair is used
instead.