23.11.2012 Views

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 <strong>The</strong> <strong>ALICE</strong> Transition Radiation Detector<br />

Startbit (1 Bit) + Frame (85 Bit)<br />

Frame<br />

(69 Bit + 16 Bit Checksum)<br />

Header (16 Bit)<br />

Slave address<br />

src/dest Bit<br />

Hop Counter<br />

Data (53 Bit)<br />

(7 Bit)<br />

(1 Bit)<br />

(8 Bit)<br />

Command (5 Bit)<br />

Memory addr. (16 Bit)<br />

Data Word (32 Bit)<br />

CRC Checksum (16 Bit)<br />

Figure 4.13: Structure <strong>of</strong> a SCSN Bus frame. <strong>The</strong> two outermost parts are added by <strong>the</strong> SCSN<br />

driver on <strong>the</strong> DCS board before sending and are removed after receiving a frame.<br />

<strong>The</strong>refore <strong>the</strong> data structure representing a frame in <strong>the</strong> control s<strong>of</strong>tware running on<br />

<strong>the</strong> DCS board only contains <strong>the</strong> header and data fields (drawing based on [Gar02]).<br />

typedef s t r u c t {<br />

unsigned i n t mcmaddress ; / / s l a v e a d d r e s s o f t h e t a r g e t MCM<br />

unsigned i n t s o u r c e _ b i t ; / / s o u r c e b i t , must be s e t t o 1<br />

unsigned i n t hopcounter ; / / hopcounter , must be s e t t o 0<br />

unsigned i n t command ; / / Command t o be e x e c u t e d w i t h i n t h e<br />

MCM<br />

unsigned i n t address ; / / Memory a d d r e s s in t h e t a r g e t MCM<br />

i n t data ; / / Payload ( d a t a f o r t h e MCM)<br />

} FrameSend ;<br />

typedef s t r u c t {<br />

unsigned i n t e r r o r _ f l a g ; / / e r r o r f l a g<br />

FrameSend <strong>the</strong>_frame ; / / t h e r e c e i v e d frame<br />

} FrameReceived ;<br />

Listing 4.1: C/C++ structure representing a frame. Before sending <strong>the</strong> frame <strong>the</strong> SCSN driver<br />

calculates and adds <strong>the</strong> CRC sum and <strong>the</strong> start bit (compare fig. 4.13). When <strong>the</strong><br />

frame has returned <strong>the</strong> driver checks <strong>the</strong> CRC sum and sets <strong>the</strong> error flag if <strong>the</strong> CRC<br />

sum does not match.<br />

<strong>The</strong> addressing scheme is quite simple. Each frame contains an address field and a<br />

hop counter (see figure 4.13 and listing 4.1). A slave receives a frame ei<strong>the</strong>r from <strong>the</strong><br />

bus master or from ano<strong>the</strong>r slave. It compares <strong>the</strong> address field with <strong>the</strong> hopcounter<br />

field. If both values are not equal or <strong>the</strong> src/dest bit is set to zero it just increases <strong>the</strong><br />

hop counter by one and forwards <strong>the</strong> frame to <strong>the</strong> next slave. If <strong>the</strong> values are equal and<br />

<strong>the</strong> src/dest bit is set <strong>the</strong> slave processes <strong>the</strong> information in <strong>the</strong> data section <strong>of</strong> <strong>the</strong> frame.<br />

After processing, <strong>the</strong> slave sets <strong>the</strong> hop counter and <strong>the</strong> src/dest bit to zero and forwards<br />

<strong>the</strong> frame to <strong>the</strong> next slave.<br />

In case <strong>of</strong> <strong>TRD</strong> quite <strong>of</strong>ten all MCMs in <strong>the</strong> bus should process <strong>the</strong> same data frame.<br />

<strong>The</strong>refore <strong>the</strong> SCSN bus supports broadcasts. If a slave receives a frame with an address<br />

field set to 127 and a src/dest bit <strong>of</strong> one, it processes <strong>the</strong> information in <strong>the</strong> data section.<br />

39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!