ClockDomain.py revision 9793
19793Sakash.bagdia@arm.com# Copyright (c) 2013 ARM Limited 29793Sakash.bagdia@arm.com# All rights reserved. 39793Sakash.bagdia@arm.com# 49793Sakash.bagdia@arm.com# The license below extends only to copyright in the software and shall 59793Sakash.bagdia@arm.com# not be construed as granting a license to any other intellectual 69793Sakash.bagdia@arm.com# property including but not limited to intellectual property relating 79793Sakash.bagdia@arm.com# to a hardware implementation of the functionality of the software 89793Sakash.bagdia@arm.com# licensed hereunder. You may use the software subject to the license 99793Sakash.bagdia@arm.com# terms below provided that you ensure that this notice is replicated 109793Sakash.bagdia@arm.com# unmodified and in its entirety in all distributions of the software, 119793Sakash.bagdia@arm.com# modified or unmodified, in source code or in binary form. 129793Sakash.bagdia@arm.com# 139793Sakash.bagdia@arm.com# Redistribution and use in source and binary forms, with or without 149793Sakash.bagdia@arm.com# modification, are permitted provided that the following conditions are 159793Sakash.bagdia@arm.com# met: redistributions of source code must retain the above copyright 169793Sakash.bagdia@arm.com# notice, this list of conditions and the following disclaimer; 179793Sakash.bagdia@arm.com# redistributions in binary form must reproduce the above copyright 189793Sakash.bagdia@arm.com# notice, this list of conditions and the following disclaimer in the 199793Sakash.bagdia@arm.com# documentation and/or other materials provided with the distribution; 209793Sakash.bagdia@arm.com# neither the name of the copyright holders nor the names of its 219793Sakash.bagdia@arm.com# contributors may be used to endorse or promote products derived from 229793Sakash.bagdia@arm.com# this software without specific prior written permission. 239793Sakash.bagdia@arm.com# 249793Sakash.bagdia@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 259793Sakash.bagdia@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 269793Sakash.bagdia@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 279793Sakash.bagdia@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 289793Sakash.bagdia@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 299793Sakash.bagdia@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 309793Sakash.bagdia@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 319793Sakash.bagdia@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 329793Sakash.bagdia@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 339793Sakash.bagdia@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 349793Sakash.bagdia@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 359793Sakash.bagdia@arm.com# 369793Sakash.bagdia@arm.com# Authors: Vasileios Spiliopoulos 379793Sakash.bagdia@arm.com# Akash Bagdia 389793Sakash.bagdia@arm.com 399793Sakash.bagdia@arm.comfrom m5.params import * 409793Sakash.bagdia@arm.comfrom m5.SimObject import SimObject 419793Sakash.bagdia@arm.com 429793Sakash.bagdia@arm.com# Abstract clock domain 439793Sakash.bagdia@arm.comclass ClockDomain(SimObject): 449793Sakash.bagdia@arm.com type = 'ClockDomain' 459793Sakash.bagdia@arm.com cxx_header = "sim/clock_domain.hh" 469793Sakash.bagdia@arm.com abstract = True 479793Sakash.bagdia@arm.com 489793Sakash.bagdia@arm.com# Source clock domain with an actual clock 499793Sakash.bagdia@arm.comclass SrcClockDomain(ClockDomain): 509793Sakash.bagdia@arm.com type = 'SrcClockDomain' 519793Sakash.bagdia@arm.com cxx_header = "sim/clock_domain.hh" 529793Sakash.bagdia@arm.com clock = Param.Clock("Clock period") 539793Sakash.bagdia@arm.com 549793Sakash.bagdia@arm.com# Derived clock domain with a parent clock domain and a frequency 559793Sakash.bagdia@arm.com# divider 569793Sakash.bagdia@arm.comclass DerivedClockDomain(ClockDomain): 579793Sakash.bagdia@arm.com type = 'DerivedClockDomain' 589793Sakash.bagdia@arm.com cxx_header = "sim/clock_domain.hh" 599793Sakash.bagdia@arm.com clk_domain = Param.ClockDomain("Parent clock domain") 609793Sakash.bagdia@arm.com clk_divider = Param.Unsigned(1, "Frequency divider") 61