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
Software Application Development Can I use XScuGic and XScuTimer at the same time?
  • 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 2 replies
  • Subscribers 328 subscribers
  • Views 1035 views
  • Users 0 members are here
Related

Can I use XScuGic and XScuTimer at the same time?

Former Member
Former Member over 12 years ago

Hi, all,
  I have an IP generated by vivado hls as the accelerator of my project and I also use the scu timer to get the execution cycles of other functions which are implemented in software. The hardware IP contains the interrupt interface.

  I find that if I seperate the accelerator and test it alone, it behave correct. (I do not use timer here). However, When I put
it into my whole design, the accelerator always busy waiting. My whole design use scu timer to estimate the performance of different functions.

  Is it the problem that I can not use scu timer and interrupt (when hardware finished, it will generate an interrupt) at the same time?  (PS: I do not mean to implement a scu timer with interrupt feature)
  I am using Zedboard and Xilinx 14.5

  Any one could give me some advice?

Thanks

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    I use both in my application. As you said, the GIC is the Interrupt Controller, and stores which ISRs to call when an interrupt is triggered.

    Also, be aware that the ScuTimer is a down counter. Perhaps you can use global timer - then you won't have to worry about expiring timers AND it's an up counter AND it's a 64 bit counter AND it's the same frequency as the ScuTimer. See xtime_l.h for info.

    There's a few things you'll have to do to enable interrupts in your application:

    To enable interrupts through the GIC:
    1) XScuGic_CfgInitialize (The device ID can be found in xparameters.h)
    2) Xil_ExceptionInit (Initialize the exception vector table)
    3) Xil_ExceptionRegisterHandler (Just register the XScuGic_InterruptHandler if you wish - it's already written for you)
    4) Xil_ExceptionEnable() (Enable interrupts on the Zedboard)

    From here, the GIC is ready to call ISRs for whichever device sets their interrupt flag. It sounds like you need to figure out the interrupt ID of the accelerator and register that to the GIC.

    To enable interrupts for a device:
    1) Configure the device for interrupts (this might involve setting a bit to allow interrupts in the device - most xilinx third party libraries have functions written for this; for the XScuTimer it is XScuTimer_EnableInterupt - who knew!?)
    2) Register an interrupt handler to the GIC, so it knows what ISR to call when the interrupt has fired. Do this with XScuGic_Connect
    3) Enable interrupts for that specific deivce using XScuGic_Enable (notice that the second parameters for XScuGic_Connect and XScuGic_Enable must match).

    From there you should be good to go. If you don't register a handler to the GIC for a device that has interrupts enabled, then it will call the default handler, StubHandler, found in xscugic.c, which will do nothing except increment the UnhandledInterrupts variable in the XScuGic struct and if that struct has not been properly initialized, Xil_AssertVoid will probably go into an infinite loop.

    Hope this helps.

    • 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 Former Member

    Hi, zackshef,
    Thanks for your details. :-) It is really helpful. I can run it now.
    Thanks again.

    Best regards,
    Henry

    • 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