Virtualenv Installation
After you set the 'virtualenv', you need to activate it to run the code for your tests.
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:
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:
>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('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:
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