DW Apb Timers Databook
DW Apb Timers Databook
Databook
2.13a
December 2020
DW_apb_timers Databook
Synopsys, Inc.
www.synopsys.com
Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Databook Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Web Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Product Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1
Product Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.1 DesignWare System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2 General Product Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.1 DW_apb_timers Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.4 Standards Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5 Verification Environment Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.6 Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.7 Where To Go From Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Chapter 2
Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.1 Timer Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 DW_apb_timers Usage Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3 DW_apb_timers Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3.1 Choosing the Number of Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3.2 Enabling and Disabling a Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.3 Configuring the Width of a Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.4 Loading a Timer Countdown Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.5 Working with Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.6 Controlling Clock Boundaries and Metastability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.7 Generating Toggled Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.8 Timer Pause Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4 Clocks and Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.1 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.2 Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.5 APB Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.5.1 APB 3.0 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.5.2 APB 4.0 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.6 Design For Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Chapter 3
Parameter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1 Top Level Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2 Timer N Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Chapter 4
Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.1 APB Interface Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.2 Timer Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Chapter 5
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.1 DW_apb_timers_mem_map/DW_apb_timers_addr_block Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.1.1 TimerNLoadCount (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.1.2 TimerNCurrentValue (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.1.3 TimerNControlReg (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
5.1.4 TimerNEOI (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.1.5 TimerNIntStatus (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.1.6 TimersIntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.1.7 TimersEOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.1.8 TimersRawIntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.1.9 TIMERS_COMP_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.1.10 TimerNLoadCount2 (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.1.11 TIMER_N_PROT_LEVEL (for N = 1; N <= NUM_TIMERS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Chapter 6
Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.1 Programming the 0% and 100% Duty Cycle Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Chapter 7
Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.1 Verification Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.2 Testbench Directories and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.3 Packaged Testcases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Chapter 8
Integration Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
8.1 Accessing Top-level Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
8.2 Coherency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
8.2.1 Writing Coherently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
8.2.2 Reading Coherently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
8.3 Timing Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
8.4 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8.4.1 Power Consumption, Frequency, and Area Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Appendix A
Basic Core Module (BCM) Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.1 BCM Library Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.2 Synchronizer Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A.2.1 Synchronizers Used in DW_apb_timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
A.2.2 Synchronizer 1: Simple Double Register Synchronizer (DW_apb_timers) . . . . . . . . . . . . . . . . . . . 100
Chapter B
Internal Parameter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Appendix C
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Revision History
This table shows the revision history for the databook from release to release. This is being tracked from
version 2.02d onward.
.
(Continued)
2.10a June 2015 ■ Modified default value for TimerNCurrentValue field of the Timer N register
■ Included section “Running SpyGlass® Lint and SpyGlass® CDC”
■ Included section “Running SpyGlass on Generated Code with coreAssembler”
■ Chapter 4, “Signal Descriptions” auto-extracted from the RTL
■ Added Chapter B, “Internal Parameter Descriptions”
■ Added Appendix A, “Basic Core Module (BCM) Library”
(Continued)
2.08a September 2012 Added the product code on the cover and in Table 1-1
2.05a September 2010 Corrected names of include files and vcs command used for simulation
2.03a December 2009 Updated databook to new template for consistency with other IIP/VIP/PHY
databooks.
2.03a July 2009 ■ Corrected and enhanced free-running and user-defined modes
■ Corrected values for setting interrupt mask as either masked or not masked in
“DW_apb_timers Usage Flow” section
2.03a May 2009 Removed references to QuickStarts, as they are no longer supported
2.02d January 2008 ■ Updated to revised installation guide and consolidated release notes
■ Changed references of “Designware AMBA” to simply “DesignWare”
Preface
This databook provides information that you need to interface the DesignWare® APB Timers peripheral,
referred to as the DW_apb_timers throughout the remainder of this databook. It is a component of the
DesignWare Advanced Peripheral Bus (DW_apb) and conforms to the AMBA Specification, Revision 2.0 from
Arm®.
The information in this databook includes a functional description, signal and parameter descriptions,
programmable register descriptions and a memory map. The databook also provides step-by-step
information about using the DW_apb_timers in the coreConsultant flow. It also includes an overview of the
component testbench and a description of the tests that are run to verify the coreKit. The databook also
contains several appendices that provide additional information to help you integrate the component into
your higher-level design.
Databook Organization
The chapters of this databook are organized as follows:
■ Chapter 1, “Product Overview” provides a system overview, a component block diagram, basic
features, and an overview of the verification environment.
■ Chapter 2, “Functional Description” describes the functional operation of the DW_apb_timers.
■ Chapter 3, “Parameter Descriptions” identifies the configurable parameters supported by the
DW_apb_timers.
■ Chapter 4, “Signal Descriptions” provides a list and description of the DW_apb_timers signals.
■ Chapter 5, “Register Descriptions” describes the programmable registers of the DW_apb_timers.
■ Chapter 6, “Programming Considerations” provides information needed to program the configured
DW_apb_timers.
■ Chapter 7, “Verification” provides information on verifying the configured DW_apb_timers.
■ Chapter 8, “Integration Considerations” includes information you need to integrate the configured
DW_apb_timers into your design.
■ Appendix A, “Basic Core Module (BCM) Library” documents the synchronizer methods (blocks of
synchronizer functionality), and list of BCM library components used in DW_apb_timers.
■ Chapter B, “Internal Parameter Descriptions” provides a list of internal parameter descriptions that
might be indirectly referenced in expressions in the Signals chapter.
■ Appendix C, “Glossary” provides a glossary of general terms.
Related Documentation
■ Using DesignWare Library IP in coreAssembler – Contains information on getting started with using
DesignWare SIP components for AMBA 2 and AMBA 3 AXI components within coreTools
■ coreAssembler User Guide – Contains information on using coreAssembler
■ coreConsultant User Guide – Contains information on using coreConsultant
To see a complete listing of documentation within the DesignWare Synthesizable Components for AMBA 2,
see the Guide to Documentation for DesignWare Synthesizable Components for AMBA 2 and AMBA 3 AXI
(Documentation Overview).
Web Resources
■ DesignWare IP product information: https://www.synopsys.com/designware-ip.html
■ Your custom DesignWare IP page: https://www.synopsys.com/dw/mydesignware.php
■ Documentation through SolvNetPlus: https://solvnetplus.synopsys.com (Synopsys password
required)
■ Synopsys Common Licensing (SCL): https://www.synopsys.com/keys
Customer Support
Synopsys provides the following various methods for contacting Customer Support:
■ Prepare the following debug information, if applicable:
❑ For environment set-up problems or failures with configuration, simulation, or synthesis that
occur within coreConsultant or coreAssembler, select the following menu:
File > Build Debug Tar-file
Check all the boxes in the dialog box that apply to your issue. This option gathers all the
Synopsys product data needed to begin debugging an issue and writes it to the
<core tool startup directory>/debug.tar.gz file.
❑ For simulation issues outside of coreConsultant or coreAssembler:
■ Create a waveforms file (such as VPD or VCD).
■ Identify the hierarchy path to the DesignWare instance.
■ Identify the timestamp of any signals or locations in the waveforms that are not understood.
■ For the fastest response, enter a case through SolvNetPlus:
a. https://solvnetplus.synopsys.com
SolvNetPlus does not support Internet Explorer. Use a supported browser such
Note as Microsoft Edge, Google Chrome, Mozilla Firefox, or Apple Safari.
b. Click the Cases menu and then click Create a New Case (below the list of cases).
c. Complete the mandatory fields that are marked with an asterisk and click Save.
Product Code
Table 1-1 lists all the components associated with the product code for DesignWare APB Peripherals.
DW_apb_gpio General Purpose I/O pad control peripheral for the AMBA 2 APB bus
DW_apb_rap Programmable controller for the remap and pause features of the DW_ahb
interconnect
DW_apb_rtc A configurable high range counter with an AMBA 2 APB slave interface
DW_apb_wdt A programmable watchdog timer peripheral for the AMBA 2 APB bus
1
Product Overview
DW_axi_x2x DW_axi_x2x
Arbitration,
DW_axi [2]
Decode, & Mux
DW_apb_uart … DW_apb_i2c
Non-DW
AHB Master
Non-DW
Master
Non-DW
Slave
Arbitration,
DW_axi
Decode, & Mux
VIP
RAM DW_axi_rs
Master/Slave DW_axi_x2h Memory Models
AXI
axi_monitor_vmt
ahb_monitor_vmt
AHB Non-DW AXI
Master/Slave DW_ahb_ictl DW_memctl DW_ahb_dmac
Master/Slave
VIP
Arbitration,
DW_ahbDW_ahb
Decode, & Mux
Application-
DW_ahb_h2h,
DW_ahb_dmac DW_ahb_icm Specific
High-speed
DW_ahb_eh2h Peripherals
Logic
USB, Ethernet,
PCI-X, and so on
DW_ahb [2] Non-DW
Peripherals
apb_monitor_vmt Application-
APB Slave Specific Non-DW
VIP Logic Peripherals
DW_ahb
DW_apb AHB/APB Bridge
You can connect, configure, synthesize, and verify the DW_apb_timers within a DesignWare subsystem
using coreAssembler, documentation for which is available on the web in the coreAssembler User Guide.
If you want to configure, synthesize, and verify a single component such as the DW_apb_timers component,
you might prefer to use coreConsultant, documentation for which is available in the coreConsultant User
Guide.
DW_apb_timers
Timer1
Timer2
TimerN*
* N <= 8
1.3 Features
DW_apb_timers has the following features:
■ APB interface supports APB2, APB3, and APB4
■ Up to eight programmable timers
■ Configurable timer width: 8 to 32 bits
■ Support for two operation modes: free-running and user-defined count
■ Support for independent clocking of timers
■ Configurable polarity for each individual interrupt
■ Configurable option for a single or combined interrupt output flag
1.6 Licenses
Before you begin using the DW_apb_timers, you must have a valid license. For more information, see
“Licenses” in the DesignWare Synthesizable Components for AMBA 2/AMBA 3 AXI Installation Guide.
2
Functional Description
This chapter describes the following sections how you can use the DW_apb_timers.
Before writing to a TimerNLoadCount register, you must disable the timer by writing a “0” to
Note the timer enable bit of TimerNControlReg in order to avoid potential synchronization problems.
As an example, suppose you have only timer1, and the timer_1_clk signal is asynchronous to pclk. When
you disable the timer enable bit (bit 0 of Timer1ControlReg), the timer_en output signal is de-asserted and,
accordingly, timer_1_clk should stop. Then when you enable the timer, the timer_en signal is asserted and
timer_1_clk should start running. This is not necessary, however, as long as the timer_1_clk is synchronous
to pclk; in this case, you can choose to directly tie timer_1_clk to pclk.
It is also not necessary to stop the timer_1_clk if the TIM_NEWMODE parameter is set to 1 (True). For more
information on this parameter and on synchronization and metastability issues, see “Controlling Clock
Boundaries and Metastability” on page 24.
Thus you have five individual registers for each of the timers in your design. All other registers control their
respective functions for all active timers, rather than for individual timers.
If you set the TIM_NEWMODE parameter to 1, the value that is loaded to the timer—when it
Note counts down to 0—alternates between the value of the TimerNLoadCount register and the
TimerNLoadCount2 register. For more details, see “Pulse Width Modulation of Toggle
Outputs” on page 28.
■ Free-running mode – Timer loads the maximum value, which is dependent on the timer width; that
is, the TimerNLoadCount register is comprised of 2TIMER_WIDTH_N – 1 bits, all of which are loaded
with 1s. The timer counter wrapping to its maximum value allows time to reprogram or disable the
timer before another interrupt occurs. Use this mode if you want a single timed interrupt. Designate
this mode by writing a “0” to bit 1 of TimerNControlReg.
timer_N_clk
interrupt*
pclk
pclk_timer_intr
timer_intr
* internal signal
The setting of the internal interrupt signal occurs synchronously to the timer clock domain. This internal
interrupt signal is transferred to the pclk domain in order to set the timer interrupt. The internal interrupt
signal and the timer interrupt are not generated if the timer is disabled; if the timer interrupt is set, then it is
cleared when the timer is disabled.
When the TIM_NEWMODE = 1 and INTR_SYNC2PCLK = 0, interrupt detection can occur even when the
system clock is disabled. The timer_intr interrupt output signal is asserted when the interrupt is detected in
the timer clock domain.
As shown in Figure 2-3, the timer_intr signal remains asserted until pclk is re-started and the TimerNEOI or
TimerEOI registers are read to clear the interrupt, or the timer is disabled.
timer_N_clk
interrupt*
pclk
pclk_timer_intr**
timer_intr
If the system bus (AHB) can perform a write to clear a timer interrupt, it could continue with another
transfer on the bus without knowing whether the write has occurred because of the hclk/pclk ratio.
Therefore, it is much safer to clear the timer interrupt by a read operation.
Figure 2-4 shows the timer interrupt timing when cleared by the TimersEOI register.
pclk
paddr Timer1EOI
pwrite
psel
penable
pclk_timer_intr
timer_intr
Each timer generates an internal interrupt signal that is synchronized to the pclk domain. Figure 2-5 shows
an internal interrupt signal affecting the clock boundaries between the two clock domains.
timerN_counter
0 pclk_intr_status
== Edge RAW
Detection STATUS &
INTR
1 STATUS
Zero
TIM_METASTABLE=1
1 0 Timer_interrupt
0 1
TIM_NEWMODE
timer_intrmask INTR_SYNC2PCLK
The internal interrupt signal is generated in the timer clock domain when the timer counter rolls over to its
maximum value.
The timer interrupt (timer_intr) is asserted based on the value of the TIM_NEWMODE and
INTR_SYNC2PCLK parameters as follows:
■ When TIM_NEWMODE is set to 0 (False), the timer interrupt is asserted when the internal interrupt
signal is edge-detected in the pclk domain.
■ When TIM_NEWMODE is set to 1 (True) and INTR_SYNC2PCLK is set to 1 (True), the timer
interrupt is asserted when the internal interrupt signal is edge-detected in the pclk domain.
■ When TIM_NEWMODE is set to 1 (True) and INTR_SYNC2PCLK is set to 0 (False), the timer
interrupt is asserted along with the internal interrupt signal generated in the timer clock domain
when the timer counter rolls over to its maximum value.
■ When TIM_NEWMODE is set to 1 (True) and INTR_SYNC2PCLK is set to 0 (False), the internal
interrupt remains set until it is transferred to the pclk domain and edge detected there. Then it is
cleared automatically, leaving the pclk interrupt set. The pclk domain interrupt is cleared when
software reads the TimerNEOI registers. This mode allows the timer interrupt to be detected, even
when pclk is disabled.
In the case when pclk is stopped and INTR_SYNC2PCLK is set to 0 (False), the timer interrupt
remains asserted until pclk is restarted and the interrupt is serviced, or the timer is disabled or reset.
The internal interrupt signal is edge-detected in the pclk domain in order to set the timer interrupt, as
illustrated in Figure 2-6.
Figure 2-6 Timer Interrupt Set – Metastability Registers Included and TIM_NEWMODE = 0
timer_N_clk
interrupt*
pclk
pclk_timer_intr
timer_intr
* internal signal
A timer_en signal is edge-detected in the timer clock domain. When it transitions from 0 to 1, the timer
counter is loaded with the value of the TimerNLoadCount register. This guarantees that the timer is in a
known state when enabled. If you disable a timer counter by writing a “0” to bit 0 of its TimerNControlReg
register, it also synchronously disables interrupts for that timer counter in the pclk domain. This prevents
spurious interrupts because of mis-sampling in the timer clock domain.
Neither the timer mode bit of TimerNControlReg nor the TimerNLoadCount register are synchronized
between the pclk domain and the timer clock domain. Because of this, it is important that you disable a
timer before programming its mode or load count value so that any information on these signals is always
communicated to the timer while it is inactive. Thus you must ensure that these signals are stable whenever
a timer is enabled. In practice, this means that you must follow at least this basic procedure:
1. First use the TimerNControlReg to disable the timer, program its timer mode, and then set the
interrupt mask.
2. Next, load the timer counter value into the TimerNLoadCount register.
3. Finally, enable the timer through TimerNControlReg.
For more details on this procedure, see “DW_apb_timers Usage Flow” on page 19.
When you connect a timer_N_clk input to a clock source that is independent of pclk, metastability registers
must be instantiated by setting the TIM_METASTABLE_N parameter (Metastability support for interrupt
from Timer N) to “Present” (where N is in the range 1 to 8). By instantiating the metastability registers, an
extra two pclk periods of latency occurs between when a timer maximum count is reached and when its
interrupt goes active. To see the difference, compare the timing in Figure 2-2 (no metastability registers) to
that in Figure 2-6 (metastability registers included).
The DW_apb_timers component supports timer clocks that are up to four times the frequency of pclk. If you
connect a timer_N_clk to a clock source that is faster than pclk, you must extend the width of the internal
interrupt signal to allow adequate time for it to be sampled in the pclk domain.
You can extend the width of the interrupt signal up to three timer_N_clk clock periods by setting the
TIM_PULSE_EXTD_N parameter (Number of clock cycles by which to extend interrupt, where N is in the
range 1 to 8) to a non-zero value.
Figure 2-7 illustrates an example of related pclk and timer_N_clk, where the frequency of timer_N_clk is
two times that of pclk. To accommodate this, the TIM_PULSE_EXTD_N parameter is set to 1 in order to
extend the internal interrupt signal by one timer_N_clk clock period.
Figure 2-7 Timer Interrupt Set – Pulse Extend One Cycle, No Metastability
timer_N_clk
interrupt*
pclk
pclk_timer_intr
timer_intr
* internal signal
Figure 2-8 illustrates an example where metastability registers are required because pclk is independent of
timer_N_clk, and 1 < frequency of timer_N_clk < 2 times that of pclk. To accommodate this, the
TIM_PULSE_EXTD_N parameter is set to 1 in order to extend the internal interrupt signal by one
timer_N_clk clock period.
Figure 2-8 Timer Interrupt Set – Pulse Extend One Cycle, With Metastability
timer_N_clk
interrupt*
pclk
pclk_timer_intr
timer_intr
* internal signal
When the TIM_NEWMODE parameter is set to 1, it is not required to extend the width of the
Note internal interrupt signal, since it remains asserted until the interrupt is detected in the pclk
domain. Therefore, when TIM_NEWMODE is set to 1, the TIM_PULSE_EXTD_N parameter
is disabled.
Figure 2-9 illustrates an example where metastability registers are included when TIM_NEWMODE = 1.
Figure 2-9 Timer Interrupt Set – Metastability Registers Included and TIM_NEWMODE=1
timer_N_clk
interrupt*
pclk
pclk_timer_intr
timer_intr
* internal signal
Note TIM_NEWMODE is enabled only when APB Data Bus Width = 32.
Note The TimerNLoadCount register defines the LOW period and the TimerNLoadCount2 register
defines the HIGH period values.
The definition of the duty cycles (with TimerNLoadCount and TimerNLoadCount2) is as follows (note that
the high period signifies the duty cycle number):
■ 0% duty cycle – Continuous Low and no high
❑ TimerNLoadCount = Do not care
❑ TimerNLoadCount2 = 0
■ 100% duty cycle – No low period and continuous high
❑ TimerNLoadCount = 0
❑ TimerNLoadCount2 = Do not care
■ Other duty cycle – When 0% and 100% duty cycle mode is enabled (with timer PWM mode and the
user-defined count mode is enabled), the definition of the toggle high and low period changes as
follows for a duty cycle other than 0% or 100%:
❑ Width of timer_N_toggle HIGH period = TimerNLoadCount2 * timer_N_clk clock period
❑ Width of timer_N_toggle LOW period = TimerNLoadCount * timer_N_clk clock period
The above definition is applicable only if the 0% and 100% duty cycle mode is enabled along
Note with the timer Pulse Width Modulation (PWM) mode and the user-defined count mode. If any
of these modes are not enabled, that is, if the PWM mode or user-defined mode is not
enabled, then the new definition of the High and Low period is not applicable. The previous
definition of the High and Low period is applicable.
Table 2-1 provides information on the relation between Duty cycle, TimerNLoadCount, and
TimerNLoadCount2 values, considering that the maximum value is 100.
0 X 0
1 99 1
2 98 2
3 97 3
4 96 4
96 4 96
97 3 97
98 2 98
99 1 99
100 0 100
Table 2-2 provides an example of the programming TimerNLoadCount and TimerNLoadCount2 registers
for a timer, with timer width set to 8 bits.
Table 2-2 Duty Cycle, TimerNLoadCount, TimerNLoadCount2 Relationship Table (8-Bit Timer)
0 X 0
1 FC 02
2 F9 05
3 F7 07
4 F4 0A
.... …. ….
96 0A F4
97 07 F7
98 05 F9
99 02 FC
100 0 X
Following are some points that you must consider while configuring the pulse width modulation with 0%
and 100% duty cycle feature:
■ The 0% and 100% duty cycle mode is enabled when DW_apb_timers is configured or programmed
with the following:
❑ Configured with TIM_NEWMODE = 1 and TIMER_0N100_PWM_HC_EN = 0
■ Enable TimerNControlReg [4] – 0% and 100% duty cycle mode enable bit.
■ Enable TimerNControlReg [3] – PWM enable bit.
2.4.2 Resets
The DW_apb_timers includes separate reset signals dedicated to each clock domain
■ The presetn signal resets logic in pclk domain
■ The timer_N_resetn signal resets logic in the timer_N_clk domain
The resets are active-low and can be asynchronously asserted but the de-assertion must be synchronous to
the respective clock. DW_apb_timers does not contain logic to perform this synchronization, it must be
taken care externally.
Figure 2-10 Read/Write Buses Between the DW_apb and an APB Slave
The data, control and status registers within the DW_apb_timers are byte-addressable. The maximum
width of the control or status register (except for the TIMERS_COMP_VERSION register) in the
DW_apb_timers is 8 bits. Therefore, if the APB data bus is 8, 16, or 32 bits wide, all read and write
operations to the DW_apb_timers control and status registers require only one APB access.
The timer load count and current value register width depends on the TIMER_WIDTH_N parameter, which
can vary from 8 to 32. Depending on the previously mentioned width of the timer and the APB data bus
width (that is, the APB_DATA_WIDTH parameter), the APB interface may need to perform single or
multiple accesses to the timer load count and current value register.
“Integration Considerations” on page 83 provides information about reading to and writing from the APB
interface.
The APB 3 and APB4 register accesses to the DW_apb_timers peripheral are discussed in the following
sections:
■ “APB 3.0 Support” on page 33
■ “APB 4.0 Support” on page 33
Note DW_apb_timers does not use the PREADY signal and it used only for interface consistency.
31 24 23 16 15 87 0
PSTRB[3] PSTRB[2] PSTRB[1] PSTRB[0]
■ PPROT – This signal supports the protection feature of the APB4 protocol. The APB4 protection
feature is supported only on the TimerNLoadCount and TimerNLoadCount2 registers. The
protection level register (TIMER_N_PROT_LEVEL) defines the APB4 protection level, that is the
protected registers (TimerNLoadCount and TimerNLoadCount2) are updated only if the PPROT
privilege is more than the protection privilege programmed in the protection level register (see
Table 2-3). Otherwise, PSLVERR is asserted and the protected register is not updated, provided that
PSLVERR_RESP_EN is set as high. If the PSLVERR_RESP_EN is low, then protection feature and
PSLVERR generation logic is not implemented
Table 2-3 PPROT Level, Protection Level Programmed in TIMER_N_PROT_LEVEL, and Slave Error Response
PPROT TIMER_N_PROT_LEVEL
X X 0 X X 1 HIGH
X 1 X X 0 X HIGH
0 X X 1 X X HIGH
S
D Q
timer_resetn
Q
C
scan_mode
timer_en
3
Parameter Descriptions
This chapter details all the configuration parameters. You can use the coreConsultant GUI configuration
reports to determine the actual configured state of the controller. Some expressions might refer to TCL
functions or procedures (sometimes identified as <functionof>) that coreConsultant uses to make
calculations. The exact formula used by these TCL functions is not provided in this chapter. However, when
you configure the controller in coreConsultant, all TCL functions and parameters are evaluated completely;
and the resulting values are displayed where appropriate in the coreConsultant GUI reports.
The parameter descriptions in this chapter include the Enabled: attribute which indicates the values
required to be set on other parameters before you can change the value of this parameter.
These tables define all of the configuration options for this component.
■ Top Level Parameters on page 36
■ Timer N Configuration on page 40
Label Description
Register Interface Type Selects Register Interface type as APB2, APB3 or APB4. By default,
DW_apb_timers supports APB2 interface.
Values:
■ APB2 (0)
■ APB3 (1)
■ APB4 (2)
Default Value: APB2
Enabled: Always
Parameter Name: SLAVE_INTERFACE_TYPE
Slave Error Response Enable Enables Slave Error response signaling. The component will refrain From signaling
an error response if this parameter is disabled.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: SLAVE_INTERFACE_TYPE>1
Parameter Name: SLVERR_RESP_EN
TIMERS Protection Level Reset Value of TIMER_N_PROT_LEVEL register. A high on any bit of timer
protection level requires a high on the corresponding pprot input bit to gain access
to the load count registers. Else, SLVERR response is triggered. A zero on the
protection bit will provide access to the register if other protection levels are
satisfied.
Values: 0x0, ..., 0x7
Default Value: 0x2
Enabled: SLAVE_INTERFACE_TYPE>1 && SLVERR_RESP_EN==1
Parameter Name: PROT_LEVEL_RST
Hard-Code Protection Level? Checking this parameter makes TIMERS_N_PROT_LEVEL a read-only register,
reflecting default PROT_LEVEL_RST when read. The register can be programmed
at run-time by a user if this hard-code option is turned off.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: SLAVE_INTERFACE_TYPE>1 && SLVERR_RESP_EN==1
Parameter Name: HC_PROT_LEVEL
Label Description
APB Data Bus Width Width of the APB data bus to which this component is attached.
Values: 8, 16, 32
Default Value: 32
Enabled: Always
Parameter Name: APB_DATA_WIDTH
Enable Timer New Mode ? When set to True (1), this parameter enables the following features in all the timers:
■ If TimerNControlReg[4] is set to 1, the width of LOW and HIGH periods of timer
toggle outputs can be separately programmed through TimerNLoadCount and
TimerNLoadCount2 registers, respectively.
■ Timer_N_clk can be free-running; that is, timer_n_clk does not have to be
stopped when timer is disabled.
■ Timer interrupt can be detected, even when pclk is stopped.
■ Timer can be paused using timer_N_pause inputs.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: APB_DATA_WIDTH==32
Parameter Name: TIM_NEWMODE
Interrupt Synchronized to When TIM_NEWMODE is enabled, the timer interrupt can be generated either in
System clock(pclk)/Timer the system clock (pclk) or in the Timer clock (timer_clk) domain. When set to 0, the
clock(timer_clk) ? timer interrupt is generated in the Timer clock domain; when set to 1, the timer
interrupt is generated in the system clock domain.
Values:
■ Timer clock (timer_clk) (0)
■ system clock (pclk) (1)
Default Value: Timer clock (timer_clk)
Enabled: TIM_NEWMODE==1
Parameter Name: INTR_SYNC2PCLK
Label Description
Enable Timer 0% and 100% When set to True (1), this parameter enables the 0% and 100% PWM mode on the
PWM Mode ? toggle output. This feature adds 1-bit to the TimerNControlReg as follows:
TimerNControlReg[4] - Timer 0% and 100% duty cycle Mode Enable
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: ((TIMER_HAS_TOGGLE_1 == 1) || (TIMER_HAS_TOGGLE_2 == 1) ||
(TIMER_HAS_TOGGLE_3 == 1) || (TIMER_HAS_TOGGLE_4 == 1) ||
(TIMER_HAS_TOGGLE_5 == 1) || (TIMER_HAS_TOGGLE_6 == 1) ||
(TIMER_HAS_TOGGLE_7 == 1) || (TIMER_HAS_TOGGLE_8 == 1)) &&
(TIM_NEWMODE_VAL == 1)
Parameter Name: TIM_0N100_PWM_MODE
Hardcode Timer 0% and 100% When set to True (1), this parameter hardcodes the 0% and 100% PWM mode
PWM Mode enable bit? enable bit in the TimerNControlReg in the register. This is provided to reduce the
software overhead.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: TIM_0N100_PWM_MODE == 1
Parameter Name: TIMER_0N100_PWM_HC_EN
Label Description
Single Combined Interrupt? When set to True (1), the component generates a single interrupt combining all
timer interrupts. If set to False (0), the component generates an interrupt output for
each timer.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: TIM_NEWMODE==0
Parameter Name: TIM_INTR_IO
Label Description
Timer N Configuration
Include toggle output for timer When set to True (1), the interface includes an output (timer_N_toggle) that toggles
#N on I/F? each time the timer counter reloads. The output is disabled to 0 each time the timer
(for N = 1; N <= is disabled.
NUM_TIMERS) Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: NUM_TIMERS >= N
Parameter Name: TIMER_HAS_TOGGLE_(N)
Metastability support for This option instantiates metastability registers to synchronize timer interrupt signals
interrupt from Timer #N to the pclk domain. Set this to Present (1) if timer_N_clk is independent of pclk. If
(for N = 1; N <= this parameter is set to Absent (0), then timer_N_clk is considered to be connected
NUM_TIMERS) to or synchronous with pclk.
Values:
■ Absent (0)
■ Present (1)
Default Value: TIM_NEWMODE
Enabled: (TIM_NEWMODE == 0) AND (NUM_TIMERS >= N)
Parameter Name: TIM_METASTABLE_(N)
Timer N Clock Domain Sets the number of synchronization stages to be placed on clock domain crossing
Crossing Synchronization signals for timer N.
Depth ■ 2: 2-stage synchronization with positive-edge capturing at both the stages
(for N = 1; N <= ■ 3: 3-stage synchronization with positive-edge capturing at all stages
NUM_TIMERS)
■ 4: 4-stage synchronization with positive-edge capturing at all stages
Values: 2, 3, 4
Default Value: 2
Enabled: TIM_METASTABLE_(N)==1
Parameter Name: TIM_SYNC_DEPTH_(N)
Label Description
Number of clock cycles by If this timer clock is faster than the system bus clock, you can extend the internal
which to extend interrupt for interrupt by up to three timer clock cycles to guarantee that it is seen in the bus clock
Timer #N domain. A 0 value in this field means that no pulse extension is performed. Also
(for N = 1; N <= refer to the "Controlling Clock Boundaries and Metastability" section in the
NUM_TIMERS) DW_apb_timers databook.
Set this parameter to the following values, depending on the timer_N_clk/pclk
frequency ratio R:
timer_N_clk/pclk frequency RPULSE_EXTEND_N
R<=1 --------------------------------- 0
1<R<=2 ------------------------------ 1
2<R<=3 ------------------------------ 2
3<R<=4 ------------------------------ 3
R>4 --------------------------------- Not Valid
Values: 0, 1, 2, 3
Default Value: 0
Enabled: (TIM_NEWMODE == 0) AND (NUM_TIMERS >= N)
Parameter Name: TIM_PULSE_EXTD_(N)
Include Coherency Registers When set to True (1), a bank of registers is added between this timer and the APB
for this Timer? interface of DW_apb_timers to guarantee that the timer value read back from this
(for N = 1; N <= block is coherent. It does not reflect ongoing changes in the timer value that takes
NUM_TIMERS) place while the read operation is in progress.
Note: Including coherency can dramatically increase the register count of the
design.
Values:
■ false (0)
■ true (1)
Default Value: false
Enabled: (TIMER_WIDTH_N > APB_DATA_WIDTH) AND (NUM_TIMERS >= N)
Parameter Name: TIM_COHERENCY_(N)
4
Signal Descriptions
This chapter details all possible I/O signals in the controller. For configurable IP titles, your actual
configuration might not contain all of these signals.
Inputs are on the left of the signal diagrams; outputs are on the right.
Attention: For configurable IP titles, do not use this document to determine the exact I/O footprint of the
controller. It is for reference purposes only.
When you configure the controller in coreConsultant, you must access the I/O signals for your actual
configuration at workspace/report/IO.html or workspace/report/IO.xml after you have completed the
report creation activity. That report comes from the exact same source as this chapter but removes all the
I/O signals that are not in your actual configuration. This does not apply to non-configurable IP titles. In
addition, all parameter expressions are evaluated to actual values. Therefore, the widths might change
depending on your actual configuration.
Some expressions might refer to TCL functions or procedures (sometimes identified as <functionof>) that
coreConsultant uses to make calculations. The exact formula used by these TCL functions is not provided in
this chapter. However, when you configure the controller in coreConsultant, all TCL functions and
parameters are evaluated completely; and the resulting values are displayed where appropriate in the
coreConsultant GUI reports.
In addition to describing the function of each signal, the signal descriptions in this chapter include the
following information:
Active State: Indicates whether the signal is active high or active low. When a signal is not intended to be
used in a particular application, then this signal needs to be tied or driven to the inactive state (opposite of
the active state).
Registered: Indicates whether or not the signal is registered directly inside the IP boundary without
intervening logic (excluding simple buffers). A value of No does not imply that the signal is not
synchronous, only that there is some combinatorial logic between the signal's origin or destination register
and the boundary of the controller. A value of N/A indicates that this information is not provided for this IP
title.
Synchronous to: Indicates which clocks in the IP sample this input (drive for an output) when considering
all possible configurations. A particular configuration might not have all of the clocks listed. This clock
might not be the same as the clock that your application logic should use to clock (sample/drive) this pin.
For more details, consult the clock section in the databook.
Exists: Names of configuration parameters that populate this signal in your configuration.
Validated by: Assertion or de-assertion of signals that validates the signal being described.
pclk - - pready
presetn - - pslverr
penable - - prdata
psel -
pwrite -
paddr -
pwdata -
pprot -
pstrb -
pclk I APB clock; also known as the system clock. This clock times all bus
transfers. All signal timings are related to the rising edge of pclk.
Exists: Always
Synchronous To: None
Registered: N/A
Power Domain: SINGLE_DOMAIN
Active State: N/A
presetn I APB reset. The bus reset signal is used to reset the system and the
bus on the DesignWare interface. Asynchronous APB interface
domain reset. This signal resets only the bus interface. The signal is
asserted asynchronously, but is deasserted synchronously after the
rising edge of pclk. DW_apb_timers does not contain logic to perform
this synchronization, so it must be provided externally.
Exists: Always
Synchronous To: Asynchronous
Registered: N/A
Power Domain: SINGLE_DOMAIN
Active State: Low
penable I APB enable control that indicates the second cycle of the APB frame.
Exists: Always
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: High
pprot[2:0] I APB4 Protection type. The input bits should match the corresponding
protection activated level bit of the accessed register to gain access
to the timer load-count registers. Else the DW_apb_timers generates
an error. If protection level is turned off, any value on the
corresponding bit is acceptable. Signal is ignored if
SLVERR_RESP_EN==0.
Exists: SLAVE_INTERFACE_TYPE>1
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: N/A
pstrb[((APB_DATA_WIDTH/8)-1):0] I APB4 Write strobe bus. A high on individual bits in the pstrb bus
indicate that the corresponding incoming write data byte on APB bus
is to be updated in the addressed register.
Exists: SLAVE_INTERFACE_TYPE>1
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: High
pready O This APB3 protocol signal indicates the end of a transaction when
high in the access phase of a transaction. PREADY never goes low in
DW_apb_timers and is tied to one.
Exists: SLAVE_INTERFACE_TYPE>0
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: High
pslverr O APB3 slave error response signal. The signal issues an error when
an incoming transaction does not have necessary authorisation. This
signal is tied to low in case SLVERR_RESP_EN parameter is
switched off.
Exists: SLAVE_INTERFACE_TYPE>0
Synchronous To: pclk
Registered: (SLAVE_INTERFACE_TYPE > 1 &&
SLVERR_RESP_EN==1) ? Yes : No
Power Domain: SINGLE_DOMAIN
Active State: High
scan_mode - - timer_en
timer_N_clk (for N = 1; N <= NUM_TIMERS) - - timer_intr
timer_N_resetn (for N = 1; N <= NUM_TIMERS) - - timer_intr_n
timer_N_pause (for N = 1; N <= NUM_TIMERS) - - timer_intr_flag
- timer_intr_flag_n
- timer_N_toggle (for N = 1; N <= NUM_TIMERS)
scan_mode I Active-high scan mode used to ensure that test automation tools can
control all asynchronous flip-flop signals. This signal should be
asserted that is, driven to logic 1 during scan testing, and should be
deasserted (tied to logic 0) at all other times.
Exists: Always
Synchronous To: Asynchronous
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: High
timer_N_clk I Each timer is supplied with its own clock from this bus. The number
(for N = 1; N <= NUM_TIMERS) of these signals is set by NUM_TIMERS parameter. This signal can
be asynchronous or synchronous to pclk. If a timer clock is
asynchronous to pclk, you must ensure that the clocks are stopped
whenever the timer is disabled.
Exists: NUM_TIMERS >= N
Synchronous To: None
Registered: N/A
Power Domain: SINGLE_DOMAIN
Active State: N/A
timer_N_resetn I Asynchronous reset for each timer. The number of these signals are
(for N = 1; N <= NUM_TIMERS) set by NUM_TIMERS parameter. Asynchronous assertion,
synchronous de-assertion. Must be synchronously de-asserted after
the rising edge of timer_1_clk.
Exists: NUM_TIMERS >= N
Synchronous To: Asynchronous
Registered: N/A
Power Domain: SINGLE_DOMAIN
Active State: Low
timer_en[(NUM_TIMERS-1):0] O When asserted, activates the necessary timer clocks and ensures
the component is supplied with an active pclk while timers are
running.
You can tie a timer clock to pclk, but if pclk is asynchronous to a timer
clock, then you must stop the timer clock before programming it.
Timer clock should start and stop depending on assertion and de-
assertion of the timer_en output signal when the timer clock is
asynchronous to pclk.
Exists: Always
Synchronous To: pclk
Registered: Yes
Power Domain: SINGLE_DOMAIN
Active State: High
timer_intr_flag O Optional. Active High Interrupt flag that is set if any timer interrupt is
set.
Exists: (TIM_INTRPT_PLRITY==1) &&
(TIM_INTR_IO==TIM_COMBINED)
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: High
timer_intr_flag_n O Optional. Active Low Interrupt flag that is set if any timer interrupt is
set.
Exists: (TIM_INTRPT_PLRITY==0) &&
(TIM_INTR_IO==TIM_COMBINED)
Synchronous To: pclk
Registered: No
Power Domain: SINGLE_DOMAIN
Active State: Low
timer_N_toggle O Optional. Signal that toggles each time the timer counter reloads.
(for N = 1; N <= NUM_TIMERS) The output is disabled to 0 each time the timer is disabled.
Exists: (NUM_TIMERS >= N) && (TIMER_HAS_TOGGLE_N==1)
Synchronous To: timer_N_clk
Registered: Yes
Power Domain: SINGLE_DOMAIN
Active State: High
5
Register Descriptions
This chapter details all possible registers in the IP. They are arranged hierarchically into maps and blocks
(banks).Your actual configuration might not contain all of these registers.
Attention: For configurable IP titles, do not use this document to determine the exact attributes of your
register map. It is for reference purposes only.
When you configure the controller in coreConsultant, you must access the register attributes for your actual
configuration at workspace/report/ComponentRegisters.html or
workspace/report/ComponentRegisters.xml after you have completed the report creation activity. That
report comes from the exact same source as this chapter but removes all the registers that are not in your
actual configuration. This does not apply to non-configurable IP titles. In addition, all parameter
expressions are evaluated to actual values. Therefore, the Offset and Memory Access values might change
depending on your actual configuration.
Some expressions might refer to TCL functions or procedures (sometimes identified as <functionof>) that
coreConsultant uses to make calculations. The exact formula used by these TCL functions is not provided in
this chapter. However, when you configure the controller in coreConsultant, all TCL functions and
parameters are evaluated completely; and the resulting values are displayed where appropriate in the
coreConsultant GUI reports.
Exists Expressions
These expressions indicate the combination of configuration parameters required for a register, field, or
block to exist in the memory map. The expression is only valid in the local context and does not indicate the
conditions for existence of the parent. For example, the expression for a bit field in a register assumes that
the register exists and does not include the conditions for existence of the register.
Offset
The term Offset is synonymous with Address.
Memory Access Attributes
The Memory Access attribute is defined as <ReadBehavior>/<WriteBehavior> which are defined in the
following table.
R/W1C You can read this register field. Writing 1 clears it.
RC/W1C Reading this register field clears it. Writing 1 clears it.
R/Wo You can read this register field. You can only write to it once.
Attribute Description
Reset Mask As defined by the IP-XACT specification. Indicates that this register
field has an unknown reset value. For example, the reset value is set
by another register or an input pin; or the register is implemented
using RAM.
* Varies Indicates that the memory access (or reset) attribute (read, write
behavior) is not fixed. For example, the read-write access of the
register is controlled by a pin or another register. Or when the
access depends on some configuration parameter; in this case the
post-configuration report in coreConsultant gives the actual access
value.
Component Banks/Blocks
The following table shows the address blocks for each memory map. Follow the link for an address block to
see a table of its registers.
RSVD_TIMER1LOADCOUNT 31:y
x:0
TIMER1LOADCOUNT
Memory
Bits Name Access Description
x:0 TIMER1LOADCOUNT R/W Value to be loaded into Timer 1. This is the value from which
counting commences. Any value written to this register is
loaded into the associated timer.
Note:
■ The field name for Timer 2 will be TIMER2LOADCOUNT.
■ The field name for Timer 3 will be TIMER3LOADCOUNT.
■ The field name for Timer 4 will be TIMER4LOADCOUNT.
■ The field name for Timer 5 will be TIMER5LOADCOUNT.
■ The field name for Timer 6 will be TIMER6LOADCOUNT.
■ The field name for Timer 7 will be TIMER7LOADCOUNT.
■ The field name for Timer 8 will be TIMER8LOADCOUNT.
Value After Reset: 0x0
Exists: Always
Range Variable[x]: TIMER_WIDTH_N - 1
RSVD_TIMER1CURRENTVAL 31:y
x:0
TIMER1CURRENTVAL
Memory
Bits Name Access Description
Table 5-7 Fields for Register: TimerNCurrentValue (for N = 1; N <= NUM_TIMERS) (Continued)
Memory
Bits Name Access Description
31:5
4
3
TIMER_INTERRUPT_MASK 2
1
0
RSVD_TimerNControlReg
TIMER_0N100PWM_EN
TIMER_ENABLE
TIMER_MODE
TIMER_PWM
Memory
Bits Name Access Description
Table 5-8 Fields for Register: TimerNControlReg (for N = 1; N <= NUM_TIMERS) (Continued)
Memory
Bits Name Access Description
4 TIMER_0N100PWM_EN ((TIM_0N Optional. Allows user to enable or disable the usage of Timer
100_PW 0% and 100% mode feature. This bit is present only when
M_MODE (TIM_0N100_PWM_MODE=1 and
==1) AND TIMER_HAS_TOGGLE_N=1). Otherwise reserved.
(TIMER_ Values:
HAS_TO ■ 0x1 (ENABLED): Timer 0% and 100% PWM duty cycle
GGLE_N
mode is enabled
==1) AND
(TIMER_ ■ 0x0 (DISABLE): Timer 0% and 100% PWM duty cycle
0N100_P mode is disabled
WM_HC_ Value After Reset: {((TIM_0N100_PWM_MODE==1) &&
EN==0)) (TIMER_HAS_TOGGLE_N==1) &&
? read- (TIMER_0N100_PWM_HC_EN==1)) ? 0x1 : 0x0}
write : Exists: TIM_0N100_PWM_MODE &&
read-only TIMER_HAS_TOGGLE_N
Table 5-8 Fields for Register: TimerNControlReg (for N = 1; N <= NUM_TIMERS) (Continued)
Memory
Bits Name Access Description
RSVD_Timer1EOI 31:1
0
Timer1EOI
Memory
Bits Name Access Description
Table 5-9 Fields for Register: TimerNEOI (for N = 1; N <= NUM_TIMERS) (Continued)
Memory
Bits Name Access Description
0 Timer1EOI R Reading from this register returns all zeroes (0) and clears
the interrupt from Timer 1.
Note:
■ The field name for Timer 2 will be Timer2EOI.
■ The field name for Timer 3 will be Timer3EOI.
■ The field name for Timer 4 will be Timer4EOI.
■ The field name for Timer 5 will be Timer5EOI.
■ The field name for Timer 6 will be Timer6EOI.
■ The field name for Timer 7 will be Timer7EOI.
■ The field name for Timer 8 will be Timer8EOI.
Value After Reset: 0x0
Exists: Always
RSVD_TIMER1INTSTAT 31:1
0
TIMER1INTSTAT
Memory
Bits Name Access Description
Values:
■ 0x1 (ACTIVE): Timer N Interrupt is active
■ 0x0 (INACTIVE): Timer N Interrupt is inactive
Value After Reset: 0x0
Exists: Always
Volatile: true
5.1.6 TimersIntStatus
■ Name: Timers Interrupt Status Register
■ Description: Contains the interrupt status of all timers in the component.
■ Size: 32 bits
■ Offset: 0xa0
■ Exists: Always
RSVD_TimersIntStatus 31:y
x:0
TimersIntStatus
Memory
Bits Name Access Description
Memory
Bits Name Access Description
x:0 TimersIntStatus R Contains the interrupt status of all timers in the component. If
a bit of this register is 0, then the corresponding timer
interrupt is not active and the corresponding interrupt could
be on either the timer_intr bus or the timer_intr_n bus,
depending on the interrupt polarity you have chosen.
Similarly, if a bit of this register is 1, then the corresponding
interrupt bit has been set in the relevant interrupt bus. In both
cases, the status reported is the status after the interrupt
mask has been applied. Reading from this register does not
clear any active interrupts.
Values:
■ 0x1 (ACTIVE): Timer_intr(_n) is active
■ 0x0 (INACTIVE): Timer_intr(_n) is inactive
Value After Reset: 0x0
Exists: Always
Volatile: true
Range Variable[x]: NUM_TIMERS - 1
5.1.7 TimersEOI
■ Name: Timers End-of-Interrupt Register
■ Description: Returns all zeroes (0) and clears all active interrupts.
■ Size: 32 bits
■ Offset: 0xa4
■ Exists: Always
RSVD_TIMERSEOI 31:y
x:0
TIMERSEOI
Memory
Bits Name Access Description
x:0 TIMERSEOI R Reading this register returns all zeroes (0) and clears all
active interrupts.
Value After Reset: 0x0
Exists: Always
Range Variable[x]: NUM_TIMERS - 1
5.1.8 TimersRawIntStatus
■ Name: Timers Raw Interrupt Status Register
■ Description: Contains the unmasked interrupt status of all timers in the component.
■ Size: 32 bits
■ Offset: 0xa8
■ Exists: Always
RSVD_TIMERSRAWINTSTAT 31:y
x:0
TIMERSRAWINTSTAT
Memory
Bits Name Access Description
x:0 TIMERSRAWINTSTAT R The register contains the unmasked interrupt status of all
timers in the component.
Values:
■ 0x1 (ACTIVE): Raw Timer_intr(_n) is active
■ 0x0 (INACTIVE): Raw Timer_intr(_n) is inactive
Value After Reset: 0x0
Exists: Always
Volatile: true
Range Variable[x]: NUM_TIMERS - 1
5.1.9 TIMERS_COMP_VERSION
■ Name: Timers Component Version
■ Description: Current revision number of the DW_apb_timers component.
■ Size: 32 bits
■ Offset: 0xac
■ Exists: Always
TIMERSCOMPVERSION 31:0
Memory
Bits Name Access Description
RSVD_TIMERNLOADCOUNT2 31:y
x:0
TIMERNLOADCOUNT2
Memory
Bits Name Access Description
x:0 TIMERNLOADCOUNT2 R/W Value to be loaded into Timer N when timer_N_toggle output
changes from 0 to 1. This value determines the width of the
HIGH period of the timer_N_toggle output.
Value After Reset: 0x0
Exists: Always
Range Variable[x]: TIMER_WIDTH_N - 1
RsvdTimer_N_ProtLevel 31:3
Timer_N_ProtLevelField 2:0
Memory
Bits Name Access Description
6
Programming Considerations
The coherency circuitry incorporates an upper byte method that requires you to program the
Note load register in LSB-to-MSB order when the peripheral width is smaller than the register width.
Additionally, you must read LSB-to-MSB for the coherency circuitry solution to operate
correctly.
When the upper byte is programmed, the value can be transferred and loaded into the load register. When
the lower bytes are programmed, they need to be stored in shadow registers so that the previous load
register is available to the timer counter if it needs to reload. When the upper byte is programmed, the
contents of the shadow registers and the upper byte are loaded into the load register.
7
Verification
This chapter provides an overview of the testbench available for the DW_apb_timers verification. After the
DW_apb_timers has been configured and the verification is setup, simulations can be run automatically. For
information on running simulations for DW_apb_timers in coreAssembler or coreConsultant, see the
“Simulating the Core” section in the DesignWare Synthesizable Components for AMBA 2 User Guide.
The DW_apb_timers verification testbench is built with DesignWare Verification IP (VIP). Make
Note sure you have the supported version of the VIP components for this release, otherwise, you
may experience some tool compatibility problems. For more information about supported tools
in this release, see the DesignWare Synthesizable Components for AMBA 2/AMBA 3 AXI
Installation Guide.
The packaged test benches are only for validating the IP configuration in coreConsultant GUI.
Note It is not for system level validation.
IPs that have the Vera test bench packaged, these test benches are encrypted.
Expected
output RAL Device
Reference
Checker Model Driver
Model
Actual output
APB RAL
Adapter
Device
APB VIP
Configuration
Agent
APB IF
timer_N_clk
timer_N_pause
timer_en
General Ports timer_intr(_n) DW_apb_timers
timer_intr_flag(_n)
timer_N_toggle
scan_mode
APB master agent and APB slave agent for providing the VIP supported randomized transactions
with bus instantiation on either side of DUT.
■ Testbench uses the following custom components:
❑ Device Agent
This component is responsible for creating traffic on the application bus interface (APB). This
agent follows the standard structure of a UVM agent and has the following sub-blocks:
■ Device Sequencer
This component is a standard UVM sequencer, which fetches the top-level sequence items
from the scenario sequences and feeds the device driver. There is no additional logic present
in the device sequencer.
■ Device Driver
The core logic of the device agent sits in the device driver. This block is responsible for the
APB side read and write. The bus protocol driver along with the RAL forms the lower layer,
which directly interacts with the design bus interface.
On the Write and Read paths, the device driver fetches a protocol transaction from the
scenario sequences (via device sequencer) and initiates the respective APB register writes or
reads.
The device driver is planned to be independent of the application bus interface. This is
accomplished by using RAL. In case of a change of bus protocol, the only change is going to
be in the RAL adapter logic.
❑ RAL Model
RAL model is Inside Device Agent. RAL model is used for two purposes: to show (shadow) the
values of registers inside DW_apb_timers, and to check whether the values of registers is correct
upon reading. To facilitate RAL model to have a two-way connection with the Reference model,
Reference model gets the values from RAL model to check whether behavior on General Ports is
correct and is responsible for updates of the RAL model. This is because the Device agent is
unable to see the activity that is happening on General Ports, where transaction can also change
the values of registers in DW_apb_timers (mostly status registers).
The RAL model is used for flexibility and reuse because if you change the adapter and VIP agent
(interface you use), you can keep all the other logic.
❑ APB RAL Adapter
APB RAL Adapter converts higher level RAL Model Reads and Writes to APB transactions, these
transactions are driven on the bus by APB VIP Agent. By replacing this part with the different
adapter, you can make this environment capable of being used by other interfaces.
❑ APB VIP Agent
APB VIP Agent drives transactions on APB interface. By replacing APB VIP Agent and APB RAL
Adapter with different components (such as AHB components) you can keep the other logic in
Device Agent, and use it for that other interface.
❑ System Virtual Sequencer
The main responsibility of System Virtual Sequencer is to synchronize General Port’s sequencer
and RAL sequencer.
❑ Reference Model / Checker / Scoreboard
The Reference Model is responsible for updating the RAL content for the activity done outside of
the main register interface.
Based on the transactions received from the agent monitors (General Port’s monitors) and values
of registers in RAL, the Reference Model also calculates the expected values of DUT output
signals. The actual DUT outputs, as well as the expected values, are then sent to the Checker. The
Checker compares the expected values of DUT output signals against the values actually driven
by the DUT.
Directory Description
<configured workspace>/sim/testbench Contains the top level testbench module (test_top.sv) and the DUT to the
testbench wrapper (dut_sv_wrapper.sv) exist in this folder.
<configured workspace>/sim/ Contains the supporting files to compile and run the simulation.
After the completion of the simulation, the log files are present here.
<configured workspace>/sim/test_* Contains individual test cases. After the completion of the simulation, the
test specific log files, and if applicable, the waveform files are stored here.
test_101_random This test initiates the random testing of all the other test sequences, It performs the
following validations.
1. This test builds the sequence dw_apb_timers_enable_virtual_sequence.
- All the existing timers as per the configuration are made user defined.
- Enables by setting respective TimerNControlReg bit 0.
- Checks the timers counter change on reading TimerNCurrentValue.
2. This test builds the sequence dw_apb_timers_intr_virtual_sequence.
- Handles the timer counter activity by enabling it and setting its load value.
- Checks the generation of interrupt when it meets the max value loaded.
- Clears the interrupt.
- Performs these checks for all the existing N timers for the given configuration.
3. This test builds the sequence dw_apb_timers_pause_virtual_sequence.
- Enables the timer.
- Enables the pause mode on asserting timer_N_pause input signal.
- Checks the TimerNCurrentValue to see that no change in the counter value on
pausing the timer.
- Disbales the pause mode and check change in counter value.
- Follow these steps for the existing timers for the given configuration.
4. This test builds the sequence dw_apb_timers_prot_virtual_sequence, which in
turn calls dw_apb_timers_prot_feature_sequence.
- Checks the prot feature for registers TimerNLoadCount and TimerNLoadCount2
when PSLVERR_RESP_EN is set as high.
8
Integration Considerations
After you have configured, tested, and synthesized your component in either coreAssembler or
coreConsultant, you can integrate the subsystem or component into your own design environment. The
following sections discuss general integration considerations:
8.2 Coherency
Coherency is where bits within a register are logically connected. For instance, part of a register is read at
time 1 and another part is read at time 2. Being coherent means that the part read at time 2 is at the same
value it was when the register was read at time 1. The unread part is stored into a shadow register and this
is read at time 2. When there is no coherency, no shadow registers are involved.
A bus master may need to be able to read the contents of a register, regardless of the data bus width, and be
guaranteed of the coherency of the value read. A bus master may need to be able to write a register
coherently regardless of the data bus width and use that register only when it has been fully programmed.
This may need to be the case regardless of the relationship between the clocks.
Coherency enables a value to be read that is an accurate reflection of the state of the counter, independent of
the data bus width, the counter width, and even the relationship between the clocks. Additionally, a value
written in one domain is transferred to another domain in a seamless and coherent fashion.
Upper Byte
Bus Width
9 - 16 1 NCR NCR
17 - 24 2 2 NCR
25 - 32 3 2 (or 3) NCR
There are three relationship cases to be considered for the processor and peripheral clocks:
■ Identical
■ Synchronous (phase coherent but of an integer fraction)
■ Asynchronous
Shadow
pwdata[7:0] 8 32 32
Shadow [7:0]
ByteWen[0] EN
pwdata[23:16] 8
Shadow [23:16]
ByteWen[2] EN
UpperByteWen EN LD
LoadCnt
The following figure shows a 32-bit register that is written over an 8-bit data bus, as well as the shadow
registers being loaded and then loaded into the counter when fully programmed. The LoadCnt signal lasts
for one cycle and is used to load the counter with CntLoadValue.
pclk
paddr A0 A1 A2 A3
penable
pwdata[7:0] 0A 0B 0C 0D
Shadow[7:0] 0A
Shadow[15:8] 0B
Shadow[23:16] 0C
LoadValue[31:0] 0D0C0B0A
UpperByteWen
LoadCnt
Counter[31:0] 0D0C0B0A
Each of the bytes that make up the load register are stored into shadow registers until the final byte is
written. The shadow register is up to three bytes wide. The contents of the shadow registers and the final
byte are transferred into the CntLoadValue register when the final byte is written. The counter uses this
register to load/initialize itself. If the counter is operating in a periodic mode, it reloads from this register
each time the count expires.
By using the shadow registers, the CntLoadValue is kept stable until it can be changed in one cycle. This
allows the counter to be loaded in one access and the state of the counter is not affected by the latency in
programming it. When there is a new value to be loaded into the counter initially, this is signaled by
LoadCnt = 1. After the upper byte is written, the LoadCnt goes to zero.
The following figure shows an RTL diagram for the circuitry required to implement the coherent write
when the bus and peripheral clocks are synchronous.
Shadow
pwdata[7:0] 8 32 32
Shadow [7:0]
ByteWen[0] EN
pwdata[23:16] 8
Shadow [23:16]
ByteWen[2] EN
UpperByteWen EN LD
1
LoadCnt
OR
The following figure shows a 32-bit register being written over an 8-bit data bus, as well as the shadow
registers being loaded and then loaded into the counter when fully programmed. The LoadCnt signal is
extended until a change in the toggle is detected and is used to load the counter.
pclk
counter_clk
paddr A0 A1 A2 A3
penable
pwdata[7:0] 0A 0B 0C 0D
Shadow[7:0] 0A
Shadow[15:8] 0B
Shadow[23:16] 0C
CntLoadValue[31:0] 0D0C0B0A
LoadCnt
toggle
toggle_edge_detect
Counter[31:0] 0D0C0B0A
Shadow
pwdata[7:0] 8 32 32 32
Shadow [7:0]
ByteWen[0] EN
ByteWen[1] EN
pwdata[23:16] 8
Shadow [23:16]
NewValue
ByteWen[2] EN &
red_counter_clk
UpperByteWen EN EN LD
(or ByteWen[3])
1 SafeNewValue
ClrNewValue
Reset
ClrNewValue
Reset red_counter_clk EN
Rising
counter_clk Edge red_counter_clk Toggle
1
Detect
ClrNewValue Edge
Detect
pclk
pclk
Shaded and edge detect registers are all
connected to the Bus clock. Others are
connected to the Peripheral clock.
When the clocks are asynchronous, you need to transfer the contents of the register from one clock domain
to another. It is not desirable to transfer the entire register through meta-stability registers, as coherency is
not guaranteed with this method. The circuitry needed requires the processor clock to be used to re-time the
peripheral clock. Upon a rising edge of the re-timed clock, the new value signal, NewValue, is transferred
into a safe new value signal, SafeNewValue, which happens after the edge of the peripheral clock has
occurred.
Every time there is a rising edge of the peripheral clock detected, the CntLoadValue is transferred into a
SafeCntLoadValue. This value is used to transfer the load value across the clock domains. The
SafeCntLoadValue only changes a number of bus clock cycles after the peripheral clock edge changes. A
counter running on the peripheral clock is able to use this value safely. It could be up to two peripheral
clock periods before the value is loaded into the counter. Along with this loaded value, there is also a single
bit transferred that is used to qualify the loading of the value into the counter.
The timing diagram depicted in the following figure does not show the shadow registers being loaded. This
is identical to the loading for the other clock modes.
pclk
counter_clk
UpperByteWen
paddr A3
penable
pwdata[7:0] 0D
NewValue
ntLoadValue[31:0] 0D0C0B0A
red_counter_clk
ntLoadValue[31:0] 0D0C0B0A
SafeNewValue
toggle
ClrNewValue
Counter[31:0] 0D0C0B0A
The NewValue signal is extended until a change in the toggle is detected and is used to update the safe
value. The SafeNewValue is used to load the counter at the rising edge of the peripheral clock. Each time a
new value is written the toggle bit is flipped and the edge detection of the toggle is used to remove both the
NewValue and the SafeNewValue.
Lower Byte
Bus Width
9 - 16 0 NCR NCR
Lower Byte
Bus Width
17 - 24 0 0 NCR
25 - 32 0 0 NCR
Depending on the bus width and the register width, there may be no need to save the upper bits because the
entire register is read in one access, in which case there is no problem with coherency. When the lower byte
is read, the remaining upper bytes within the counter register are transferred into a holding register. The
holding register is the source for the remaining upper bytes. Users must read LSB to MSB for this solution to
operate correctly. NCR means that no coherency circuitry is required, as the entire register is read with one
access.
There are two cases regarding the relationship between the processor and peripheral clocks to be considered
as follows:
■ Identical and/or synchronous
■ Asynchronous
SafeCntVal
CntVal[31:8]
EN
LowerByteRen ReadCntVal[31:0]
CntVal[31:8]
ByteRen[3:0]
Counter
Block
Shaded registers are clocked
with the processor clock.
pclk
clk1
penable
prdata[7:0] 03 02 01 00 0H 0G
LowerByteRen
Note You must read LSB to MSB when the bus width is narrower than the counter width.
Once a read transaction has started, the value of the upper register bits need to be stored into a shadow
register so that they can be read with subsequent read accesses. Storing these upper bits preserves the
coherency of the value that is being read. When the processor reads the current value it actually reads the
contents of the shadow register instead of the actual counter value. The holding register is read when the
bus width is narrower than the counter width. When the LSB is read, the value comes from the shadow
register; when the remaining bytes are read they come from the holding register. If the data bus width is
wide enough to read the counter in one access, then the holding registers do not exist.
The counter clock is registered and successively pipelined to sense a rising edge on the counter clock.
Having detected the rising edge, the value from the counter is known to be stable and can be transferred
into the shadow register. The coherency of the counter value is maintained before it is transferred, because
the value is stable.
The following figure illustrates the synchronization of the counter clock and the update of the shadow
register.
CntVal ShdwCntVal
SafeCntVal
EN
LowerByteRen ReadCntVal
EN
Safe To Update
Sync & Rising
Edge Detect Sync and shaded registers are
clocked with the processor clock.
8.4 Performance
This section discusses performance and the hardware configuration parameters that affect the performance of the DW_apb_timers.
Default Configuration pclk = 100 MHz 2084 5 nW 0.011 mW 99.82 99.89 99.9
timer_N_clk = 100MHz
(N = 1, 2)
Typical Configuration 1 pclk = 100 MHz 30532 80 nW 0.255 mW 99.91 99.91 100
APB_DATA_WIDTH = 32 timer_N_clk = 100 MHz
NUM_TIMERS = 8 (N = 1 to 8)
TIMER_HAS_TOGGLE_1 = 1
TIMER_HAS_TOGGLE_2 = 1
TIMER_HAS_TOGGLE_3 = 1
TIMER_HAS_TOGGLE_4 = 1
TIMER_HAS_TOGGLE_5 = 1
TIMER_HAS_TOGGLE_6 = 1
TIMER_HAS_TOGGLE_7 = 1
TIMER_HAS_TOGGLE_8 = 1
TIMER_WIDTH_1 = 32
TIMER_WIDTH_2 = 32
TIMER_WIDTH_3 = 32
TIMER_WIDTH_4 = 32
TIMER_WIDTH_5 = 32
TIMER_WIDTH_6 = 32
TIMER_WIDTH_7 = 32
TIMER_WIDTH_8 = 32
TIM_METASTABLE_1 = 1
TIM_METASTABLE_2 = 1
TIM_METASTABLE_3 = 1
TIM_METASTABLE_4 = 1
TIM_METASTABLE_5 = 1
TIM_METASTABLE_6 = 1
TIM_METASTABLE_7 = 1
TIM_METASTABLE_8 = 1
SLAVE_INTERFACE_TYPE = 2
SLVERR_RESP_EN = 1
TIM_0N100_PWM_MODE = 1
TIMER_0N100_PWM_HC_EN = 0
TIM_NEWMODE = 1
HC_PROT_LEVEL = 0
Typical Configuration 2 pclk = 100 MHz 7914 20 nW 0.052 mW 99.82 99.91 99.9
APB_DATA_WIDTH = 8 timer_N_clk = 100 MHz
NUM_TIMERS = 8 (N = 1 to 8)
TIMER_HAS_TOGGLE_1 = 1
TIMER_HAS_TOGGLE_2 = 1
TIMER_HAS_TOGGLE_3 = 1
TIMER_HAS_TOGGLE_4 = 1
TIMER_HAS_TOGGLE_5 = 1
TIMER_HAS_TOGGLE_6 = 1
TIMER_HAS_TOGGLE_7 = 1
TIMER_HAS_TOGGLE_8 = 1
TIMER_WIDTH_1 = 32
TIMER_WIDTH_2 = 32
TIMER_WIDTH_3 = 32
TIMER_WIDTH_4 = 32
TIMER_WIDTH_5 = 32
TIMER_WIDTH_6 = 32
TIMER_WIDTH_7 = 32
TIMER_WIDTH_8 = 32
TIM_METASTABLE_1 = 1
TIM_METASTABLE_2 = 1
TIM_METASTABLE_3 = 1
TIM_METASTABLE_4 = 1
TIM_METASTABLE_5 = 1
TIM_METASTABLE_6 = 1
TIM_METASTABLE_7 = 1
TIM_METASTABLE_8 = 1
TIM_PULSE_EXTD_1 = 3
TIM_PULSE_EXTD_2 = 3
TIM_PULSE_EXTD_3 = 3
TIM_PULSE_EXTD_4 = 3
TIM_PULSE_EXTD_5 = 3
TIM_PULSE_EXTD_6 = 3
TIM_PULSE_EXTD_7 = 3
TIM_PULSE_EXTD_8 = 3
SLAVE_INTERFACE_TYPE = 1
SLVERR_RESP_EN = 0
TIM_0N100_PWM_MODE = 0
TIMER_0N100_PWM_HC_EN = 0
TIM_NEWMODE = 0
HC_PROT_LEVEL = 0
A
Basic Core Module (BCM) Library
The Basic Core Module (BCM) Library is a library of commonly used blocks for the Synopsys DesignWare
IP development. These BCMs are configurable on an instance-by-instance basis and, for the majority of
BCM designs, there is an equivalent (or nearly equivalent) DesignWare Building Block (DWBB) component.
This appendix contains the following sections:
■ “BCM Library Components” on page 99
■ “Synchronizer Methods” on page 99
The DesignWare Building Blocks (DWBB) contains several synchronizer components with
Note functionality similar to methods documented in this appendix. For more information about the
DWBB synchronizer components go to:
https://www.synopsys.com/dw/buildingblock.php
Note The BCM21 is a basic multiple register based synchronizer module used in the design. It can be
replaced with equivalent technology specific synchronizer cell.
Figure A-1 Block Diagram of Synchronizer 1 With Two Stage Synchronization (Both Positive Edges)
test
width
data_s width width
D Q D Q data_d
width
D Q
B
Internal Parameter Descriptions
Provides a description of the internal parameters that might be indirectly referenced in expressions in the
Signals, Parameters, or Registers chapters. These parameters are not visible in the coreConsultant GUI and
most of them are derived automatically from visible parameters. You must not set any of these parameters
directly.
Some expressions might refer to TCL functions or procedures (sometimes identified as function_of) that
coreConsultant uses to make calculations. The exact formula used by these TCL functions is not provided in
this chapter. However, when you configure the core in coreConsultant, all TCL functions and parameters
are evaluated completely; and the resulting values are displayed where appropriate in the coreConsultant
GUI reports.
TIM_ADDR_SLICE_LHS 7
TIM_COMBINED 1
TIM_INDIVIDUAL 0
TIM_VERSION_ID 32'h3231332a
C
Glossary
active command queue Command queue from which a model is currently taking commands; see also
command queue.
application design Overall chip-level design into which a subsystem or subsystems are integrated.
BFM Bus-Functional Model — A simulation model used for early hardware debug. A
BFM simulates the bus cycles of a device and models device pins, as well as
certain on-chip functions. See also Full-Functional Model.
big-endian Data format in which most significant byte comes first; normal order of bytes in a
word.
blocked command stream A command stream that is blocked due to a blocking command issued to that
stream; see also command stream, blocking command, and non-blocking
command.
blocking command A command that prevents a testbench from advancing to next testbench
statement until this command executes in model. Blocking commands typically
return data to the testbench from the model.
command channel Manages command streams. Models with multiple command channels execute
command streams independently of each other to provide full-duplex mode
function.
command stream The communication channel between the testbench and the model.
component A generic term that can refer to any synthesizable IP or verification IP in the
DesignWare Library. In the context of synthesizable IP, this is a configurable block
that can be instantiated as a single entity (VHDL) or module (Verilog) in a design.
configuration The act of specifying parameters for a core prior to synthesis; can also be used in
the context of VIP.
configuration intent Range of values allowed for each parameter associated with a reusable core.
cycle command A command that executes and causes HDL simulation time to advance.
decoder Software or hardware subsystem that translates from and “encoded” format back
to standard format.
design context Aspects of a component or subsystem target environment that affect the
synthesis of the component or subsystem.
dual role device Device having the capabilities of function and host (limited).
endian Ordering of bytes in a multi-byte word; see also little-endian and big-endian.
Full-Functional Mode A simulation model that describes the complete range of device behavior,
including code execution. See also BFM.
GTECH A generic technology view used for RTL simulation of encrypted source code by
non-Synopsys simulators.
implementation view The RTL for a core. You can simulate, synthesize, and implement this view of a
core in a real chip.
interface Set of ports and parameters that defines a connection point to a component.
master Device or model that initiates and controls another device or peripheral.
non-blocking command A testbench command that advances to the next testbench statement without
waiting for the command to complete.
peripheral Generally refers to a small core that has a bus connection, specifically an APB
interface.
RTL Register Transfer Level. A higher level of abstraction that implies a certain gate-
level structure. Synthesis of RTL code yields a gate-level design.
static controller Memory controller with specific connections for Static memories such as
asynchronous SRAMs, Flash memory, and ROMs.
synthesis intent Attributes that a core developer applies to a top-level design, ports, and core.
technology-independent Design that allows the technology (that is, the library that implements the gate
and via widths for gates) to be specified later during synthesis.
Testsuite Regression A collection of files for stand-alone verification of the configured component. The
Environment (TRE) files, tests, and functionality vary from component to component.
VIP Verification Intellectual Property — A generic term for a simulation model in any
form, including a Design View.
wrap, wrapper Code, usually VHDL or Verilog, that surrounds a design or model, allowing easier
interfacing. Usually requires an extra, sometimes automated, step to create the
wrapper.
zero-cycle command A command that executes without HDL simulation time advancing.