BRT Community

General Category => Discussion - EVE => Topic started by: Rudolph on August 30, 2020, 05:48:25 PM

Title: CoProcessor faults and REG_CMDB_SPACE
Post by: Rudolph on August 30, 2020, 05:48:25 PM
The programming guide states for REG_CMD_READ:
"In the case of an error, the co-processor engine writes 0xfff to this register."

As I was reading REG_CMD_READ for my  EVE_busy() function anyways I put the reset-on-fault code
in EVE_busy() as well.

Now I changed my library from writing to RAM_CMD+offset to use REG_CMDB_WRITE.
And it seems obvious to use REG_CMDB_SPACE in EVE_busy().
When the FIFO is empty the value in REG_CMDB_SPACE is 0xffc.

Now my question is, does the coprocessor also write 0xfff to REG_CMDB_SPACE in the case of an error?
The documents do not say anything about this but it seems logical.

Title: Re: CoProcessor faults and REG_CMDB_SPACE
Post by: BRT Community on August 31, 2020, 12:20:29 PM
Hello,

I have doubled checked and yes you are correct the documentation does not mentioned the value for REG_CMDB_SPACE when the co-processor is in an error state. I will ask the development team if they can clarify this.

Best Regards,
BRT Community
Title: Re: CoProcessor faults and REG_CMDB_SPACE
Post by: BRT Community on September 02, 2020, 01:59:56 PM
Hello,

I've heard back regarding your question.

REG_CMDB_SPACE is always set to (REG_CMD_READ - REG_CMD_WRITE) & 0xfff.
In regular operation REG_CMD_READ and REG_CMD_WRITE are 32-bit aligned, so the low 2 bits of REG_CMDB_SPACE are 00.

But when there is a fault, REG_CMD_READ is set to 0xfff, so the low 2 bits of REG_CMDB_SPACE immediately read as 11.

Therefore if ((REG_CMDB_SPACE & 0x3) != 0) there is a coprocessor fault.
Otherwise it holds the available FIFO space.

Best Regards,
BRT Community
Title: Re: CoProcessor faults and REG_CMDB_SPACE
Post by: Rudolph on September 02, 2020, 02:43:36 PM
Excellent, thank you, this will bring back my busy() function to only read one register. :-)
Title: Re: CoProcessor faults and REG_CMDB_SPACE
Post by: Kaetemi on September 05, 2020, 09:02:52 PM
REG_CMDB_SPACE is always set to (REG_CMD_READ - REG_CMD_WRITE) & 0xfff.

(REG_CMD_READ - REG_CMD_WRITE - 4) & 0xfff