Skip to content

Commit 4940a18

Browse files
RoC: Add dedicated README.md for ALF
1 parent ef8145c commit 4940a18

File tree

3 files changed

+73
-46
lines changed

3 files changed

+73
-46
lines changed

README.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -331,42 +331,4 @@ Also, the PDA kernel module must be inserted as root in any case.
331331
ALICE Low-level Front-end (ALF) DIM Server <div id='alf'/>
332332
===================
333333
The utilities contain a DIM server for DCS control of the cards
334-
335-
Usage
336-
-------------------
337-
`DIM_DNS_NODE=mydimdns roc-alf-server --serial=11225 --channel=0`
338-
339-
Service description
340-
-------------------
341-
342-
Services names are under:
343-
`ALF/SERIAL_[a]/CHANNEL_[b]/[service name]`
344-
345-
where [a] = card serial number
346-
[b] = BAR index
347-
348-
* The RPC calls take a string argument and return a string.
349-
* When the argument must contain multiple values, they must be comma-separated.
350-
* The return string will contain an 8-byte prefix indicating success or failure "success:" or "failure:",
351-
optionally followed by a return value or error message.
352-
353-
For example: a register write call could have the argument string "504,42" meaning write value 42 to address 504.
354-
The return string could be "success:" or "failure:Address out of range".
355-
356-
#### Register read
357-
* Service type: RPC call
358-
* Service name: REGISTER_READ
359-
* Parameters: register address
360-
* Return: register value
361-
362-
#### Register write
363-
* Service type: RPC call
364-
* Service name: REGISTER_WRITE
365-
* Parameters: register address, register value
366-
* Return:
367-
368-
#### Temperature
369-
Card's core temperature in degrees Celsius
370-
* Service type: Published
371-
* Service name: TEMPERATURE
372-
* Value type: double
334+
For more information, see the dedicated readme at `src/CommandLineUtilities/AliceLowlevelFrontend/README.md`

src/CommandLineUtilities/AliceLowlevelFrontend/ProgramAliceLowlevelFrontendServer.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ class ProgramAliceLowlevelFrontendServer: public Program
240240
[&](auto parameter){return publishStartCommand(parameter, mCommandQueue);});
241241
auto serverPublishStop = makeServer(names.publishStopCommandRpc(),
242242
[&](auto parameter){return publishStopCommand(parameter, mCommandQueue);});
243-
// auto serverScaRead = makeServer(names.scaRead(),
244-
// [&](auto parameter){return scaRead(parameter, bar2);});
245-
// auto serverScaWrite = makeServer(names.scaWrite(),
246-
// [&](auto parameter){return scaWrite(parameter, bar2);});
243+
auto serverScaRead = makeServer(names.scaRead(),
244+
[&](auto parameter){return scaRead(parameter, bar2);});
245+
auto serverScaWrite = makeServer(names.scaWrite(),
246+
[&](auto parameter){return scaWrite(parameter, bar2);});
247247
auto serverScaGpioWrite = makeServer(names.scaGpioWrite(),
248248
[&](auto parameter){return scaGpioWrite(parameter, bar2);});
249249

@@ -351,7 +351,7 @@ class ProgramAliceLowlevelFrontendServer: public Program
351351

352352
static std::string scaRead(const std::string& parameter, ChannelSharedPtr bar2)
353353
{
354-
getInfoLogger() << "SCA_READ: '" << parameter << "'" << endm;
354+
getInfoLogger() << "SCA_READ" << endm;
355355
//auto params = split(parameter, ",");
356356
auto result = Sca(*bar2, bar2->getCardType()).read();
357357
return (b::format("%1%,%2%") % result.data % result.command).str();
@@ -361,8 +361,8 @@ class ProgramAliceLowlevelFrontendServer: public Program
361361
{
362362
getInfoLogger() << "SCA_WRITE: '" << parameter << "'" << endm;
363363
auto params = split(parameter, ",");
364-
auto command = b::lexical_cast<uint32_t>(params.at(0));
365-
auto data = b::lexical_cast<uint32_t>(params.at(1));
364+
auto data = b::lexical_cast<uint32_t>(params.at(0));
365+
auto command = b::lexical_cast<uint32_t>(params.at(1));
366366
Sca(*bar2, bar2->getCardType()).write(command, data);
367367
return "";
368368
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# ALICE Low-level Front-end (ALF) DIM Server
2+
DIM server for DCS control of the cards
3+
4+
5+
# Usage
6+
`DIM_DNS_NODE=mydimdns roc-alf-server --serial=11225`
7+
8+
9+
# Services
10+
11+
Service names are organized by card serial number:
12+
`ALF/SERIAL_[serial number]/[service name]`
13+
14+
## RPC calls
15+
Some of the services are RPC calls.
16+
* RPC calls take a string argument and return a string.
17+
* When the argument must contain multiple values, they must be comma-separated.
18+
* The return string will contain an 8-byte prefix indicating success or failure "success:" or "failure:",
19+
optionally followed by a return value or error message.
20+
* Numbers and addresses are all in base-10.
21+
22+
For example: a register write call could have the argument string "504,42" meaning write value 42 to address 504.
23+
The return string could be "success:" or "failure:Address out of range".
24+
25+
## Service description
26+
27+
#### Register read
28+
* Service type: RPC call
29+
* Service name: REGISTER_READ
30+
* Parameters: register address
31+
* Return: register value
32+
33+
#### Register write
34+
* Service type: RPC call
35+
* Service name: REGISTER_WRITE
36+
* Parameters: register address, register value
37+
* Return: empty
38+
39+
#### SCA read
40+
A basic read from the SCA
41+
* Service type: RPC call
42+
* Service name: SCA_READ
43+
* Parameters: empty
44+
* Return: SCA data, SCA command
45+
46+
#### SCA write
47+
A basic write to the SCA
48+
* Service type: RPC call
49+
* Service name: SCA_WRITE
50+
* Parameters: SCA data, SCA command
51+
* Return: empty
52+
53+
#### SCA GPIO write
54+
Set enabled the selected GPIO pins
55+
* Service type: RPC call
56+
* Service name: SCA_GPIO_WRITE
57+
* Parameters: SCA data
58+
* Return: SCA data, SCA command
59+
60+
#### Temperature
61+
Card's core temperature in degrees Celsius
62+
* Service type: Published
63+
* Service name: TEMPERATURE
64+
* Value type: double
65+

0 commit comments

Comments
 (0)