From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17860 invoked by alias); 22 Jun 2006 12:56:07 -0000 Received: (qmail 17849 invoked by uid 22791); 22 Jun 2006 12:56:07 -0000 X-Spam-Check-By: sourceware.org Received: from server.cct.co.uk (HELO SERVER.cct.co.uk) (195.11.24.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Jun 2006 12:56:04 +0000 Received: from 192.67.84.200 ([192.67.84.200]) by SERVER.cct.co.uk ([10.10.10.1]) with Microsoft Exchange Server HTTP-DAV ; Thu, 22 Jun 2006 12:56:04 +0000 Received: from software.cct.co.uk by server.cct.co.uk; 22 Jun 2006 13:56:01 +0100 From: David Fernandez To: birahim.fall@elsys-design.com Cc: ecos-discuss@ecos.sourceware.org In-Reply-To: <200606210919.AA273809616@elsys-design.com> References: <200606210919.AA273809616@elsys-design.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 22 Jun 2006 12:56:00 -0000 Message-Id: <1150980960.29450.10.camel@software.cct.co.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR X-SW-Source: 2006-06/txt/msg00220.txt.bz2 On Wed, 2006-06-21 at 09:19 +0200, FALL wrote: > Good Day, I have successfully compiled and ran ecos on an oki platform. > I am however not understanding how to setup the NUMERATOR DENOMINATOR > RTC_PERIOD per my platform specs. I have read the documentation but I am > still not clear on what values I should use. Specifically, my processor > is runningat 33Mhz, when the hal_clock_initialize is called, what is the > relationship between that and the above mentioned values. > > Moussa > hi Moussa try this config: > cdl_component CYGNUM_HAL_CPUCLOCK { > display "cpu clock" display "cpu clock (Mhz.)" > flavor data > calculated 33000000 > no_define > define -file system.h CYGNUM_HAL_CPUCLOCK > description "Frequency of cpu clock in Hz." > } > .... > # Real-time clock/counter specifics > cdl_component CYGNUM_HAL_RTC_CONSTANTS { > display "Real-time clock constants" > flavor none > > cdl_option CYGNUM_HAL_RTC_NUMERATOR { > display "Real-time clock numerator" display "Real-time clock numerator (nanoseconds per second)" > flavor data > default_value 1000000000 > } > cdl_option CYGNUM_HAL_RTC_DENOMINATOR { > display "Real-time clock denominator" display "Real-time clock denominator (wraps per second)" > flavor data > default_value 100 > } > cdl_option CYGNUM_HAL_RTC_PERIOD { > display "Real-time clock period" display "Real-time clock period (ticks per wrap)" > flavor data > default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1 > } > } The way I see that in my intel platform is as modified above. The DENOMINATOR allows you to calculate ticks and specifies the OS timer "tick" (usually 10 milliseconds) The NUMERATOR allows you to convert periods into frequencies and viceversa (periods in nanoseconds to/from frequencies in Mhz.) The only reason you want to change DENOMINATOR is to get a different time granularity in the OS. The only reason you want to change the NUMERATOR is if you need to use different units of periods or frequencies becuase may be that the calculi you need to do exceeds the numerical capacity of your scalar types. David. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss