Using Nios II Tightly Coupled Memory
Tutorial
101 Innovation Drive
San Jose, CA 95134
(408) 544-7000
http://www.altera.com
TU-N2060305-1.0
Copyright © 2005 Altera Corporatio n. All rights r eserved. Altera, The Programm able Solutio ns Company, the stylized Alter a logo, s
p
ecific device des
-
ignations, and all other words and logo s that are identified as trademark s and/or service marks are, unless noted o therwise, the tr adem arks an
d
ser vice mark s of Altera Corporation in the U.S. and other countries. All other product or service nam es are the pr operty of their respective holders. Al-
tera products are protected under numerous U.S. and foreign patents and pending applications, mask work rights, and copyrights. Altera warrant
s
per form ance of i ts s em icon d uctor p ro du c ts to c u rren t specificati on s i n accor dan ce with Altera's stan dard warran ty, but r eserv es the right to make
changes to any products and services at any time without notice. Altera assumes no r esponsibility or liability arising out of the ap-
plication or use of any information, product, or service described herein except as expressly agreed to in writing by Altera
Corporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published in-
form ation and b efo re placin g orders for pro ducts o r services
.
ii Altera Corporation
Contents
Altera Corporation iii
July 2005
About This Tutorial............................................................ V
How to Find Information.................................................................................... v
How to Contact Altera ........................................................................................ vi
Typographical Conventions............................................................................... vii
Using Tightly Coupled Memory ............................................. 9
Introduction .......................................................................................................... 9
Reasons for Using Tightly Coupled Memory ......................................... 9
Trade Offs...................................................................................................... 10
Guidelines for Using Tightly Coupled Memory............................................. 10
Hardware Guidelines.................................................................................. 10
Software Guidelines .................................................................................... 11
Locating Functions in Tightly Coupled Memory........................... 11
Tightly Coupled Memory Interface .................................................................. 12
Restrictions.................................................................................................... 12
Dual Port Memories .................................................................................... 13
Building a Nios II System with Tightly Coupled Memory........................... 13
Hardware and Software Requirements.................................................... 14
Modify the Example Design to Include Tightly Coupled Memories.. 15
Create the Tightly Coupled Memories..................................................... 17
Connect & Position the Tightly Coupled Memories.............................. 21
Exception Address Selection...................................................................... 23
Add a Performance Counter ...................................................................... 24
Build the Hardware System ....................................................................... 25
Create a Software Project to Exercise Tightly Coupled Memories...... 26
Specify a Separate Exception Stack........................................................... 26
Change the Projects’ Build Properties ...................................................... 28
Executing the Software on the Modified Standard_tcm Hardware Design 28
Download and Run Tcm_vs_cache Project ............................................. 29
Interrupt Response Time ............................................................................ 29
Memory Access Times ................................................................................ 30
Software Example Implementation Notes....................................................... 30
Checksum Memory Block Size .................................................................. 30
Heating the Instruction Cache ................................................................... 31
Unrolled Checksum Loops for Optimization.......................................... 31
Conclusion............................................................................................................. 31
Contents
iv Altera Corporation
Using Nios II Tightly Coupled Memory Tutorial July 2005
About This Tutorial
Altera Corporation v
July 2005
This tutorial describes how to use tightly coupled memory in Nios
®
II
designs.
The following table shows the revision history of this document.
Date Description
July 2005 First publication.
How to Find Information
The Adobe Acrobat Find feature allows you to search the contents
of a PDF file. Click the binoculars toolbar icon to open the Find
dialog box.
Bookmarks serve as an additional table of contents.
Thumbnail icons, which provide miniature previews of each page,
provide a link to the pages.
Numerous links, shown in green text, allow you to jump to related
information.