JP6769662B2 - Hardware timers, control methods and programs - Google Patents

Hardware timers, control methods and programs Download PDF

Info

Publication number
JP6769662B2
JP6769662B2 JP2019063957A JP2019063957A JP6769662B2 JP 6769662 B2 JP6769662 B2 JP 6769662B2 JP 2019063957 A JP2019063957 A JP 2019063957A JP 2019063957 A JP2019063957 A JP 2019063957A JP 6769662 B2 JP6769662 B2 JP 6769662B2
Authority
JP
Japan
Prior art keywords
timer
memory
cpu
time
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019063957A
Other languages
Japanese (ja)
Other versions
JP2020166355A (en
Inventor
鈴木 守
守 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Platforms Ltd
Original Assignee
NEC Platforms Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Platforms Ltd filed Critical NEC Platforms Ltd
Priority to JP2019063957A priority Critical patent/JP6769662B2/en
Publication of JP2020166355A publication Critical patent/JP2020166355A/en
Application granted granted Critical
Publication of JP6769662B2 publication Critical patent/JP6769662B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Bus Control (AREA)
  • Microcomputers (AREA)

Description

本発明は、ハードウェアタイマ、制御方法及びプログラムに関する。 The present invention relates to hardware timers, control methods and programs.

特許文献1は、タイムアウトバッファがフル状態の場合に、タイムアウトしたタイマの通知漏れを防ぐとともに、そのタイマについて本来のタイムアウトになるべき時間の情報を取得する技術について開示している。
また、特許文献2は、CPU(Central Processing Unit)からメモリへのアクセス要求が発生した場合に、CPUからメモリへのアクセスが許可され、CPUがメモリに対して、タイマ値のリード(Read)やライト(Write)の処理を行う技術について開示している。
Patent Document 1 discloses a technique for preventing omission of notification of a timer that has timed out when the time-out buffer is in the full state, and for acquiring information on the time when the original time-out should occur for the timer.
Further, in Patent Document 2, when an access request to the memory is generated from the CPU (Central Processing Unit), the access to the memory is permitted from the CPU, and the CPU reads the timer value (Read) to the memory. It discloses a technology for processing write.

また、特許文献3は、タイマバッファに記憶されているタイマ値が、タイムアウトとなった場合に、そのタイマバッファの情報を、所定のテーブルから削除して、タイマバッファを解放する技術について開示している。
また、特許文献4は、タイマメモリに記憶されている複数のタイマ値のカウント処理が、時分割で行われることについて開示している。
Further, Patent Document 3 discloses a technique for releasing the timer buffer by deleting the information of the timer buffer from a predetermined table when the timer value stored in the timer buffer times out. There is.
Further, Patent Document 4 discloses that counting processing of a plurality of timer values stored in a timer memory is performed in a time division manner.

特開2013−229671号公報Japanese Unexamined Patent Publication No. 2013-229671 特開2001−273049号公報Japanese Unexamined Patent Publication No. 2001-273049 特開平11−143723号公報JP-A-11-143723 特開平08−190517号公報Japanese Patent Application Laid-Open No. 08-190517

しかし、特許文献1〜4では、CPUがタイマメモリにアクセス可能な第1の時間と、タイマがタイマメモリにアクセス可能な第2の時間とが、割り当てられている場合において、第2の時間中は、タイマがオフの場合であっても、第2の時間が経過した後でなければ、CPUは、タイマメモリにアクセスすることができなかった。
そのため、タイマメモリへのアクセスが、CPUとタイマにより時分割で行われる場合おいて、タイマメモリへのアクセスが、タイマに割り当てられている時間には、タイマメモリがオフの状態であっても、CPUによるタイマメモリのアクセスを行うことができず、CPUのタイマメモリの使用時間を増やすことはできなかった。
However, in Patent Documents 1 to 4, when the first time in which the CPU can access the timer memory and the second time in which the timer can access the timer memory are allocated, during the second time. The CPU could not access the timer memory until after the second time had elapsed, even when the timer was off.
Therefore, when the access to the timer memory is performed by the CPU and the timer on a time-division basis, even if the timer memory is off during the time allotted to the timer, the access to the timer memory is performed. The timer memory could not be accessed by the CPU, and the usage time of the timer memory of the CPU could not be increased.

そこで、この発明は、上述の課題を解決するハードウェアタイマ、制御方法及びプログラムを提供することを目的としている。 Therefore, an object of the present invention is to provide a hardware timer, a control method, and a program that solve the above-mentioned problems.

本発明のいくつかの態様は、上述の課題を解決すべくなされたもので、本発明の第1の態様によるハードウェアタイマは、
中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択する選択部と、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記選択部に、前記第1の状態を選択させる制御部と、
を備える。
Some aspects of the present invention have been made to solve the above-mentioned problems, and the hardware timer according to the first aspect of the present invention is a device.
A selection unit that selects either a first state in which the central processing unit can access the timer memory and a second state in which the timer can access the timer memory.
Of the first time allocated as the time that the central processing unit can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. A control unit that causes the selection unit to select the first state when the timer is off even within the time period.
To be equipped.

また、本発明の第2の態様によるハードウェアタイマの制御方法は、
中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択し、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記第1の状態を選択する。
Further, the method for controlling the hardware timer according to the second aspect of the present invention is as follows.
One of the first state in which the central processing unit can access the timer memory and the second state in which the timer can access the timer memory is selected.
Of the first time allocated as the time that the central processing unit can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. Even within the time, if the timer is off, the first state is selected.

また、本発明の第3の態様によるプログラムは、中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択する選択手段、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記選択手段に、前記第1の状態を選択させる制御手段、
として機能させる。
Further, the program according to the third aspect of the present invention has either a first state in which the central processing unit can access the timer memory and a second state in which the timer can access the timer memory. Selection means to select,
Of the first time allocated as the time that the central processing unit can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. A control means that causes the selection means to select the first state even within the time when the timer is off.
To function as.

本発明によれば、タイマメモリへのアクセスが、CPUとタイマにより時分割で行われる場合おいて、CPUによるタイマメモリの使用時間を増やすことができる。 According to the present invention, when the timer memory is accessed by the CPU and the timer in a time-division manner, the usage time of the timer memory by the CPU can be increased.

本発明の第1の実施形態によるCPU、及び、ハードウェアタイマの構成を示すブロック図である。It is a block diagram which shows the structure of the CPU and the hardware timer by 1st Embodiment of this invention. 本発明の第1の実施形態によるバス選択部の構成を示すブロック図である。It is a block diagram which shows the structure of the bus selection part by 1st Embodiment of this invention. 本発明の第1の実施形態によるタイマオン制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the timer-on control part by 1st Embodiment of this invention. 本発明の第1の実施形態によるハードウェアタイマの動作を示すタイミングチャートである。It is a timing chart which shows the operation of the hardware timer by 1st Embodiment of this invention. 本発明の第1の実施形態によるタイマの動作を示すフローチャートである。It is a flowchart which shows the operation of the timer by 1st Embodiment of this invention. 本発明の第1の実施形態によるタイマオン制御部のレジスタ部の動作を示すフローチャートである。It is a flowchart which shows the operation of the register part of the timer-on control part by 1st Embodiment of this invention. 本発明の第1の実施形態によるタイマオン制御部の信号選択部の動作を示すフローチャートである。It is a flowchart which shows the operation of the signal selection part of the timer-on control part by 1st Embodiment of this invention. 本発明の第2の実施形態によるタイマオン制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the timer-on control part by 2nd Embodiment of this invention. 本発明の第3の実施形態によるタイマオン制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the timer-on control part by the 3rd Embodiment of this invention. 本発明の第4の実施形態によるタイマオン制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the timer-on control part by 4th Embodiment of this invention. 最小構成を有するハードウェアタイマの構成を示すブロック図である。It is a block diagram which shows the structure of the hardware timer which has the minimum structure. 最小構成を有するハードウェアタイマの処理を示すフローチャートである。It is a flowchart which shows the processing of the hardware timer which has the minimum configuration.

[第1の実施形態]
始めに、本発明の第1の実施形態について説明する。
図1は、本発明の第1の実施形態によるCPU10、及び、ハードウェアタイマ20の構成を示すブロック図である。
例えば、ハードウェアタイマ20は、携帯電話の基地局装置であって、複数のユーザ(子機)との通信制御を行う上でユーザ毎に時間を管理する基地局装置が備えるタイマとして用いられる。
ハードウェアタイマ20は、タイマ21、タイムアウトバッファ22、バス選択部23(選択部とも称する)、タイマメモリ24、タイマオン制御部25a(制御部とも称する)、バス26を備える。
[First Embodiment]
First, the first embodiment of the present invention will be described.
FIG. 1 is a block diagram showing a configuration of a CPU 10 and a hardware timer 20 according to the first embodiment of the present invention.
For example, the hardware timer 20 is a base station device for a mobile phone, and is used as a timer included in a base station device that manages time for each user in controlling communication with a plurality of users (slave units).
The hardware timer 20 includes a timer 21, a timeout buffer 22, a bus selection unit 23 (also referred to as a selection unit), a timer memory 24, a timer-on control unit 25a (also referred to as a control unit), and a bus 26.

CPU10は、バス26を介して、RAM(Random Access Memory)であるタイマメモリ24の記憶領域に、タイマ初期値をライト(Write)する。
CPU10は、タイマ21によってデクリメント(Decrement)されたタイマ値を、バス26を介して、タイマメモリ24からリード(Read)する。CPU10は、アドレスx(x=0〜nの整数)にライトしたタイマ値と、アドレスxからリードしたタイマ値との差分から、時間経過を求める。
The CPU 10 writes the initial timer value to the storage area of the timer memory 24 which is a RAM (Random Access Memory) via the bus 26.
The CPU 10 reads the timer value decremented by the timer 21 from the timer memory 24 via the bus 26. The CPU 10 obtains the passage of time from the difference between the timer value written to the address x (integer of x = 0 to n) and the timer value read from the address x.

CPU10は、タイムアウトバッファ22からの割り込み信号がアクティブ(Active)になると、タイムアウトバッファ22をリードして、タイムアウトしたタイマ番号を取得する。
なお、1個のタイマがデクリメントする周期は、(クロック周期)×(タイマ数)×(タイマサイクル数)の値以上とするため、(クロック周期)×(n+1)×(r+1)の値以上となる。例えば、クロック周期が10ns(ナノ秒)、タイマ数が、4096(n=4095)、タイマサイクル数が10(r=9)の場合には、1個のタイマがデクリメントする周期は、10ns×4096×10=0.4096ms以上となる。
When the interrupt signal from the timeout buffer 22 becomes active, the CPU 10 reads the timeout buffer 22 and acquires the timer number that has timed out.
Since the cycle of decrementing by one timer is equal to or greater than the value of (clock cycle) × (number of timers) × (number of timer cycles), it is equal to or greater than the value of (clock cycle) × (n + 1) × (r + 1). Become. For example, when the clock cycle is 10 ns (nanoseconds), the number of timers is 4096 (n = 4095), and the number of timer cycles is 10 (r = 9), the cycle in which one timer decrements is 10 ns × 4096. × 10 = 0.4096 ms or more.

タイマ21は、タイマメモリ24から、タイマ値をリードし、リードしたタイマ値に基づき、タイムアウト、タイマ未使用、デクリメントのいずれの状態にあるかについて判定する。具体的には、タイマ21は、タイマメモリ24からリードしたタイマ値が‘0’の場合は、タイマ未使用と判定し、タイマ値が‘1’である場合には、タイムアウトと判定し、タイマ値が、‘0’又は‘1’以外の値である場合には、デクリメントと判定する。
タイマ21は、タイマ未使用と判定した場合は、何も処理を行わない。
The timer 21 reads a timer value from the timer memory 24, and determines whether the timer is in a time-out state, a timer not used, or a decrement state based on the read timer value. Specifically, the timer 21 determines that the timer is not used when the timer value read from the timer memory 24 is "0", and determines that the timer is timed out when the timer value is "1", and determines that the timer is unused. If the value is a value other than '0' or '1', it is determined to be decrement.
When the timer 21 determines that the timer is not used, the timer 21 does not perform any processing.

タイマ21は、タイムアウトと判定し、かつ、タイムアウトバッファ22の記憶領域に空きがある場合は、タイムアウトしたタイマ番号を、タイムアウト番号として、タイムアウトバッファライト信号をアクティブにして、タイムアウトバッファ22に出力する。それとともに、タイマ21は、ライトデータを‘0’にして、タイムアウトバッファ22にライトする。
タイマ21は、タイムアウトと判定した場合であって、タイムアウトバッファ22の記憶領域に空きがない場合は、何も処理を行わない。
タイマ21は、デクリメントと判定した場合には、リードしたタイマ値と同じアドレスに、デクリメントした値をライトする。
If the timer 21 determines that a timeout has occurred and there is space in the storage area of the timeout buffer 22, the timeout buffer write signal is activated and output to the timeout buffer 22 with the timeout timer number as the timeout number. At the same time, the timer 21 sets the write data to '0' and writes to the timeout buffer 22.
The timer 21 does not perform any processing when it is determined that a timeout has occurred and there is no free space in the storage area of the timeout buffer 22.
When the timer 21 determines that the decrement is determined, the timer 21 writes the decremented value to the same address as the read timer value.

タイムアウトバッファ22は、一般的に用いられるFIFO(First In First Out)である。タイマ21から出力されるライト信号がアクティブになった場合には、タイムアウトバッファ22は、タイムアウトしたタイマ番号を記憶し、エンプティ(Empty)信号をネゲート(Negate)して、CPU10に対して割り込み信号を出力する。
タイムアウトバッファ22は、タイムアウトしたタイマ番号を、m(mは、正の整数)個記憶でき、タイムアウトバッファ22の記憶領域に空きがない場合には、フル信号をアクティブにすることにより、タイマ21が、タイムアウトバッファ22にライトしないようにする。
The timeout buffer 22 is a generally used FIFO (First In First Out). When the write signal output from the timer 21 becomes active, the timeout buffer 22 stores the time-out timer number, negates the empty signal, and sends an interrupt signal to the CPU 10. Output.
The timeout buffer 22 can store m (m is a positive integer) timer numbers that have timed out, and when there is no free space in the storage area of the timeout buffer 22, the timer 21 activates the full signal. , Do not write to the timeout buffer 22.

タイムアウトバッファ22は、CPU10のみから、リードアクセスを受けることが可能である。タイムアウトバッファ22がCPU10からリードされると、タイムアウトバッファ22は、タイマ21からライトされた順番に、タイマ番号を、CPU10に出力する。
タイムアウトバッファ22は、CPU10からリードされて、タイムアウトバッファ22の記憶領域が空になった場合には、エンプティ信号をアクティブにして、CPU10に対する割り込みを停止する。
The timeout buffer 22 can receive read access only from the CPU 10. When the timeout buffer 22 is read from the CPU 10, the timeout buffer 22 outputs the timer numbers to the CPU 10 in the order of being written from the timer 21.
The timeout buffer 22 is read from the CPU 10, and when the storage area of the timeout buffer 22 becomes empty, the timeout buffer 22 activates the empty signal and stops the interrupt to the CPU 10.

バス選択部23は、CPU10からのタイマメモリ24へのアクセス信号と、タイマ21からのタイマメモリ24へのアクセス信号を、タイマ21からのサイクルカウント信号と、タイマオン制御部25aからの選択タイマオン信号に基づいて選択して、タイマメモリ24に出力する。
バス選択部23は、選択タイマオン信号がアクティブの場合には、タイマ21からのサイクルカウント信号の値で、CPU10とタイマ21の使用割合を時分割して固定的に決定する。バス選択部23は、時分割された時間に基づいて、CPU10の出力信号と、タイマ21の出力信号を交互に選択して、タイマメモリ24に出力する。
The bus selection unit 23 converts the access signal to the timer memory 24 from the CPU 10 and the access signal to the timer memory 24 from the timer 21 into the cycle count signal from the timer 21 and the selection timer-on signal from the timer-on control unit 25a. Select based on and output to the timer memory 24.
When the selection timer on signal is active, the bus selection unit 23 fixedly determines the usage ratio of the CPU 10 and the timer 21 by time division based on the value of the cycle count signal from the timer 21. The bus selection unit 23 alternately selects the output signal of the CPU 10 and the output signal of the timer 21 based on the time-division time, and outputs the output signal to the timer memory 24.

バス選択部23は、選択タイマオン信号がノンアクティブ(Non−Active)の場合には、時分割された時間に関係なく、CPU10からのアクセス信号を、タイマメモリ24に出力するとともに、タイマメモリ24に対するリードデータを、タイマ未使用を表す‘0’でマスクして出力する。
バス選択部23は、CPU10に割り当てられた時間に、CPU10からのアクセスがあった場合は、CPUアック(Ack)信号を、すぐにCPU10に返信する。一方、バス選択部23は、CPU10に割り当てられた時間外に、CPU10からのアクセスがあった場合は、CPUアック信号をすぐには返信せずに、CPU10を待機させ、CPU10に割り当てられた時間になった場合に、CPUアック信号をCPU10に返信する。
When the selection timer on signal is non-active, the bus selection unit 23 outputs an access signal from the CPU 10 to the timer memory 24 and with respect to the timer memory 24 regardless of the time-division time. The read data is masked with "0" indicating that the timer is not used and output.
When the bus selection unit 23 receives an access from the CPU 10 at the time allocated to the CPU 10, the bus selection unit 23 immediately returns the CPU Ac signal to the CPU 10. On the other hand, when the bus selection unit 23 receives an access from the CPU 10 outside the time allocated to the CPU 10, the bus selection unit 23 causes the CPU 10 to stand by without immediately returning the CPU ack signal, and the time allocated to the CPU 10. When becomes, the CPU ack signal is returned to the CPU 10.

タイマメモリ24は、タイマ値を記憶する。タイマメモリ24は、バス選択部23を介して、CPU10とタイマ21により、ライトとリードの処理が行われる。
タイマメモリ24のアドレス‘0’番地は、タイマ番号‘0’と1対1で対応付けられており、タイマメモリ24のアドレスnが、タイマ番号nとなる。
The timer memory 24 stores the timer value. The timer memory 24 is subjected to write and read processing by the CPU 10 and the timer 21 via the bus selection unit 23.
The address '0' of the timer memory 24 is associated with the timer number '0' on a one-to-one basis, and the address n of the timer memory 24 is the timer number n.

タイマオン制御部25aは、CPU10がタイマメモリ24にアクセスする信号と、タイムアウトバッファ22へのタイムアウト番号と、タイムアウトバッファライト信号とを、スヌープ(Snoop)して、タイマ値のデクリメント動作が行われているか否かを判定する。なお、タイマ値のデクリメント動作が行われている場合を、タイマオンと定義する。
タイマオン制御部25aは、CPU10がタイマメモリ24のタイマ番号x(x=0〜nの整数)に対してライトする際に、ライトデータ値が‘0’の場合は、タイマ番号xはタイマオフであると判定する。
Whether the timer-on control unit 25a snoops the signal that the CPU 10 accesses the timer memory 24, the timeout number to the timeout buffer 22, and the timeout buffer write signal to perform the timer value decrementing operation. Judge whether or not. The case where the timer value decrement operation is performed is defined as timer on.
When the CPU 10 writes to the timer number x (integer of x = 0 to n) of the timer memory 24, the timer-on control unit 25a has the timer number x the timer off if the write data value is '0'. Is determined.

また、タイマオン制御部25aは、CPU10がタイマメモリ24のタイマ番号xに対してライトする場合に、ライトデータ値が‘0’以外の場合は、タイマ番号xはタイマオンであると判定する。
また、タイマオン制御部25aは、タイマ21がタイムアウトバッファ22にタイマ番号xをライトする場合に、タイマ番号xはタイマオフであると判定する。
また、タイマオン制御部25aは、タイマ個数分のタイマオン/オフ情報を保持する1ビットのレジスタを備えており、タイマオン/オフ判定結果を、各タイマ番号に割り当てられたレジスタに保持する。
また、タイマオン制御部25aは、タイマ21から出力されるタイマ番号よって、対応するタイマ番号のレジスタを選択して、選択されたレジスタの値を選択タイマオン信号として、バス選択部23に出力する。
Further, the timer-on control unit 25a determines that the timer number x is timer-on when the CPU 10 writes to the timer number x of the timer memory 24 and the write data value is other than '0'.
Further, the timer-on control unit 25a determines that the timer number x is timer-off when the timer 21 writes the timer number x to the timeout buffer 22.
Further, the timer-on control unit 25a includes a 1-bit register that holds timer on / off information for the number of timers, and holds the timer on / off determination result in the register assigned to each timer number.
Further, the timer-on control unit 25a selects a register of the corresponding timer number according to the timer number output from the timer 21, and outputs the value of the selected register as a selection timer-on signal to the bus selection unit 23.

バス26は、CPU10、タイマ21、タイムアウトバッファ22、バス選択部23、タイマオン制御部25aに接続され、それらの間でデータのやり取りをするための信号線である。 The bus 26 is a signal line connected to the CPU 10, the timer 21, the timeout buffer 22, the bus selection unit 23, and the timer-on control unit 25a, and for exchanging data between them.

図2は、本発明の第1の実施形態によるバス選択部23の構成を示すブロック図である。バス選択部23は、タイマ選択信号生成部231、CPU制御部232、セレクタ233、マスク制御部234を備える。 FIG. 2 is a block diagram showing a configuration of a bus selection unit 23 according to the first embodiment of the present invention. The bus selection unit 23 includes a timer selection signal generation unit 231, a CPU control unit 232, a selector 233, and a mask control unit 234.

タイマ選択信号生成部231は、タイマ21からのタイマサイクルカウント信号に基づいて、CPU10とタイマ21によるタイマメモリ24の使用割合を時分割して固定的に決定したタイマ選択信号を生成し、マスク制御部234に出力する。 The timer selection signal generation unit 231 generates a timer selection signal that is fixedly determined by time-dividing the usage ratio of the timer memory 24 by the CPU 10 and the timer 21 based on the timer cycle count signal from the timer 21, and mask control. Output to unit 234.

CPU制御部232は、CPU10からのタイマメモリ234へのアクセスを検出し、マスクタイマ選択信号が‘0’の場合は、すぐにCPU10に、CPUアック信号を出力する。一方、マスクタイマ選択信号が‘1’の場合は、CPU制御部232は、マスクタイマ選択信号が‘0’になるまで待機してから、CPU10にCPUアック信号を出力する。
CPU制御部232は、CPU10からのタイマメモリ234へのライトアクセスを検出して、CPUアック信号にタイミングを合わせたCPUリタイミングライト(Retiming Write)信号をセレクタ233に出力する。
CPU制御部232は、CPU10からタイマメモリ24へのリードアクセスを検出して、入力されたRAMリードデータを、CPUアック信号にタイミングを合わせたCPUリードデータとして出力する。
The CPU control unit 232 detects access to the timer memory 234 from the CPU 10, and if the mask timer selection signal is '0', immediately outputs a CPU ack signal to the CPU 10. On the other hand, when the mask timer selection signal is '1', the CPU control unit 232 waits until the mask timer selection signal becomes '0', and then outputs the CPU ack signal to the CPU 10.
The CPU control unit 232 detects a write access from the CPU 10 to the timer memory 234, and outputs a CPU retiming write signal whose timing is matched to the CPU ack signal to the selector 233.
The CPU control unit 232 detects read access from the CPU 10 to the timer memory 24, and outputs the input RAM read data as CPU read data whose timing is adjusted to the CPU ack signal.

セレクタ233は、マスクタイマ選択信号の値が‘0’の場合は、CPU10のアドレス、データとCPUリタイミングライト信号を、タイマメモリ24に出力する。
また、セレクタ233は、マスクタイマ選択信号の値が‘1’の場合は、タイマ21のタイマ番号、タイマライトデータ、タイマライト信号を、タイマメモリ24に出力する。
When the value of the mask timer selection signal is '0', the selector 233 outputs the address and data of the CPU 10 and the CPU retiming write signal to the timer memory 24.
When the value of the mask timer selection signal is '1', the selector 233 outputs the timer number of the timer 21, the timer write data, and the timer write signal to the timer memory 24.

マスク制御部234は、タイマ選択信号と、タイマオン制御部25aからの選択タイマオン信号に基づいて、タイマ21に出力するタイマリードデータの‘0’マスク制御や、マスクタイマ選択信号のマスク制御を行い、その制御結果を、CPU制御部232とセレクタ233に出力する。
マスク制御部234は、選択タイマオン信号が‘0’の場合は、タイマリードデータを‘0’にする。また、マスク制御部234は、マスクタイマ選択信号を‘0’にする。
マスク制御部234は、選択タイマオン信号が‘1’の場合は、タイマリードデータとして、RAMリードデータを出力する。また、マスク制御部234は、マスクタイマ選択信号として、タイマ選択信号を出力する。
The mask control unit 234 performs '0' mask control of the timer read data output to the timer 21 and mask control of the mask timer selection signal based on the timer selection signal and the selection timer on signal from the timer on control unit 25a. The control result is output to the CPU control unit 232 and the selector 233.
The mask control unit 234 sets the timer read data to '0' when the selection timer on signal is '0'. Further, the mask control unit 234 sets the mask timer selection signal to '0'.
When the selection timer on signal is '1', the mask control unit 234 outputs RAM read data as timer read data. Further, the mask control unit 234 outputs a timer selection signal as a mask timer selection signal.

図3は、本発明の第1の実施形態によるタイマオン制御部25aの構成を示すブロック図である。タイマオン制御部25aは、CPUセットパルス生成部251、CPUクリアパルス生成部252、レジスタ部253a、信号選択部254、タイムアウトクリアパルス生成部255、クリアパルス合成部256を備える。 FIG. 3 is a block diagram showing a configuration of a timer-on control unit 25a according to the first embodiment of the present invention. The timer-on control unit 25a includes a CPU set pulse generation unit 251, a CPU clear pulse generation unit 252, a register unit 253a, a signal selection unit 254, a timeout clear pulse generation unit 255, and a clear pulse synthesis unit 256.

CPUセットアップパルス生成部251は、CPU10からのCPUアドレス、CPUデータと、バス選択部23からのCPUリタイミングライト信号に基づき、タイマメモリ24のタイマ番号x(x=0〜nの整数)に対してライトデータが‘0’以外のライトを行った場合に、セットパルスxをアクティブにする。 The CPU setup pulse generation unit 251 refers to the timer number x (an integer of x = 0 to n) of the timer memory 24 based on the CPU address and CPU data from the CPU 10 and the CPU retiming write signal from the bus selection unit 23. When the light data is written other than '0', the set pulse x is activated.

CPUクリアパルス生成部252は、CPU10からのCPUアドレス、CPUデータと、バス選択部23からのCPUリタイミングライト信号に基づき、タイマメモリ24のタイマ番号x(x=0〜nの整数)に対してライトデータが‘0’のライトを行った場合に、クリアパルスxをアクティブにする。 The CPU clear pulse generation unit 252 refers to the timer number x (integer of x = 0 to n) of the timer memory 24 based on the CPU address and CPU data from the CPU 10 and the CPU retiming write signal from the bus selection unit 23. When the write data is '0', the clear pulse x is activated.

レジスタ部253aは、タイマ個数分のレジスタ253a−0、・・・、253a−nで構成され、対応するクリアパルスがアクティブの場合は、レジスタ値を‘0’とする。一方、レジスタ部253aは、対応するセットパルスがアクティブの場合は、レジスタ値を‘1’にセットする。レジスタ部253aは、レジスタ値を、タイマオン信号として、信号選択部254に出力する。 The register unit 253a is composed of registers 253a-0, ..., 253a-n corresponding to the number of timers, and when the corresponding clear pulse is active, the register value is set to "0". On the other hand, the register unit 253a sets the register value to '1' when the corresponding set pulse is active. The register unit 253a outputs the register value to the signal selection unit 254 as a timer-on signal.

信号選択部254は、タイマ21からのタイマ番号に基づき、レジスタ部253aからのタイマオン信号を選択して、選択タイマオン信号として、バス選択部23に出力する。 The signal selection unit 254 selects the timer-on signal from the register unit 253a based on the timer number from the timer 21, and outputs it to the bus selection unit 23 as the selection timer-on signal.

タイムアウトクリアパルス生成部255は、タイマ21からのタイムアウト番号と、タイムアウトバッファライト信号に基づき、タイマメモリ24のタイマ番号x(x=0〜nの整数)に対してライトを行った場合に、クリアパルスxをアクティブにする。 The timeout clear pulse generation unit 255 clears the timer number x (integer of x = 0 to n) of the timer memory 24 based on the timeout number from the timer 21 and the timeout buffer write signal. Activate pulse x.

クリアパルス合成部256は、CPUクリアパルス生成部252のクリアパルスxと、タイムアウトクリアパルス生成部255からのクリアパルスxとの論理和をとって、レジスタ部253aに出力する。 The clear pulse synthesis unit 256 takes the logical sum of the clear pulse x of the CPU clear pulse generation unit 252 and the clear pulse x from the timeout clear pulse generation unit 255, and outputs the logical sum to the register unit 253a.

図4は、本発明の第1の実施形態によるハードウェアタイマ20の動作を示すタイミングチャートである。
図4の符号(a)の信号は、クロック信号を示している。ここでは、クロック周期は、10ns(ナノ秒)である。
図4の符号(b)の信号は、RAMアドレス(タイマ番号)を示している。ここでは、0〜nの合計n+1個のタイマ番号からなる。各タイマ番号には、1クロックが割り当てられ、タイマ番号が、nまで進むと、タイマ番号が、0に戻る。
図4の符号(c)の信号は、タイマ選択信号を示している。タイマ選択信号は、RAMアドレス(タイマ番号)に対応するタイマが、オン(ON)であるか、オフ(OFF)であるかを示す。ここでは、タイマ番号0のタイマが、オンとなり、タイマ番号1のタイマが、オフとなり、タイマ番号2〜nのタイマが、オンとなる場合を示している。
FIG. 4 is a timing chart showing the operation of the hardware timer 20 according to the first embodiment of the present invention.
The signal of reference numeral (a) in FIG. 4 indicates a clock signal. Here, the clock period is 10 ns (nanoseconds).
The signal of reference numeral (b) in FIG. 4 indicates a RAM address (timer number). Here, it consists of a total of n + 1 timer numbers from 0 to n. One clock is assigned to each timer number, and when the timer number advances to n, the timer number returns to 0.
The signal of reference numeral (c) in FIG. 4 indicates a timer selection signal. The timer selection signal indicates whether the timer corresponding to the RAM address (timer number) is ON (ON) or OFF (OFF). Here, the case where the timer with the timer number 0 is turned on, the timer with the timer number 1 is turned off, and the timers with the timer numbers 2 to n are turned on is shown.

図4の符号(d)の信号は、RAMアドレス(タイマ番号)を示している。
図4の符号(e)の信号は、タイマ選択信号を示している。
図4の符号(f)の信号は、タイマサイクルカウント信号を示している。タイマサイクルカウント信号は、0からrまで増加した後、0からrまでカウントする処理を繰り返す。
図4の符号(g)の信号は、バス選択動作信号を示している。バス選択動作信号は、CPU10とタイマ(TIMER)21のいずれかを選択するための信号である。ここでは、RAMアドレス(タイマ番号)が、1の場合であって、タイマサイクルカウントが、1から4の間は、タイマ21が選択され、タイマサイクルカウントが、5からrの間は、CPU10が選択される場合について示している。
なお、図4の符号(d)〜(g)の信号は、主に、符号(b)の信号のRAMアドレス(タイマ番号)が、1の部分を、拡大して示している。
The signal of reference numeral (d) in FIG. 4 indicates a RAM address (timer number).
The signal of reference numeral (e) in FIG. 4 indicates a timer selection signal.
The signal of reference numeral (f) in FIG. 4 indicates a timer cycle count signal. The timer cycle count signal increases from 0 to r, and then repeats the process of counting from 0 to r.
The signal of reference numeral (g) in FIG. 4 indicates a bus selection operation signal. The bus selection operation signal is a signal for selecting either the CPU 10 or the timer (TIMER) 21. Here, when the RAM address (timer number) is 1, the timer 21 is selected when the timer cycle count is between 1 and 4, and the CPU 10 is selected when the timer cycle count is between 5 and r. It shows the case where it is selected.
The signals of reference numerals (d) to (g) in FIG. 4 are mainly shown by enlarging the portion where the RAM address (timer number) of the signal of reference numeral (b) is 1.

図4の符号(h)の信号は、符号(d)のRAMアドレス(タイマ番号)が、1の場合であって、タイマサイクルカウントが、1から4の場合を示しており、タイマ21で行われる処理を示している。ここでは、RAMアドレス(タイマ番号)が、1の場合であって、タイマサイクルカウントが、1から4の場合に、タイマ21が、タイマ値リード、タイマ値判定、タイマ値デクリメント、デクリメント値ライト(タイムアウトバッファライト)の処理を行う。 The signal of reference numeral (h) in FIG. 4 indicates a case where the RAM address (timer number) of reference numeral (d) is 1 and the timer cycle count is 1 to 4, and the timer 21 sets the signal. Indicates the processing to be performed. Here, when the RAM address (timer number) is 1, and the timer cycle count is 1 to 4, the timer 21 reads the timer value, determines the timer value, decrements the timer value, and writes the decrement value (decrement value write). Timeout buffer write) is processed.

図5は、本発明の第1の実施形態によるタイマ21の動作を示すフローチャートである。タイマ21は、CPU10から、タイマ動作のオン設定の指示を受けているか否かについて判定する(ステップS101)。タイマ21が、CPU10から、タイマ動作のオン設定の指示を受けていない場合には(ステップS101でNo)、タイマ21は、再度、ステップS101の処理を行う。
タイマ21が、CPU10から、タイマ動作のオン設定の指示を受けている場合には(ステップS101でYes)、タイマ21は、ステップS102の処理を行う。
つまり、タイマ21は、タイマ番号0から、タイマアクセスを開始する(ステップS102)。そして、タイマ21は、タイマ値を、タイマメモリ24からリードする(ステップS103)。なお、タイマ21は、タイマ番号に対応するタイマ動作を停止している場合には、タイマサイクルカウント信号として‘0’を出力して、タイマ21からタイマメモリ24へのアクセスを禁止する。
FIG. 5 is a flowchart showing the operation of the timer 21 according to the first embodiment of the present invention. The timer 21 determines whether or not the CPU 10 has instructed the timer operation to be turned on (step S101). If the timer 21 has not received an instruction from the CPU 10 to set the timer operation to ON (No in step S101), the timer 21 again performs the process of step S101.
When the timer 21 receives an instruction from the CPU 10 to set the timer operation on (Yes in step S101), the timer 21 performs the process of step S102.
That is, the timer 21 starts timer access from the timer number 0 (step S102). Then, the timer 21 reads the timer value from the timer memory 24 (step S103). When the timer operation corresponding to the timer number is stopped, the timer 21 outputs '0' as a timer cycle count signal to prohibit the timer 21 from accessing the timer memory 24.

次に、タイマ21は、タイマ値が、0であるか否かについて判定する(ステップS104)。つまり、タイマ21は、タイマ値が、未使用の状態であるか否かについて判定する。タイマ21が、タイマ値が、0であると判定した場合には(ステップS104でYes)、タイマ21は、ステップS105の処理を行う。
つまり、タイマ21は、タイマ番号に、1を加算(インクリメント)する(ステップS105)。
Next, the timer 21 determines whether or not the timer value is 0 (step S104). That is, the timer 21 determines whether or not the timer value is in an unused state. When the timer 21 determines that the timer value is 0 (Yes in step S104), the timer 21 performs the process of step S105.
That is, the timer 21 adds (increments) 1 to the timer number (step S105).

そして、タイマ21は、タイマ番号が、最大の番号であるnであるか否かについて判定する(ステップS106)。タイマ21が、タイマ番号が、nではないと判定した場合には(ステップS106でNo)、タイマ21は、上述したステップS103の処理を行う。一方、タイマ21が、タイマ番号が、nであると判定した場合には(ステップS106でYes)、タイマ21は、ステップS107の処理を行う。
つまり、タイマ21は、CPU10から、タイマ動作のオフ設定の指示を受けているか否かについて判定する(ステップS107)。タイマ21が、CPU10から、タイマ動作のオフ設定の指示を受けている場合には(ステップS107でYes)、タイマ21は、図5に示すフローチャートの処理を終了し、動作を停止する。この場合、タイマ21は、タイマサイクルカウント信号を、‘0’にする。
Then, the timer 21 determines whether or not the timer number is n, which is the maximum number (step S106). When the timer 21 determines that the timer number is not n (No in step S106), the timer 21 performs the process of step S103 described above. On the other hand, when the timer 21 determines that the timer number is n (Yes in step S106), the timer 21 performs the process of step S107.
That is, the timer 21 determines whether or not the CPU 10 has instructed the timer operation to be turned off (step S107). When the timer 21 receives an instruction from the CPU 10 to set the timer operation to off (Yes in step S107), the timer 21 ends the processing of the flowchart shown in FIG. 5 and stops the operation. In this case, the timer 21 sets the timer cycle count signal to '0'.

一方、タイマ21が、CPU10から、タイマ動作のオフ設定の指示を受けていない場合には(ステップS107でNo)、タイマ21は、ステップS108の処理を行う。
つまり、タイマ21は、タイマ更新周期になったか否かについて判定する(ステップS108)。タイマ21が、タイマ更新周期になっていないと判定した場合には(ステップS108でNo)、タイマ21は、再度、ステップS108の処理を行う。
一方、タイマ21が、タイマ更新周期となったと判定した場合には(ステップS108でYes)、タイマ21は、タイマ番号を‘0’にして、上述したステップS102の処理を行う。
On the other hand, when the timer 21 has not received the instruction of the timer operation off setting from the CPU 10 (No in step S107), the timer 21 performs the process of step S108.
That is, the timer 21 determines whether or not the timer update cycle has been reached (step S108). If it is determined that the timer 21 has not reached the timer update cycle (No in step S108), the timer 21 again performs the process of step S108.
On the other hand, when the timer 21 determines that the timer update cycle has been reached (Yes in step S108), the timer 21 sets the timer number to '0' and performs the process of step S102 described above.

一方、タイマ21が、タイマ値が、0ではないと判定した場合には(ステップS104でNo)、タイマ21は、ステップS109の処理を行う。
つまり、タイマ21は、タイマ値が、1であるか否かについて判定する(ステップS109)。タイマ21が、タイマ値が、1であると判定した場合には(ステップS109でYes)、タイマ21は、ステップS110の処理を行う。
つまり、タイマ21は、タイムアウトバッファ22がフルであるか否かについて判定する(ステップS110)。タイマ21が、タイムアウトバッファ22がフルであると判定した場合には(ステップS110でYes)、タイマ21は、上述したステップS105の処理を行う。
On the other hand, when the timer 21 determines that the timer value is not 0 (No in step S104), the timer 21 performs the process of step S109.
That is, the timer 21 determines whether or not the timer value is 1 (step S109). When the timer 21 determines that the timer value is 1 (Yes in step S109), the timer 21 performs the process of step S110.
That is, the timer 21 determines whether or not the timeout buffer 22 is full (step S110). When the timer 21 determines that the timeout buffer 22 is full (Yes in step S110), the timer 21 performs the process of step S105 described above.

一方、タイマ21が、タイムアウトバッファ22がフルではないと判定した場合には(ステップS110でNo)、タイマ21は、ステップS111の処理を行う。
つまり、タイマ21は、タイマ値から1を減算(デクリメント)する(ステップS111)。
そして、タイマ21は、タイマ値を、タイマメモリ24にライトするとともに、タイムアウトバッファ22に、タイマ番号をライトし(ステップS112)、上述したステップS105の処理を行う。
On the other hand, when the timer 21 determines that the timeout buffer 22 is not full (No in step S110), the timer 21 performs the process of step S111.
That is, the timer 21 subtracts (decrements) 1 from the timer value (step S111).
Then, the timer 21 writes the timer value to the timer memory 24, writes the timer number to the timeout buffer 22 (step S112), and performs the process of step S105 described above.

一方、タイマ21が、タイマ値が、1ではないと判定した場合には(ステップS109でNo)、タイマ21は、ステップS113の処理を行う。
つまり、タイマ21は、タイマ値から1を減算する(ステップS113)。
そして、タイマ21は、タイマ値を、タイマメモリ24にライトし(ステップS114)、上述したステップS105の処理を行う。
On the other hand, when the timer 21 determines that the timer value is not 1 (No in step S109), the timer 21 performs the process of step S113.
That is, the timer 21 subtracts 1 from the timer value (step S113).
Then, the timer 21 writes the timer value to the timer memory 24 (step S114), and performs the process of step S105 described above.

図6は、本発明の第1の実施形態によるタイマオン制御部25aのレジスタ部253aの動作を示すフローチャートである。
始めに、レジスタ部253aは、タイマ番号が更新されたか否かについて判定する(ステップS201)。レジスタ部253aが、タイマ番号が更新されていないと判定した場合には(ステップS201でNo)、レジスタ部253aは、再度、ステップS201の処理を行う。
一方、レジスタ部253aが、タイマ番号が更新されたと判定した場合には(ステップS201でYes)、レジスタ部253aは、ステップS202の処理を行う。
FIG. 6 is a flowchart showing the operation of the register unit 253a of the timer-on control unit 25a according to the first embodiment of the present invention.
First, the register unit 253a determines whether or not the timer number has been updated (step S201). When the register unit 253a determines that the timer number has not been updated (No in step S201), the register unit 253a again performs the process of step S201.
On the other hand, when the register unit 253a determines that the timer number has been updated (Yes in step S201), the register unit 253a performs the process of step S202.

つまり、レジスタ部253aは、CPU10から、タイマメモリ24への更新があったか否かについて判定する(ステップS202)。
レジスタ部253aが、CPU10から、タイマメモリ24への更新があったと判定した場合には(ステップS202でYes)、レジスタ部253aは、ステップS203の処理を行う。
That is, the register unit 253a determines whether or not the CPU 10 has updated the timer memory 24 (step S202).
When the register unit 253a determines that the timer memory 24 has been updated from the CPU 10 (Yes in step S202), the register unit 253a performs the process of step S203.

つまり、レジスタ部253aは、CPU10から、ライトデータ値‘0’以外のライトがあったか否かについて判定する(ステップS203)。
レジスタ部253aが、CPU10から、ライトデータ値‘0’以外のライトがあったと判定した場合には(ステップS203でYes)、レジスタ部253aは、タイマ番号xのレジスタを、タイマオンに設定する(ステップS204)。
一方、レジスタ部253aが、CPU10から、ライトデータ値‘0’以外のライトがないと判定した場合には(ステップS203でNo)、レジスタ部253aは、タイマ番号xのレジスタを、タイマオフに設定する(ステップS206)。
That is, the register unit 253a determines from the CPU 10 whether or not there is a write other than the write data value '0' (step S203).
When the register unit 253a determines from the CPU 10 that there is a write other than the write data value '0' (Yes in step S203), the register unit 253a sets the timer number x register to timer on (step). S204).
On the other hand, when the register unit 253a determines from the CPU 10 that there is no write other than the write data value '0' (No in step S203), the register unit 253a sets the timer number x register to timer off. (Step S206).

なお、レジスタ部253aが、CPU10から、タイマメモリ24への更新がないと判定した場合には(ステップS202でNo)、レジスタ部253aは、ステップS205の処理を行う。
つまり、レジスタ部253aは、タイマ21から、タイムアウトバッファ22への更新があったか否かについて判定する(ステップS205)。
レジスタ部253aが、タイマ21から、タイムアウトバッファ22への更新があったと判定した場合には(ステップS205でYes)、レジスタ部253aは、上述したステップS206の処理を行う。
一方、レジスタ部253aが、タイマ21から、タイムアウトバッファ22への更新がなかったと判定した場合には(ステップS205でNo)、レジスタ部253aは、上述したステップS201の処理を行う。
If the register unit 253a determines that the CPU 10 has not updated the timer memory 24 (No in step S202), the register unit 253a performs the process of step S205.
That is, the register unit 253a determines whether or not the timer 21 has updated the timeout buffer 22 (step S205).
When the register unit 253a determines that the timer 21 has updated the timeout buffer 22 (Yes in step S205), the register unit 253a performs the process of step S206 described above.
On the other hand, when the register unit 253a determines that the timer 21 has not updated the timeout buffer 22 (No in step S205), the register unit 253a performs the process of step S201 described above.

図7は、本発明の第1の実施形態によるタイマオン制御部25aの信号選択部254の動作を示すフローチャートである。
始めに、信号選択部254は、タイマ番号xが更新されたか否かについて判定する(ステップS301)。信号選択部254が、タイマ番号xが更新されていないと判定した場合には(ステップS301でNo)、信号選択部254は、再度、ステップS301の処理を行う。
一方、信号選択部254が、タイマ番号xが更新されたと判定した場合には(ステップS301でYes)、信号選択部254は、ステップS302の処理を行う。
FIG. 7 is a flowchart showing the operation of the signal selection unit 254 of the timer-on control unit 25a according to the first embodiment of the present invention.
First, the signal selection unit 254 determines whether or not the timer number x has been updated (step S301). When the signal selection unit 254 determines that the timer number x has not been updated (No in step S301), the signal selection unit 254 performs the process of step S301 again.
On the other hand, when the signal selection unit 254 determines that the timer number x has been updated (Yes in step S301), the signal selection unit 254 performs the process of step S302.

つまり、信号選択部254は、タイマ番号xが示すレジスタ値が、オンとオフのいずれの状態であるかについて判定する(ステップS302)。
信号選択部254が、タイマ番号xが示すレジスタ値が、オンであると判定した場合には(ステップS302でオン)、信号選択部254は、タイマ21が、タイマメモリ24にアクセスできるように、バス選択部23を切り替え(ステップS303)、上述したステップS301の処理を行う。
一方、信号選択部254が、タイマ番号xが示すレジスタ値が、オフであると判定した場合には(ステップS302でオフ)、信号選択部254は、CPU10が、タイマメモリ24にアクセスできるように、バス選択部23を切り替え(ステップS304)、上述したステップS301の処理を行う。
That is, the signal selection unit 254 determines whether the register value indicated by the timer number x is on or off (step S302).
When the signal selection unit 254 determines that the register value indicated by the timer number x is on (on in step S302), the signal selection unit 254 allows the timer 21 to access the timer memory 24. The bus selection unit 23 is switched (step S303), and the process of step S301 described above is performed.
On the other hand, when the signal selection unit 254 determines that the register value indicated by the timer number x is off (off in step S302), the signal selection unit 254 allows the CPU 10 to access the timer memory 24. , The bus selection unit 23 is switched (step S304), and the process of step S301 described above is performed.

なお、本実施形態によるハードウェアタイマ20の動作について、以下に説明する。
最初に、CPU10は、タイマ数分のアドレスエリアを持つタイマメモリ24のタイマ番号xに、タイマ初期値を設定する。
タイマ値の最大値は、タイマメモリ24のデータ幅で決定される。例えば、タイマメモリ24のデータ幅が、16ビットの場合には、タイマ値の最大値は、65535なので、ハードウェアタイマ20は、(タイマ更新周期)×(65535)の値まで計数可能となる。
The operation of the hardware timer 20 according to this embodiment will be described below.
First, the CPU 10 sets a timer initial value in the timer number x of the timer memory 24 having an address area corresponding to the number of timers.
The maximum value of the timer value is determined by the data width of the timer memory 24. For example, when the data width of the timer memory 24 is 16 bits, the maximum value of the timer value is 65535, so that the hardware timer 20 can count up to the value of (timer update cycle) × (65535).

バス選択部23は、CPU10からタイマメモリ24へのライトアクセスを検出して、CPU10がタイマメモリ24にアクセス可能な時間のみ、CPUアック信号を生成し、タイマメモリ24にCPUアドレスと、CPUデータと、リタイミングしたライト信号とを出力する。バス選択部23から出力されるアドレス及びデータや、タイマ初期値は、タイマメモリ24にライトされる。
タイマ初期値のライトが終了した後、CPU10は、タイマ動作のオンを設定する(図5ステップS101でYes)。タイマ21は、CPU10からのタイマ動作オン設定を検出して、タイマサイクルカウントのインクリメントを開始する。タイマサイクルカウントでは、0〜rの値が繰り返される。
The bus selection unit 23 detects write access from the CPU 10 to the timer memory 24, generates a CPU ack signal only for the time when the CPU 10 can access the timer memory 24, and causes the timer memory 24 to have a CPU address and CPU data. , Outputs a retimed light signal. The address and data output from the bus selection unit 23 and the initial timer value are written to the timer memory 24.
After the write of the initial value of the timer is finished, the CPU 10 sets the timer operation on (Yes in step S101 of FIG. 5). The timer 21 detects the timer operation on setting from the CPU 10 and starts incrementing the timer cycle count. In the timer cycle count, the values 0 to r are repeated.

タイマサイクルカウントが0に戻るたびに、タイマ番号(RAMアドレス)はインクリメントされる。
タイマ更新周期毎に、タイマ0からタイマnまでのタイマ番号が出力される(図5のステップS103〜S106)。タイマ21は、図4の符号(f)及び(h)で示すように、タイマサイクルカウントの1〜4の4クロックの間に、タイマ値リード、タイマ値判定、タイマ値デクリメント、デクリメント値ライト(タイムアウトバッファライト)の処理を行う。
タイマオン制御部25aは、CPU10がタイマメモリ24にアクセスする信号と、タイムアウトバッファ22へのタイムアウト番号と、タイムアウトバッファライト信号とを、スヌープして、タイマ値のデクリメント動作が行われているか否かを判定する。ここでは、タイマ値のデクリメント動作が行われている場合を、タイマオンと定義する。また、タイマオン以外の場合を、タイマオフと定義する。
Every time the timer cycle count returns to 0, the timer number (RAM address) is incremented.
The timer numbers from timer 0 to timer n are output for each timer update cycle (steps S103 to S106 in FIG. 5). As shown by the reference numerals (f) and (h) of FIG. 4, the timer 21 has a timer value read, a timer value determination, a timer value decrement, and a decrement value write (during the four clocks of the timer cycle counts 1 to 4). Timeout buffer write) is processed.
The timer-on control unit 25a snoops the signal that the CPU 10 accesses the timer memory 24, the timeout number to the timeout buffer 22, and the timeout buffer write signal, and determines whether or not the timer value decrement operation is performed. judge. Here, the case where the timer value decrement operation is performed is defined as timer on. A case other than timer on is defined as timer off.

タイマオン制御部25aは、CPU10がタイマメモリ24のタイマ番号x(x=0〜n)に対してライトする場合に、ライトデータ値が‘0’の場合は、タイマ番号xはタイマオフの状態にあると判定する。
タイマオン制御部25aは、CPU10がタイマメモリ24のタイマ番号xに対してライトする場合、ライトデータ値が‘0’以外の場合には、タイマ番号xはタイマオンの状態にあると判定する。
タイマオン制御部25aは、タイマ21がタイムアウトバッファ22にタイマ番号xをライトする場合に、タイマ番号xはタイマオフの状態にあると判定する。
タイマオン制御部25aは、タイマ個数分のタイマオン/オフ情報を保持する1ビットのレジスタを備えており、タイマオン/オフ判定結果を、対応するタイマ番号のレジスタに記録する。
When the CPU 10 writes to the timer number x (x = 0 to n) of the timer memory 24 and the write data value is '0', the timer-on control unit 25a is in the timer-off state. Is determined.
When the CPU 10 writes to the timer number x of the timer memory 24, the timer-on control unit 25a determines that the timer number x is in the timer-on state when the write data value is other than '0'.
When the timer 21 writes the timer number x to the timeout buffer 22, the timer-on control unit 25a determines that the timer number x is in the timer-off state.
The timer-on control unit 25a includes a 1-bit register that holds timer on / off information for the number of timers, and records the timer on / off determination result in the register of the corresponding timer number.

タイマオン制御部25aは、タイマ21からのタイマ番号に基づき、対応するタイマ番号のレジスタを選択して、選択されたレジスタの値を選択タイマオン信号としてバス選択部23に出力する。
バス選択部23は、選択タイマオン信号が‘1’の場合は、タイマ21がオンの状態にあると判定し、タイマサイクルカウントの1〜4の時間で、タイマ21にタイマメモリ24へのアクセスを許可する。一方、バス選択部23は、選択タイマオン信号が‘0’の場合は、タイマ21がオフの状態にあると判定し、タイマサイクルカウントの1〜4の時間であっても、CPU10にタイマメモリ24へのアクセスを許可する(図4の符号(b)及び(d)のタイマ番号1の区間)。
この場合、CPU10にタイマメモリ24へのアクセスを許可している時間は、タイマ21には、タイマメモリ24をリードしているように見せるために、タイマメモリ24のリードデータを‘0’にマスクする。
The timer-on control unit 25a selects a register having a corresponding timer number based on the timer number from the timer 21, and outputs the value of the selected register to the bus selection unit 23 as a selection timer-on signal.
When the selection timer on signal is '1', the bus selection unit 23 determines that the timer 21 is in the on state, and gives the timer 21 access to the timer memory 24 within 1 to 4 times of the timer cycle count. to approve. On the other hand, when the selection timer on signal is '0', the bus selection unit 23 determines that the timer 21 is in the off state, and even if the time is 1 to 4 of the timer cycle count, the timer memory 24 is stored in the CPU 10. (Section of timer number 1 of reference numerals (b) and (d) in FIG. 4).
In this case, the time when the CPU 10 is allowed to access the timer memory 24 masks the read data of the timer memory 24 to '0' in order to make the timer 21 appear to be reading the timer memory 24. To do.

タイマ21は、タイマ値をリードした後に、タイマ値が‘1’かつタイムアウトバッファ22がフルでない場合は、タイムアウトと判定して、タイマ値をデクリメントして、デクリメントしたタイマ値をタイマメモリ24にライトするとともに、タイムアウトバッファ22にタイマ番号をライトする。
タイマ21は、タイマ値をリードした後に、タイマ値が‘1’かつタイムアウトバッファ22がフルの場合は、何も処理を行わずに、次の同じタイマ番号のタイマ値をリードした場合に、タイムアウトバッファ22がフルの状態であるか否かを確認する。
After reading the timer value, if the timer value is '1' and the timeout buffer 22 is not full, the timer 21 determines that the timer has timed out, decrements the timer value, and writes the decremented timer value to the timer memory 24. At the same time, the timer number is written to the timeout buffer 22.
After reading the timer value, the timer 21 times out when the timer value is '1' and the timeout buffer 22 is full, and when the next timer value having the same timer number is read without performing any processing. Check if the buffer 22 is in the full state.

タイムアウトバッファ22は、タイマ番号がライトされた場合に、CPU10に対して割り込みをアクティブにする。
CPU10は、タイムアウトの割り込みがアクティブになると、タイムアウトバッファ22をリードすることで、タイマ番号を取得することができる。
なお、ここでは、タイマ初期値を、タイマメモリ24にライトしてから、タイマ21に対してタイマ動作のオン設定を行う場合について説明したが、タイマ動作のオン設定を先に行って、タイマ動作が始まってから、タイマ初期値をライトするようにしても良い。
The timeout buffer 22 activates an interrupt to the CPU 10 when the timer number is written.
When the timeout interrupt becomes active, the CPU 10 can acquire the timer number by reading the timeout buffer 22.
Here, the case where the timer initial value is written to the timer memory 24 and then the timer operation is set to be turned on for the timer 21 has been described. The initial value of the timer may be written after the start of.

タイマ21の他の使用方法として、タイムアウトさせることなく、時間経過を観測する方法について説明する。ここでは、CPU10が、時間計測する処理を処理yとする。
CPU10は、タイマ動作中に、タイマメモリ24のアドレスx(タイマ番号x)に初期値をライトして、処理yを行った後、タイマメモリ24のアドレスxをリードして、初期値と、リードしたタイマ値との差分をとることで、処理yの時間を、タイマ更新周期単位で計測することができる。
As another method of using the timer 21, a method of observing the passage of time without timing out will be described. Here, the process of time measurement by the CPU 10 is defined as process y.
During the timer operation, the CPU 10 writes an initial value to the address x (timer number x) of the timer memory 24, performs processing y, and then reads the address x of the timer memory 24 to read the initial value. By taking the difference from the timer value, the time of processing y can be measured in units of timer update cycles.

本発明の第1の実施形態によれば、タイマメモリ24へのアクセスが、CPU10とタイマ21により時分割で行われる場合であって、タイマメモリ24がオフの状態である場合に、CPU10は、タイマメモリ24に割り当てられた時間が経過するのを待つことなく、タイマメモリ24にアクセスすることができる。そのため、CPU10によるタイマメモリ24の使用時間を増やすことができる。 According to the first embodiment of the present invention, when the timer memory 24 is accessed by the CPU 10 and the timer 21 in a time-divided manner, and the timer memory 24 is in the off state, the CPU 10 determines the timer memory 24. The timer memory 24 can be accessed without waiting for the time allotted to the timer memory 24 to elapse. Therefore, the usage time of the timer memory 24 by the CPU 10 can be increased.

また、タイマオン制御部25aとバス選択部23によりマスク制御を行うことで、タイマ値をライトしていないアドレスは、タイマ21からは‘0’がリードされるため、タイマメモリ24の初期化を不要とすることができる。
また、タイマ数が多い大規模なハードウェアタイマ20を用いる場合であって、CPU10が、タイマメモリ24からタイマ値をライトしたりリードしたりして、タイマ値のライトアクセスやリードアクセスに時間かかる場合であっても、CPU10によるタイマメモリ24の使用時間を増やすことができるため、バス26の性能低下を避けることができる。
Further, by performing mask control by the timer on control unit 25a and the bus selection unit 23, '0' is read from the timer 21 at the address where the timer value is not written, so that the initialization of the timer memory 24 is unnecessary. Can be.
Further, when a large-scale hardware timer 20 having a large number of timers is used, the CPU 10 writes or reads the timer value from the timer memory 24, and it takes time to write or read the timer value. Even in this case, the usage time of the timer memory 24 by the CPU 10 can be increased, so that the performance deterioration of the bus 26 can be avoided.

次に、本発明の第2の実施形態について説明する。なお、第2の実施形態が、第1の実施形態と同様である部分については、それらの処理を説明する。
第1の実施形態では、ハードウェアタイマ20は、タイマオン制御部25aを備えていたが、第2の実施形態によるハードウェアタイマ20は、タイマオン制御部25bを備える点で異なっている。
Next, a second embodiment of the present invention will be described. In addition, about the part where the 2nd Embodiment is the same as the 1st Embodiment, those processings will be described.
In the first embodiment, the hardware timer 20 includes a timer-on control unit 25a, but the hardware timer 20 according to the second embodiment is different in that it includes a timer-on control unit 25b.

図8は、本発明の第2の実施形態によるタイマオン制御部25bの構成を示すブロック図である。タイマオン制御部25bは、CPUセットパルス生成部251、CPUクリアパルス生成部252、レジスタ部253a、信号選択部254を備えている。
タイマオン制御部25b(図8)では、第1の実施形態によるタイマオン制御部25a(図3)において、タイムアウトクリアパルス生成部255、クリアパルス合成部256が省略されている。第2の実施形態では、タイムアウトバッファ22からのタイムアウト番号と、タイムアウトバッファライト信号を使用しないようになっている。
FIG. 8 is a block diagram showing a configuration of a timer-on control unit 25b according to a second embodiment of the present invention. The timer-on control unit 25b includes a CPU set pulse generation unit 251, a CPU clear pulse generation unit 252, a register unit 253a, and a signal selection unit 254.
In the timer-on control unit 25b (FIG. 8), the timeout clear pulse generation unit 255 and the clear pulse synthesis unit 256 are omitted in the timer-on control unit 25a (FIG. 3) according to the first embodiment. In the second embodiment, the timeout number from the timeout buffer 22 and the timeout buffer write signal are not used.

第2の実施形態によるハードウェアタイマ20では、CPU10がタイマメモリ24にアクセスできる時間は減るものの、タイムアウトしたタイマ番号のタイマオフを判定する構成を設ける必要が無いので、第1の実施形態と比較して、選択タイマオン信号のアクティブ区間が多くなる。そのため、第2の実施形態によるハードウェアタイマ20は、タイムアウトバッファ22を有さない回路にも適用することができる。 In the hardware timer 20 according to the second embodiment, although the time during which the CPU 10 can access the timer memory 24 is reduced, it is not necessary to provide a configuration for determining the timer off of the timer number that has timed out, so that the hardware timer 20 is compared with the first embodiment. Therefore, the active section of the selection timer on signal increases. Therefore, the hardware timer 20 according to the second embodiment can be applied to a circuit that does not have a timeout buffer 22.

次に、本発明の第3の実施形態について説明する。なお、第3の実施形態が、第1の実施形態と同様である部分については、それらの処理を説明する。
第1の実施形態では、ハードウェアタイマ20は、タイマオン制御部25aを備えていたが、第3の実施形態によるハードウェアタイマ20は、タイマオン制御部25cを備える点で異なっている。
Next, a third embodiment of the present invention will be described. In addition, about the part where the 3rd Embodiment is the same as the 1st Embodiment, those processings will be described.
In the first embodiment, the hardware timer 20 includes a timer-on control unit 25a, but the hardware timer 20 according to the third embodiment is different in that it includes a timer-on control unit 25c.

図9は、本発明の第3の実施形態によるタイマオン制御部25cの構成を示すブロック図である。タイマオン制御部25cは、CPUセットパルス生成部251、レジスタ部253c、信号選択部254を備えている。
タイマオン制御部25c(図9)では、第2の実施形態によるタイマオン制御部25b(図8)において、CPUクリアパルス生成部252が省略されている。また、タイマオン制御部25c(図9)は、第2の実施形態によるレジスタ部253a(図8)の代わりに、レジスタ部253cを備えている。
FIG. 9 is a block diagram showing a configuration of a timer-on control unit 25c according to a third embodiment of the present invention. The timer-on control unit 25c includes a CPU set pulse generation unit 251, a register unit 253c, and a signal selection unit 254.
In the timer-on control unit 25c (FIG. 9), the CPU clear pulse generation unit 252 is omitted in the timer-on control unit 25b (FIG. 8) according to the second embodiment. Further, the timer-on control unit 25c (FIG. 9) includes a register unit 253c instead of the register unit 253a (FIG. 8) according to the second embodiment.

第3の実施形態によるタイマオン制御部25c(図9)は、CPU10からのライトアクセスによりタイマオン/オフ設定が可能な、タイマ個数分のレジスタ部253cを備える。レジスタ部253cは、タイマメモリ24以外のアドレスエリアに設けられ、CPUデータレジスタ設定が‘1’の場合は、タイマオンとされ、レジスタ設定が‘0’の場合は、タイマオフとされる。 The timer-on control unit 25c (FIG. 9) according to the third embodiment includes register units 253c for the number of timers, which can be set to turn on / off the timer by write access from the CPU 10. The register unit 253c is provided in an address area other than the timer memory 24, and when the CPU data register setting is "1", the timer is turned on, and when the register setting is "0", the timer is turned off.

第3の実施形態によるハードウェアタイマ20では、タイマ21とは別に、タイマ21と同じアドレス領域を設ける必要があるものの、タイマオフと設定したタイマ番号(アドレス)を、データスタック用に使用することができる。 In the hardware timer 20 according to the third embodiment, although it is necessary to provide the same address area as the timer 21 separately from the timer 21, the timer number (address) set as the timer off can be used for the data stack. it can.

第3の実施形態において、CPUセットパルスは、タイマメモリ24以外のアドレスエリアにマップされたタイマ個数分のレジスタ部253cのセットパルスを生成する。CPUライトが‘1’の場合であって、CPUアドレスが任意のアドレスx(x=0〜nの整数)の場合に、セットパルスxをアクティブにする。
レジスタ部253cを構成するレジスタ253c−0〜253c−nは、セットパルスxがアクティブの場合に、CPUデータの1ビットをレジスタ253c−xに記録する。レジスタ253c−xの設定値は、タイマオン信号として信号選択部254に出力される。
信号選択部254は、タイマ21からのタイマ番号xの値に対応するタイマオン信号を選択して、選択タイマオン信号として、バス選択部23に出力する。
In the third embodiment, the CPU set pulse generates set pulses of the register unit 253c corresponding to the number of timers mapped to the address area other than the timer memory 24. When the CPU write is '1' and the CPU address is an arbitrary address x (an integer of x = 0 to n), the set pulse x is activated.
The registers 253c-0 to 253cn constituting the register unit 253c record one bit of CPU data in the register 253c-x when the set pulse x is active. The set value of the register 253c-x is output to the signal selection unit 254 as a timer-on signal.
The signal selection unit 254 selects a timer-on signal corresponding to the value of the timer number x from the timer 21 and outputs it to the bus selection unit 23 as a selection timer-on signal.

次に、本発明の第4の実施形態について説明する。なお、第4の実施形態が、第1の実施形態と同様である部分については、それらの処理を説明する。
第1の実施形態では、ハードウェアタイマ20は、タイマオン制御部25aを備えていたが、第4の実施形態によるハードウェアタイマ20は、タイマオン制御部25dを備える点で異なっている。
Next, a fourth embodiment of the present invention will be described. In addition, about the part where the 4th Embodiment is the same as the 1st Embodiment, those processings will be described.
In the first embodiment, the hardware timer 20 includes a timer-on control unit 25a, but the hardware timer 20 according to the fourth embodiment is different in that it includes a timer-on control unit 25d.

図10は、本発明の第4の実施形態によるタイマオン制御部25dの構成を示すブロック図である。タイマオン制御部25dは、CPUセットパルス生成部251、上限レジスタ301、下限レジスタ302、比較器303を備える。
なお、上限レジスタ301は、タイマ番号の上限値を記憶する。また、下限レジスタ302は、タイマ番号の下限値を記憶する。
FIG. 10 is a block diagram showing a configuration of a timer-on control unit 25d according to a fourth embodiment of the present invention. The timer-on control unit 25d includes a CPU set pulse generation unit 251, an upper limit register 301, a lower limit register 302, and a comparator 303.
The upper limit register 301 stores the upper limit of the timer number. Further, the lower limit register 302 stores the lower limit value of the timer number.

第1〜第3の実施形態では、タイマ個数分のレジスタが設けられていたが、第4の実施形態によるタイマオン制御部25dは、各タイマのオン/オフを保持するのではなく、タイマ番号の上限と下限を設定できる上限レジスタ301及び下限レジスタ302を、タイマメモリ24以外のアドレスエリアに設ける。そして、タイマオン制御部25dは、タイマ21からのタイマ番号が、下限から上限の範囲内にある場合は、選択タイマオン信号をアクティブにする。
第4の実施形態によれば、第1〜第3の実施形態と比較して、タイマ数分のレジスタを設ける必要がないので、ハードウェアタイマ20の回路規模を小さくすることができるとともに、タイマオフのエリアをデータスタック用に使用することができる。
なお、第4の実施形態では、タイマオンの領域は、初期化が必要になるが、タイマ21の動作中のCPU10からタイマメモリ24へのアクセスの効率を改善することができる。
In the first to third embodiments, registers corresponding to the number of timers are provided, but the timer on control unit 25d according to the fourth embodiment does not hold on / off of each timer, but has a timer number. An upper limit register 301 and a lower limit register 302 in which an upper limit and a lower limit can be set are provided in an address area other than the timer memory 24. Then, the timer-on control unit 25d activates the selection timer-on signal when the timer number from the timer 21 is within the range from the lower limit to the upper limit.
According to the fourth embodiment, as compared with the first to third embodiments, it is not necessary to provide registers for the number of timers, so that the circuit scale of the hardware timer 20 can be reduced and the timer is turned off. Area can be used for the data stack.
In the fourth embodiment, the timer-on area needs to be initialized, but the efficiency of access from the CPU 10 during the operation of the timer 21 to the timer memory 24 can be improved.

なお、図10において、CPUセットパルス生成部251は、CPU10からのCPUアドレスとCPUライト信号に基づき、下限セットパルスのアドレスである場合に、下限セットパルスをアクティブにする。
CPUセットパルス生成部251は、CPU10からのCPUアドレスとCPUライト信号に基づき、上限セットパルスのアドレスである場合に、上限セットパルスをアクティブにする。
In FIG. 10, the CPU set pulse generation unit 251 activates the lower limit set pulse when it is the address of the lower limit set pulse based on the CPU address and the CPU write signal from the CPU 10.
The CPU set pulse generation unit 251 activates the upper limit set pulse when it is the address of the upper limit set pulse based on the CPU address from the CPU 10 and the CPU write signal.

上限レジスタ301は、上限セットパルスがアクティブの場合に、CPU10からのCPUデータを取り込み保持する。
下限レジスタ302は、下限セットパルスがアクティブの場合に、CPU10からのCPUデータを取り込み保持する。
比較器303は、下限レジスタ302が保持する値を下限値とし、上限レジスタ301が保持する値を上限値とする。比較器303は、タイマ21からのタイマ番号が、下限値から上限値の範囲内にある場合は、選択タイマオン信号をアクティブにする。タイマ21からのタイマ番号が、下限値から上限値の範囲外の場合は、選択タイマオン信号をノンアクティブにする。
なお、第1の実施形態と、第4の実施形態とを組み合わせることで、タイマオンの領域の初期化が不要となり、タイマオンの領域の1つ1つのタイマの状態もスヌープすることで、CPU10からタイマメモリ24へのアクセスの効率を最大にすることができる。
The upper limit register 301 captures and holds CPU data from the CPU 10 when the upper limit set pulse is active.
The lower limit register 302 captures and holds CPU data from the CPU 10 when the lower limit set pulse is active.
The comparator 303 uses the value held by the lower limit register 302 as the lower limit value and the value held by the upper limit register 301 as the upper limit value. The comparator 303 activates the selection timer on signal when the timer number from the timer 21 is within the range from the lower limit value to the upper limit value. When the timer number from the timer 21 is out of the range from the lower limit value to the upper limit value, the selection timer on signal is deactivated.
By combining the first embodiment and the fourth embodiment, it is not necessary to initialize the timer-on area, and by snooping the state of each timer in the timer-on area, the timer can be started from the CPU 10. The efficiency of access to the memory 24 can be maximized.

図11は、最小構成を有するハードウェアタイマ400の構成を示すブロック図である。ハードウェアタイマ400は、選択部401、制御部402を備える。 FIG. 11 is a block diagram showing the configuration of the hardware timer 400 having the minimum configuration. The hardware timer 400 includes a selection unit 401 and a control unit 402.

図12は、ハードウェアタイマ400の処理を示すフローチャートである。
始めに、選択部401は、CPU(中央演算処理装置)10によるタイマメモリ24へのアクセスが可能な第1の状態と、タイマ21によるタイマメモリ24へのアクセスが可能な第2の状態のいずれかを選択する(ステップS401)。
そして、制御部402は、CPU10がタイマメモリ24にアクセス可能な時間として割り当てられた第1の時間と、タイマ21がタイマメモリ24にアクセス可能な時間として割り当てられた第2の時間のうち、第2の時間内であっても、タイマ21がオフである場合には、選択部401に、第1の状態を選択させる(ステップS402)。
FIG. 12 is a flowchart showing the processing of the hardware timer 400.
First, the selection unit 401 has either a first state in which the CPU (Central Processing Unit) 10 can access the timer memory 24 or a second state in which the timer 21 can access the timer memory 24. Is selected (step S401).
Then, the control unit 402 is the second of the first time allocated as the time that the CPU 10 can access the timer memory 24 and the second time allocated as the time that the timer 21 can access the timer memory 24. If the timer 21 is off even within the time of 2, the selection unit 401 is made to select the first state (step S402).

なお、図1における各部の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより各部の処理を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。 A program for realizing the functions of each part in FIG. 1 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into a computer system and executed to process each part. You may. The term "computer system" as used herein includes hardware such as an OS and peripheral devices. Further, the "computer-readable recording medium" refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, or a CD-ROM, or a storage device such as a hard disk built in a computer system. Furthermore, a "computer-readable recording medium" is a volatile memory (RAM) inside a computer system that serves as a server or client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In addition, it shall include those that hold the program for a certain period of time.

本発明のいくつかの態様は、タイマメモリへのアクセスが、CPUとタイマにより時分割で行われる場合おいて、CPUによるタイマメモリの使用時間を増やすことが必要なハードウェアタイマ、制御方法及びプログラムなどに適用することができる。 In some aspects of the present invention, a hardware timer, a control method, and a program that require an increase in the usage time of the timer memory by the CPU when the timer memory is accessed by the CPU and the timer in a time-divided manner. It can be applied to.

10・・・CPU
20・・・ハードウェアタイマ
21・・・タイマ
22・・・タイムアウトバッファ
23・・・バス選択部
24・・・タイマメモリ
25a、25b、25c、25d・・・タイマオン制御部
26・・・バス
231・・・タイマ選択信号生成部
232・・・CPU制御部
233・・・セレクタ
234・・・マスク制御部
251・・・CPUセットパルス生成部
252・・・CPUクリアパルス生成部
253a・・・レジスタ部
253c・・・レジスタ部
253a−0〜253a−n・・・レジスタ
253c−0〜253c−n・・・レジスタ
254・・・信号選択部
255・・・タイムアウトクリアパルス生成部
256・・・クリアパルス合成部
301・・・上限レジスタ
302・・・下限レジスタ
303・・・比較器
400・・・ハードウェアタイマ
401・・・選択部
402・・・制御部
10 ... CPU
20 ... Hardware timer 21 ... Timer 22 ... Timeout buffer 23 ... Bus selection unit 24 ... Timer memory 25a, 25b, 25c, 25d ... Timer on control unit 26 ... Bus 231 ... Timer selection signal generation unit 232 ... CPU control unit 233 ... Selector 234 ... Mask control unit 251 ... CPU set pulse generation unit 252 ... CPU clear pulse generation unit 253a ... Register Unit 253c ... Register unit 253a-0 to 253an ... Register 253c-0 to 253cn ... Register 254 ... Signal selection unit 255 ... Timeout clear Pulse generation unit 256 ... Clear Pulse synthesis unit 301 ... Upper limit register 302 ... Lower limit register 303 ... Comparer 400 ... Hardware timer 401 ... Selection unit 402 ... Control unit

Claims (10)

中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択する選択部と、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記選択部に、前記第1の状態を選択させる制御部と、
を備えるハードウェアタイマ。
A selection unit that selects either a first state in which the central processing unit can access the timer memory and a second state in which the timer can access the timer memory.
Of the first time allocated as the time that the central processing unit can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. A control unit that causes the selection unit to select the first state when the timer is off even within the time period.
Hardware timer with.
前記制御部は、前記タイマが、オンである場合であって、前記選択部が、前記第2の状態を選択している場合には、前記タイマによる前記タイマメモリへのアクセスを許可し、前記中央演算処理装置による前記タイマメモリへのアクセスを許可しない
請求項1に記載のハードウェアタイマ。
When the timer is on and the selection unit selects the second state, the control unit permits the timer to access the timer memory. The hardware timer according to claim 1, which does not allow access to the timer memory by the central processing unit.
前記制御部は、前記タイマが、タイムアウトしているか否か、及び、前記タイマが、未使用であるか否かについて判定し、前記タイマが、タイムアウトしている場合、又は、前記タイマが、未使用である場合に、前記タイマが、オフであると判定する
請求項1又は2に記載のハードウェアタイマ。
The control unit determines whether or not the timer has timed out and whether or not the timer has been unused, and when the timer has timed out or the timer has not yet been used. The hardware timer according to claim 1 or 2, wherein the timer is determined to be off when it is in use.
前記制御部は、前記タイマが、タイムアウトしているか否か、及び、前記タイマが、未使用であるか否かについて判定し、前記タイマが、タイムアウトしていない場合、又は、前記タイマが、未使用ではない場合に、前記タイマが、オンであると判定する
請求項1又は2に記載のハードウェアタイマ。
The control unit determines whether or not the timer has timed out and whether or not the timer has not been used, and if the timer has not timed out or the timer has not yet been used. The hardware timer according to claim 1 or 2, wherein the timer is determined to be on when not in use.
前記選択部は、前記第1の状態と、前記第2の状態とを、時分割で、交互に選択する
請求項1から4のいずれかに記載のハードウェアタイマ。
The hardware timer according to any one of claims 1 to 4, wherein the selection unit alternately selects the first state and the second state in a time division manner.
前記タイマが、オフである場合であって、前記選択部が、前記第1の状態を選択している場合に、前記タイマのリード処理が発生した場合には、前記選択部は、前記タイマが、未使用であることを示す信号を、前記タイマに出力する
請求項1から5のいずれかに記載のハードウェアタイマ。
When the timer is off, and the selection unit selects the first state, and the read process of the timer occurs, the selection unit uses the timer. The hardware timer according to any one of claims 1 to 5, which outputs a signal indicating that the timer is unused.
前記タイマメモリに記憶される複数のタイマ番号のうち、タイムアウトとなったタイマ番号を記憶するタイムアウトバッファを更に備え、
前記制御部は、前記タイムアウトとなったタイマ番号に割り当てられている時間については、前記選択部に、前記第1の状態を選択させる
請求項1から6のいずれかに記載のハードウェアタイマ。
Of the plurality of timer numbers stored in the timer memory, a timeout buffer for storing the timer number that has timed out is further provided.
The hardware timer according to any one of claims 1 to 6, wherein the control unit causes the selection unit to select the first state for the time allocated to the timer number that has timed out.
複数のタイマ番号と、オン又はオフのいずれの状態であるかを、対応付けて記憶するレジスタであって、前記複数のタイマ番号の数以下のレジスタを更に備える
請求項1から7のいずれかに記載のハードウェアタイマ。
The present invention according to any one of claims 1 to 7, which is a register that stores a plurality of timer numbers in association with each other and whether the state is on or off, and further includes registers equal to or less than the number of the plurality of timer numbers. The described hardware timer.
中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択し、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記第1の状態を選択する
ハードウェアタイマの制御方法。
One of the first state in which the central processing unit can access the timer memory and the second state in which the timer can access the timer memory is selected.
Of the first time allocated as the time that the central arithmetic processing device can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. A method of controlling a hardware timer that selects the first state when the timer is off even within a time period.
中央演算処理装置によるタイマメモリへのアクセスが可能な第1の状態と、タイマによる前記タイマメモリへのアクセスが可能な第2の状態のいずれかを選択する選択手段、
前記中央演算処理装置が前記タイマメモリにアクセス可能な時間として割り当てられた第1の時間と、前記タイマが前記タイマメモリにアクセス可能な時間として割り当てられた第2の時間のうち、前記第2の時間内であっても、前記タイマがオフである場合には、前記選択手段に、前記第1の状態を選択させる制御手段、
として機能させるプログラム。
A selection means for selecting either a first state in which the central processing unit can access the timer memory and a second state in which the timer can access the timer memory.
Of the first time allocated as the time that the central processing unit can access the timer memory and the second time allocated as the time that the timer can access the timer memory, the second time. A control means that causes the selection means to select the first state even within the time when the timer is off.
A program that functions as.
JP2019063957A 2019-03-28 2019-03-28 Hardware timers, control methods and programs Active JP6769662B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019063957A JP6769662B2 (en) 2019-03-28 2019-03-28 Hardware timers, control methods and programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019063957A JP6769662B2 (en) 2019-03-28 2019-03-28 Hardware timers, control methods and programs

Publications (2)

Publication Number Publication Date
JP2020166355A JP2020166355A (en) 2020-10-08
JP6769662B2 true JP6769662B2 (en) 2020-10-14

Family

ID=72717361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019063957A Active JP6769662B2 (en) 2019-03-28 2019-03-28 Hardware timers, control methods and programs

Country Status (1)

Country Link
JP (1) JP6769662B2 (en)

Also Published As

Publication number Publication date
JP2020166355A (en) 2020-10-08

Similar Documents

Publication Publication Date Title
JP4749657B2 (en) DMA controller
JP5551512B2 (en) COMMUNICATION CONTROL DEVICE, DATA COMMUNICATION METHOD, AND PROGRAM
CN111177025B (en) Data storage method and device and terminal equipment
JP2009518753A (en) Arbitration of memory access requests
CN113138802B (en) Command distribution device, method, chip, computer device and storage medium
CN113312278B (en) Device and method for statically allocating shared multi-queue cache
CN116249973B (en) Adaptive memory transaction scheduling
JP6769662B2 (en) Hardware timers, control methods and programs
WO2019127230A1 (en) Network node wake-up method and device
US10031884B2 (en) Storage apparatus and method for processing plurality of pieces of client data
CN110968538B (en) Data buffering method and device
US6292853B1 (en) DMA controller adapted for transferring data in two-dimensional mapped address space
CN106776393B (en) uninterrupted serial port data receiving method and device
US20060047866A1 (en) Computer system having direct memory access controller
CN111078598B (en) Memory module data access control method, data access device and chip
JP2007156855A (en) Information processor and information processing method
JP5907558B2 (en) MULTI-INTERVAL TIMER AND ITS CONTROL DEVICE, CONTROL METHOD, AND CONTROL PROGRAM
KR100658918B1 (en) Apparatus and method for initialization of system global variables using block input/output command
JP4514411B2 (en) Inter-bus communication interface device
JP2586168B2 (en) Semiconductor storage device and method
KR100578655B1 (en) Wireless communication terminal notifying transmission time of packet and its method
JP4898527B2 (en) RESOURCE USE MANAGEMENT DEVICE, RESOURCE USE MANAGEMENT SYSTEM, AND RESOURCE USE MANAGEMENT DEVICE CONTROL METHOD
JP2006091966A (en) Memory controller
JP2006277363A (en) Information transfer system, and image forming device
KR20230013828A (en) A system on chip and a operating method of the semiconductor package

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190328

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200303

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200430

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200825

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200917

R150 Certificate of patent or registration of utility model

Ref document number: 6769662

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150