Skip to content

Commit 5be0804

Browse files
authored
Add docs
1 parent 8c2cb9f commit 5be0804

File tree

1 file changed

+126
-1
lines changed

1 file changed

+126
-1
lines changed

README.md

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,126 @@
1-
# ALF
1+
# ALF
2+
3+
## Introduction
4+
ALF(Alice Low-level Frontend) spawns DIM services as an interface with detector FEEs(Front-End Electronics). The DIM services can be accessed through DCS's [FRED](https://gitlab.cern.ch/alialfred/FREDServer).
5+
6+
## Requirements
7+
In order to run ALF a DIM Nameserver has to be up and running.
8+
9+
## Usage
10+
11+
### o2-alf
12+
o2-alf is the binary of the ALF server. The only option it expects is the address of the DIM Nameserver. It can be passed either as a command-line argument or as an environmental variable.
13+
14+
`
15+
o2-alf --dim-dns-node thedimdns
16+
`
17+
18+
`
19+
DIM_DNS_NODE=thedimdns o2-alf
20+
`
21+
22+
### o2-alf-client
23+
o2-alf-client is the binary of an ALF client used solely for testing purposes. On top of the DIM Nameserver it expects the hostname of the node hosting the ALF server, the card's serial and the link number as command-line arguments.
24+
25+
`
26+
o2-alf-client --dim-dns-node thedimdns --alf-id thealfserver --serial 0 --link 4
27+
`
28+
29+
## Services
30+
31+
Service names are identified by the server's hostname, the card's serial number and the link, as follows:
32+
33+
`
34+
ALF_[hostname]/SERIAL_[serial_number]/LINK_[link]/[service_name]
35+
`
36+
37+
### DIM RPC services
38+
39+
The services are DIM RPC services. Every RPC is called with a string and expects a string in return. For these strings the following requirements are defined:
40+
41+
* Arguments are newline-separated ('\n').
42+
* The return string is prefixed by "success\n" or "failure\n"
43+
* Address and values are hex strings with leading zeros for 32-bit unsigned integers. (e.g. 0x0000f00d)
44+
* An exception is made for SWT words which are 76-bit unsigned integers. (e.g. 0x0000000000badc0ffee)
45+
* Input needs to be prefixed with "0x" but not necessarily with leading zeros.
46+
* Lines prefixed with `#` are disregarded as comments.
47+
48+
#### REGISTER_READ
49+
* Parameter:
50+
* Register address
51+
* Returns:
52+
* Register value
53+
54+
* Example:
55+
* DIM input: `0x0000f00d \n`
56+
* DIM output: `0x0000beef \n`
57+
58+
#### REGISTER_WRITE
59+
* Parameters:
60+
* Register address
61+
* Register value
62+
* Returns:
63+
* empty
64+
65+
* Example:
66+
* DIM input: `0x0000f00d,0x0000beef \n`
67+
* DIM output: ` `
68+
69+
#### SCA_SEQUENCE
70+
* Parameters:
71+
* Sequence of SCA command and data pairs
72+
* Returns:
73+
* Sequence of SCA command, and SCA read pairs
74+
75+
* Example:
76+
* DIM input: `0x00000010,0x00000011\n0x000000020,0x00000021\n`
77+
* DIM output: `0x00000010,0x00000111\n0x00000020,0x00000221\n`
78+
79+
#### SWT_SEQUENCE
80+
* Parameters:
81+
* Sequence of SWT word and operation pairs as follows:
82+
* Operations may be:
83+
* SWT word with `write`
84+
* `reset` (no SWT word)
85+
* `read` (no SWT word)
86+
* Returns:
87+
* Sequence of SWT output as follows:
88+
* `write` always retuns `0`
89+
* `read` returns an SWT word
90+
* `reset` returns nothing
91+
92+
* Example:
93+
* DIM input `reset\n0x0000000000badc0ffee,write\nread\n`
94+
* DIM output `0\n0x0000000000badc0ffee\n`
95+
96+
#### IC_SEQUENCE
97+
98+
* Parameters:
99+
* Sequence of IC operations as follows:
100+
* Operations may be:
101+
* Address, Value and `write`
102+
* Address and `read`
103+
104+
* Returns:
105+
* Value on `write` (echo)
106+
* Value on `read`
107+
108+
* Example:
109+
* DIM input: `0x54,0xff,write\n0x54,read\n`
110+
* DIM output: `0x000000ff\n0x000000ff\n`
111+
112+
#### IC_GBT_I2C_WRITE
113+
114+
* Parameters:
115+
* Value
116+
117+
* Returns:
118+
* empty
119+
120+
* Example:
121+
* DIM input `0x3\n`
122+
* DIM output ` `
123+
124+
#### Examples
125+
126+
Examples on making the RPC calls can be seen under [ProgramAlfClient.cxx](apps/ProgramAlfClient.cxx) and [AlfClient.h](src/AlfClient.h).

0 commit comments

Comments
 (0)