- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey everybody. I'm a fairly new user using this board, however I come here to search for topics that can help solve my problems. Lately I have been successful finding these troubleshooting topics except for one.
I'm trying to access the Program Counter (PC) register of the Nios II Processor. Is there any available software function (C/C++ macro) that I'm able to access the program counter and store its value into a variable? If this is not possible, then what other possible solutions that allows me to retrieve the value of the PC? Thanks a lotLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nios II provides the NEXTPC instruction that returns the PC of that instruction plus four.
There doesn't appear to be a HAL macro available for using this instruction from C code. However, it is relatively easy to make one yourself. Just look at the examples in the HAL nios2.h file. It is located in your Nios II kit directory under components/altera_nios2/HAL/inc.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by james@May 30 2006, 10:13 AM nios ii provides the nextpc instruction that returns the pc of that instruction plus four.
there doesn't appear to be a hal macro available for using this
instruction from c code. however, it is relatively easy to make one yourself.
just look at the examples in the hal nios2.h file. it is located in your nios ii kit directory under components/altera_nios2/hal/inc.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15686)
--- quote end ---
--- Quote End --- Thanks, I will certainly take a look at that
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page