element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Using Xilinx Tools Forum PS/PL BRAM share
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 33 replies
  • Subscribers 337 subscribers
  • Views 4709 views
  • Users 0 members are here
Related

PS/PL BRAM share

jamestkennedy
jamestkennedy over 12 years ago

I have a Linux/FreeRTOS AMP on the PS cores. I am trying to benchmark a CPIW created custom accelerator. What I have in mind is to use BRAM to provide data to the user logic submodule computation.

I reference AR #50826 ..CDMA transfers from block RAM to OCM. I conceptualize data arriving via ethernet placed in OCM by a linux App (or some custom peripheral). Then the data is moved  from OCM to BRAM for use by the custom IP in the PL.

From the AR, with a AXI BRAM controller and AXI CDMA, I can move data to/from a BRAM. All this is designed in XPS.

Now I want to use the other unconnected BRAM port to read/write data to/from the user logic. I assume that I have to add the BRAM interface as USER PORTS in user_logic.v and proliferate up to system hdl and down to define the PORT B interface in the BRAM module.

Is there an cleaner way to do this? The BRAM controller to BRAM interface in XPS was easy due to the innate BRAM connection. Since my custom peripheral (computational accelerator) has no such native BRAM interface, is the only way to do it within the HDL?

  • Sign in to reply
  • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago

    Would using the AXI4 MMAP interface for the custom accelerator provide the functionality that I am looking for? On the surface, the documentation seems to indicate its use more for data peripherals than for parallel number-crunching, but actually i have not seen reference designs.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago

    added to my ip .mpd file (from axi_bram_ctrl .mpd):

    BUS_INTERFACE BUS = BRAM_PORTB, BUS_STD = XIL_BRAM, BUS_TYPE = INITIATOR


    and
    PORT BRAM_Rst_B = BRAM_Rst, DIR = O, BUS = BRAM_PORTB
    PORT BRAM_Clk_B = BRAM_Clk, DIR = O, BUS = BRAM_PORTB
    PORT BRAM_En_B = BRAM_En, DIR = O, BUS = BRAM_PORTB
    PORT BRAM_WEN_B = BRAM_WEN, DIR = O, BUS = BRAM_PORTB,  VEC = 3:0, ENDIAN = LITTLE
    PORT BRAM_Addr_B = BRAM_Addr, DIR = O, BUS = BRAM_PORTB, VEC = [(C_S_AXI_ADDR_WIDTH - 1) : 0], ENDIAN = LITTLE
    PORT BRAM_Dout_B = BRAM_Dout, DIR = O, BUS = BRAM_PORTB, VEC = 31:0, ENDIAN = LITTLE
    PORT BRAM_Din_B = BRAM_Din, DIR = I, BUS = BRAM_PORTB,  VEC = 31:0, ENDIAN = LITTLE


    now it looks pretty in XPS.

    now to make sure my HDL matches!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago

    Hurray! The HDL (from PlanAhead) is synthesizable.
    Getting it right in the pcore put it right automatically, and the XPS Bus Interface tab looks clean.

    "We don't need no stinkin' XPS license."

    So now, do the DMA from FreeRTOS, and then roll the BRAM data to my submodule ports.
    Getting there. Can I do it?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Hello james,

    I'm working on this issue. I instantiated a BRAM controller and a BRAM in my XPS project, but when I push the "Generate Addresses" button, then the controller remains under the "Unmapped addresses" list. It gets an address, but it seems that is unmapped. I followed UG873 cap.6 to instantiate a CDMA peripheral. Could you give me any hints to solve my problem?

    Thank you,
    sticken

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago in reply to Former Member

    Hi,

    I got the same result -- the bram_ctrl remained under unmapped but received an address. This address is used to access the BRAM from the CDMA. I was able to use this address to execute DMA transfers to and from BRAM to and from high OCM.
    did you try to complete the SDK app and attempt a DMA transfer?
    In another vein, for my attempted accelerator, I used the ACP to move datasets into BRAM instantiated in XPS. But then I got bogged down when trying to access the BRAM from within my custom IP user logic. The resultant dual bus AXI and BRAM interface module is giving me problems where the user_logic modules are trimmed in synthesis due to the way the BRAM access is coded in HDL. I needed to add the BRAM interface to my IP's .mpd. XST is somehow setting the BRAM ports to constant values and trimming the module.
    So I changed to the AXI burst mode in the CIPW and now am working with that mode of transferring the dataset. This creates inferrred BRAM within the IP user_logic, which you can use to transfer data sets and results. However, I don't think the burst mode is supported in AXI_Lite, so I think you need to convert your XPS design to AXI from AXI_lite.
    I still work on both versions though. I can't see why you can't access the BRAM from your IP and am reading the 400+ pages of HDL for the AXI_BRAM_CTRL Xilinx IP to get insights into how to have AXI and BRAM bus interfaces in coexistence.

    hope this helps.

    i think avnet and/or xilinx neds to weigh in on this subject with reference designs, UG etc.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Thank you for your quick answer. You're right, it seems that DMA transfer from DDR to BRAM ends succesfully: status register contains correct value. But I can't understand one thing. BRAM controller is automatically connected to a BRAM in PL? I tried to perform another transfer, from BRAM controller to DDR in order to check whether the values are correct, but they're not..maybe I missed something..

    Thank you again,
    sticken

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to jamestkennedy

    I am also trying to use PL as an accelerator and need a shared buffer for communication between PL and PS. It seems that the AXI_BRAM_CTRL might be helpful. According to the posts "Can the AXI BRAM CONTROLLER ports be made external", it should be able to have a BRAM port exposed to user logic. However, I tried all the possible configurations, and now I am pretty sure there is no way I can make any of the BRAM port external at least on XPS 14.4. I am not sure if it a bug or something. Anyway, I also tried another way by adding an AXI4 peripheral with the XPS wizard. By default, I got an AXI4 peripheral supporting burst transfer. The default configuration of the peripheral is actually a RAM block implemented in synthesizable HDL code. It is really cool, because it allows me to configure the BRAM whatever I want. While the problem is that it does not support AXI burst and I am not familiar with AXI4 protocol. So I am writing to see if I missed something. I guess this is really a basic communication scheme for PL and PS. Is there any easier way to implement a dual port BRAM for the PL-PS communication? If not, I may have to go back to the lengthy AXI4 specification.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to jamestkennedy

    I want to know how you can solve the problem,can you tell me the way and give me the source code you write,thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to jamestkennedy

    Finally I managed to perform a DMA transfer from DDR to BRAM and from BRAM to DDR. Unfortunately when I read value wrote back in the DDR I face a strange behaviour. In practice some values don't make any sense to me. The CDMA transfers number from 0 to 1023 (so 1024 integers, each of them 32 bit wide). Ok, when I print the numbers stored in the destination memory I see that some values don't belong to numbers from 0 to 1023.

    Example:

    Value: 892
    Value: 893
    Value: 894
    Value: 895
    Value: -476021416
    Value: 27279365
    .
    .
    .
    Value: 912
    Value: 913
    Value: 914

    As you can see the is an interval of numbers that are completely wrong. Strange behvior: those intervals can be more than one and I noted that are made by 8, 16 or 32 numbers..

    Any hint would be really appreciated!!

    sticken

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago in reply to Former Member

    My design only used OCM and not DDR. Sorry and good luck finding it.
    Probably an issue specific to using DDR with CDMA. If I find the answer digging into the TRM, I will post it here.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube