Skip to content

Commit a6664a6

Browse files
committed
[cru] Add TTCUP gbt mux option
1 parent f570322 commit a6664a6

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ The Parameters that affect the configuration of the CRU, their possible values (
151151

152152
`GbtMode (GBT | WB) [GBT]`
153153

154-
`GbtMux (TTC | DDG | SWT) [TTC]`
154+
`GbtMux (TTC | DDG | SWT | TTCUP) [TTC]`
155155

156156
`LinkLoopbackEnabled (true | false) [false]`
157157

@@ -480,18 +480,18 @@ metric format for the CRORC and the CRU is different, as different parameters ar
480480
481481
###### Metric: `"link"`
482482
483-
| Value name | Value | Type |
484-
| ---------------- | ------------------------------------------------------- | ------ |
485-
| `"pciAddress"` | - | string |
486-
| `"gbtMode"` | "GBT/GBT" or "GBT/WB" | string |
487-
| `"loopback"` | 0/1 (Enabled/Disabled) | int |
488-
| `"gbtMux"` | "DDG", "SWT", "TTC:CTP", "TTC:PATTERN", or "TTC:MIDTRG" | string |
489-
| `"datapathMode"` | "PACKET" or "CONTINUOUS" | string |
490-
| `"datapath"` | 0/1 (Disabled/Enabled) | int |
491-
| `"rxFreq"` | - | double |
492-
| `"txFreq"` | - | double |
493-
| `"status"` | 0/1/2 (DOWN/UP/UP was DOWN) | int |
494-
| `"opticalPower"` | - | double |
483+
| Value name | Value | Type |
484+
| ---------------- | ----------------------------------------------------------------- | ------ |
485+
| `"pciAddress"` | - | string |
486+
| `"gbtMode"` | "GBT/GBT" or "GBT/WB" | string |
487+
| `"loopback"` | 0/1 (Enabled/Disabled) | int |
488+
| `"gbtMux"` | "DDG", "SWT", "TTC:CTP", "TTC:PATTERN", "TTC:MIDTRG", or "TTC UP" | string |
489+
| `"datapathMode"` | "PACKET" or "CONTINUOUS" | string |
490+
| `"datapath"` | 0/1 (Disabled/Enabled) | int |
491+
| `"rxFreq"` | - | double |
492+
| `"txFreq"` | - | double |
493+
| `"status"` | 0/1/2 (DOWN/UP/UP was DOWN) | int |
494+
| `"opticalPower"` | - | double |
495495
496496
| Tag key | Value |
497497
| ----------------- | ------------------ |

cru_template.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ userAndCommonLogicEnabled=false
6666
# [true | false]
6767
enabled=true
6868

69-
# [TTC | DDG | SWT]
69+
# [TTC | DDG | SWT | TTCUP]
7070
gbtMux=TTC
7171

7272
#############################################

include/ReadoutCard/Cru.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static constexpr uint32_t DATA_MIDTRG(0x2);
3737
static constexpr uint32_t GBT_MUX_TTC(0x0);
3838
static constexpr uint32_t GBT_MUX_DDG(0x1);
3939
static constexpr uint32_t GBT_MUX_SWT(0x2);
40+
static constexpr uint32_t GBT_MUX_TTCUP(0x3);
4041

4142
static constexpr uint32_t GBT_MODE_GBT(0x0);
4243
static constexpr uint32_t GBT_MODE_WB(0x1);

include/ReadoutCard/ParameterTypes/GbtMux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct GbtMux {
3030
Ttc = Cru::GBT_MUX_TTC,
3131
Ddg = Cru::GBT_MUX_DDG,
3232
Swt = Cru::GBT_MUX_SWT,
33+
TtcUp = Cru::GBT_MUX_TTCUP,
3334
Na = -1,
3435
};
3536

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ProgramConfig : public Program
6565
"GBT MODE [GBT, WB]");
6666
options.add_options()("gbtmux",
6767
po::value<std::string>(&mOptions.gbtMux)->default_value("TTC"),
68-
"GBT MUX [TTC, DDG, SWT]");
68+
"GBT MUX [TTC, DDG, SWT, TTCUP]");
6969
options.add_options()("links",
7070
po::value<std::string>(&mOptions.links)->default_value("0"),
7171
"Links to enable");

src/Cru/Gbt.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void Gbt::setMux(int index, uint32_t mux)
4040
uint32_t reg = index / 16;
4141
uint32_t bitOffset = (index % 16) * 2;
4242
uint32_t address = Cru::Registers::GBT_MUX_SELECT.address + (reg * 4);
43+
std::cout << mux << std::endl;
4344
mPdaBar->modifyRegister(address / 4, bitOffset, 2, mux);
4445
}
4546

@@ -121,6 +122,8 @@ void Gbt::getGbtMuxes()
121122
link.gbtMux = GbtMux::type::Ddg;
122123
} else if (txMux == Cru::GBT_MUX_SWT) {
123124
link.gbtMux = GbtMux::type::Swt;
125+
} else if (txMux == Cru::GBT_MUX_TTCUP) {
126+
link.gbtMux = GbtMux::type::TtcUp;
124127
} else {
125128
link.gbtMux = GbtMux::type::Na;
126129
}

src/ParameterTypes/GbtMux.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const auto converter = Utilities::makeEnumConverter<GbtMux::type>("GbtMux
2727
{ GbtMux::Ttc, "TTC" },
2828
{ GbtMux::Ddg, "DDG" },
2929
{ GbtMux::Swt, "SWT" },
30+
{ GbtMux::TtcUp, "TTC UP" },
3031
{ GbtMux::Na, "N/A" },
3132
});
3233

0 commit comments

Comments
 (0)