Commit Graph
35 Commits
Author SHA1 Message Date
0837de2a5a CTB frequency rounding, CTB frequency measurement, CTB frequency units (#1423)
* round CTB clocks to next closest possible value, added freq measurement

* added time for firmware to measrue actual value after frequency change

* add check for backwards compatibility

* change CTB and XCTB clock values to MHz, TODO: units and validation errors

* changed runclk command to use units and float, TODO: dbit, adcclk, why is everything called StringTo ?

* do the same for dbit and adcclk

* added tolerance to exptime, fixed test

* update default values in server defs

* added virtual check in Altera_PLL, update testcases

* change python and pyctbgui to accept and return floating point MHz

* update help and comments

* Dev/ctb clocks fix (#1434)

* introduced new type Hz, typetraits, String conversions, command generation (not yet generated)

* incorrect unit typo

* cmd generation and compiles

* default to MHz, removed space between units for consistency with timers, min and max checks for clks

* in python, but need to change the default to Hz again for clean code and intuition

* allow ints, doubles, implicit conversions

* dont allow raw ints, doubles and implicit conversions

* fixed tests

* added operators for Hz in python

* fix test for min clk for xilinx ctb

* fix test

* fix python tests

* fixed xilinx period and default clks

* test fix

* removed the 3 clock cycle check for ctb and implemented properly the max adc clk frq for altera ctb

* removing 3 clock cycle code from xilinx as well

* formatting

* loadpattern before 3 clk cycles code

* actualtime and measurement time to be implemented in 100ns already in fw

* fix tests

* pyzmq dependency forthe tests

* fixed pyctbgui for freq

* insert tolerance check again

* also added tolerance check for patwaittime

* formatting

* minor: rounding test

* removed Rep redundant in ToString for freq

* intro frequency unit enums, removed unnecessary template behavior for ToString with freq unit, switching from parsing string unit argument to the enum argument for ToString, adding parsing string to unit at CLI boundary

* minor, and binaries

* minor, default clk vals are 0 but set up at detector setup

* get frequency only for that unit

* tolerance process

* missed in previous commit

* some more changes to exptime and validations

* ctb is probably done

* periodleft and delayleft

* fixed xilinx freq conv as well

* fixed m3 bug, binaries

* xilinx: setup also done in stop server so that the clk is not 0

* missed a test marker

* binaries in

* review fixes, simpler validation of timers in ctb and xilinx ctb

* typo fix

* format

* fix tests

---------

Co-authored-by: Martin Mueller <martin.mueller@psi.ch>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2026-05-06 15:52:13 +02:00
3dd07bf2be Dev/define cmd (#1312)
Build on local RHEL9 / build (push) Successful in 1m25s
Build on RHEL9 / build (push) Successful in 3m15s
Build on local RHEL8 / build (push) Successful in 3m31s
Build on RHEL8 / build (push) Successful in 4m44s
* basic ctb config api for register and bit names

* tests for define and definelist pass. yet to implement using them for reg, setbit, clearbit and getbit

* improved autocomplete for getbit,setbit, clearbit

* validate autocomplete

* definelist has no put

* updating help

* converting char array+int in runtimeerror compiles but throws at runtime.Fixed.Tested for it. Also check if string or int before using getregisterdefinitonbyvalue to see if it threw to call the other function. because both of it can throw and we should differentiate the issues for both

* removed std::vector<std::pair<string,int> to std::map<string, int> for defiitions list

* Dev/define cmd tie bit to reg (#1328)

* strong type

* moved everythign to bit_utils class

* pybindings

* added tests for python

* removed duplicates

* removed bit names in reg

* changed BitPosition to BitAddress

* Using define reg/bit from python (#1344)

* define_bit, define_addr in python. 
* setBit/clearBit takes int or addr

* added example using bits

* split define into 2 commands define_reg and define_bit, definelist into 2: definelist_reg and definelist_bit

* allow string for register and bit names in c++ api

* refactor from github comments

* naming refactoring (getRegisterDefnition to retunr name and address specifically

* added marker for 8 cmd tests connected to define, changed macro to static constexpr

* changed bitPosition from int to uint32_t

* got rid of setbitposition and setaddress, instead overloaded constructor to take in strings so that the conversion from string to bit address members, takes place within the class for easy maintainance in case type changes

* Removing implicit conversions:
RegisterAddresss and RegisterValue: Removed the implicit conversions.
RegisterAddress: Changed member name from address_ to value_ and method as well to value().
RegisterValue: Also added | operator to be able to concatenate with uint32_t. Same in python bindings (but could not find the tests to modify

* Allowed concatenation with other RegisterValue, made them all constexpr

* fix a ctbConfig test

* Maponstack works with integration tests, but need unit tests

* tests on mapstack

* fixed ctb tests and FixedString being initialized with gibberish

* removing parsing from string inside the class RegisterAddress, BitAddress and RegisterValue

* updated python bindings

* fixed bit utils test

* renaming getRegisterDefintiionAddress/Name=>getRegisterAddress/Name and similary for getBitDefinitionAddress/Name

* updated python bindings

* fix tests (format)

* a few python tests added and python bindings corrected

* replaceing str with __str__ for bit.cpp

* repr reimplemented for bit.cpp

* removed make with registerAddress etc

* starting server for tests per session and nor module

* killprocess throws if no process found-> github runs fails, changed to pkill and not throw

* clean shm shouldnt raise, in ci binary not found

* ignoring these tests for CI, which fail on CI because simulators are not generated in CI. This is in another PR, where it should work

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: froejdh_e <erik.frojdh@psi.ch>
2026-01-05 15:10:46 +01:00
maliakal_dandGitHub d003a6d8e0 2. Dev/add jf pedestal feature (#807) 2023-09-29 11:25:58 +02:00
Erik FröjdhandGitHub 045a28b5de Nanosecond times in Python (#522)
* initital implementation

* datetime replaces with sls::Duration in Python C bindings

* using custom type caster

* fix for conversion to seconds

* added set_count in python

* common header for pybind11 includes

authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2022-08-26 11:48:40 +02:00
maliakal_d b39c64032d clang format 2021-10-19 14:49:43 +02:00
maliakal_d 519b09fcad permission 2021-10-18 15:01:10 +02:00
maliakal_d dac60ad76d added .cpp licenses 2021-10-15 15:47:04 +02:00
Erik Frojdh 56b7dd3ca9 added currentsource to python 2021-10-05 17:13:32 +02:00
Erik Frojdh a6e23b0509 added scanParameters in Python 2020-12-01 18:40:45 +01:00
Erik Frojdh d9b2a90651 Introduced pattern class 2020-11-27 10:03:15 +01:00
Erik FröjdhandGitHub a15d8dd30a Moving headers into include/sls (#212) 2020-11-02 16:05:28 +01:00
Erik Frojdh f1bce15a57 replaced udp socket 2020-02-17 17:43:14 +01:00
Erik FröjdhandGitHub ed2a69744b Auto generating Python bindings (#70)
Auto generating python bindings
2020-01-07 15:47:38 +01:00
Dhanya ThattilandGitHub 995f0924e5 Commandline (#66)
* WIP

* WIP

* removed status to string from defs

* WIP

* WIP

* WIP removed unused functions in multi

* WIP

* print hex in a terrible way

* WIP, loadconfig error

* WIP, type to string

* WIP

* fix to conversion

* WIP, hostname doesnt work

* WIP

* WIP

* WIP

* WIP, threshold

* WIP, threshold

* WIP

* WIP, triggers

* WIP, cycles to triggers

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* rx_udsocksize fx, WIP

* WIP

* WIP

* WIP

* file index (64 bit), WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* merge

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* New python mod
2019-10-21 10:29:06 +02:00
Erik Frojdh 7242a6901a python compiles 2019-09-30 15:00:03 +02:00
Erik Frojdh c3c3f78c59 removed roflags from python 2019-09-17 09:32:22 +02:00
Erik Frojdh 1980a7d80c python fix 2019-08-28 14:19:54 +02:00
Erik Frojdh d1ea74120d added string concat to ToString 2019-08-20 12:17:42 +02:00
Erik Frojdh 336f8ceb50 WIP 2019-08-16 10:46:42 +02:00
Erik Frojdh 1f549d51fa fixed merge 2019-08-09 11:45:06 +02:00
Erik Frojdh ce9f76d017 WIP 2019-08-08 16:48:03 +02:00
Dhanya ThattilandGitHub 4ceee97c03 Api (#48)
* WIP

* WIP

* WIP

* cleaned up multi

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* split up python module

* WIP

* WIP

* WIP

* WIP

* WIP

* ok

* fixed bugs from rebase

* WIP

* fixed broken test

* WIP

* fixed python

* WIP

* sphinx help

* including new commands

* docs

* WIP

* WIP

* more tests

* added missing public header

* WIP
2019-08-07 11:21:07 +02:00
Dhanya ThattilandGitHub b524e0c95f removed online flags, apiversion in shm, ret for ok and fail, bind socket help in exception message (#43)
* removed online flag, removed rxronline flag, added useReceier flag that is set only when rxr hostname is set, removed setonline, setreceiveronline flag, removed ret for ok or fail, using exceptions for this, changed cannot bind socket printout

* fixed python
2019-07-26 16:33:39 +02:00
Erik Frojdh 0fa63f8be2 updated enums in old python 2019-07-22 16:09:35 +02:00
Erik Frojdh 2d3f5a03ca syncclk for python 2019-06-19 17:31:49 +02:00
Erik Frojdh 55229f77a3 python 2019-06-12 10:41:50 +02:00
Erik Frojdh 83c2775d6c fixed python 2019-04-18 15:57:59 +02:00
Erik Frojdh 833ca071c4 fix 2019-04-18 15:40:20 +02:00
Erik Frojdh 202d88d6be experimental python 2019-04-18 15:31:07 +02:00
Erik Frojdh faf7e0db82 fix 2019-04-18 15:09:36 +02:00
Erik Frojdh 86afb2bd0e more ctb commands 2019-04-18 15:03:01 +02:00
Erik Frojdh c7259538e9 python commands 2019-04-18 13:39:43 +02:00
Erik Frojdh 7c4aa7f3a7 added commands to python 2019-04-18 10:53:06 +02:00
Erik Frojdh 248306d570 minor 2019-04-15 17:22:31 +02:00
maliakal_d 89a06f099c merging refactor (replacing) 2019-04-12 10:53:09 +02:00