Board Initialization and PE_Main Operation Regs

Added by Renato Sampaio over 11 years ago

Hi,

the description of the BRD_MODE and BRD_STATUS registers from the PE_MAIN module seems to be incomplete, in comparison to the equivalent structs listed on the driver.
Could you explain a little bit about how the initialization works with those registers?

The part I didn't understand is:

WriteOperationWordReg(brd,PEMAINadr_BRD_MODE, 0);
ToPause(100);    // pause ~ 100 msec
for(i = 0; i < 10; i++)
{
    WriteOperationWordReg(brd, PEMAINadr_BRD_MODE, 1);
    ToPause(100);    // pause ~ 100 msec
    WriteOperationWordReg(brd, PEMAINadr_BRD_MODE, 3);
    ToPause(100);    // pause ~ 100 msec
    WriteOperationWordReg(brd, PEMAINadr_BRD_MODE, 7);
    ToPause(100);    // pause ~ 100 msec
    temp = ReadOperationWordReg(brd, PEMAINadr_BRD_STATUS) & 0x01;
    if(temp)
        break;
}
WriteOperationWordReg(brd, PEMAINadr_BRD_MODE, 0x0F);

- BRD_STATUS(0) is always 1 accordingly to block_pe_main.vhd. So is 'temp' always 1?
- Why does the initialization keeps writing 1,3,7 to the BRD_MODE register and then writes 0xF?

And besides that part, there`s the part of the initialization that checks for the ADM PLD being on 'Test mode'
- How does the InFlags from BRD_MODE and OutFlags from the BRD_STATUS work? The code checks the InFlags for a 0x80 mask. Does that mean 'in test mode'?
Is there a table of values available?

Thanks and sorry for so many questions. Best regards!


Replies (3)

RE: Board Initialization and PE_Main Operation Regs - Added by Dmitry Smekhov over 11 years ago

Hi
This code for old board - AMBPEX8 http://insys.ru/products/ambunits/ambpex8
AMBPEX8 have two FPGA and I made bus between FPGA. This code for connect initialization.

InFlags and OutFlags is part bus. Field in the BRD_MODE and BRD_STATUS allow to check bus between FPGA.

"test mode" is the mode of ADM; In this mode all operation write and read independent from address; All operation - to register DATA in TRD_MAIN;

RE: Board Initialization and PE_Main Operation Regs - Added by Renato Sampaio over 11 years ago

About the code for the AMBPEX8, so I could comment it out with no change to the DMA core behavior, right?

About the 'test mode', I see that there's a TEST_MODE register in TRD_MAIN, but the initialization code writes to the BAR0 PE_MAIN module.
The code goes like this:

dbg_msg(dbg_trace, "%s(): ADM PLD is captured.\n", __FUNCTION__);
brd_status.AsWhole = ReadOperationWordReg(brd, PEMAINadr_BRD_STATUS);
if(AMBPEX8_DEVID == deviceID)
    brd_status.ByBits.InFlags &= 0x80; // 1 - ADM PLD in test mode
else
    brd_status.ByBits.InFlags = 0x80; // 1 - ADM PLD in test mode
if(brd_status.ByBits.InFlags)
{
    BRD_MODE brd_mode;
    dbg_msg(dbg_trace, "%s(): ADM PLD in test mode.\n", __FUNCTION__);
....

As we're not using the AMBPEX8_DEVID device id, it reads brd_status.ByBits.InFlags = 0x80;
So, it says that we are always in 'Test mode' and the 'test mode' isn't set during driver initialization, correct? It`s already defined inside the core.

So then, can I conclude that the Test mode check is optional and could be commented out as well?

thanks!

RE: Board Initialization and PE_Main Operation Regs - Added by Renato Sampaio over 11 years ago

Just to be clear, when I mean 'we're not using the AMBPEX8_DEVID', I mean "I'm not using". I'm not proposing to comment out the original code from the repository.
I'm just trying to simplify the code as much as I can to have a better understanding of the core and driver behavior.

thank you

(1-3/3)