Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8547d8a
Start on an ECOND formatter
Mar 4, 2025
326d816
Merge remote-tracking branch 'refs/remotes/origin/main'
May 16, 2025
b29af07
Merged
May 20, 2025
2f51c95
Merge remote-tracking branch 'refs/remotes/origin/main'
May 20, 2025
9581007
Merge remote-tracking branch 'refs/remotes/origin/main'
Jul 8, 2025
b20c9b9
Merge remote-tracking branch 'origin/main'
Sep 10, 2025
da9dfd6
Change CTL test to deal with very good mezzanines
Sep 10, 2025
70c3d4c
Working EC and handling of dual link firmware, pretty much done with …
Sep 16, 2025
20af6b5
Move optolink into main library
Sep 17, 2025
aa3aa98
Adjust GPIO class to focus on names, not numbers
Sep 17, 2025
99c389a
Adjust to prepare for lpGBT-based Target
Sep 17, 2025
5b138b9
Change design to share mappings where possible
Sep 17, 2025
834725f
Add names, trig configuration
Sep 17, 2025
2f86788
Add GPIO interface which keeps a list of names
Sep 17, 2025
41c4ec0
Add std::string varient
Sep 17, 2025
bc75f52
Add I2C interblock for lpGBT, including with MUX
Sep 17, 2025
14671dc
Create Target and Hcal for backplane-via-ZCU
Sep 17, 2025
42aa49a
Start integration of the ZCU-optical path (needs a menu for getting t…
Sep 17, 2025
cb60718
Add TRIG standard configuration
Sep 17, 2025
9c7ede7
Several new files to build
Sep 17, 2025
f39c4c7
Correct bus number for BOARD I2C
Sep 17, 2025
aae0088
Added ECOND and ECONT register maps to register_maps directory.
taylorjcolaizzi Sep 18, 2025
6a6f6c6
added test econd yaml to register_maps. it has only 1 parameter
taylorjcolaizzi Sep 19, 2025
dcfaf31
add econ to header conversion
cmantill Sep 26, 2025
49bd98f
Merge branch 'main' into 205-econ-register-compiler
cmantill Sep 26, 2025
5df8e07
remove boost target
cmantill Sep 29, 2025
e469c1c
Merge branch '205-econ-register-compiler' of github.com:LDMX-Software…
cmantill Sep 29, 2025
5ed918e
Josh: comitting recent changes to enable switch to branch with fixed …
cmantill Oct 1, 2025
1443692
add econ resets and base for i2c comm
cmantill Oct 2, 2025
55d6b1c
Adjust logic to exactly match iic.py
Oct 2, 2025
4e88f05
Merge branch 'hcal-backplane-dev' of github.com:LDMX-Software/pflib i…
cmantill Oct 2, 2025
4e96e65
merge w econ dev
cmantill Oct 3, 2025
9ed0fe3
add econ dev as checkpoint
cmantill Oct 3, 2025
a8df09d
Correct multibyte I2C read for the strange lpGBT ordering...
Oct 3, 2025
8e959ec
Merge remote-tracking branch 'origin/hcal-backplane-dev' into 205-eco…
cmantill Oct 3, 2025
b5b4f9a
checkpoint
cmantill Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,39 @@ add_custom_command(
)
add_custom_target(lpgbt_regmap DEPENDS include/register_maps/lpgbt.h)

add_custom_command(
OUTPUT "include/register_maps/econd.h"
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/register_maps
COMMAND python3
${PROJECT_SOURCE_DIR}/register_maps/econ-to-header.py
${PROJECT_SOURCE_DIR}/register_maps/ECOND_I2C_params_regmap.yaml
${CMAKE_CURRENT_BINARY_DIR}/include/register_maps/econd.h
DEPENDS
${PROJECT_SOURCE_DIR}/register_maps/econ-to-header.py
${PROJECT_SOURCE_DIR}/register_maps/ECOND_I2C_params_regmap.yaml
COMMENT "Generating C++ ECOND register LUT from register_maps/ECOND_I2C_params_regmap.yaml"
VERBATIM
)
add_custom_target(econd DEPENDS include/register_maps/econd.h)

add_custom_command(
OUTPUT "include/register_maps/econt.h"
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/register_maps
COMMAND python3
${PROJECT_SOURCE_DIR}/register_maps/econ-to-header.py
${PROJECT_SOURCE_DIR}/register_maps/ECONT_I2C_params_regmap.yaml
${CMAKE_CURRENT_BINARY_DIR}/include/register_maps/econt.h
DEPENDS
${PROJECT_SOURCE_DIR}/register_maps/econ-to-header.py
${PROJECT_SOURCE_DIR}/register_maps/ECONT_I2C_params_regmap.yaml
COMMENT "Generating C++ ECONT register LUT from register_maps/ECONT_I2C_params_regmap.yaml"
VERBATIM
)
add_custom_target(econt DEPENDS include/register_maps/econt.h)

#list(APPEND generate_headers econd)
#list(APPEND generate_headers econt)

add_custom_command(
OUTPUT include/register_maps/register_maps.h
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include/register_maps
Expand Down Expand Up @@ -144,9 +177,10 @@ target_link_libraries(packing PUBLIC utility)
#
# src/pflib/FastControl.cxx

add_library(pflib SHARED
add_library(pflib SHARED
src/pflib/I2C_Linux.cxx
src/pflib/ROC.cxx
src/pflib/ECON.cxx
src/pflib/Compile.cxx
src/pflib/Logging.cxx
src/pflib/Hcal.cxx
Expand All @@ -160,13 +194,18 @@ add_library(pflib SHARED
src/pflib/lpgbt/lpGBT_ConfigTransport_I2C.cxx
src/pflib/lpgbt/lpGBT_Registers.cxx
src/pflib/lpgbt/lpGBT_Utility.cxx
src/pflib/lpgbt/lpGBT_standard_configs.cxx
src/pflib/lpgbt/I2C.cxx
src/pflib/lpgbt/GPIO.cxx
src/pflib/TargetFiberless.cxx
src/pflib/GPIO_HcalHGCROCZCU.cxx
src/pflib/FastControlCMS_MMap.cxx
src/pflib/ECOND_Formatter.cxx
src/pflib/zcu/UIO.cxx
src/pflib/zcu/Elinks_zcu.cxx
src/pflib/zcu/lpGBT_ICEC_ZCU_Simple.cxx
src/pflib/zcu/zcu_optolink.cxx
src/pflib/zcu/HcalBackplaneZCU.cxx
src/pflib/Bias.cxx
src/pflib/algorithm/level_pedestals.cxx
src/pflib/algorithm/toa_vref_scan.cxx
Expand All @@ -180,7 +219,7 @@ target_include_directories(pflib PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_link_libraries(pflib PUBLIC yaml-cpp::yaml-cpp packing Boost::log version utility)
add_dependencies(pflib register_maps_header direct_access lpgbt_regmap)
add_dependencies(pflib register_maps_header direct_access lpgbt_regmap econd)

add_library(menu SHARED
src/pflib/menu/Menu.cc
Expand Down Expand Up @@ -216,7 +255,6 @@ target_link_libraries(pftool PRIVATE pflib menu)

add_executable(pflpgbt app/lpgbt/main.cxx
app/lpgbt/lpgbt_mezz_tester.cc
app/lpgbt/zcu_optolink.cc
)
target_link_libraries(pflpgbt PRIVATE pflib menu)

Expand Down
36 changes: 0 additions & 36 deletions app/lpgbt/lpgbt_mezz_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,39 +159,3 @@ std::vector<uint32_t> LPGBT_Mezz_Tester::capture(int ilink, bool is_rx) {
}


void LPGBT_Mezz_Tester::capture_ec(int mode, std::vector<uint8_t>& tx, std::vector<uint8_t>& rx) {
static constexpr int REG_SPY_CTL = 67;
static constexpr int REG_READ = 69;

uint32_t val=opto_.read(REG_SPY_CTL);
val=val&0x1FF;
val=val|((mode&0x3)<<10)|(1<<9);
opto_.write(REG_SPY_CTL,val);

// now wait for it...
bool done=false;
do {
usleep(100);
done=(opto_.read(REG_READ)&0x400)!=0;
if (mode==0) done=true;
} while (!done);
val=val&0x1FF;
val=val|((mode&0x3)<<10); // disable the spy
opto_.write(REG_SPY_CTL,val);

tx.clear();
rx.clear();

val=val&0x1FF;
val=val|((mode&0x3)<<10);
for (int i=0; i<256; i++) {
val=val&0xFFF;
val=val|(i<<12);
opto_.write(REG_SPY_CTL,val);
usleep(1);
uint32_t k=opto_.read(REG_READ);
tx.push_back((k>>(2+11))&0x3);
rx.push_back((k>>11)&0x3);
}

}
1 change: 0 additions & 1 deletion app/lpgbt/lpgbt_mezz_tester.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class LPGBT_Mezz_Tester {
std::vector<uint32_t> ber_tx();

std::vector<uint32_t> capture(int ilink, bool is_rx = false);
void capture_ec(int mode, std::vector<uint8_t>& tx, std::vector<uint8_t>& rx);

private:
pflib::UIO& opto_;
Expand Down
Loading