AMCT Python Software

General Explanations

The goal is to develop a set of routines to automatically (i.e. without human intervention) test AMC13 hardware using python language. Tests will exercise the functionality of the AMC13 card(s) and report errors/failures. The tool allows for a detailed testing of the AMC hardware in both supervised and non-supervised fashion and it is meant to be used as a part of the production and quality testing of the AMC13 hardware.

For python tool, typically you need to use `virtualenv` to create a separate python environment and install all dependencies. It creates a folder which contains all the necessary executables to use the packages that a Python project would need. Before starting, make sure you have `pip` and `virtualenv`. Use your favorite package manager to install them.

Installation

After you set the 'virtualenv', you need to activate it to run the code for your tests.

  • cd ./dev_tools
  • source virtualenv/bin/activate
  • pip install --upgrade pip
  • python setup.py develop

Running the AMCT Tool

AMCT tool executes all the AMC13Tool2 commands and run them using new scripting language, such as:

>amc.do('en 1-12 f t')
>amc.do('localL1A o 1') 
>amc.do('lt 5') 
>amc.do('rv STATUS*')
>amc.do('re') #etc...
or
  • amc.run('any AMC13Tool2_command') ##run=do (select your favorite one.)
>amc.run('en 1-12 f t')
>amc.run('localL1A o 1') 
>amc.run('lt 5') 
>amc.run('rv STATUS*')
>amc.run('re') #etc...

Info : If you want to print the test result as a table just say:

>print amc.do('any AMC13Tool2_command') 
For example:
> print amc.do('nodes t1 *ttc*error*')
9 nodes matched
0: STATUS.TTC.BCNT_ERROR                                        (addr=00000000 mask=00000040)  r
1: STATUS.TTC.BCNT_ERRORS_HI                                    (addr=00000045 mask=0000ffff)  r
2: STATUS.TTC.BCNT_ERRORS_LO                                    (addr=00000044 mask=ffffffff)  r
3: STATUS.TTC.MULT_BIT_ERROR                                    (addr=00000000 mask=00000100)  r
4: STATUS.TTC.MULT_BIT_ERRORS_HI                                (addr=00000043 mask=0000ffff)  r
5: STATUS.TTC.MULT_BIT_ERRORS_LO                                (addr=00000042 mask=ffffffff)  r
6: STATUS.TTC.SGL_BIT_ERROR                                     (addr=00000000 mask=00000080)  r
7: STATUS.TTC.SGL_BIT_ERRORS_HI                                 (addr=00000041 mask=0000ffff)  r
8: STATUS.TTC.SGL_BIT_ERRORS_LO                                 (addr=00000040 mask=ffffffff)  r

Code is working as Command-line tool for:

  • Interactive mode
  • Scripted mode

Testing AMC13 Cards Using Interactive Mode

In this method you will run the code inside python (better you install python 2.7 and use ipython), you will exacute all the commands from AMC13Tool2 and use them

If you use ipyhon do:

>amct amctool ipython -i 322  ## SerialNumber=322
If you use pyhon do:
>amct amctool python -i 322

Then start to do test!!!

Here is an example to check registers and looking at differences of registers with and without trigger using interactive mode.

>r1 = amc.get_registers()    : get  registers
>r1['STATUS.AMC01.COUNTERS.AMC13_AMC_EVENTS_LO']check specific register
>amc.do('en 1-12 f t')    : create fake events
>amc.do('localL1A o 1 1')    : configure localL1A)
>amc.do('lt 5')    : send 5 triggers
>r2 = amc.get_registers()    : get  registers
>r2['STATUS.AMC01.COUNTERS.AMC13_AMC_EVENTS_LO']    : check specific register after send 5 trig.
>rdiff = amc.diff_registers(r1, r2)    : define diff function to check the differences with/without trig.
>rdiff['STATUS.AMC01.COUNTERS.AMC13_AMC_EVENTS_LO']    : check diff of registers with/without trig.

-- SemirayGirgisChyla - 08 Aug 2016

Edit | Attach | Watch | Print version | History: r14 | r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 12 Aug 2016 - SemirayGirgisChyla
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback