element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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 & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General CDMA source/dest address: lab4 in workshop -- Advanced Embedded System Design on Zynq using Vivado
  • 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 1 reply
  • Subscribers 356 subscribers
  • Views 262 views
  • Users 0 members are here
Related

CDMA source/dest address: lab4 in workshop -- Advanced Embedded System Design on Zynq using Vivado

jge
jge over 7 years ago

Hello,

 

I'm trying to understand how the address setup works in the Lab4 of the workshop 2017: 

https://www.xilinx.com/support/university/vivado/vivado-workshops/Vivado-adv-embedded-design-zynq.html

 

 

It seems 'working' but the way it setup the transfer source/destination address is little confusing:

 

#define PROCESSOR_BRAM_MEMORY 0x80000000 // BRAM Port A mapped through 1st BRAM Controller accessed by CPU
#define CDMA_BRAM_MEMORY 0xC0000000 // BRAM Port B mapped through 2nd BRAM Controller accessed by CDMA
#define DDR_MEMORY 0x01000000

let's say the option 1 selected as "  "

 

 

   case '1' :
 //   case '2' :
    source = (u8 *)PROCESSOR_BRAM_MEMORY;
    cdma_memory_source = (u8 *)CDMA_BRAM_MEMORY;
    destination = (u8 *)DDR_MEMORY;
    cdma_memory_destination = (u8 *)DDR_MEMORY;
    print("BRAM to DDR transfer\r\n");
    break;

the 'source' and 'destination' buffer initilized (cleared destination after non-DMA trial) as :

 

 

  // Initialize src memory
  for (i=0; i<numofbytes; i++)
   *(source+i) = numofbytes-i;
  // clear destination memory
  for (i=0; i<numofbytes; i++)
   *(destination+i) = 0;

 after started a polling mode DMA transfer: note with src/dest as "cdma_memory_source/cdma_memory_destination ", NOT "sourc e/destination" already setup, 

 

the 'destination' buffer is compared against the 'source'  to see 'match' or not; if match then DMA succeeded -- WHY? (unless 'source' and 'cdma_memory_source the same; and "destination" and "cdma_memory_destnation" the same too)

 

 // DMA in polling mode
  XAxiCdma_IntrDisable(&xcdma, XAXICDMA_XR_IRQ_ALL_MASK);
  print("Starting transfer through DMA in poll mode\r\n");
  // reset timer
  XScuTimer_RestartTimer(TimerInstancePtr);
  Status = XAxiCdma_SimpleTransfer(&xcdma, (u32) cdma_memory_source, (u32) cdma_memory_destination, numofbytes, NULL, NULL);

  if (Status != XST_SUCCESS) {
   CDMA_Status = XAxiCdma_GetError(&xcdma);
   if (CDMA_Status != 0x0) {
    XAxiCdma_Reset(&xcdma);
    xil_printf("Error Code = %x\r\n",CDMA_Status);
   }
   return XST_FAILURE;
  }

     while (XAxiCdma_IsBusy(&xcdma)); // Wait
  CntValue1 = XScuTimer_GetCounterValue(TimerInstancePtr);

  CDMA_Status = XAxiCdma_GetError(&xcdma);
  if (CDMA_Status != 0x0) {
   XAxiCdma_Reset(&xcdma);
   xil_printf("Error Code = %x\r\n",CDMA_Status);
  }
  else {
   xil_printf("Moving %d bytes through DMA in poll mode took %d clock cycles\r\n", numofbytes, TIMER_LOAD_VALUE-CntValue1);
   print("Transfer complete\r\n");
   polled_cycles = TIMER_LOAD_VALUE-CntValue1;
   Error = 0; // reset for interrupt mode transfer
  }

  for (i = 0; i < numofbytes; i++) {
    if ( destination[i] != source[i]) {
     xil_printf("Data match failed at = %d, source data = %x, destination data = %x\n\r",i,source[i],destination[i]);
     break;
    }
   }
  print("Transfered data verified\r\n");

 

note: the "destination" and "cdma_memory_destination" actually point to the same block (0x0100 0000) . The transfer  is a 'success'.

BUT the "source" and "cdma_memory_source" pointed to different blocks. Although the "destination" block indeed resulted in the same as "source", but contents of  the "cdma_memory_source" (starting from address 0xC000 0000) shown as "?" in debug mode. 

How does the CDMA transfer get the data from 'source; instead of 'cdma_memory_source"? , or 

the memory block starting from 0xC000 0000 is not 'visible' in SDK debug mode???

  • Sign in to reply
  • Cancel
  • jafoste4
    0 jafoste4 over 7 years ago

    Hello,

    Please ask this question over at the Xilinx forum as it is in regards to their training.

    Thanks!

    Josh

    • 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 © 2026 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