Author Topic: Interfacing Arm to custom Logic  (Read 431 times)

enliteneer

  • Active Member
  • *
  • Posts: 7
Interfacing Arm to custom Logic
« on: March 22, 2020, 04:48:12 PM »
Microsemi has a 2012 app note (AC335) how to do it, but I haven't been able to make it work.   

Basically, just creating a simple project that uses their example AP3 wrapper/slave around a reg16x8 ram block.   Everything seems to synthesize/route fine, yet once programmed, the moment I step the cpu thru a line that accesses the logic/memory, I get a hard fault.

I had to modify their reg_apb_wrp.v file in order to make it work with Libero 12.3, but not sure if this is the issue.    Also, not sure why the tool put the slave at both 0x50000000-0x50000FFF AND 0x30000000-0x30000FFF nor why it's 0x1000 in length.    I'd like to add much more custom logic, and since there's only 2 FIC, I need a much bigger memory map to decode outside of the arm!
 







Antti Lukats

  • Hero Member
  • *****
  • Posts: 508
    • Trioflex
Re: Interfacing Arm to custom Logic
« Reply #1 on: March 23, 2020, 08:20:26 AM »
did you try reading writing the apb peripheral from the debugger? It does different access then

we have done little work with smartfusion, but with one project we had no issues, there I used a dual port block ram interface to the hard cpu and to the fpga fabric

enliteneer

  • Active Member
  • *
  • Posts: 7
Re: Interfacing Arm to custom Logic
« Reply #2 on: March 23, 2020, 04:53:42 PM »
Thanks, would the design you mention be the one listed under the SMF2000 resources (SMFSDRAM.zip)?   I couldn't find any custom hdl/firmware files in that zip.   

Using the Memory tab in Eclipse, I don't get a hard fault when reading/writing the apb3 slave memory space!   Interestingly, it seems as if it's a byte access issue.   For example, this will crash:

uint8_t rdVal;
uint8_t *pUserLogic8 = (uint8_t*) (0x50000000);
rdVal = *(pUserLogic8 +3 ); 

but this wont:
uint8_t rdVal;
uint8_t *pUserLogic8 = (uint8_t*) (0x50000000);
rdVal = *(pUserLogic8 +4 ); 

Do you see anything obvious with the screenshots of the project settings?