Difference: AMCTPythonSoftware (1 vs. 14)

Revision 1426 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 113 to 113
 
  • Scripted mode

Testing AMC13 Cards Using Interactive Mode

Changed:
<
<
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
>
>
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:

Revision 1322 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 14 to 14
 

  • cd ~/amc13
Changed:
<
<
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
>
>
 
  • make
  • source env.sh
  • cd dev_tools

Revision 1219 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

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


Changed:
<
<
>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.
>
>
>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.
 

Testing AMC13 Cards Using Scripted Mode

Revision 1118 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Changed:
<
<

General Explanations

>
>

AMCT Purpose

 
Changed:
<
<
AMCT(AMCThirteen): 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 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.
Added:
>
>

Installation

 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.
Deleted:
<
<

Installation

 

Virtualenv Installation

Line: 29 to 29
 
  • pip install --upgrade pip
  • python setup.py develop
Changed:
<
<

Python 2.7.12 Installation to Virtualenv

>
>

Python 2.7.12 Installation

 
Changed:
<
<
Inside the virtualenv you can also install python 2.7.12 version (it is better than 2.6.X version) and ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.
>
>
If you dont have python 2.7.12 version (it is better than 2.6.X version) you can install it as following:
 
Line: 42 to 42
 
  • make
  • make install
  • export PATH=~/bin:~/python2.7/bin:~/vim/bin:$PATH
Deleted:
<
<
  • pip install ipython
 
Changed:
<
<
Now you have python 2.7.12 and ipython in virtualenv.
>
>
Now you have python 2.7.12. If you also want to install ipython:
  • pip install ipython
 

Running the AMCT Tool

Before running the AMCT tool you can look at the help options:

Revision 1017 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

General Explanations

Changed:
<
<
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.
>
>
AMCT(AMCThirteen): 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.

Line: 14 to 14
 

  • cd ~/amc13
Added:
>
>
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
 
  • make
  • source env.sh
Deleted:
<
<
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
 
Line: 29 to 29
 
  • pip install --upgrade pip
  • python setup.py develop
Changed:
<
<

Python 2.7 Installation to Virtualenv

>
>

Python 2.7.12 Installation to Virtualenv

 
Changed:
<
<
Inside the virtualenv you can also install python 2.7 version (it is better than 2.6) and use ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.
>
>
Inside the virtualenv you can also install python 2.7.12 version (it is better than 2.6.X version) and ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.
 
Line: 41 to 41
 
  • ./configure --prefix=/home/${USER}/.localpython
  • make
  • make install
Added:
>
>
  • export PATH=~/bin:~/python2.7/bin:~/vim/bin:$PATH
 
  • pip install ipython

Now you have python 2.7.12 and ipython in virtualenv.

Running the AMCT Tool

Added:
>
>
Before running the AMCT tool you can look at the help options:
> dev_tools]$ amct --help
Usage: amct [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  -d, --debug
  -l, --log-level [INFO|DEBUG|WARNING|ERROR|CRITICAL]
  -c, --config PATH               Global configuration
  --version                       Show the version and exit.
  -h, --help                      Show this message and exit.

Commands:
  amctool    Utilities for testing AMC13 interactively.
  firmware   Operations for testing AMC13 firmware.
  testsuite  Run predefined test-suites against AMC13...
  AMCT tool executes all the AMC13Tool2 commands and run them using new scripting language, such as:

Added:
>
>
For example:
 
>amc.do('en 1-12 f t')
>amc.do('localL1A o 1') 

Line: 58 to 78
 >amc.do('re') #etc...
or
Changed:
<
<
  • amc.run('any AMC13Tool2_command') ##run=do (select your favorite one.)
>
>
  • amc.run('any AMC13Tool2_command') # run=do (select your favorite one.)
For example:
 
>amc.run('en 1-12 f t')
>amc.run('localL1A o 1') 

Line: 119 to 140
 >rdiff['STATUS.AMC01.COUNTERS.AMC13_AMC_EVENTS_LO'] : check diff of registers with/without trig.
Added:
>
>

Testing AMC13 Cards Using Scripted Mode

 
Added:
>
>
In this method you can run your commands inside the script that you prepared and can test the AMC13 cards. I have prepared an example which will test the event and time counter registers. This script will check the expected and observed values of the register(s) and compare the expected value with observed value. If the expected/observed values are equal test result will be OK. Here is the example of the script:
 
Added:
>
>
test1.pyamc : script to check some registers.
 
Added:
>
>
Tests are organized into testsuite. You can execute them against every AMC13 board like so:
 
Added:
>
>
  • cd dev_tools (note: dont forget to activate virtualenv)
 
Added:
>
>
amct --verbose testsuite run --name c01 -i 161/c

(SN =161 and c01: a folder that contain the test1.pyamc script)

 
Added:
>
>
--> If expected and observed values are the same then you will see below message:
INFO	13772 [08/17/2016 14:02:51]:	Testsuite c01 finished OK
 
Added:
>
>
--> If expected and observed values are different then you will see the message of the problematic register and its expected and observed values!
STATUS.SFP.SFP0.EVENTS_BUILT error, expected: 6, observed: 5
 

Revision 917 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 10 to 10
 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

Deleted:
<
<

 

Virtualenv Installation

Added:
>
>

 
  • cd ~/amc13
  • make
  • source env.sh
Line: 29 to 30
 
  • python setup.py develop

Python 2.7 Installation to Virtualenv

Deleted:
<
<
Inside the virtualenv you can also install python 2.7 version (it is better than 2.6) and use ipython (python 2.6 version does not support ipython). I have already put the Python-2.7.12.tgz file in the folder, you just need to run it as below:
 
Added:
>
>
Inside the virtualenv you can also install python 2.7 version (it is better than 2.6) and use ipython (python 2.6 version does not support ipython). Here is the installation of python-2.7.12 version.

 
  • cd Python-2.7.12
  • make clean
  • ./configure --prefix=/home/${USER}/.localpython

Revision 817 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 7 to 7
 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.
Changed:
<
<
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.
>
>
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

Added:
>
>

Virtualenv Installation

 
  • cd ~/amc13
  • make
  • source env.sh
Line: 27 to 28
 
  • pip install --upgrade pip
  • python setup.py develop
Added:
>
>

Python 2.7 Installation to Virtualenv

Inside the virtualenv you can also install python 2.7 version (it is better than 2.6) and use ipython (python 2.6 version does not support ipython). I have already put the Python-2.7.12.tgz file in the folder, you just need to run it as below:

  • cd Python-2.7.12
  • make clean
  • ./configure --prefix=/home/${USER}/.localpython
  • make
  • make install
  • pip install ipython

Now you have python 2.7.12 and ipython in virtualenv.

 

Running the AMCT Tool

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

Revision 712 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 14 to 14
 
  • cd ~/amc13
  • make
  • source env.sh
Changed:
<
<
>
>
  • svn co (code_link) (Note: AMCT tool is inside the dev_tool package)
 

Revision 612 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 11 to 11
 

Installation

Changed:
<
<
  • cd amc13
>
>
  • cd ~/amc13
 
  • make
  • source env.sh
Changed:
<
<
  • cd ~/amc13/dev_tools
  • svn co (code link)
>
>
 
Line: 68 to 68
 8: STATUS.TTC.SGL_BIT_ERRORS_LO (addr=00000040 mask=ffffffff) r
Changed:
<
<
Code is working as Command-line tool as:
>
>
Code is working as Command-line tool for:
 
  • Interactive mode
  • Scripted mode
Changed:
<
<

Testing AMC13 Cards in Interactive 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:

Revision 512 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 68 to 68
 8: STATUS.TTC.SGL_BIT_ERRORS_LO (addr=00000040 mask=ffffffff) r
Changed:
<
<
Code is working as Command-line tool for:
>
>
Code is working as Command-line tool as:
 
  • Interactive mode
  • Scripted mode

Revision 412 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

Line: 42 to 42
 or
  • amc.run('any AMC13Tool2_command') ##run=do (select your favorite one.)

Changed:
<
<
>amc.do('en 1-12 f t')
>amc.do('localL1A o 1')
>amc.do('lt 5')
>amc.do('rv STATUS*')
>amc.do('re') #etc...
>
>
>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:

Added:
>
>

 >print amc.do('any AMC13Tool2_command')
Changed:
<
<
>
>
 For example:
> print amc.do('nodes t1 *ttc*error*')

Revision 312 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"

AMCT Python Software

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

Changed:
<
<
amc.do('en 1-12 f t ')
amc.do('localL1A o 1 ') 
amc.do('lt 5') 
amc.do('rv STATUS*')
amc.do('re') #etc...
>
>
>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.)
Changed:
<
<
amc.run('en 1-12 f t ')
amc.run('localL1A o 1 ') 
amc.run('lt 5') 
amc.run('rv STATUS*')
amc.run('re') #etc...
>
>
>amc.do('en 1-12 f t')
>amc.do('localL1A o 1') 
>amc.do('lt 5') 
>amc.do('rv STATUS*')
>amc.do('re') #etc...
  Info : If you want to print the test result as a table just say:
Added:
>
>
>print amc.do('any AMC13Tool2_command')
 
Changed:
<
<
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
Line: 70 to 75
 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:

Changed:
<
<
amctool ipython -i 322  ## SerialNumber=322
>
>
>amct amctool ipython -i 322  ## SerialNumber=322
 If you use pyhon do:
Changed:
<
<
amctool python -i 322 
>
>
>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.

Changed:
<
<
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') #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.
>
>
>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.
 

Revision 212 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
 
META TOPICPARENT name="HcalDTC"
Added:
>
>

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') 

Code is working as Command-line tool for:

  • Interactive mode
  • Scripted mode

Testing AMC13 Cards in 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:

amctool ipython -i 322  ## SerialNumber=322
If you use pyhon do:
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') #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.

 
Deleted:
<
<
AMCT
 

Revision 108 Aug 2016 - SemirayGirgisChyla

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="HcalDTC"

AMCT

-- SemirayGirgisChyla - 08 Aug 2016

 
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