Understanding adm_test program
Added by Renato Sampaio over 11 years ago
Hi,
I'm studying DS_DMA to use in my own project (deliver network packages to the host trought PCIe like a NIC card does), but I can't get passed the adm_test.
Could you help me, please?
I'm using a SP605 Evaluation Kit from Xilinx.
I succefully implemented and programmed the bitstream of the sp605_lx45t_core.
I don't have the Aldec Active-HDL software, so I'm doing everything in Xilinx ISE.
First, I had some troubles due to synthesis/implementation settings, but studying the Active-HDL config file you are using, I was able to copy the settings and generate the bitstream.
Now, I'm trying to run the adm_test program. My testing enviroment is Ubuntu 12.04 32-bit GCC 4.6.
I had some situations:
- Running with the provided test_main.cfg as configuration file, everything looks fine by the program's output in the beginning, but when it gets to the performance statistics, there's no information (everything is zero) (attachment: test_main.log)
- Running with no config file, it shows performance statistics, but I don't understand the numbers. What does BLOCK_RD and BLOCK_WR stand for? (attachment: test_with_no_cfg.log)
- If I try not to use the parameter "isSystem" as 1 (user-mode), the program crashes with "Alloc memory error".
I don't know if it helps, but I ran the pex_test program. I'm still not familiar with most of the core's configuration, so I don't understand the outputs, but maybe they show something about my situation that would explain the behaviors. Attachment: pex_test.log
Could you guide to extending adm_test so I can receive my own data? If the situation with no config file is right output, why is there negative numbers?
I attached the log files to this post. Thank you very much for any help.
pex_test.log - pex_test output (1.5 kB)
test_main.log - Running with the provided test_main.cfg as configuration file (2.2 kB)
test_with_no_cfg.log - Running with no config file (1.7 kB)
Replies (43)
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
pex_test.log is ok.
test_main.log is ok; But DMA channel is not start. I corrected pex_drv to wishbone project; Try pex_drv from revision r9
adm_test program must have a configuration file. Default parameters is incorrect.
isSystem must be '1'; Current linux driver work with system memory only.
You can extentding function TF_TestStrm::ReceiveData to work with your data.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
I checked and I'm using pex_drv revision r9.
The TF_TestStrm::ReceiveData function is never reached using the provided test_main.cfg. (results are always zeroes)
I noticed that if I use trdNo = 0 and isTest = 0, the function is reached, but no sequence is sent, right?
Do you have a configuration file that receives generated data? Maybe I'm just not using the config parameters right.
I'll extend the TF_TestStrm::ReceiveData function like you said, but first I'm trying to setup a working starting point using the adm_test.
Thanks for the help!
RE: Understanding adm_test program - Added by Vladimir Karakozov over 11 years ago
Hi, Renato Sampaio!
Please, can you look at the file: /proc/AMB* or proc/ADP* (depend on your device ID) and look at the value of m_TotalIRQ entry.
This interrupt service routine call counter. If it is incremented - DMA channel working and interrupt request incoming into the CPU.
If it is zero - DMA channel don't started yet.
Vladimir.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi Vladimir,
the m_TotalIRQ entry value is 75, so it seems that the DMA channel has started.
There is one strange thing, though. The CAP_ID entry is 0x5, so the message "Can't find PCI Express capabilities" appears.
Is it a problem?
Thanks!
RE: Understanding adm_test program - Added by Vladimir Karakozov over 11 years ago
Hi Renato!
I suppose that no problem if capabilities is absent (But don't shure :)). If m_TotalIRQ is incremented while application
is running it is mean that DMA channel is working. Can you see data in the user space program? After data block was
received via PCI Express into the system memory, board generate IRQ. All allocated memory is mapped directly to the
user space. Look at the function:
u32 pex_board::core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
If you run pex_board_test you can see received data after string:
DMA data buffer 0:
XXXXXXXXXXXXXXXXX
DMA data buffer 1:
...
Vladimir
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
The TF_TestStrm::ReceiveData function is never reached using the provided test_main.cfg. (results are always zeroes) I noticed that if I use trdNo = 0 and isTest = 0, the function is reached, but no sequence is sent, right?
No. Test sequence is always sent if trdNo=0;
isTest=0 is no check in the ReceiveData.
Test sequence started in the TF_TestStrm::Execute();
Code:
pBrd->StreamStart( rd0.Strm ); // start dma channel
pBrd->RegPokeInd( rd0.trd, 0, 0x2038 ); // start dma request in TRD_MAIN
TF_TestStrm::ReceiveData function is always reached.
Code:
ret=pBrd->StreamGetBuf( pr->Strm, &ptr );
if( ret ) // ret==1 if block is received
{
// This place for process on the received data;
}
I correct test_main.cfg and translate comments to English.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Vladmir:
I ran pex_board_test successfully and it returned ffffffff in all DMA data buffers, except 6 and 7. Those last returned "real" data.
Is it expected behavior? If it is, I think I can work from there.
Dmitry:
I ran the main_test against your new configuration (by the way, thanks for the translation.. cleared up some things google translator wasn't helping) but with no change. Zero on all statistics.
Thank you very much for the help!
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi,
I've been trying to put it to work, but with no luck.
The pex_board_test looked like it was running successfully but the data buffers weren't really changing. I checked with before and after outputs.
The adm_test does not return any data using the provided configuration file.
I checked the m_TotalIRQ entry and it is incremented while the application runs.
The data block is never received, however.
ret=pBrd->StreamGetBuf( pr->Strm, &ptr );
if( ret ) // ret==1 if block is received {
// This code is never reached
}
I'm trying to understand more about the driver and it's interface to solve this.
Do you have any advice?
Thanks!
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
Hi
I check driver and adm_test programm. Current driver does not work. Get revision 9 for pexdrv please.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi Dmitry,
When I used the current driver implementation, the interrupts requests were not being produced.
All my tests, since then, are using revision 9 driver.
I see that I can interact with the FPGA registers through functions like RegPeekInd and it works.
But StreamGetBuf almost always returns 0. Does it mean that there's no data coming from the DMA channel?
When I managed to get StreamGetBuf to return 1 using different configurations (I'll post those later, because I don't have the file now), I wrote the data to a file like you said and all it wrote was a sequence of ^Q characters.
I don't believe this is the test sequence. Am I wrong?
Thanks for the patience,
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
I updated adm_test and published output from the program: http://ds-dev.ru/projects/ds-dma/wiki/ADM_TEST_en
Revision: r28
But pexdrv must be from revision r9
Send me log from ./adm_test test_main.cfg please.
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
Please view of the cat /proc/AMBPEX50
dsmv@dsmv-linux:~/pcie_ds_dma/trunk/soft/linux/application/adm_test/bin$ cat /proc/AMBPEX50 Device capabilities CAP_ID = 0x5 Can't find PCI Express capabilities Device information m_TotalIRQ = 2112670 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a100 FLAG_CLR = 0 PCI_ADRL = 7000 PCI_ADRH = 0 LOCAL_ADR = d000
It is very important that FIFO_STATUS = a100;
a1 - it is means that DMA chanel work correct: block of descriptors was read from memory with correct CRC.
P.S. Use strmNo 1 in the test_main.cfg
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
Renato Sampaio wrote:
But StreamGetBuf almost always returns 0. Does it mean that there's no data coming from the DMA channel?
Yes. DMA channel does not work.
When I managed to get StreamGetBuf to return 1 using different configurations (I'll post those later, because I don't have the file now), I wrote the data to a file like you said and all it wrote was a sequence of ^Q characters. I don't believe this is the test sequence. Am I wrong?
Yes. It is not a test sequence;
Pseudo random test sequence begin with:
0x0000000000000002
0x0000000000000004
0x0000000000000008
0x0000000000000010
0x0000000000000020
...
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi,
Thanks for the answers. I checked everything that you mentioned and here are my results.
The DMA transfers still don't happen. I compared the output of "cat /proc/AMBPEX50" against yours and the biggest difference is the DMA_MODE
rsampaio@saint-tropez:~$ cat /proc/AMBPEX50 Device capabilities CAP_ID = 0x5 Can't find PCI Express capabilities Device information m_TotalIRQ = 3847 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 27 <===== DMA_CTRL = 0 FIFO_STATUS = a100 FLAG_CLR = 0 PCI_ADRL = f000 PCI_ADRH = 0 LOCAL_ADR = 1000
Looking at the DMA_MODE register documentation (http://src.ds-dev.ru/doc/core/block_pe_ext_fifo.htm#Регистр%20DMA_MODE),
I understand that DMA_MODE behaves like this:
DMA_MODE=29, when idle (adm_test not running):
0 - ScatterGatter mode
2 - Transfer ADM-> HOST
3 - ?
4 - ?
27, using test_dio.cfg or test_main.cfg:
0 - ScatterGatter mode
1 - DEMAND_MODE (Work on requests)
2 - Transfer HOST-> ADM
3 - ?
4 - ?
23, using out_dio.cfg:
0 - ScatterGatter mode
1 - DEMAND_MODE (Work on requests)
2 - Transfer ADM-> HOST
4 - ?
What do the 3 and 4 bits mean? Is it normal behavior?
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Dmitry Smekhov wrote:
I updated adm_test and published output from the program: http://ds-dev.ru/projects/ds-dma/wiki/ADM_TEST_en
Revision: r28 But pexdrv must be from revision r9
Send me log from ./adm_test test_main.cfg please.
Hi,
these are the outputs for the 3 updated configuration files and application.
All failed.
I tested using my own compiled core version and the ones from the "Downloads" section.
All of them failed.
Could this be related to my working setup?
I use the Ubuntu (12.04LTS 32-bit) operating system in a quite recent motherboard (Gigabyte GA-Z77X-D3H ).
Thanks for the help!
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
Hi,
12.04LTS 32-bit - may be problem; I use Kubuntu 12.04 LTS 64-bit; Source code is independet for 32 or 64; But 32 bit does not check for long time; Can you check with 64-bit ?
test_dio.log - I see problem in the register STATUS; Value 0x71 - FIFO is empty and DMA request is not present.
Write to register on TRD_TEST_CTRL is not complete (may be - operation system is 32-bit).
Value of register DMA_MODE ( 0x27, 0x23 ) is right; Bit 3,4 - not used.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi,
Yes, I can. I'll test it as soon as possible and report my progress here.
Thank you very much!
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi,
I tried again using Kubuntu 12.04LTS 64-bit. Still doesn't work, but now FIFO_STATUS = a000 and m_TotalIRQ = 0. Meaning DMA channel is not working.
How can I further investigate this? I imagine it is better to debug the driver rather than scoping the core.
I feel that the options are getting fewer and fewer.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Here is my cat /proc/AMBPEX50 output:
Device capabilities CAP_ID = 0x5 Can't find PCI Express capabilities Device information m_TotalIRQ = 0 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 103 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 27 DMA_CTRL = 1 FIFO_STATUS = a000 FLAG_CLR = 10 PCI_ADRL = 6000 PCI_ADRH = 0 LOCAL_ADR = 9000
RE: Understanding adm_test program - Added by Dmitry Smekhov over 11 years ago
Hello,
Please, check the project; My project (sp605_lx45t_core_2011_09_09_v1_0_build_0x101.zip) has BLOCK_VER = 102; May be your current project is not good.
I published a log from adm_test program: http://ds-dev.ru/projects/ds-dma/wiki/Adm_test_test_dio_output
Command: ./adm_test test_dio.cfg
Please, send me your log; It is intresting the STATUS register.
And don't forget: pexdrv must be from revision r9
May be it is problem from computer ? It is very intresting; What type of CPU and motherboard ?
RE: Understanding adm_test program - Added by Vladimir Karakozov over 11 years ago
Hello Renato.
CAP_ID = 0x5
Can't find PCI Express capabilities
I remake some function to avoid this errors. Patch will be available at soon. It will search PCI Express capabilities and show output.
Vladimir.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Hi,
I checked with your project (BLOCK_VER = 102 and pexdrv revision = r9) and I had the same results:
rsampaio@saint-tropez:~/dev/pcie_ds_dma_linux/application/adm_test/bin$ cat /proc/AMBPEX50 Device capabilities CAP_ID = 0x5 Can't find PCI Express capabilities Device information m_TotalIRQ = 0 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 27 DMA_CTRL = 1 FIFO_STATUS = a021 FLAG_CLR = 10 PCI_ADRL = 7000 PCI_ADRH = 0 LOCAL_ADR = 1000
And I'm attaching the outputs from the 3 provided configuration (test_main.cfg, out_dio.cfg, test_dio.cfg).
As you said the STATUS register is the most important, I'm listing here:
test_main.cfg: 0x006F test_dio.cfg : 0x004F out_dio.cfg : 0x0073
I noted from the output that the "Firmware build number" is 0x0101.
That's different from your example outputs (0x0100).
I'll download the sp605_lx45t_core_2011_09_02_v1_0_build_0x100.zip and test it out.
The lab computer specs are:
Motherboard: Gigabyte GA-Z77X-D3H Processor: Intel i7 3770 Box Memory: Corsair CMV8GX3M1A1600C11 (8GB 1600)
Today I'll bring the board home and test it there. Maybe I'll have different results.
Thank you very much!
Dmitry Smekhov wrote:
Hello, Please, check the project; My project (sp605_lx45t_core_2011_09_09_v1_0_build_0x101.zip) has BLOCK_VER = 102; May be your current project is not good.
I published a log from adm_test program: http://ds-dev.ru/projects/ds-dma/wiki/Adm_test_test_dio_output Command: ./adm_test test_dio.cfg Please, send me your log; It is intresting the STATUS register. And don't forget: pexdrv must be from revision r9 May be it is problem from computer ? It is very intresting; What type of CPU and motherboard ?
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
Thanks Vladimir,
I think it will be very helpful.
Best regards,
Vladimir Karakozov wrote:
Hello Renato.
CAP_ID = 0x5 Can't find PCI Express capabilities
I remake some function to avoid this errors. Patch will be available at soon. It will search PCI Express capabilities and show output.
Vladimir.
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
I did the same tests with the Firmware build number = 0x0100 and got the same results (attachment).
rsampaio@saint-tropez:~/dev/pcie_ds_dma_linux/application/adm_test/bin$ cat /proc/AMBPEX50 Device capabilities CAP_ID = 0x5 Can't find PCI Express capabilities Device information m_TotalIRQ = 0 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 10 PCI_ADRL = e000 PCI_ADRH = 0 LOCAL_ADR = d000
These 2 tests (0x0101 and 0x0100) were made in a Kubuntu 12.04 LTS 64-bit operating system.
I'm taking the board home, so tomorrow I'll report here the results I'll get there.
Thank you very much!
RE: Understanding adm_test program - Added by Renato Sampaio over 11 years ago
So, I tried on my computer and the results were exactly the same.
My configuration:
Motherboard: Gigabyte GA-B75M-D3V
Processor: Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz
Kubuntu 12.04 LTS 64-bit
I know I have to use pex driver revision r9, but I updated to see PCIe Capabilities Register. Everything seems normal. Here is the report:
rsampaio@bolotorta-kubuntu64:~/dev/pcie_ds_dma_linux/driver/pexdrv$ cat /proc/AMBPEX50 Capability pointer: 0x40 Capability ID: 0x7e034801 Capability ID: 0x805805 Capability ID: 0x10010 PCI Express Capability Register Set 0x58: 0x10010 0x5c: 0x5908FC1 0x60: 0x2800 0x64: 0x3F411 0x68: 0x10110040 0x6c: 0x0 0x70: 0x0 0x74: 0x0 0x78: 0x0 Device information m_TotalIRQ = 0 PE_EXT_FIFO 4 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 0 RESOURCE = 2 DMA_MODE = 0 DMA_CTRL = 0 FIFO_STATUS = a000 FLAG_CLR = 0 PCI_ADRL = 0 PCI_ADRH = 0 LOCAL_ADR = 0 PE_EXT_FIFO 5 BLOCK_ID = 18 BLOCK_VER = 102 FIFO_ID = 3400 FIFO_NUMBER = 1 RESOURCE = 2 DMA_MODE = 27 DMA_CTRL = 1 FIFO_STATUS = a021 FLAG_CLR = 10 PCI_ADRL = 9000 PCI_ADRH = 0 LOCAL_ADR = 0
It's a long shot, but I noticed that the core's Max Payload Size is 256, while both boards I tested with have 128 bytes configuration. Would that cause the board to reject the DMA packets?