JP2013175014A - Address byte count determination device, address byte count determination method, program, and semiconductor device - Google Patents

Address byte count determination device, address byte count determination method, program, and semiconductor device Download PDF

Info

Publication number
JP2013175014A
JP2013175014A JP2012038512A JP2012038512A JP2013175014A JP 2013175014 A JP2013175014 A JP 2013175014A JP 2012038512 A JP2012038512 A JP 2012038512A JP 2012038512 A JP2012038512 A JP 2012038512A JP 2013175014 A JP2013175014 A JP 2013175014A
Authority
JP
Japan
Prior art keywords
address
data
data string
bytes
output
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.)
Pending
Application number
JP2012038512A
Other languages
Japanese (ja)
Inventor
Kei Tokunaga
系 徳永
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2012038512A priority Critical patent/JP2013175014A/en
Publication of JP2013175014A publication Critical patent/JP2013175014A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To determine an address byte count of a serial memory without writing determination data to the serial memory.SOLUTION: An address byte count determination device 10 comprises: an address generation unit 12 that assumes a maximum byte count and transmits in order a first address having the assumed maximum byte count and a second address which is obtained by inverting a specific bit of the first address, to a memory input/output unit 11; a first data string acquisition unit 13 that obtains a first data string from a first starting data value that is obtained first to a first ending data value that is detected as being different from the first starting data value; a second data string acquisition unit 14 that obtains a second data string from a second starting data value that is obtained first to a second ending data value that is detected as being different from the second starting data value; a comparison unit 15 that outputs a match/mismatch between the first data string and the second data string; and a control unit 16 that, when they do not match, outputs an address byte count on the basis of an address portion including the specific bit.

Description

本発明は、外部接続するSPI(Serial Peripheral Interface)規格のシリアルメモリのアドレスバイト数を判定するアドレスバイト数判定方法とその判定装置に関し、例えば、不揮発性シリアルメモリのアドレスバイト数判定方法とその判定装置に関する。   The present invention relates to an address byte number determination method for determining the number of address bytes in an externally connected SPI (Serial Peripheral Interface) standard serial memory and a determination apparatus thereof, for example, a method for determining the number of address bytes in a nonvolatile serial memory and the determination thereof. Relates to the device.

近年、コスト削減は、ASIC(Application Specific Integrated Circuit)搭載製品の重要課題となっている。例えば、ASICとROM(Read Only Memory)デバイスの端子数や実装面積に関わるコスト削減のために、端子数の少ない不揮発性シリアルメモリがブートROMとして搭載されるケースが増えている。シリアルメモリは、幅広い容量バリエーションと端子位置互換を特徴としており、ASICや実装基板が完成した後からでも製品別に最適容量のシリアルメモリ・デバイスを選択することが可能である。これは、ASICの流用による開発コストや、製品コストの削減に貢献する。例えば、製品開発の過程では、ソフトウェアの完成度が向上するまでの期間において、ブートROMとして、容量に余裕を持たせたEEPROM(Electrically Erasable Programmable Read Only Memory)やFLASH等の書き換え可能な不揮発性シリアルメモリが用いられる。そして、ソフトウェアが完成した後に、不揮発性シリアルメモリが備えるプロテクト機能によってソフトウェア破壊防止が図られる。さらに、必要最小限の小容量不揮発性シリアルメモリや安価なマスクROM型のシリアルメモリへの切り替えによるコスト削減が図られる。   In recent years, cost reduction has become an important issue for products equipped with ASIC (Application Specific Integrated Circuit). For example, in order to reduce costs related to the number of terminals and mounting area of ASIC and ROM (Read Only Memory) devices, a case where a nonvolatile serial memory with a small number of terminals is mounted as a boot ROM is increasing. The serial memory is characterized by a wide range of capacity variations and terminal position compatibility, and it is possible to select a serial memory device having the optimum capacity for each product even after the ASIC or mounting board is completed. This contributes to a reduction in development cost and product cost due to diversion of ASIC. For example, in the product development process, rewritable non-volatile serial such as EEPROM (Electrically Erasable Programmable Read Only Memory) or FLASH with sufficient capacity as boot ROM in the period until software perfection is improved Memory is used. After the software is completed, software destruction is prevented by a protect function provided in the nonvolatile serial memory. Furthermore, the cost can be reduced by switching to the minimum necessary small-capacity nonvolatile serial memory or an inexpensive mask ROM type serial memory.

しかしながら、不揮発性シリアルメモリのアドレスバイト数には1/2/3等の種類がある。このため、ASIC側から接続されたシリアルメモリに合わせた幅のアドレスを出力しなければ、シリアルメモリから正しい内容を読み出すことが出来ない。また、アドレスバイト数を外部端子入力で選択すると、端子コストの増加を招く。さらに、従来、アドレスバイト数3であったシリアルFLASHにおいても、近年、アドレスバイト数4のデバイスが出現してきている。このため、同一のASICを搭載する製品であっても、製品毎に最適なアドレスバイト数が異なるという状況の増加が予想される。
そこで、利用者が製品毎に最適な(安価な)不揮発性シリアルメモリを選択可能とすることが望まれる。具体的には、アドレスバイト数を選択するための端子コストが発生しないように、不揮発性シリアルメモリのアドレスバイト数を判定する手段が必要とされている。
However, the number of address bytes of the non-volatile serial memory includes a type such as 1/2/3. For this reason, the correct contents cannot be read from the serial memory unless an address having a width corresponding to the serial memory connected from the ASIC side is output. Further, if the number of address bytes is selected by external terminal input, the terminal cost increases. Furthermore, in the serial FLASH that conventionally has 3 address bytes, devices with 4 address bytes have recently appeared. For this reason, even if the products are equipped with the same ASIC, an increase in the situation where the optimum number of address bytes differs for each product is expected.
Therefore, it is desired that the user can select an optimal (inexpensive) nonvolatile serial memory for each product. Specifically, a means for determining the number of address bytes of the nonvolatile serial memory is required so that a terminal cost for selecting the number of address bytes does not occur.

シリアルメモリのアドレスバイト数を判定する手段として、例えば、特許文献1には、
SPIに準拠したシリアルメモリにアクセスして、該シリアルメモリのメモリサイズを自
動的に判別する方法が開示されている。
また、特許文献2には、EEPROMの記憶容量が事前に分からない場合にも、入手したEEPROMの記憶容量を自動的に判別でき、その判別結果を利用することにより、アクセスシーケンスを決定することのできるEEPROMの記憶容量判別装置およびEEPROMの記憶容量判別方法が開示されている。特許文献2では、起動時処理において、第1のタイミングを開始タイミングとしてシリアルインタフェースがシリアルに受信するデータが所定のデータに一致するか否かを判断し、データ不一致の場合には、第2のタイミングを開始タイミングとしてシリアルインタフェースがシリアルに受信するデータが所定のデータに一致するか否かを判断する手法を用いる。
さらに、特許文献3には、スレーブデバイスのアドレスビット長に依存せずにブートアップ処理を行うことができる情報処理装置が開示されている。特許文献3では、EEPROMにアドレスデータを入力して、EEPROMの出力レベルが所定の値となるときまでにEEPROMに入力したアドレスデータのビット数をカウントする手法を用いる。
As means for determining the number of address bytes of the serial memory, for example, Patent Document 1
A method of accessing a serial memory compliant with SPI and automatically determining the memory size of the serial memory is disclosed.
Further, in Patent Document 2, even when the storage capacity of the EEPROM is not known in advance, the storage capacity of the obtained EEPROM can be automatically determined, and the access sequence is determined by using the determination result. An EEPROM storage capacity determination apparatus and an EEPROM storage capacity determination method that can be performed are disclosed. In the patent document 2, in the start-up process, it is determined whether the data received serially by the serial interface with the first timing as the start timing matches the predetermined data. A method is used for determining whether data serially received by the serial interface matches predetermined data with timing as start timing.
Furthermore, Patent Document 3 discloses an information processing apparatus that can perform boot-up processing without depending on the address bit length of a slave device. In Patent Document 3, a method is used in which address data is input to the EEPROM and the number of bits of the address data input to the EEPROM is counted until the output level of the EEPROM reaches a predetermined value.

特許04374416号公報Japanese Patent No. 0374416 特開2002−073411号公報JP 2002-073411 A 特開2010−044638号公報JP 2010-044638 A

例えば、特許文献1は、シリアルメモリ、特にSPI準拠のシリアルメモリにおいて、アクセスモード、すなわちメモリが必要とするアドレスバイト数を自動的に判別することができる判別方法の提供を目的としている。
図22Aは、特許文献1のシリアルメモリのアクセスモード自動判別装置が、SPIに準拠したインタフェースをもつシリアルメモリへアクセスする接続配線図であり、図22Bは、そのアクセスモード判定処理フローチャートである。
For example, Patent Document 1 aims to provide a determination method capable of automatically determining the access mode, that is, the number of address bytes required by the memory, in a serial memory, in particular, an SPI-compliant serial memory.
FIG. 22A is a connection wiring diagram in which the serial memory access mode automatic determination device of Patent Document 1 accesses a serial memory having an interface compliant with SPI, and FIG. 22B is a flowchart of the access mode determination processing.

図22Aに示すように、本判別装置は、CPU2とプルアップ抵抗3で構成され、図22Aの点線で囲まれたメモリサイズが未知のシリアルメモリ1のDO、DI、SK、CSポートは、CPU2のそれぞれ対応するI/Oピンに接続される。そして、DOポートは、プルアップ抵抗3で電源回路に接続されて、常時電位がハイ・レベルになっている。この回路構成において、CPU2がメモリ1のメモリサイズを判定する手順は、図22Bのフローチャートに示されるように、初期データ書き込み処理(f1)、判定データ読み出し処理(f2)、及び判定処理(f3)の手順を順に行うことで実現される。
初期データ書き込み処理(f1)においては、CSポートをハイ・レベルからロウ・レベルに設定した後、CPU2からDIポートに、書き込みコマンドに続いて4バイトのゼロ(00h)が出力される。
As shown in FIG. 22A, this discrimination device is composed of a CPU 2 and a pull-up resistor 3, and the DO, DI, SK, and CS ports of the serial memory 1 whose memory size is unknown and surrounded by the dotted line in FIG. Are respectively connected to corresponding I / O pins. The DO port is connected to the power supply circuit by the pull-up resistor 3 so that the potential is always high. In this circuit configuration, the procedure in which the CPU 2 determines the memory size of the memory 1 is, as shown in the flowchart of FIG. 22B, an initial data write process (f1), a determination data read process (f2), and a determination process (f3). This is realized by performing the steps in order.
In the initial data write process (f1), after the CS port is set from high level to low level, 4-byte zero (00h) is output from the CPU 2 to the DI port following the write command.

図23Aは、判定データ読み出し処理(f2)におけるアクセスモードごとの読み出しデータの一覧表であり、図23Bは、判定処理の詳細フローチャートである。
判定データ読み出し処理(f2)において、読み出しコマンドに続いて1番目、2番目のゼロがメモリ1に入力されると、2番目のゼロと引き換えにメモリがアクセスモード1の場合には、メモリの0番地からデータゼロ(00h)がDOポートに読み出される。
一方、メモリがアクセスモード2の場合には、1番目と2番目のゼロは、アドレスの上位と下位を指定し、また、メモリがアクセスモード3の場合には、1番目と2番目のゼロは、アドレスの上位及び中位を指定することになる。
アクセスモード2、3の場合においては、必要なバイト数のアドレス(アクセスモード2では2バイト、アクセスモード3では3バイト)がメモリに入力されないうちは、図22Aに示すDOポートに接続されたプルアップ抵抗3よって、DOポートの電位がハイに吊り上げられ、16進表現でFFhの状態のデータが出力される。
このように、2番目のゼロと引き換えにDOポートから得られるデータを第1の判定データとする。
FIG. 23A is a list of read data for each access mode in the determination data read process (f2), and FIG. 23B is a detailed flowchart of the determination process.
In the determination data read process (f2), when the first and second zeros are input to the memory 1 following the read command, if the memory is in the access mode 1 in exchange for the second zero, the memory 0 Data zero (00h) is read from the address to the DO port.
On the other hand, when the memory is in access mode 2, the first and second zeros specify the upper and lower addresses, and when the memory is in access mode 3, the first and second zeros are The upper and middle addresses are designated.
In the case of the access modes 2 and 3, the pull connected to the DO port shown in FIG. 22A is performed until the address of the required number of bytes (2 bytes in the access mode 2 and 3 bytes in the access mode 3) is not input to the memory. The potential of the DO port is raised to high by the up resistor 3, and data in the state of FFh is output in hexadecimal.
Thus, data obtained from the DO port in exchange for the second zero is used as the first determination data.

同様にして、3番目のゼロ及び4番目のゼロと引き換えにDOポートより読み出されるデータを、それぞれ第2、第3判定データとする。
図23Bは、判定処理の詳細フローチャートである。該判定処理は、第1〜第3判定データをもとに実施され、同図に示されるように、第1の判定データがゼロ(00h)であれば、アクセスモード1のメモリと判定される。そして、第1の判定データがゼロ以外で第2の判定データがゼロ(00h)であれば、アクセスモード2、第2の判定データもゼロ以外で第3の判定データがゼロ(00h)であれば、アクセスモード3と判定される。第3の判定データもゼロでなければメモリの故障と判定される。
Similarly, data read from the DO port in exchange for the third zero and the fourth zero are set as second and third determination data, respectively.
FIG. 23B is a detailed flowchart of the determination process. The determination process is performed based on the first to third determination data. As shown in the figure, if the first determination data is zero (00h), the memory is determined as the access mode 1 memory. . If the first determination data is non-zero and the second determination data is zero (00h), the access mode 2, the second determination data is also non-zero, and the third determination data is zero (00h). In this case, the access mode 3 is determined. If the third determination data is not zero, it is determined that the memory is faulty.

しかしながら、特許文献1では、初期データ書き込み処理(ステップf1)によって不揮発性シリアルメモリの一部(0番地)に特定の値(0)を書き込む必要がある。このため、マスクROMタイプやプロテクト処置が施された書き換え不能な不揮発性シリアルメモリに対しては、アドレスバイト数の自動判定ができないという問題がある。加えて、上述した特許文献2、3の判別方法においても、シリアルメモリから受信する値が、所定の値となることを用いている判別方法であるため、同様の問題が生じる。
このように、シリアルメモリのアドレスバイト数を判定するには、判定用データをシリアルメモリに書き込む必要があった。
その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。
However, in Patent Document 1, it is necessary to write a specific value (0) to a part (address 0) of the nonvolatile serial memory by the initial data writing process (step f1). For this reason, there is a problem that the number of address bytes cannot be automatically determined for a mask ROM type or a non-rewritable nonvolatile serial memory that has been protected. In addition, in the discrimination methods of Patent Documents 2 and 3 described above, the same problem occurs because the discrimination method uses that the value received from the serial memory is a predetermined value.
As described above, in order to determine the number of address bytes of the serial memory, it is necessary to write determination data to the serial memory.
Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

一実施態様のアドレスバイト数判定装置、その方法及びプログラムは、例えば、次のような手順によりアドレスバイト数を判定する。まず、シリアルメモリのアドレスの最大バイト数を仮定する。前記最大バイト数を有する第1アドレスをシリアルメモリへ出力し、前記第1アドレスの出力に応じて、第1データ列として、最初に取得する第1先頭データ値から、前記第1先頭データ値と異なる第1末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出す。続いて、前記第1アドレスの特定ビットを反転した第2アドレスを前記シリアルメモリへ出力し、前記第2アドレスの出力に応じて、第2データ列として、最初に取得する第2先頭データ値から、前記第2先頭データ値と異なる第2末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出す。そして、前記第1データ列と前記第2データ列とを比較し、前記第1データ列と前記第2データ列とが不一致であることを検出すると、前記特定ビットを含むアドレス部位に基づいて前記シリアルメモリのアドレスバイト数を判定する。   The address byte number determination apparatus, method, and program according to one embodiment determine the address byte number by the following procedure, for example. First, assume the maximum number of bytes of the address of the serial memory. A first address having the maximum number of bytes is output to a serial memory, and in response to the output of the first address, as a first data string, from the first head data value acquired first, the first head data value and A data string until a different first tail data value is detected is read from the serial memory. Subsequently, a second address obtained by inverting the specific bit of the first address is output to the serial memory, and from the second head data value acquired first as a second data string according to the output of the second address A data string until a second tail data value different from the second head data value is detected is read from the serial memory. Then, when comparing the first data string and the second data string and detecting that the first data string and the second data string do not match, based on the address portion including the specific bit, Determine the number of serial memory address bytes.

前記一実施態様によれば、判定用データをシリアルメモリに書き込むことなく、シリアルメモリのアドレスバイト数の判定を可能にする手段を提供することが可能となる。   According to the embodiment, it is possible to provide means for enabling determination of the number of address bytes of the serial memory without writing determination data in the serial memory.

一実施形態のアドレスバイト数判定装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the address byte number determination apparatus of one Embodiment. シリアルメモリのアドレスの一例を示す図である。It is a figure which shows an example of the address of a serial memory. 一実施形態のアドレスバイト数判定装置の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the address byte number determination apparatus of one Embodiment. 一実施形態のアドレスバイト数判定装置を用いる半導体装置のシステム例(実施形態1)を示す構成図である。It is a block diagram which shows the system example (embodiment 1) of the semiconductor device using the address byte number determination apparatus of one Embodiment. 実施形態1のアドレスバイト数検出モジュールの一例を示す詳細構成図である。3 is a detailed configuration diagram illustrating an example of an address byte count detection module according to Embodiment 1. FIG. SPI信号切り替えモジュールの一例を示す詳細構成図である。It is a detailed block diagram which shows an example of an SPI signal switching module. 図4の半導体装置における、CPUの動作例を示すフローチャートである。6 is a flowchart illustrating an operation example of a CPU in the semiconductor device of FIG. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリのアドレスバイト数判定の動作例を示すフローチャート(前半)である。6 is a flowchart (first half) showing an operation example of determination of the number of address bytes of the serial memory in the address byte number detection module of the first embodiment. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリのアドレスバイト数判定の動作例を示すフローチャート(後半)である。6 is a flowchart (second half) illustrating an operation example of determination of the number of address bytes of the serial memory in the address byte number detection module according to the first embodiment. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリの第1データ列情報取得の詳細動作例を示すフローチャート(前半)である。6 is a flowchart (first half) showing a detailed operation example of obtaining the first data string information of the serial memory in the address byte count detection module of the first embodiment. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリの第1データ列情報取得の詳細動作例を示すフローチャート(後半)である。5 is a flowchart (second half) illustrating a detailed operation example of obtaining the first data string information of the serial memory in the address byte count detection module of the first embodiment. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリの第2データ列情報取得の詳細動作例を示すフローチャート(前半)である。6 is a flowchart (first half) showing a detailed operation example of acquiring second data string information of the serial memory in the address byte count detection module of the first embodiment. 実施形態1のアドレスバイト数検出モジュールにおける、シリアルメモリの第2データ列情報取得の詳細動作例を示すフローチャート(後半)である。6 is a flowchart (second half) illustrating a detailed operation example of acquiring second data string information of the serial memory in the address byte count detection module according to the first embodiment. 実施形態1の半導体装置に接続する、アドレスバイト数4のシリアルメモリのデータ内容例を示す図である。FIG. 3 is a diagram illustrating an example of data contents of a serial memory having four address bytes connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置に接続する、アドレスバイト数3のシリアルメモリのデータ内容例を示す図である。3 is a diagram illustrating an example of data contents of a serial memory having three address bytes connected to the semiconductor device of Embodiment 1. FIG. 実施形態1の半導体装置に接続する、アドレスバイト数2のシリアルメモリのデータ内容例を示す図である。3 is a diagram illustrating an example of data contents of a serial memory having two address bytes, which is connected to the semiconductor device of Embodiment 1. FIG. 実施形態1の半導体装置に接続する、アドレスバイト数1のシリアルメモリのデータ内容例を示す図である。FIG. 3 is a diagram illustrating an example of data contents of a serial memory having an address byte number of 1 connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数4のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T511)である。6 is a timing chart (T511) showing an operation example when a serial memory having four address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数4のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T512)である。6 is a timing chart (T512) showing an operation example when a serial memory having four address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数3のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T521)である。6 is a timing chart (T521) showing an operation example when a serial memory having three address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数3のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T522)である。6 is a timing chart (T522) showing an operation example when a serial memory having three address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数3のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T523)である。6 is a timing chart (T523) illustrating an operation example when a serial memory having three address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数2のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T531)である。6 is a timing chart (T531) illustrating an operation example when a serial memory having two address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数2のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T532)である。6 is a timing chart (T532) showing an operation example when a serial memory having two address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数2のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T533)である。6 is a timing chart (T533) showing an operation example when a serial memory having two address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数2のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T534)である。6 is a timing chart (T534) showing an operation example when a serial memory having two address bytes is connected to the semiconductor device of the first embodiment. 実施形態1の半導体装置へアドレスバイト数1のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T541)である。6 is a timing chart (T541) showing an operation example when a serial memory having an address byte number of 1 is connected to the semiconductor device of Embodiment 1. 実施形態1の半導体装置へアドレスバイト数1のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T542)である。6 is a timing chart (T542) showing an operation example when a serial memory having an address byte number of 1 is connected to the semiconductor device of Embodiment 1. 実施形態1の半導体装置へアドレスバイト数1のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T543)である。5 is a timing chart (T543) illustrating an operation example when a serial memory having an address byte number of 1 is connected to the semiconductor device of Embodiment 1. 実施形態1の半導体装置へアドレスバイト数1のシリアルメモリを接続した場合の動作例を示すタイミングチャート(T544)である。6 is a timing chart (T544) showing an operation example when a serial memory having one address byte is connected to the semiconductor device of the first embodiment. 一実施形態のアドレスバイト数判定装置を用いる半導体装置の他のシステム例(実施形態2)を示す構成図である。It is a block diagram which shows the other system example (Embodiment 2) of the semiconductor device using the address byte number determination apparatus of one Embodiment. 図19の半導体装置の動作例を示すフローチャートである。20 is a flowchart illustrating an operation example of the semiconductor device of FIG. プログラムを実行させる半導体装置のシステム例を示す構成図である。It is a block diagram which shows the system example of the semiconductor device which performs a program. 特許文献1のSPIに準拠したインタフェースを持つシリアルメモリへアクセスするための接続配線図である。FIG. 10 is a connection wiring diagram for accessing a serial memory having an interface conforming to the SPI of Patent Document 1. 特許文献1のアクセスモード判定処理フローチャートである。10 is an access mode determination processing flowchart of Patent Document 1; 特許文献1の判定データ読み出し処理におけるアクセスモードごとの読み出しデータの一覧表である。10 is a list of read data for each access mode in determination data read processing of Patent Document 1. 特許文献1の判定処理の詳細フローチャートである。10 is a detailed flowchart of the determination process of Patent Document 1.

以下、実施形態について、図面を参照しながら説明する。説明の明確化のため、以下の記載及び図面は、適宜、省略、及び簡略化がなされている。各図面において同一の構成または機能を有する構成要素および相当部分には、同一の符号を付し、その説明は省略する。   Hereinafter, embodiments will be described with reference to the drawings. For clarity of explanation, the following description and drawings are omitted and simplified as appropriate. In the drawings, components having the same configuration or function and corresponding parts are denoted by the same reference numerals and description thereof is omitted.

図1に一実施形態のアドレスバイト数判定装置の構成例を示す。アドレスバイト数判定装置10は、メモリ入出力部11、アドレス生成部12、第1データ列取得部13、第2データ列取得部14、比較部15、及び、制御部16を備える。図1には示していないが、アドレスバイト数判定装置10は、例えば半導体装置に搭載され、半導体装置に接続可能なシリアルメモリとデータを送受信する。
メモリ入出力部11は、シリアルメモリとのインタフェースを担う。具体的には、シリアルメモリへアドレスを出力し、アドレスに応じてシリアルメモリから連続するデータ列を受け取る。
FIG. 1 shows an example of the configuration of an address byte number determination apparatus according to an embodiment. The address byte count determination device 10 includes a memory input / output unit 11, an address generation unit 12, a first data string acquisition unit 13, a second data string acquisition unit 14, a comparison unit 15, and a control unit 16. Although not shown in FIG. 1, the address byte number determination device 10 is mounted on, for example, a semiconductor device, and transmits and receives data to and from a serial memory that can be connected to the semiconductor device.
The memory input / output unit 11 serves as an interface with the serial memory. Specifically, an address is output to the serial memory, and a continuous data string is received from the serial memory according to the address.

アドレス生成部12は、シリアルメモリのアドレスの最大バイト数を仮定し、まず、最大バイト数を有する第1アドレスをメモリ入出力部11へ送る。次に、メモリ入出力部11が第1アドレスに応じたデータを取得した後、第1アドレスの特定ビットを反転した第2アドレスをメモリ入出力部11へ送る。
ここで、特定ビットについての説明を容易にするため、第1及び第2アドレスが、1バイトの大きさのアドレス部位を最大バイト数有する構成であることを用いる。加えて、各アドレス部位を特定する場合、X番目(Xは1から最大バイト数までの整数)のアドレス部位、と表すことにする。例えば、最大バイト数が3バイトである場合、第1及び第2アドレスは、1番目から3番目までの3つのアドレス部位からなる。
図2を用いてアドレスバイト数とアドレス部位との関係を具体的に説明する。図2では、アドレスバイト数1〜4それぞれの場合を一例として示す。アドレスバイト数1〜4のアドレスが、1番目から各アドレスバイト数までのアドレス部位を有する構成であることを示している。
The address generation unit 12 assumes the maximum number of bytes of the address of the serial memory, and first sends the first address having the maximum number of bytes to the memory input / output unit 11. Next, after the memory input / output unit 11 acquires data corresponding to the first address, the second address obtained by inverting the specific bit of the first address is sent to the memory input / output unit 11.
Here, in order to facilitate the description of the specific bit, it is used that the first and second addresses have a configuration having a maximum number of bytes of an address part having a size of 1 byte. In addition, when specifying each address part, it is expressed as the Xth address part (X is an integer from 1 to the maximum number of bytes). For example, when the maximum number of bytes is 3, the first and second addresses consist of three address parts from the first to the third.
The relationship between the number of address bytes and the address part will be specifically described with reference to FIG. In FIG. 2, the case of each address byte number 1 to 4 is shown as an example. It shows that the address having 1 to 4 address bytes has a configuration having address parts from the first to each address byte number.

さらに、シリアルメモリのアドレスは、アドレスバイト数1〜4それぞれのすべての領域(ビット)を用いる場合もあるが、その一部分の領域を用いる場合もある。例えば、シリアルメモリのアドレスとして、最上位のアドレス部位(1番目のアドレス部位)の最下位ビットを除く、上位ビットを用いていないことがある。図2に、アドレスバイト数のアドレス領域のうち、一部分の領域を用いない場合の一例を示す。図2では、アドレスバイト数1〜4のアドレス領域が、1つ以上のアドレス部位から構成される様子を示す。加えて、アドレス領域のうち、アドレスを特定するビットとして使用する領域を斜線の矩形領域で示している。黒塗りの丸印は、各アドレスの最下位ビットである。
アドレスバイト数1〜4の各アドレスにおいて、最下位バイトのアドレス部位(アドレスバイト数のアドレス部位)の最下位ビット(図2で黒塗りの丸印の領域)はアドレスを特定するビットとして常に用いられる。このため、特定ビットに各アドレス部位の最下位ビット(図2において矢印で示すビット)を用いると、各アドレス部位の有効・無効を確実に検出することができる。例えば、図2において、最右の矢印のビットが有効であればアドレスバイト数4と判断できる。
Furthermore, the address of the serial memory may use all the areas (bits) of 1 to 4 address bytes, but may use a part of the area. For example, as the address of the serial memory, there are cases where the upper bits except for the least significant bit of the highest address part (first address part) are not used. FIG. 2 shows an example in which a part of the address area of the number of address bytes is not used. FIG. 2 shows a state in which an address area having 1 to 4 address bytes is composed of one or more address parts. In addition, of the address area, an area used as a bit for specifying an address is indicated by a hatched rectangular area. The black circle is the least significant bit of each address.
In each address of 1 to 4 address bytes, the least significant bit of the address part of the least significant byte (address part of the number of address bytes) is always used as a bit for specifying an address. It is done. For this reason, when the least significant bit (bit indicated by an arrow in FIG. 2) of each address part is used as the specific bit, the validity / invalidity of each address part can be reliably detected. For example, in FIG. 2, if the rightmost bit is valid, it can be determined that the number of address bytes is four.

従って、アドレス生成部12は、第1アドレスの各アドレス部位の最下位ビットを特定ビットとすることが好ましい。さらに、アドレス生成部12は、まず、特定ビットとして、最大バイト数のアドレス部位の最下位ビットを反転させ、順次上位のアドレス部位の最下位ビットを反転させることが好ましい。これにより、下位のアドレス部位(大きいアドレスバイト数の場合)から順番に有効・無効を判別することになるため、効率良くアドレスバイト数を判定することができる。なお、1番目のアドレス部位については、他のアドレス部位が無効であることが検出されると、アドレスバイト数1であると判定できる。従って、1番目のアドレス部位については、特定ビットを反転させて有効・無効を判別しなくても、アドレスバイト数を判定することができる。   Therefore, the address generator 12 preferably uses the least significant bit of each address part of the first address as a specific bit. Furthermore, it is preferable that the address generation unit 12 first inverts the least significant bit of the address part having the maximum number of bytes as the specific bit, and sequentially inverts the least significant bit of the upper address part. As a result, the validity / invalidity is determined in order from the lower address part (in the case of a large address byte number), so that the number of address bytes can be determined efficiently. For the first address part, when it is detected that the other address part is invalid, it can be determined that the number of address bytes is one. Therefore, for the first address part, the number of address bytes can be determined without reversing the specific bit to determine validity / invalidity.

第1データ列取得部13は、メモリ入出力部11がシリアルメモリへ第1アドレスを出力し、第1アドレスに応じたデータを読み出すと、第1データ列を取得する。第1データ列取得部13は、第1データ列として、メモリ入出力部11が読み出したデータ列のうち、最初に取得する第1先頭データ値から、第1先頭データ値と異なる第1末尾データ値が検出されるまでのデータ列を取得する。
第2データ列取得部14は、メモリ入出力部11がシリアルメモリへ第2アドレスを出力し、第2アドレスに応じたデータを読み出すと、第2データ列を取得する。第2データ列取得部14は、第2データ列として、メモリ入出力部11が読み出したデータ列のうち、最初に取得する第2先頭データ値から、第2先頭データ値と異なる第2末尾データ値が検出されるまでのデータ列を取得する。
比較部15は、第1データ列と第2データ列とが一致するか、不一致であるかを示す比較結果を出力する。
The first data string acquisition unit 13 acquires the first data string when the memory input / output unit 11 outputs the first address to the serial memory and reads data corresponding to the first address. The first data string acquisition unit 13 uses, as the first data string, first tail data that is different from the first head data value from the first head data value acquired first among the data strings read by the memory input / output unit 11. Get the data string until the value is detected.
The second data string acquisition unit 14 acquires the second data string when the memory input / output unit 11 outputs the second address to the serial memory and reads data corresponding to the second address. The second data string acquisition unit 14 uses, as the second data string, second tail data different from the second head data value from the first head data value acquired first in the data string read by the memory input / output unit 11. Get the data string until the value is detected.
The comparison unit 15 outputs a comparison result indicating whether the first data string and the second data string match or do not match.

制御部16は、外部からクロック信号やリセット信号を受け、アドレスバイト数の判定処理の開始・完了を制御する。さらに、制御部16は、比較部15から比較結果を受け、比較結果が不一致であることを検出すると、特定ビットを含むアドレス部位に基づいてシリアルメモリのアドレスバイト数を判定し、判定したアドレスバイト数を出力する。一方、比較結果が一致を示す場合、制御部16は、特定ビットを異なる位置に変更した第2アドレスをメモリ入出力部11へ送るように、アドレス生成部12を制御する。制御部16は、アドレスバイト数を判定するまで、第2データ列取得部14が特定ビットを変更した第2アドレスに応じた第2データ列の取得を繰り返すように制御する。
制御部16は、アドレスバイト数を次のようにして判定する。
比較結果が不一致であり、かつ、特定ビットを含むアドレス部位より下位のアドレス部位が無効である場合には、制御部16は、アドレスバイト数を1番目から特定ビットを含むアドレス部位までのバイト数であると判定する。これは、特定ビットを含むアドレス部位及びそれより上位のアドレス部位が有効である場合である。
さらに、比較結果が一致であり、かつ、2番目から最大バイト数までのアドレス部位が無効(1番目のアドレス部位を除いて無効)である場合には、制御部16は、アドレスバイト数が、1バイトであると判定する。
The control unit 16 receives a clock signal and a reset signal from the outside, and controls the start and completion of the address byte count determination process. Further, when the control unit 16 receives the comparison result from the comparison unit 15 and detects that the comparison result does not match, the control unit 16 determines the number of address bytes of the serial memory based on the address portion including the specific bit, and determines the determined address byte Print a number. On the other hand, when the comparison result indicates coincidence, the control unit 16 controls the address generation unit 12 to send the second address with the specific bit changed to a different position to the memory input / output unit 11. The control unit 16 controls the second data string acquisition unit 14 to repeat acquisition of the second data string corresponding to the second address whose specific bit is changed until the address byte number is determined.
The control unit 16 determines the number of address bytes as follows.
When the comparison result is inconsistent and the address part lower than the address part including the specific bit is invalid, the control unit 16 determines the number of address bytes from the first to the address part including the specific bit. It is determined that This is a case where an address part including a specific bit and a higher-order address part are valid.
Further, when the comparison result is coincident and the address part from the second to the maximum number of bytes is invalid (invalid except for the first address part), the control unit 16 determines that the number of address bytes is It is determined that it is 1 byte.

例えば、アドレス生成部12が、特定ビットを、最大バイト数から順番に上位のアドレス部位に設定している場合には、制御部16は、比較結果が不一致であることを検出すると、アドレスバイト数が、1番目から特定ビットを含むアドレス部位までのバイト数であると判定する。さらに、比較結果が一致である場合であっても、2番目から最大バイト数までのアドレス部位が無効である場合には、制御部16は、アドレスバイト数が、1バイトであると判定する。   For example, when the address generation unit 12 sets specific bits in the higher-order address part in order from the maximum number of bytes, the control unit 16 detects the number of address bytes when detecting that the comparison result does not match Is determined to be the number of bytes from the first to the address part including the specific bit. Further, even if the comparison result is coincident, if the address portion from the second to the maximum number of bytes is invalid, the control unit 16 determines that the number of address bytes is 1 byte.

次に、図3を参照して動作を説明する。図3に一実施形態のアドレスバイト数判定装置の動作例を示す。
ここで、アドレスバイト数判定装置10のいずれかの構成要素、例えば、制御部16やアドレス生成部12が、仮定したシリアルメモリのアドレスの最大バイト数を保持していることを前提とする。この処理は、アドレスバイト数判定装置10に予め設定されていてもよいし、処理開始時に外部から入力する場合であってもよい。少なくともアドレス生成部12が最大バイト数の第1アドレスを生成できる状態になっていればよい。例えば、アドレス生成部12が、第1アドレスとして、予め設定された値を保持していてもよい。
アドレスバイト数判定処理の開始の指示(例えば、リセット信号の解除)を制御部16が受けると(S11)、アドレス生成部12は、最大バイト数を有する第1アドレスを生成し、メモリ入出力部11へ送る。メモリ入出力部11は、第1アドレスをシリアルメモリへ出力する(S12)。
メモリ入出力部11は、第1アドレスの出力に応じて、シリアルメモリからデータ列を読み出し、第1データ列取得部13は、第1データ列を取得する(S13)。
Next, the operation will be described with reference to FIG. FIG. 3 shows an operation example of the address byte number determination apparatus according to the embodiment.
Here, it is assumed that any component of the address byte count determination device 10, for example, the control unit 16 or the address generation unit 12 holds the assumed maximum number of bytes of the address of the serial memory. This process may be set in advance in the address byte count determination apparatus 10 or may be input from the outside at the start of the process. It is sufficient that at least the address generation unit 12 can generate the first address having the maximum number of bytes. For example, the address generation unit 12 may hold a preset value as the first address.
When the control unit 16 receives an instruction to start the address byte number determination process (for example, release of the reset signal) (S11), the address generation unit 12 generates a first address having the maximum number of bytes, and the memory input / output unit Send to 11. The memory input / output unit 11 outputs the first address to the serial memory (S12).
The memory input / output unit 11 reads the data string from the serial memory in response to the output of the first address, and the first data string acquisition unit 13 acquires the first data string (S13).

制御部16は、第1データ列が取得されたことを検出すると、アドレス生成部12へ第2アドレスの生成を指示する。アドレス生成部12は、制御部16からの指示に従って、第1アドレスの特定ビットを反転した第2アドレスを生成し、メモリ入出力部11へ送る。メモリ入出力部11は、第2アドレスをシリアルメモリへ出力する(S14)。
メモリ入出力部11は、第2アドレスの出力に応じて、シリアルメモリからデータ列を読み出し、第2データ列取得部14は、第2データ列を取得する(S15)。
第1及び第2データ列が保持されると、比較部15は、第1データ列と第2データ列とを比較し、比較結果を制御部16へ出力する(S16)。
制御部16は、比較結果から、第1データ列と第2データ列とが不一致であり、特定ビットを含むアドレス部位が有効であることを検出すると(S17、YES)、特定ビットを含むアドレス部位に基づいてシリアルメモリのアドレスバイト数を判定し、判定結果を出力して処理を終了する(S18)。一方、比較結果が一致する場合(S17、NO)、制御部16は、2番目から最大バイト数までのアドレス部位の有効・無効を確認する(S19)。2番目から最大バイト数までのアドレス部位がすべて無効である場合には(S19、YES)、アドレスバイト数は1バイトとなることから、制御部16は、アドレスバイト数を判定し、判定結果を出力して処理を終了する(S18)。
When detecting that the first data string has been acquired, the control unit 16 instructs the address generation unit 12 to generate a second address. The address generation unit 12 generates a second address obtained by inverting the specific bit of the first address in accordance with an instruction from the control unit 16 and sends the second address to the memory input / output unit 11. The memory input / output unit 11 outputs the second address to the serial memory (S14).
The memory input / output unit 11 reads the data string from the serial memory in response to the output of the second address, and the second data string acquisition unit 14 acquires the second data string (S15).
When the first and second data strings are held, the comparison unit 15 compares the first data string and the second data string, and outputs the comparison result to the control unit 16 (S16).
When the control unit 16 detects from the comparison result that the first data string and the second data string are inconsistent and the address part including the specific bit is valid (S17, YES), the control part 16 includes an address part including the specific bit. The number of address bytes of the serial memory is determined based on the above, the determination result is output, and the process is terminated (S18). On the other hand, if the comparison results match (S17, NO), the control unit 16 checks the validity / invalidity of the address part from the second to the maximum number of bytes (S19). When all the address parts from the second to the maximum number of bytes are invalid (S19, YES), the number of address bytes is 1 byte. Therefore, the control unit 16 determines the number of address bytes, and determines the determination result. The process is output and the process is terminated (S18).

一方、2番目から最大バイト数までのアドレス部位に有効・無効を判別していないアドレス部位がある場合)には(S19、NO)、制御部16は、アドレス生成部12へ特定ビットを異なる位置に変更した第2アドレスをメモリ入出力部11へ送るように制御する。アドレス生成部12は、制御部16から新たな第2アドレスの生成を指示されると、特定ビットの位置を変更した第2アドレスを生成し、アドレスバイト数判定装置10は、上述したステップS14以降の処理を繰り返す。このとき、アドレス生成部12は、制御部16から特定ビットの位置を指示される。制御部16は、アドレスバイト数が判定可能となるまで、特定ビットを異なる部位に変更した第2アドレスをメモリ入出力部11へ送ることを繰り返すように、アドレス生成部12を制御する。   On the other hand, when there is an address part for which validity / invalidity is not determined in the address part from the second to the maximum number of bytes) (S19, NO), the control unit 16 sends the specific bit to the address generation unit 12 at a different position. The second address changed to is controlled to be sent to the memory input / output unit 11. When the address generation unit 12 is instructed to generate a new second address from the control unit 16, the address generation unit 12 generates a second address in which the position of the specific bit is changed, and the address byte number determination device 10 performs the above-described step S14 and subsequent steps. Repeat the process. At this time, the address generation unit 12 is instructed by the control unit 16 for the position of the specific bit. The control unit 16 controls the address generation unit 12 to repeat sending the second address in which the specific bit is changed to a different part to the memory input / output unit 11 until the number of address bytes can be determined.

例えば、制御部16は、第2アドレスの最初の特定ビットを最大バイト数のアドレス部位の最下位ビットとし、その後に生成する第2アドレスの特定ビットを、一つ前に生成した第2アドレスの特定ビットを含むアドレス部位より一つ上位のアドレス部位の最下位ビットとするように、アドレス生成部12を制御する。
シリアルメモリへの第2アドレスの新たな出力に応じて、メモリ入出力部11がデータ列を読み出すと、第2データ列取得部14は、新たな第2データ列を取得するように構成される(S16)。比較部15は、第2データ列取得部14が第2データ列を新たに取得すると、比較結果を更新するように構成される(S17)。
For example, the control unit 16 sets the first specific bit of the second address as the least significant bit of the address part of the maximum number of bytes, and then generates the specific bit of the second address generated after that of the second address generated immediately before. The address generator 12 is controlled so as to be the least significant bit of the address part one level higher than the address part including the specific bit.
When the memory input / output unit 11 reads a data string in response to a new output of the second address to the serial memory, the second data string acquisition unit 14 is configured to acquire a new second data string. (S16). The comparison unit 15 is configured to update the comparison result when the second data string acquisition unit 14 newly acquires the second data string (S17).

一実施形態では、シリアルメモリは、複数の値(異なる値)が格納されていることを前提とする。これは、データの取得を開始する先頭データに対して、異なる値である末尾データを検出するためである。
以上、図1から図3を用いて、アドレスバイト数判定装置10を説明した。以下に、アドレスバイト数判定装置10のより具体的な実施形態、及び、一実施形態のアドレスバイト数判定装置10を半導体装置に搭載する場合の構成例について説明する。
In one embodiment, the serial memory assumes that multiple values (different values) are stored. This is to detect tail data that is different from the head data from which data acquisition is started.
The address byte number determination apparatus 10 has been described above with reference to FIGS. 1 to 3. In the following, a more specific embodiment of the address byte number determination device 10 and a configuration example when the address byte number determination device 10 of one embodiment is mounted on a semiconductor device will be described.

実施形態1.
* 実施形態1の構成
図4は、実施形態1における、アドレスバイト数判定装置を用いる半導体装置のシステム構成例を示す図である。実施形態1のシステム構成例は、シリアルメモリ101と、一実施形態のアドレスバイト数判定装置を搭載する半導体装置102とで構成される。半導体装置102は、シリアルメモリ101と外部接続する。
半導体装置102は、クロック生成モジュール(CLKGEN)103、CPU104、ROM105、RAM(Random Access Memory)106、汎用入出力ポート(GPIO)107、アドレスバイト数検出モジュール(ADDRESS BYTE DETECTOR)108、クロックド・シリアル・インタフェース・モジュール(CLOCKED SERIAL INTERFACE)109、及び、SPI信号切り替えモジュール(SEL)110で構成される。アドレスバイト数検出モジュール108は、アドレスバイト数判定装置の一態様である。実施形態1では、半導体装置102に搭載する一例を示す。
Embodiment 1. FIG.
* Configuration of Embodiment 1 FIG. 4 is a diagram illustrating a system configuration example of a semiconductor device using an address byte number determination device according to Embodiment 1. The system configuration example of the first embodiment includes a serial memory 101 and a semiconductor device 102 on which the address byte number determination device of one embodiment is mounted. The semiconductor device 102 is externally connected to the serial memory 101.
The semiconductor device 102 includes a clock generation module (CLKGEN) 103, a CPU 104, a ROM 105, a RAM (Random Access Memory) 106, a general-purpose input / output port (GPIO) 107, an address byte number detection module (ADDRESS BYTE DETECTOR) 108, and a clocked serial. An interface module (CLOCKED SERIAL INTERFACE) 109 and an SPI signal switching module (SEL) 110 are included. The address byte number detection module 108 is an aspect of the address byte number determination device. In the first embodiment, an example of mounting on the semiconductor device 102 is shown.

クロック生成モジュール103は、クロック信号N116と、リセット信号N117とをシステムバスN115に出力する。
CPU104は、システムバスN115に接続されたバスマスタであり、システムバスN115を経由して、ROM105やRAM106や汎用入出力ポート107やクロックド・シリアル・インタフェース・モジュール109へのアクセスを行う。
ROM105は、システムバスN115に接続されたバススレーブであり、システムバスN115からのリードアクセス要求に対して、ROMに格納されたデータをシステムバスN115のリードデータとして出力する。
RAM106は、システムバスN115に接続されたバススレーブである。RAM106は、システムバスN115からのライトアクセス要求に対して、システムバスN115から入力されたライトデータをRAMに格納し、システムバスN115からのリードアクセス要求に対して、RAMに格納されたデータをシステムバスN115のリードデータとして出力する。
The clock generation module 103 outputs a clock signal N116 and a reset signal N117 to the system bus N115.
The CPU 104 is a bus master connected to the system bus N115, and accesses the ROM 105, RAM 106, general-purpose input / output port 107, and clocked serial interface module 109 via the system bus N115.
The ROM 105 is a bus slave connected to the system bus N115, and outputs data stored in the ROM as read data of the system bus N115 in response to a read access request from the system bus N115.
The RAM 106 is a bus slave connected to the system bus N115. The RAM 106 stores write data input from the system bus N115 in the RAM in response to a write access request from the system bus N115, and stores data stored in the RAM in response to a read access request from the system bus N115. Output as read data of the bus N115.

汎用入出力ポート107は、システムバスN115に接続されたバススレーブであり、アドレスバイト数検出完了信号N113と、アドレスバイト数検出結果信号N114とを受け、システムバスN115からのリードアクセス要求に対して、アドレスバイト数検出完了信号N113とアドレスバイト数検出結果信号N114の状態を、システムバスN115のリードデータとして出力する。
アドレスバイト数検出モジュール108は、クロック信号N116、リセット信号N117、及び、アドレスバイト数検出用データ出力信号N108を受け、アドレスバイト数検出完了信号N113、アドレスバイト数検出結果信号N114、アドレスバイト数検出用デバイス選択信号N105、アドレスバイト数検出用クロック信号N106、及び、アドレスバイト数検出用データ入力信号N107を出力する。
The general-purpose input / output port 107 is a bus slave connected to the system bus N115, receives the address byte count detection completion signal N113 and the address byte count detection result signal N114, and responds to a read access request from the system bus N115. The state of the address byte number detection completion signal N113 and the address byte number detection result signal N114 is output as read data of the system bus N115.
The address byte number detection module 108 receives a clock signal N116, a reset signal N117, and an address byte number detection data output signal N108, and receives an address byte number detection completion signal N113, an address byte number detection result signal N114, and an address byte number detection. Device selection signal N105, address byte count detection clock signal N106, and address byte count detection data input signal N107.

クロックド・シリアル・インタフェース・モジュール109は、システムバスN115に接続されたバススレーブであり、SPI入出力用データ出力信号N112を受け、SPI入出力用デバイス選択信号N109と、SPI入出力用クロック信号N110と、SPI入出力用データ入力信号N111とを出力する。
SPI信号切り替えモジュール110は、アドレスバイト数検出用デバイス選択信号N105、アドレスバイト数検出用クロック信号N106、アドレスバイト数検出用データ入力信号N107、SPI入出力用デバイス選択信号N109、SPI入出力用クロック信号N110、SPI入出力用データ入力信号N111、シリアルメモリ用データ出力信号N104、及び、アドレスバイト数検出完了信号N113を受け、アドレスバイト数検出用データ出力信号N108、SPI入出力用データ出力信号N112、シリアルメモリ用デバイス選択信号N101、シリアルメモリ用クロック信号N102、及び、シリアルメモリ用データ入力信号N103を出力する。
シリアルメモリ101は、シリアルメモリ用デバイス選択信号N101と、シリアルメモリ用クロック信号N102と、シリアルメモリ用データ入力信号N103とが受けとり、シリアルメモリ用データ出力信号N104を出力する。
The clocked serial interface module 109 is a bus slave connected to the system bus N115, receives an SPI input / output data output signal N112, receives an SPI input / output device selection signal N109, and an SPI input / output clock signal. N110 and an SPI input / output data input signal N111 are output.
The SPI signal switching module 110 includes an address byte number detection device selection signal N105, an address byte number detection clock signal N106, an address byte number detection data input signal N107, an SPI input / output device selection signal N109, and an SPI input / output clock. In response to the signal N110, the SPI input / output data input signal N111, the serial memory data output signal N104, and the address byte number detection completion signal N113, the address byte number detection data output signal N108 and the SPI input / output data output signal N112 are received. The serial memory device selection signal N101, the serial memory clock signal N102, and the serial memory data input signal N103 are output.
The serial memory 101 receives a serial memory device selection signal N101, a serial memory clock signal N102, and a serial memory data input signal N103, and outputs a serial memory data output signal N104.

一般に、半導体装置は、クロックド・シリアル・インタフェース・モジュール109がシリアルメモリ101と接続し、データの入出力を制御する構成をとる。しかし、本実施形態では、汎用入出力ポート107、アドレスバイト数検出モジュール108、クロックド・シリアル・インタフェース・モジュール109、及び、SPI信号切り替えモジュール110が、シリアルメモリ101とインタフェースを担う。言い換えると、本実施形態の半導体装置102は、一本実施形態のアドレスバイト数判定装置であるアドレスバイト数検出モジュール108を搭載するため、汎用入出力ポート107と、SPI信号切り替えモジュール110とをさらに備える。これらの構成要素は、上述した入出力により、少なくとも次のような機能を実現するともいえる。   Generally, a semiconductor device has a configuration in which a clocked serial interface module 109 is connected to a serial memory 101 to control data input / output. However, in this embodiment, the general-purpose input / output port 107, the address byte count detection module 108, the clocked serial interface module 109, and the SPI signal switching module 110 serve as an interface with the serial memory 101. In other words, since the semiconductor device 102 of this embodiment is equipped with the address byte count detection module 108 that is the address byte count determination device of this embodiment, the general-purpose input / output port 107 and the SPI signal switching module 110 are further provided. Prepare. It can be said that these components realize at least the following functions by the input / output described above.

クロックド・シリアル・インタフェース・モジュール109は、通常動作において、シリアルメモリ101とのデータの入出力を制御するシリアルインタフェース部として働く。
アドレスバイト数検出モジュール108は、アドレスバイト数が決定される前に起動され、半導体装置102と接続するシリアルメモリ101のアドレスバイト数を判定する。
汎用入出力ポート107は、SPI信号切り替えモジュール110の切り替えを制御する制御信号の内容をアクセス要求に応じてシステムバスN115に出力する。制御信号は、アドレスバイト数検出モジュール108がアドレスバイト数を検出するか否かを示す信号(図4のアドレスバイト数検出完了信号N113)を用いる。
SPI信号切り替えモジュール110は、制御信号に応じて、クロックド・シリアル・インタフェース・モジュール109とアドレスバイト数検出モジュール108とを切り替えて、シリアルメモリと接続するスイッチ部として働く。具体的には、SPI信号切り替えモジュール110は、シリアルメモリ101のアドレスバイト数が検出される前は、アドレスバイト数検出モジュール108とシリアルメモリ101とを接続させ、アドレスバイト信号が検出された後は、クロックド・シリアル・インタフェース・モジュール109とシリアルメモリ101とを接続させるように制御される。
The clocked serial interface module 109 functions as a serial interface unit that controls data input / output with the serial memory 101 in normal operation.
The address byte count detection module 108 is activated before the address byte count is determined, and determines the address byte count of the serial memory 101 connected to the semiconductor device 102.
The general purpose input / output port 107 outputs the content of the control signal for controlling the switching of the SPI signal switching module 110 to the system bus N115 in response to the access request. As the control signal, a signal indicating whether or not the address byte number detection module 108 detects the address byte number (address byte number detection completion signal N113 in FIG. 4) is used.
The SPI signal switching module 110 switches between the clocked serial interface module 109 and the address byte number detection module 108 in accordance with a control signal, and functions as a switch unit connected to the serial memory. Specifically, the SPI signal switching module 110 connects the address byte number detection module 108 and the serial memory 101 before the address byte number of the serial memory 101 is detected, and after the address byte signal is detected. The clocked serial interface module 109 and the serial memory 101 are controlled to be connected.

図5は、アドレスバイト数検出モジュール108の詳細構成図である。
アドレスバイト数検出モジュール108は、シリアル転送クロック生成モジュール(SKGEN)201、シーケンス制御モジュール(SEQ)202、バイト選択モジュール203、ビット反転制御モジュール204、パラレル/シリアル変換モジュール205、ANDゲート206、シリアル/パラレル変換モジュール207、1バイト・レジスタ(REG)208〜211、カウンタ(CONTER)212、213、比較器(EQ)214〜218、及び、ANDゲート219で構成される。
FIG. 5 is a detailed configuration diagram of the address byte count detection module 108.
The address byte count detection module 108 includes a serial transfer clock generation module (SKGEN) 201, a sequence control module (SEQ) 202, a byte selection module 203, a bit inversion control module 204, a parallel / serial conversion module 205, an AND gate 206, a serial / serial It comprises a parallel conversion module 207, 1-byte registers (REG) 208 to 211, counters (CONTER) 212 and 213, comparators (EQ) 214 to 218, and an AND gate 219.

シリアル転送クロック生成モジュール201は、バスのクロック信号N116を入力し、シリアル転送クロック信号N201を出力する。これにより、シリアル転送クロック生成モジュール201は、バスのクロック信号に基づいて、アドレスバイト数検出モジュール108内の内部クロックを生成する。
シーケンス制御モジュール202は、バスのクロック信号N116と、バスのリセット信号N117、シリアル転送クロック信号N201、比較結果出力信号N225、比較結果出力信号N226、及び、比較結果出力信号N230を受け、出力バイトデータ選択信号N204、ビット反転制御信号N206、データ更新制御信号N208、クロック出力許可信号N209、アドレスバイト数検出用デバイス選択信号N105、受信データキャプチャ制御信号N211、受信データキャプチャ制御信号N212、受信データキャプチャ制御信号N213、受信データキャプチャ制御信号N214、カウンタ初期化信号N219、カウントクロックN220、カウンタ初期化信号N221、及び、カウントクロックN222を出力する。これにより、シーケンス制御モジュール202は、アドレスバイト数の検出処理の開始・完了、及び、アドレスバイト数検出モジュール108の各構成要素を制御する。
The serial transfer clock generation module 201 receives the bus clock signal N116 and outputs the serial transfer clock signal N201. Thus, the serial transfer clock generation module 201 generates an internal clock in the address byte count detection module 108 based on the bus clock signal.
The sequence control module 202 receives a bus clock signal N116, a bus reset signal N117, a serial transfer clock signal N201, a comparison result output signal N225, a comparison result output signal N226, and a comparison result output signal N230, and outputs byte data. Selection signal N204, bit inversion control signal N206, data update control signal N208, clock output enable signal N209, address byte number detection device selection signal N105, reception data capture control signal N211, reception data capture control signal N212, reception data capture control A signal N213, a reception data capture control signal N214, a counter initialization signal N219, a count clock N220, a counter initialization signal N221, and a count clock N222 are output. As a result, the sequence control module 202 controls the start / end of the address byte count detection process and each component of the address byte count detection module 108.

ビット反転制御モジュール204は、アドレスバイト数検出用アドレス信号N202と、ビット反転制御信号N206とを受け、ビット反転制御済みアドレスN207を出力する。これにより、ビット反転制御モジュール204は、最大バイト数を有する第1アドレスと、第1アドレスの特定ビットを反転させた第2アドレスを生成する。
バイト選択モジュール203は、1バイトのアドレスバイト数検出用命令コードN203と、4バイトのビット反転制御済みアドレスN207と、出力バイトデータ選択信号N204とを受け、出力バイトデータN205を出力する。これにより、バイト選択モジュール203は、アドレスのうち、シリアルメモリ101へ送るバイトの位置を選択する。
パラレル/シリアル変換モジュール205は、出力バイトデータN205と、データ更新制御信号N208と、シリアル転送クロック信号N201とを受け、アドレスバイト数検出用データ入力信号N107を出力する。
ANDゲート206は、シリアル転送クロック信号N201と、クロック出力許可信号N209とを受け、アドレスバイト数検出用クロック信号N106を出力する。
シリアル/パラレル変換モジュール207は、シリアル転送クロック信号N201と、アドレスバイト数検出用データ出力信号N108とを受け、受信データN210を出力する。
The bit inversion control module 204 receives the address byte number detection address signal N202 and the bit inversion control signal N206, and outputs a bit inversion controlled address N207. Accordingly, the bit inversion control module 204 generates a first address having the maximum number of bytes and a second address obtained by inverting a specific bit of the first address.
The byte selection module 203 receives a 1-byte address byte number detection instruction code N203, a 4-byte bit inversion controlled address N207, and an output byte data selection signal N204, and outputs output byte data N205. Thereby, the byte selection module 203 selects the position of the byte to be sent to the serial memory 101 from the address.
The parallel / serial conversion module 205 receives the output byte data N205, the data update control signal N208, and the serial transfer clock signal N201, and outputs a data input signal N107 for detecting the number of address bytes.
The AND gate 206 receives the serial transfer clock signal N201 and the clock output permission signal N209, and outputs an address byte count detection clock signal N106.
Serial / parallel conversion module 207 receives serial transfer clock signal N201 and data output signal N108 for detecting the number of address bytes, and outputs received data N210.

1バイト・レジスタ208は、受信データN210と、受信データキャプチャ制御信号N211とを受け、キャプチャ済み受信データN215を出力する。
1バイト・レジスタ209は、受信データN210と、受信データキャプチャ制御信号N212とを受け、キャプチャ済み受信データN216を出力する。
1バイト・レジスタ210は、受信データN210と、受信データキャプチャ制御信号N213とを受け、キャプチャ済み受信データN217を出力する。
1バイト・レジスタ211は、受信データN210と、受信データキャプチャ制御信号N214とを受け、キャプチャ済み受信データN218を出力する。
カウンタ212は、カウンタ初期化信号N219と、カウントクロックN220とを受け、カウント結果N223を出力する。
カウンタ213は、カウンタ初期化信号N221と、カウントクロックN222とを受け、カウント結果N224を出力する。
The 1-byte register 208 receives the reception data N210 and the reception data capture control signal N211 and outputs captured reception data N215.
The 1-byte register 209 receives the reception data N210 and the reception data capture control signal N212, and outputs captured reception data N216.
The 1-byte register 210 receives the reception data N210 and the reception data capture control signal N213, and outputs captured reception data N217.
The 1-byte register 211 receives the reception data N210 and the reception data capture control signal N214, and outputs captured reception data N218.
The counter 212 receives the counter initialization signal N219 and the count clock N220, and outputs a count result N223.
The counter 213 receives the counter initialization signal N221 and the count clock N222, and outputs a count result N224.

比較器214は、キャプチャ済み受信データN215と、キャプチャ済み受信データN216とを受け、比較結果出力信号N225を出力する。
比較器215は、キャプチャ済み受信データN217と、キャプチャ済み受信データN218とを受け、比較結果出力信号N226を出力する。
比較器216は、キャプチャ済み受信データN215と、キャプチャ済み受信データN217とを受け、比較結果出力信号N227を出力する。
比較器217は、キャプチャ済み受信データN216と、キャプチャ済み受信データN218とを受け、比較結果出力信号N228を出力する。
比較器218は、カウント結果N223と、カウント結果N224とを受け、比較結果出力信号N229を出力する。
ANDゲート219は、比較結果出力信号N227と、比較結果出力信号N228と、比較結果出力信号N229とを受け、比較結果出力信号N230を出力する。
The comparator 214 receives the captured reception data N215 and the captured reception data N216, and outputs a comparison result output signal N225.
The comparator 215 receives the captured reception data N217 and the captured reception data N218, and outputs a comparison result output signal N226.
The comparator 216 receives the captured reception data N215 and the captured reception data N217, and outputs a comparison result output signal N227.
The comparator 217 receives the captured reception data N216 and the captured reception data N218, and outputs a comparison result output signal N228.
Comparator 218 receives count result N223 and count result N224, and outputs comparison result output signal N229.
AND gate 219 receives comparison result output signal N227, comparison result output signal N228, and comparison result output signal N229, and outputs comparison result output signal N230.

ここで、図1の構成と、図4の構成とを対応づけると次のようになる。
バイト選択モジュール203、パラレル/シリアル変換モジュール205、ANDゲート206、及び、シリアル/パラレル変換モジュール207は、メモリ入出力部11を構成し、シリアルメモリ101とのデータの入出力を制御するように働く。
ビット反転制御モジュール204は、アドレス生成部12を構成し、シリアルメモリ101へ出力するアドレス(第1アドレス、第2アドレス)を生成するように働く。
1バイト・レジスタ208、209と、カウンタ212と、比較器214とは、第1データ列取得部13を構成し、第1データ列を取得するように働く。
1バイト・レジスタ210、211と、カウンタ213と、比較器215とは、第2データ列取得部14を構成し、第2データ列を取得するように働く。
比較器216〜218と、ANDゲート219とは、比較部15を構成し、第1データ列と第2データ列とが一致するか、不一致であるかを示す比較結果を出力する。
シリアル転送クロック生成モジュール201と、シーケンス制御モジュール202とは、制御部16を構成し、アドレスバイト数を判定する。加えて、アドレスバイト数を検出できるように、各構成要素が機能するように制御する。
Here, the configuration of FIG. 1 is associated with the configuration of FIG. 4 as follows.
The byte selection module 203, the parallel / serial conversion module 205, the AND gate 206, and the serial / parallel conversion module 207 constitute the memory input / output unit 11 and operate to control data input / output with the serial memory 101. .
The bit inversion control module 204 constitutes the address generation unit 12 and functions to generate addresses (first address and second address) to be output to the serial memory 101.
The 1-byte registers 208 and 209, the counter 212, and the comparator 214 constitute the first data string acquisition unit 13 and operate to acquire the first data string.
The 1-byte registers 210 and 211, the counter 213, and the comparator 215 constitute the second data string acquisition unit 14 and operate to acquire the second data string.
The comparators 216 to 218 and the AND gate 219 constitute a comparison unit 15 and outputs a comparison result indicating whether the first data string and the second data string match or do not match.
The serial transfer clock generation module 201 and the sequence control module 202 constitute the control unit 16 and determine the number of address bytes. In addition, each component is controlled to function so that the number of address bytes can be detected.

ここで、実施形態1では、第1データ列は、第1先頭データ値、第1末尾データ値、及び、第1データ列の長さ(第1データ長)からなる第1データ列情報として保持する。同様に、第2データ列は、第2先頭データ値、第2末尾データ値、及び、第2データ列の長さ(第2データ長)からなる第2データ列情報として保持する。具体的には次の構成要素で保持する。
1バイト・レジスタ208は、第1データ列の第1先頭データ値を保持する。1バイト・レジスタ209は、第1データ列の第1末尾データ値を保持する。カウンタ212は、第1データ長を保持する。ここで、第1データ長は、第1データ列の総バイト数である。半導体装置102は、シリアルメモリ101から1バイトずつデータを読み出す。従って、カウンタ212が保持する値は、半導体装置102が、第1先頭データ値から第1末尾データ値を取得するまでの第1データ列の各データを取得した回数(取得回数)を保持しているということもできる。
第2データ列情報についても同様に、1バイト・レジスタ210は、第2データ列の第2先頭データ値を保持する。1バイト・レジスタ211は、第2データ列の第2末尾データ値を保持する。カウンタ213は、第2データ長を保持する。
加えて、ANDゲート219は、比較器216〜218の比較結果に基づいて、第1データ列情報及び第2データ列情報の各要素のすべてが一致する場合には、一致を示す比較結果を出力し、いずれかの要素が不一致である場合には、不一致を示す比較結果を出力する。
Here, in the first embodiment, the first data string is held as first data string information including the first head data value, the first tail data value, and the length (first data length) of the first data string. To do. Similarly, the second data string is held as second data string information including the second head data value, the second tail data value, and the length (second data length) of the second data string. Specifically, the following components are held.
The 1-byte register 208 holds the first head data value of the first data string. The 1-byte register 209 holds the first end data value of the first data string. The counter 212 holds the first data length. Here, the first data length is the total number of bytes of the first data string. The semiconductor device 102 reads data from the serial memory 101 byte by byte. Therefore, the value held by the counter 212 holds the number of times (acquisition number) that the semiconductor device 102 has acquired each data of the first data string until the first end data value is acquired from the first start data value. It can also be said.
Similarly for the second data string information, the 1-byte register 210 holds the second head data value of the second data string. The 1-byte register 211 holds the second end data value of the second data string. The counter 213 holds the second data length.
In addition, the AND gate 219 outputs a comparison result indicating a match when all the elements of the first data string information and the second data string information match based on the comparison results of the comparators 216 to 218. If any element does not match, a comparison result indicating mismatch is output.

図6は、SPI信号切り替えモジュール110の一例を示す詳細構成図である。
SPI信号切り替えモジュール110は、セレクタ(SEL)301〜303と、バッファ304と、バッファ305とで構成される。
セレクタ301は、アドレスバイト数検出用デバイス選択信号N105と、SPI入出力用デバイス選択信号N109と、アドレスバイト数検出完了信号N113とを受け、シリアルメモリ用デバイス選択信号N101を出力する。
セレクタ302は、アドレスバイト数検出用クロック信号N106と、SPI入出力用クロック信号N110と、アドレスバイト数検出完了信号N113とを受け、シリアルメモリ用クロック信号N102を出力する。
セレクタ303は、アドレスバイト数検出用データ入力信号N107と、SPI入出力用データ入力信号N111と、アドレスバイト数検出完了信号N113とを受け、シリアルメモリ用データ入力信号N103を出力する。
バッファ304は、シリアルメモリ用データ出力信号N104を受け、アドレスバイト数検出用データ出力信号N108を出力する。
バッファ305は、シリアルメモリ用データ出力信号N104を受け、SPI入出力用データ出力信号N112を出力する。
FIG. 6 is a detailed configuration diagram illustrating an example of the SPI signal switching module 110.
The SPI signal switching module 110 includes selectors (SEL) 301 to 303, a buffer 304, and a buffer 305.
The selector 301 receives the address byte number detection device selection signal N105, the SPI input / output device selection signal N109, and the address byte number detection completion signal N113, and outputs a serial memory device selection signal N101.
The selector 302 receives the address byte number detection clock signal N106, the SPI input / output clock signal N110, and the address byte number detection completion signal N113, and outputs a serial memory clock signal N102.
The selector 303 receives the address byte number detection data input signal N107, the SPI input / output data input signal N111, and the address byte number detection completion signal N113, and outputs a serial memory data input signal N103.
The buffer 304 receives the serial memory data output signal N104 and outputs the address byte count detection data output signal N108.
The buffer 305 receives the serial memory data output signal N104 and outputs an SPI input / output data output signal N112.

*実施形態1の動作
図4、図5、及び図6で説明した半導体装置102の動作を、図7、図8A、8B、図9A、9B、図10A、10Bのフローチャートと、図11〜図14のデータ内容例、図15A〜15B、図16A〜16C、図17A〜17D、図18A〜18Dのタイミングチャートを用いて説明する。
図4のシステムに電源が投入されると、半導体装置102において、クロック生成モジュール103は、リセット信号N117をアサートするとともに、クロック信号N116にクロックの出力を開始する。そして、クロック生成モジュール103は、所定時間経過後に、リセット信号N117をデアサートする。
* Operation of Embodiment 1 The operation of the semiconductor device 102 described with reference to FIGS. 4, 5, and 6 is illustrated in the flowcharts of FIGS. 7, 8A, 8B, 9A, 9B, 10A, and 10B, and FIGS. 14 data content examples, FIGS. 15A to 15B, FIGS. 16A to 16C, FIGS. 17A to 17D, and FIGS. 18A to 18D.
When the system of FIG. 4 is turned on, in the semiconductor device 102, the clock generation module 103 asserts the reset signal N117 and starts outputting the clock to the clock signal N116. Then, the clock generation module 103 deasserts the reset signal N117 after a predetermined time has elapsed.

図7は、本実施形態の半導体装置102における、CPU104の動作を示すフローチャートである。
CPU104は、汎用入出力ポート107からアドレスバイト数検出完了信号N113の状態を読み出す(ステップS101)。
アドレスバイト数検出が完了している場合には(S102、YES)、次のステップS103へ進み、アドレスバイト数検出が完了していない場合には(S102、NO)、ステップS101に戻って、アドレスバイト数検出完了となるまで、アドレスバイト数検出完了信号N113の状態を読み出す処理を繰り返す(ステップS102)。
アドレスバイト数検出が完了していると、CPU104は、汎用入出力ポート107からアドレスバイト数検出結果信号N114の状態を読み出し、接続されたシリアルメモリのアドレスバイト数を取得する(ステップS103)。
以降、CPU104は、クロックド・シリアル・インタフェース・モジュール109を操作し、取得したシリアルメモリのアドレスバイト数に従ってSPIバス・サイクルを組み立てる。これにより、CPU104は、シリアルメモリ101へのアクセスを行う(ステップS104)。
FIG. 7 is a flowchart showing the operation of the CPU 104 in the semiconductor device 102 of this embodiment.
The CPU 104 reads the state of the address byte count detection completion signal N113 from the general-purpose input / output port 107 (step S101).
If the address byte count detection is completed (S102, YES), the process proceeds to the next step S103. If the address byte count detection is not completed (S102, NO), the process returns to step S101 to return to the address The process of reading the state of the address byte number detection completion signal N113 is repeated until the byte number detection is completed (step S102).
When the address byte number detection is completed, the CPU 104 reads the state of the address byte number detection result signal N114 from the general-purpose input / output port 107, and acquires the number of address bytes of the connected serial memory (step S103).
Thereafter, the CPU 104 operates the clocked serial interface module 109 to assemble an SPI bus cycle according to the acquired number of address bytes of the serial memory. As a result, the CPU 104 accesses the serial memory 101 (step S104).

図8A、8Bは、本実施形態の半導体装置102における、アドレスバイト数検出モジュール108の動作を示すフローチャートである。
初期状態において、アドレスバイト数検出完了信号N113は、ロウ・レベルに初期化されており、またアドレスバイト数検出時に用いるシリアルメモリ読み出し用の命令コード(03h)が固定値として与えられている。ここでは、シリアルメモリ101の最大バイト数が4バイトであることを前提とする。例えば、シーケンス制御モジュール202は、リセット信号N117がアサートされると、アドレスバイト数検出完了信号N113を、ロウ・レベルに初期化し、リセット信号N117がデアサートされると、アドレスを生成する処理を開始するように、ビット反転制御モジュール204を制御する。これにより、アドレスバイト数を判定する処理が開始される。
先ず、ビット反転制御モジュール204は、任意の4バイトの値を第1アドレスとして選択し、ビット反転制御済みアドレスN207に供給する(ステップS201)。この時、ビット反転制御信号N206は、デアサートされており、ビット反転制御済みアドレスN207には、アドレスバイト数検出用アドレス信号N202の値がそのまま出力される。ここで、第1アドレスとなる、任意の4バイトの値は、予めアドレスバイト数検出モジュール108内に保持した値であってもよいし、外部から入力される値を用いるように構成されていてもよい。最大バイト数についても、任意の4バイトの値と同様である。
次に、第1アドレスを用いてシリアルメモリ101から第1データ列を読み出し、第1データ列情報を取得する(ステップS202)。シリアルメモリのデータ列取得の詳細フローは、別途説明する。
ステップS202で取得した第1データ列情報は、最初に読み出された第1の値(第1先頭データ値)が1バイト・レジスタ208に格納され、2バイト目以降で最初に読み出された1バイト・レジスタ208に格納された値と異なる第2の値(第1末尾データ値)が1バイト・レジスタ209に格納される。さらに、第1の値から第2の値が格納されるまでに読み出された総バイト数(第1データ長)がカウンタ212に格納される。
次に、ビット反転制御モジュール204は、第1アドレスのビット0を反転した値を第2アドレスとして選択する(S203)。ここでは、第1アドレスのビット0は、最大バイト数のアドレス部位(最下位のアドレス部位)の最下位ビットである。このとき、シーケンス制御モジュール202は、ビット反転制御信号N206を制御する。これにより、ビット反転制御済みアドレスN207には、アドレスバイト数検出用アドレス信号N202のビット0が反転された値が出力される。
8A and 8B are flowcharts showing the operation of the address byte count detection module 108 in the semiconductor device 102 of this embodiment.
In the initial state, the address byte number detection completion signal N113 is initialized to a low level, and a serial memory read instruction code (03h) used when detecting the number of address bytes is given as a fixed value. Here, it is assumed that the maximum number of bytes of the serial memory 101 is 4 bytes. For example, the sequence control module 202 initializes the address byte count detection completion signal N113 to a low level when the reset signal N117 is asserted, and starts a process of generating an address when the reset signal N117 is deasserted. In this manner, the bit inversion control module 204 is controlled. Thereby, a process for determining the number of address bytes is started.
First, the bit inversion control module 204 selects an arbitrary 4-byte value as the first address and supplies it to the bit inversion controlled address N207 (step S201). At this time, the bit inversion control signal N206 is deasserted, and the value of the address byte number detection address signal N202 is output as it is to the bit inversion controlled address N207. Here, the arbitrary 4-byte value serving as the first address may be a value previously stored in the address byte number detection module 108 or may be configured to use a value input from the outside. Also good. The maximum number of bytes is the same as an arbitrary 4-byte value.
Next, the first data string is read from the serial memory 101 using the first address, and the first data string information is acquired (step S202). A detailed flow for acquiring a data string in the serial memory will be described separately.
In the first data string information acquired in step S202, the first value (first head data value) read first is stored in the 1-byte register 208, and is read first after the second byte. A second value (first tail data value) different from the value stored in the 1-byte register 208 is stored in the 1-byte register 209. Further, the total number of bytes (first data length) read until the second value is stored from the first value is stored in the counter 212.
Next, the bit inversion control module 204 selects a value obtained by inverting bit 0 of the first address as the second address (S203). Here, bit 0 of the first address is the least significant bit of the address part (lowest address part) of the maximum number of bytes. At this time, the sequence control module 202 controls the bit inversion control signal N206. Thus, a value obtained by inverting bit 0 of the address byte number detection address signal N202 is output to the bit inversion controlled address N207.

第2アドレスがシリアルメモリ101へ出力されると、シリアルメモリ101からデータ列情報を取得する(ステップS204)。シリアルメモリのデータ列取得の詳細フローは、別途説明する。
ステップS204で取得した第2データ列情報は、最初に読み出された第1の値(第2先頭データ値)が1バイト・レジスタ210に格納され、2バイト目以降で最初に読み出された1バイト・レジスタ210と異なる第2の値(第2末尾データ値)が1バイト・レジスタ211に格納される。さらに、第2の値が格納されるまでに読み出された総バイト数(第2データ長)がカウンタ213に格納される。
次に、比較器216〜218は、ステップS202で得られた第1データ列情報とステップS204で得られた第2データ列情報との一致確認を行う(ステップS205)。データ列情報の一致確認は、各要素どうしが全て一致することで確認する。比較器216は、第1及び第2データ列情報の第1の値(第1先頭データ値と第2先頭データ値)の比較を行う。比較器217は、第1及び第2データ列情報の第2の値(第1末尾データ値と第2末尾データ値)の比較を行う。比較器218で第1及び第2データ列情報の総バイト数のカウント値(第1データ長と第2データ長)を比較する。ANDゲート219は、各要素が一致したことを検出し、第1及び第2データ列情報の一致確認結果を比較結果出力信号N230に出力する。比較結果出力信号N230は、シーケンス制御モジュール202に入力される。
When the second address is output to the serial memory 101, data string information is acquired from the serial memory 101 (step S204). A detailed flow for acquiring a data string in the serial memory will be described separately.
In the second data string information acquired in step S204, the first value (second head data value) read first is stored in the 1-byte register 210, and is read first after the second byte. A second value (second tail data value) different from the 1-byte register 210 is stored in the 1-byte register 211. Further, the total number of bytes (second data length) read until the second value is stored is stored in the counter 213.
Next, the comparators 216 to 218 perform matching confirmation between the first data string information obtained in step S202 and the second data string information obtained in step S204 (step S205). Data string information matching is confirmed by checking that all elements match. The comparator 216 compares the first values (first head data value and second head data value) of the first and second data string information. The comparator 217 compares the second values (first tail data value and second tail data value) of the first and second data string information. The comparator 218 compares the count values (first data length and second data length) of the total number of bytes of the first and second data string information. The AND gate 219 detects that the elements match, and outputs a match confirmation result of the first and second data string information to the comparison result output signal N230. The comparison result output signal N230 is input to the sequence control module 202.

第1データ列情報と第2データ列情報とが一致しない場合には、ステップS203で反転したアドレスのビット0がシリアルメモリ101に有効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、接続されたシリアルメモリ101のアドレスバイト数が、4であると判定(ステップS206)し、最終ステップS216に進む。
データ列情報が一致している場合には、ステップS203で反転したアドレスのビット0がシリアルメモリ101に無効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、新たな第2アドレスを用いてシリアルメモリ101のアドレスバイト数の判定を更に進めるために、次のステップS207に進むように制御する。
If the first data string information and the second data string information do not match, it means that bit 0 of the address inverted in step S203 is a valid address bit in the serial memory 101. Accordingly, the sequence control module 202 determines that the number of address bytes of the connected serial memory 101 is 4 (step S206), and proceeds to the final step S216.
If the data string information matches, bit 0 of the address inverted in step S203 is an invalid address bit in the serial memory 101. Therefore, the sequence control module 202 performs control to proceed to the next step S207 in order to further determine the number of address bytes in the serial memory 101 using the new second address.

ビット反転制御モジュール204は、第1アドレスのビット8を反転した値を新たな第2アドレスとして選択する(ステップS207)。ここでは、第1アドレスのビット8は、第1アドレスにおける3番目のアドレス部位の最下位ビットであり、特定ビットが一つ前の4番目(最大バイト数)のアドレス部位より一つ上位のアドレス部位に設定されることになる。このとき、シーケンス制御モジュール202は、ビット反転制御モジュール204が第1アドレスのビット8を反転するように、ビット反転制御信号N206を制御する。これにより、ビット反転制御済みアドレスN207には、アドレスバイト数検出用アドレス信号N202のビット8が反転された値が出力される。   The bit inversion control module 204 selects a value obtained by inverting bit 8 of the first address as a new second address (step S207). Here, bit 8 of the first address is the least significant bit of the third address part in the first address, and the specific bit is one address higher than the fourth (maximum number of bytes) address part one before. It will be set to the part. At this time, the sequence control module 202 controls the bit inversion control signal N206 so that the bit inversion control module 204 inverts bit 8 of the first address. As a result, a value obtained by inverting bit 8 of the address byte number detection address signal N202 is output to the bit inversion controlled address N207.

新たな第2アドレスがシリアルメモリ101へ出力されると、シリアルメモリ101から新たな第2アドレスに応じた第2データ列情報を取得する(ステップS208)。シリアルメモリ101のデータ列取得の詳細フローは、別途説明する。
ステップS208で取得した第2データ列情報は、ステップS204と同様に格納される。
次に、比較器216〜218は、ステップS202で得られた第1データ列情報とステップS208で得られた第2データ列情報との一致確認を行う(ステップS209)。データ列情報の一致確認は、各要素どうしが全て一致することで確認する。比較器216〜218の具体的な動作は、ステップS205と同様であるため説明を省略する。
When the new second address is output to the serial memory 101, the second data string information corresponding to the new second address is acquired from the serial memory 101 (step S208). A detailed flow of acquiring a data string in the serial memory 101 will be described separately.
The second data string information acquired in step S208 is stored in the same manner as in step S204.
Next, the comparators 216 to 218 perform matching confirmation between the first data string information obtained in step S202 and the second data string information obtained in step S208 (step S209). Data string information matching is confirmed by checking that all elements match. Since the specific operations of the comparators 216 to 218 are the same as those in step S205, description thereof will be omitted.

データ列情報が一致しない場合には、ステップS207で反転したアドレスのビット8がシリアルメモリ101に有効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、接続されたシリアルメモリ101のアドレスバイト数は、3であると判定(ステップS210)し、最終ステップS216に進む。
データ列情報が一致している場合には、ステップS207で反転したアドレスのビット8がシリアルメモリ101に無効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、さらに新たな第2アドレスを用いてシリアルメモリ101のアドレスバイト数の判定を更に進めるために、次のステップS211に進むように制御する。
ビット反転制御モジュール204は、第1アドレスのビット16を反転した値を第2アドレスとして選択する(ステップS211)。ここでは、第1アドレスのビット16は、第1アドレスにおける2番目のアドレス部位の最下位ビットであり、特定ビットが一つ前の3番目アドレス部位より一つ上位のアドレス部位に設定されることになる。このとき、シーケンス制御モジュール202は、ビット反転制御信号N206を制御する。これにより、ビット反転制御済みアドレスN207には、アドレスバイト数検出用アドレス信号N202のビット16が反転された値が出力される。
If the data string information does not match, bit 8 of the address inverted in step S207 is a valid address bit in the serial memory 101. Therefore, the sequence control module 202 determines that the number of address bytes of the connected serial memory 101 is 3 (step S210), and proceeds to the final step S216.
If the data string information matches, bit 8 of the address inverted in step S207 is an invalid address bit in the serial memory 101. Accordingly, the sequence control module 202 performs control to proceed to the next step S211 in order to further determine the number of address bytes of the serial memory 101 using the new second address.
The bit inversion control module 204 selects a value obtained by inverting the bit 16 of the first address as the second address (step S211). Here, bit 16 of the first address is the least significant bit of the second address part in the first address, and the specific bit is set to the address part one higher than the previous third address part. become. At this time, the sequence control module 202 controls the bit inversion control signal N206. As a result, a value obtained by inverting bit 16 of the address byte number detection address signal N202 is output to the bit inversion controlled address N207.

さらに新たな第2アドレスがシリアルメモリ101へ出力されると、シリアルメモリ101からさらに新たなデータ列情報を取得する(ステップS212)。シリアルメモリ101のデータ列取得の詳細フローは、別途説明する。
ステップS212で取得した第2データ列情報は、ステップS204、S208と同様に格納される。
次に、比較器216〜218は、ステップS202で得られた第1データ列情報とステップS212で得られた第2データ列情報との一致確認を行う(ステップS213)。データ列情報の一致確認は、各要素どうしが全て一致することで確認する。比較器216〜218の具体的な動作は、ステップS205、S209と同様であるため説明を省略する。
When a new second address is output to the serial memory 101, new data string information is acquired from the serial memory 101 (step S212). A detailed flow of acquiring a data string in the serial memory 101 will be described separately.
The second data string information acquired in step S212 is stored in the same manner as in steps S204 and S208.
Next, the comparators 216 to 218 perform matching confirmation between the first data string information obtained in step S202 and the second data string information obtained in step S212 (step S213). Data string information matching is confirmed by checking that all elements match. Since the specific operations of the comparators 216 to 218 are the same as those in steps S205 and S209, description thereof will be omitted.

データ列情報が一致しない場合には、ステップS211で反転したアドレスのビット16がシリアルメモリ101に有効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、接続されたシリアルメモリ101のアドレスバイト数は、2であると判定(ステップS214)し、最終ステップS216に進む。
データ列情報が一致している場合には、ステップS211で反転したアドレスのビット16がシリアルメモリ101に無効なアドレスビットであったことになる。従って、シーケンス制御モジュール202は、接続されたシリアルメモリ101のアドレスバイト数は、1であると判定(ステップS215)し、最終ステップS216に進む。
最終ステップS216では、シーケンス制御モジュール202は、アドレスバイト数検出完了信号N113にハイ・レベルを出力し、アドレスバイト数検出の完了を外部に通知する。加えて、シーケンス制御モジュール202は、アドレスバイト数検出結果信号N114へ検出したアドレスバイト数を出力する。
If the data string information does not match, the bit 16 of the address inverted in step S211 is a valid address bit in the serial memory 101. Accordingly, the sequence control module 202 determines that the number of address bytes of the connected serial memory 101 is 2 (step S214), and proceeds to the final step S216.
If the data string information matches, the bit 16 of the address inverted in step S211 is an invalid address bit in the serial memory 101. Accordingly, the sequence control module 202 determines that the number of address bytes of the connected serial memory 101 is 1 (step S215), and proceeds to the final step S216.
In the final step S216, the sequence control module 202 outputs a high level to the address byte number detection completion signal N113 to notify the outside of the completion of address byte number detection. In addition, the sequence control module 202 outputs the detected number of address bytes to the address byte number detection result signal N114.

続いて、アドレスバイト数検出モジュール108が第1データ列情報と第2データ列情報とを取得する動作について説明する。
図9A、9Bは、本実施形態のアドレスバイト数検出モジュール108における、シリアルメモリ101の第1データ列情報取得(図8AのステップS202)の詳細フローチャートである。
先ず、シーケンス制御モジュール202は、カウンタ初期化信号N219を出力し、総バイト数のカウンタ212をクリアする(ステップS301)。
次に、シーケンス制御モジュール202は、アドレスバイト数検出用デバイス選択信号N105にロウ・レベルを出力し、SPIバス・サイクルを開始させる(ステップS302)。
次に、シーケンス制御モジュール202は、アドレスバイト数検出用命令コードN203の送信を行う(ステップS303)。
シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にアドレスバイト数検出用命令コードN203の値を出力する。
続いて、シーケンス制御モジュール202によってデータ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納され、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107にMSBから順にシリアル出力される。
Next, an operation in which the address byte number detection module 108 acquires the first data string information and the second data string information will be described.
9A and 9B are detailed flowcharts of the first data string information acquisition (step S202 in FIG. 8A) of the serial memory 101 in the address byte count detection module 108 of the present embodiment.
First, the sequence control module 202 outputs a counter initialization signal N219 and clears the counter 212 of the total number of bytes (step S301).
Next, the sequence control module 202 outputs a low level to the address byte count detection device selection signal N105 to start an SPI bus cycle (step S302).
Next, the sequence control module 202 transmits the address byte count detection instruction code N203 (step S303).
In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the value of the address byte count detection instruction code N203 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted by the sequence control module 202, the value of the output byte data N205 is stored in the parallel / serial conversion module 205, and the number of address bytes is synchronized with the serial transfer clock signal N201. The detection data input signal N107 is serially output in order from the MSB.

次に、アドレスのビット31〜24の送信を行う(ステップS304)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット31〜24の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205は、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
Next, the bits 31 to 24 of the address are transmitted (step S304). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of bits 31 to 24 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. The parallel / serial conversion module 205 serially outputs the values stored in the address byte count detection data input signal N107 in order from the MSB in synchronization with the serial transfer clock signal N201.

次に、アドレスのビット23〜16の送信を行う(ステップS305)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット23〜16の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205は、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
Next, the bits 23 to 16 of the address are transmitted (step S305). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of bits 23 to 16 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. The parallel / serial conversion module 205 serially outputs the values stored in the address byte count detection data input signal N107 in order from the MSB in synchronization with the serial transfer clock signal N201.

次に、アドレスのビット15〜8の送信を行う(ステップS306)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット15〜8の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205は、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
次に、アドレスのビット7〜0の送信を行う(ステップS307)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット7〜0の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205は、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
Next, bits 15 to 8 of the address are transmitted (step S306). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of the bits 15 to 8 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. The parallel / serial conversion module 205 serially outputs the values stored in the address byte count detection data input signal N107 in order from the MSB in synchronization with the serial transfer clock signal N201.
Next, bits 7 to 0 of the address are transmitted (step S307). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the value of bits 7 to 0 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. The parallel / serial conversion module 205 serially outputs the values stored in the address byte count detection data input signal N107 in order from the MSB in synchronization with the serial transfer clock signal N201.

次に、シリアル/パラレル変換モジュール207は、1バイトのデータを取得する(ステップS308)。
具体的には、シリアル/パラレル変換モジュール207は、アドレスバイト数検出用クロック信号N106に同期して入力されるアドレスバイト数検出用データ出力信号N108を、8ビット分受信し、1バイトの受信データN210を得る。受信データN210は、受信データキャプチャ制御信号N211の制御により、第1の値(第1先頭データ値)として1バイト・レジスタ208に格納される。
Next, the serial / parallel conversion module 207 acquires 1-byte data (step S308).
Specifically, the serial / parallel conversion module 207 receives 8 bits of the address byte number detection data output signal N108 inputted in synchronization with the address byte number detection clock signal N106, and receives 1 byte of received data. N210 is obtained. The reception data N210 is stored in the 1-byte register 208 as a first value (first head data value) under the control of the reception data capture control signal N211.

次に、カウントクロックN220の制御により、カウンタ212をインクリメントする(ステップS309)。
次に、シリアル/パラレル変換モジュール207は、後続する1バイトのデータを取得する(ステップS310)。
具体的には、シリアル/パラレル変換モジュール207は、アドレスバイト数検出用クロック信号N106に同期して入力されるアドレスバイト数検出用データ出力信号N108を、8ビット分受信し、1バイトの受信データN210を得る。受信データN210は、受信データキャプチャ制御信号N212の制御により、第2の値として1バイト・レジスタ209に格納する。
次に、カウントクロックN220の制御により、カウンタ212をインクリメントする。(ステップS311)。
Next, the counter 212 is incremented under the control of the count clock N220 (step S309).
Next, the serial / parallel conversion module 207 obtains subsequent 1-byte data (step S310).
Specifically, the serial / parallel conversion module 207 receives 8 bits of the address byte number detection data output signal N108 inputted in synchronization with the address byte number detection clock signal N106, and receives 1 byte of received data. N210 is obtained. The reception data N210 is stored in the 1-byte register 209 as a second value under the control of the reception data capture control signal N212.
Next, the counter 212 is incremented under the control of the count clock N220. (Step S311).

次に、比較器214は、第1の値と第2の値との比較を行う(ステップS312)。比較器214は、キャプチャ済み受信データN215とキャプチャ済み受信データN216とを比較した結果を比較結果出力信号N225として出力する。シーケンス制御モジュール202は、比較結果出力信号N225を参照し、一致していれば(ステップS312、YES)、ステップS310に戻り処理を繰り返し、一致していなければ(ステップS312、NO)、次のステップS313に進むように制御する。比較結果出力信号N225が一致を示す場合、1バイト・レジスタ209に格納された第2の値は、第1末尾データとなる。
最後に、シーケンス制御モジュール202は、アドレスバイト数検出用デバイス選択信号N105にハイ・レベルを出力し、SPIバス・サイクルを終了する(ステップS313)。
ステップS308〜S312で説明したように、シーケンス制御モジュール202は、1バイト・レジスタ208に第1先頭データ値を保持させ、比較器214の出力が不一致を示すまで、第1データ列の2番目に取得する値から順番に1バイト・レジスタ209に取り込むことによって、第1末尾データ値を1バイト・レジスタ209に保持させるように制御する。
Next, the comparator 214 compares the first value with the second value (step S312). The comparator 214 outputs a result of comparing the captured reception data N215 and the captured reception data N216 as a comparison result output signal N225. The sequence control module 202 refers to the comparison result output signal N225. If they match (step S312: YES), the sequence control module 202 returns to step S310 and repeats the process. If they do not match (step S312: NO), the next step Control is performed to proceed to S313. When the comparison result output signal N225 indicates a match, the second value stored in the 1-byte register 209 is the first tail data.
Finally, the sequence control module 202 outputs a high level to the address byte count detection device selection signal N105 and ends the SPI bus cycle (step S313).
As described in steps S308 to S312, the sequence control module 202 holds the first head data value in the 1-byte register 208, and continues to the second of the first data string until the output of the comparator 214 indicates a mismatch. The first end data value is controlled to be held in the 1-byte register 209 by fetching it into the 1-byte register 209 in order from the acquired value.

図10A、10Bは、本実施形態のアドレスバイト数検出モジュール108における、シリアルメモリ101の第2データ列情報取得(図8BのステップS204、ステップS208,ステップS212)の詳細フローチャートである。
先ず、シーケンス制御モジュール202は、カウンタ初期化信号N221を出力し、総バイト数のカウンタ213をクリアする(ステップS401)。
次に、シーケンス制御モジュール202は、アドレスバイト数検出用デバイス選択信号N105にロウ・レベルを出力し、SPIバス・サイクルを開始させる(ステップS402)。
次に、シーケンス制御モジュール202は、アドレスバイト数検出用命令コードN203の送信を行う(ステップS403)。
シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にアドレスバイト数検出用命令コードN203の値を出力する。
続いて、シーケンス制御モジュール202によってデータ更新制御信号N208がアサートされ、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納され、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107にMSBから順にシリアル出力される。
10A and 10B are detailed flowcharts of the second data string information acquisition (step S204, step S208, and step S212 in FIG. 8B) of the serial memory 101 in the address byte count detection module 108 of the present embodiment.
First, the sequence control module 202 outputs the counter initialization signal N221 and clears the counter 213 for the total number of bytes (step S401).
Next, the sequence control module 202 outputs a low level to the address byte count detection device selection signal N105 to start an SPI bus cycle (step S402).
Next, the sequence control module 202 transmits the address byte count detection instruction code N203 (step S403).
In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the value of the address byte count detection instruction code N203 to the output byte data N205.
Subsequently, the data update control signal N208 is asserted by the sequence control module 202, the value of the output byte data N205 is stored in the parallel / serial conversion module 205, and is used for detecting the number of address bytes in synchronization with the serial transfer clock signal N201. The data input signal N107 is serially output in order from the MSB.

次に、アドレスのビット31〜24の送信を行う(ステップS404)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット31〜24の値を出力する。
続いて、データ更新制御信号N208がアサートされ、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205は、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
Next, address bits 31 to 24 are transmitted (step S404). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of bits 31 to 24 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, the data update control signal N208 is asserted, and the value of the output byte data N205 is stored in the parallel / serial conversion module 205. The parallel / serial conversion module 205 serially outputs the values stored in the address byte count detection data input signal N107 in order from the MSB in synchronization with the serial transfer clock signal N201.

次に、アドレスのビット23〜16の送信を行う(ステップS405)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット23〜16の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
次に、アドレスのビット15〜8の送信を行う(ステップS406)。シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット15〜8の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
Next, the bits 23 to 16 of the address are transmitted (step S405). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of bits 23 to 16 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. In synchronization with the parallel / serial conversion module 205 and the serial transfer clock signal N201, the value stored in the address byte count detection data input signal N107 is serially output in order from the MSB.
Next, the bits 15 to 8 of the address are transmitted (step S406). In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the values of the bits 15 to 8 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. In synchronization with the parallel / serial conversion module 205 and the serial transfer clock signal N201, the value stored in the address byte count detection data input signal N107 is serially output in order from the MSB.

次に、アドレスのビット7〜0の送信を行う(ステップS407)。
シーケンス制御モジュール202から出力される出力バイトデータ選択信号N204に従い、バイト選択モジュール203は、出力バイトデータN205にビット反転制御済みアドレスN207のビット7〜0の値を出力する。
続いて、データ更新制御信号N208がアサートされると、出力バイトデータN205の値が、パラレル/シリアル変換モジュール205に格納される。パラレル/シリアル変換モジュール205、シリアル転送クロック信号N201に同期して、アドレスバイト数検出用データ入力信号N107に格納した値をMSBから順にシリアル出力する。
次に、シリアル/パラレル変換モジュール207は、1バイトのデータを取得する(ステップS408)。
具体的には、シリアル/パラレル変換モジュール207は、アドレスバイト数検出用クロック信号N106に同期して入力されるアドレスバイト数検出用データ出力信号N108を、8ビット分受信し、1バイトの受信データN210を得る。受信データN210は、受信データキャプチャ制御信号N213の制御により、第1の値(第1先頭データ値)として1バイト・レジスタ210に格納される。
次に、カウントクロックN222の制御により、カウンタ213をインクリメントする。(ステップS409)。
Next, bits 7 to 0 of the address are transmitted (step S407).
In accordance with the output byte data selection signal N204 output from the sequence control module 202, the byte selection module 203 outputs the value of bits 7 to 0 of the bit inversion controlled address N207 to the output byte data N205.
Subsequently, when the data update control signal N208 is asserted, the value of the output byte data N205 is stored in the parallel / serial conversion module 205. In synchronization with the parallel / serial conversion module 205 and the serial transfer clock signal N201, the value stored in the address byte count detection data input signal N107 is serially output in order from the MSB.
Next, the serial / parallel conversion module 207 acquires 1-byte data (step S408).
Specifically, the serial / parallel conversion module 207 receives 8 bits of the address byte number detection data output signal N108 inputted in synchronization with the address byte number detection clock signal N106, and receives 1 byte of received data. N210 is obtained. The reception data N210 is stored in the 1-byte register 210 as the first value (first head data value) under the control of the reception data capture control signal N213.
Next, the counter 213 is incremented under the control of the count clock N222. (Step S409).

次に、シリアル/パラレル変換モジュール207は、後続する1バイトのデータを取得する(ステップS410)。
具体的には、シリアル/パラレル変換モジュール207は、アドレスバイト数検出用クロック信号N106に同期して入力されるアドレスバイト数検出用データ出力信号N108を、8ビット分受信し、1バイトの受信データN210を得る。受信データN210は、受信データキャプチャ制御信号N214の制御により、第2の値として1バイト・レジスタ211に格納する。
Next, the serial / parallel conversion module 207 obtains subsequent 1-byte data (step S410).
Specifically, the serial / parallel conversion module 207 receives 8 bits of the address byte number detection data output signal N108 inputted in synchronization with the address byte number detection clock signal N106, and receives 1 byte of received data. N210 is obtained. The reception data N210 is stored in the 1-byte register 211 as a second value under the control of the reception data capture control signal N214.

次に、カウントクロックN222の制御により、カウンタ213をインクリメントする。(ステップS411)。
次に、比較器215は、第1の値と第2の値との比較を行う(ステップS412)。比較器215は、キャプチャ済み受信データN217とキャプチャ済み受信データN218とを比較した結果を比較結果出力信号N226として出力する。シーケンス制御モジュール202は、比較結果出力信号N226を参照し、一致していれば(ステップS412、YES)、ステップS410に戻り処理を繰り返し、一致していなければ(ステップS412、NO)、次のステップS413に進むように制御する。比較結果出力信号N226が一致を示す場合、1バイト・レジスタ211に格納された第2の値は、第2末尾データとなる。
最後に、シーケンス制御モジュール202は、アドレスバイト数検出用デバイス選択信号N105にハイ・レベルを出力し、SPIバス・サイクルを終了する(ステップS413)。
ステップS408〜S412で説明したように、シーケンス制御モジュール202は、1バイト・レジスタ210に第2先頭データ値を保持させ、比較器215の出力が不一致を示すまで、第2データ列の2番目に取得する値から順番に1バイト・レジスタ211に取り込むことによって、第2末尾データ値を1バイト・レジスタ211に保持させるように制御する。
Next, the counter 213 is incremented under the control of the count clock N222. (Step S411).
Next, the comparator 215 compares the first value with the second value (step S412). The comparator 215 outputs the comparison result output signal N226 as a result of comparing the captured reception data N217 and the captured reception data N218. The sequence control module 202 refers to the comparison result output signal N226. If they match (step S412, YES), the sequence control module 202 returns to step S410 and repeats the processing. If they do not match (step S412, NO), the next step Control is made to proceed to S413. When the comparison result output signal N226 indicates coincidence, the second value stored in the 1-byte register 211 is the second tail data.
Finally, the sequence control module 202 outputs a high level to the address byte number detection device selection signal N105, and ends the SPI bus cycle (step S413).
As described in steps S408 to S412, the sequence control module 202 holds the second head data value in the 1-byte register 210, and continues to the second data string until the output of the comparator 215 indicates a mismatch. The second end data value is controlled to be held in the 1-byte register 211 by fetching it into the 1-byte register 211 in order from the value to be acquired.

ここで、シリアルメモリ101が保持する具体的な値と、アドレスバイト数検出モジュール108の判定動作のタイミングチャートとを用いて、具体的な動作例を説明する。図11〜図14は、本実施形態の半導体装置102へ接続するシリアルメモリ101のデータ内容例を示す図である。図15A〜図18Dは、本実施形態の半導体装置102へシリアルメモリ101を接続した場合の動作例を示すタイミングチャートである。シリアルメモリ101のアドレスバイト数が図11、15A、15Bでは4、図12、16A〜16Cでは3、図13、図17A〜17Dでは2、図14、図18A〜18Dでは1の場合をそれぞれ示している。   Here, a specific operation example will be described using a specific value held in the serial memory 101 and a timing chart of the determination operation of the address byte number detection module 108. 11 to 14 are diagrams showing examples of data contents of the serial memory 101 connected to the semiconductor device 102 of the present embodiment. 15A to 18D are timing charts showing an operation example when the serial memory 101 is connected to the semiconductor device 102 of the present embodiment. 11, 15A, 15B, 4 in FIGS. 11, 15A, 15B, 3 in FIGS. 12, 16A-16C, 2 in FIGS. 13, 17A-17D, 1 in FIGS. 14, 18A-18D, respectively. ing.

図11〜図14に示すように、シリアルメモリ101には、均一では無い値を格納していることを前提とする。
図15A〜図18Dに示す符号T511からT544で示すタイミングチャートは、図8A〜図10Bの処理と次のように対応する。タイミングチャートT511、T521、T531、T541は、図8AのステップS202の処理(図9A、9Bのフローチャート)によって、第1アドレスに応じた第1データ列情報を取得する場合を示す。タイミングチャートT512、T522、T532、T542は、図8BのステップS204の処理(図10A、10Bのフローチャート)によって、第2アドレスに応じた第2データ列情報を取得する場合を示す。タイミングチャートT523、T533、T543は、図8BのステップS208の処理(図10A、10Bのフローチャート)によって、新たな第2アドレスに応じた第2データ列情報を取得する場合を示す。タイミングチャートT534、T544は、図8BのステップS212の処理(図10A、10Bのフローチャート)によって、さらに新たな第2アドレスに応じた第2データ列情報を取得する場合を示す。
図15A〜図18Dでは、第1アドレスを"0000FF00h"とする。
As shown in FIGS. 11 to 14, it is assumed that the serial memory 101 stores non-uniform values.
Timing charts indicated by reference numerals T511 to T544 shown in FIGS. 15A to 18D correspond to the processes of FIGS. 8A to 10B as follows. Timing charts T511, T521, T531, and T541 show a case where the first data string information corresponding to the first address is acquired by the process of step S202 of FIG. 8A (the flowcharts of FIGS. 9A and 9B). Timing charts T512, T522, T532, and T542 show a case where the second data string information corresponding to the second address is acquired by the process of step S204 of FIG. 8B (the flowcharts of FIGS. 10A and 10B). Timing charts T523, T533, and T543 show a case where the second data string information corresponding to the new second address is acquired by the process of step S208 of FIG. 8B (the flowcharts of FIGS. 10A and 10B). Timing charts T534 and T544 illustrate a case where second data string information corresponding to a new second address is acquired by the process of step S212 in FIG. 8B (the flowcharts in FIGS. 10A and 10B).
In FIGS. 15A to 18D, the first address is set to “0000FF00h”.

まず、半導体装置102へアドレスバイト数4のシリアルメモリ101を接続する場合を説明する。
シリアルメモリ101には、図11に示すデータが格納されている。
図15Aに示す、タイミングチャートT511では、第1アドレスを用いて、シリアルメモリ101の第1データ列情報を取得する(図8A、ステップS202)。
先ず、半導体装置102は、アドレスバイト数検出用デバイス選択信号N101にロウ・レベルを出力する。続いて、半導体装置102は、シリアルメモリ用クロック信号N102に同期して、1バイトの読み出し命令コード(タイミングC1)と、4バイトの第1アドレス(タイミングC2〜C5)とをシリアルメモリ用データ入力信号N103に順次出力する。
引き続き、半導体装置102は、シリアルメモリ用クロック信号N102に同期して、シリアルメモリ用データ出力信号N104から第1の値を取得し(タイミングC6)、第1の値とデータ値が異なる第2の値を取得する(タイミングC10)まで、第1データ列の取得を継続する。
このとき、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と4バイトのアドレス0000FF00h(タイミングC2〜C5)とを認識し、該当アドレスのデータをシリアルメモリ用データ出力信号N104に出力開始(タイミングC6)する。
ここで、半導体装置102は、第1の値が00h、第2の値がBCh、及び、カウント値が5となる第1データ列情報を得る。
First, a case where the serial memory 101 having 4 address bytes is connected to the semiconductor device 102 will be described.
The serial memory 101 stores data shown in FIG.
In the timing chart T511 shown in FIG. 15A, the first data string information of the serial memory 101 is acquired using the first address (FIG. 8A, step S202).
First, the semiconductor device 102 outputs a low level to the address byte count detection device selection signal N101. Subsequently, the semiconductor device 102 inputs a 1-byte read instruction code (timing C1) and a 4-byte first address (timing C2 to C5) in synchronization with the serial memory clock signal N102. The signal N103 is sequentially output.
Subsequently, the semiconductor device 102 acquires the first value from the serial memory data output signal N104 in synchronization with the serial memory clock signal N102 (timing C6), and the second value having a data value different from the first value. The acquisition of the first data string is continued until the value is acquired (timing C10).
At this time, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the 4-byte address 0000FF00h (timing C2 to C5), and transfers the data at the corresponding address to the serial memory. The output of the data output signal N104 is started (timing C6).
Here, the semiconductor device 102 obtains first data string information in which the first value is 00h, the second value is BCh, and the count value is 5.

図15Bに示す、タイミングチャートT512では、第1アドレス0000FF00hのビット0を反転して得られる第2アドレス0x0000FF01hを用いて、シリアルメモリ101の第2データ列情報を取得する。
このとき、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と4バイトのアドレス0000FF01h(タイミングC2〜C5)とを認識し、該当アドレスのデータをシリアルメモリ用データ出力信号N104に出力開始(タイミングC6)する。
ここで、半導体装置102は、第1の値が00h、第2の値がBCh、及び、カウント値が4となる第2データ列情報を得る。
In the timing chart T512 shown in FIG. 15B, the second data string information of the serial memory 101 is acquired using the second address 0x0000FF01h obtained by inverting bit 0 of the first address 0000FF00h.
At this time, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the 4-byte address 0000FF01h (timing C2 to C5), and transfers the data at the corresponding address to the serial memory. The output of the data output signal N104 is started (timing C6).
Here, the semiconductor device 102 obtains second data string information in which the first value is 00h, the second value is BCh, and the count value is 4.

タイミングチャートT511及びT512で得られた第1及び第2データ列情報は、一致しない。
この結果から、接続されたシリアルメモリのアドレスバイト数は、4であると判断する。
The first and second data string information obtained in the timing charts T511 and T512 do not match.
From this result, it is determined that the number of address bytes of the connected serial memory is 4.

次に、半導体装置102へアドレスバイト数3のシリアルメモリ101を接続する場合を説明する。
シリアルメモリ101には、図12に示すデータが格納されている。
図16A、16Bに示す、タイミングチャートT521及びT522においては、シリアルメモリ101のアドレスバイト数が3である。従って、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と上位3バイトのアドレス0000FFh(タイミングC2〜C4)とを認識し、認識したアドレスのデータ出力を開始(タイミングC5)する。一方、半導体装置102は、タイミングC5までは、アドレスを出力する処理を実施するため、タイミングC6からの第1及び第2データ列を読み出す。その結果、タイミングチャートT521及びT522において、半導体装置102は、第1及び第2データ列情報ともに、第1の値が00h、第2の値がBCh、カウント値が4となる情報を取得する。
タイミングチャートT521及びT522で得られる第1データ列情報と第2データ列情報とは、一致する。
Next, a case where the serial memory 101 having the address byte number 3 is connected to the semiconductor device 102 will be described.
The serial memory 101 stores data shown in FIG.
In the timing charts T521 and T522 shown in FIGS. 16A and 16B, the number of address bytes of the serial memory 101 is three. Therefore, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the upper 3 bytes of address 0000FFh (timing C2 to C4), and outputs data of the recognized address. Start (timing C5). On the other hand, the semiconductor device 102 reads the first and second data strings from the timing C6 in order to perform the process of outputting the address until the timing C5. As a result, in the timing charts T521 and T522, the semiconductor device 102 acquires information in which the first value is 00h, the second value is BCh, and the count value is 4, together with the first and second data string information.
The first data string information and the second data string information obtained in the timing charts T521 and T522 match.

図16Cに示す、タイミングチャートT523では、第1アドレス0000FF00hのビット8を反転して得た第2アドレス0x0000FE00を用いて、シリアルメモリ101のデータ列情報を取得する。
このとき、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と上位3バイトのアドレス0000FEh(タイミングC2〜C4)とを認識し、該当アドレスのデータ出力を開始(タイミングC5)する。
ここで、半導体装置102は、タイミングC6からのデータ列を読み出し、第1のデータが00h、第2のデータがBCh、カウント値が5となる、新たな第2データ列情報を取得する。
タイミングチャートT521及びT523で得られた第1及び第2データ列情報は、一致しない。
この結果から、接続されたシリアルメモリのアドレスバイト数は、3であると判断する。
なお、タイミングチャートT523において半導体装置102から出力されるアドレスの最下位1バイトは、上述した説明ではゼロを設定した。しかし、シリアルメモリ101が最下位バイトの値を参照することが無いため、任意の値でもよい。
In the timing chart T523 illustrated in FIG. 16C, the data string information of the serial memory 101 is acquired using the second address 0x0000FE00 obtained by inverting bit 8 of the first address 0000FF00h.
At this time, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the upper 3 bytes of address 0000FEh (timing C2 to C4), and outputs the data output of the corresponding address. Start (timing C5).
Here, the semiconductor device 102 reads the data string from the timing C6, and acquires new second data string information in which the first data is 00h, the second data is BCh, and the count value is 5.
The first and second data string information obtained in the timing charts T521 and T523 do not match.
From this result, it is determined that the number of address bytes of the connected serial memory is 3.
In the timing chart T523, the least significant byte of the address output from the semiconductor device 102 is set to zero in the above description. However, since the serial memory 101 never refers to the value of the least significant byte, any value may be used.

次に、半導体装置102へアドレスバイト数2のシリアルメモリ101を接続する場合を説明する。
シリアルメモリ101には、図13に示すデータが格納されている。
図17A〜17Cに示す、タイミングチャートT531、T532及びT533においては、シリアルメモリ101のアドレスバイト数が2である。従って、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と上位2バイトのアドレス0000h(タイミングC2〜C3)とを認識し、認識したアドレスのデータ出力を開始(タイミングC4)する。一方、半導体装置102は、タイミングC5までは、アドレスを出力する処理を実施するため、タイミングC6からの第1及び第2データ列を読み出す。その結果、タイミングチャートT531〜T533において、半導体装置102は、第1及び第2データ列情報ともに、第1の値が00h、第2の値がBCh、カウント値が3となる情報を取得する。
タイミングチャートT531、T532及びT533で得られる第1データ列情報と、二つの第2データ列情報とは、すべて一致する。
Next, a case where the serial memory 101 having the address byte number 2 is connected to the semiconductor device 102 will be described.
The serial memory 101 stores data shown in FIG.
In the timing charts T531, T532, and T533 shown in FIGS. 17A to 17C, the number of address bytes of the serial memory 101 is two. Therefore, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the upper 2 bytes of address 0000h (timing C2 to C3), and outputs the data output of the recognized address. Start (timing C4). On the other hand, the semiconductor device 102 reads the first and second data strings from the timing C6 in order to perform the process of outputting the address until the timing C5. As a result, in the timing charts T531 to T533, the semiconductor device 102 acquires information in which the first value is 00h, the second value is BCh, and the count value is 3, for both the first and second data string information.
The first data string information obtained in the timing charts T531, T532, and T533 and the two second data string information all match.

図17Dに示す、タイミングチャートT534では、第1アドレス0000FF00hのビット16を反転して得た第2アドレス0x0001FF00を用いて、シリアルメモリ101のデータ列情報を取得する。
このとき、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と上位2バイトのアドレス0001h(タイミングC2〜C3)とを認識し、該当アドレスのデータ出力を開始(タイミングC4)する。
ここで、半導体装置102は、タイミングC6からのデータ列を読み出し、第1の値が00h、第2の値がBCh、カウント値が2となるさらに新たな第2データ列情報を取得する。
タイミングチャートT531及びT534で得られた第1及び第2データ列情報は、一致しない。
この結果から、接続されたシリアルメモリのアドレスバイト数は、2であると判断する。
なお、半導体装置102から出力されるアドレスについて、タイミングチャートT533における最下位1バイトと、タイミングチャートT534における最下位2バイトとを、上述した説明ではゼロに設定した。しかし、シリアルメモリ101がこれらの値を参照することが無いため、任意の値でもよい。
In the timing chart T534 illustrated in FIG. 17D, the data string information of the serial memory 101 is acquired using the second address 0x0001FF00 obtained by inverting the bit 16 of the first address 0000FF00h.
At this time, the serial memory 101 recognizes the read instruction code (timing C1) input to the serial memory data input signal N103 and the upper 2 bytes of address 0001h (timing C2 to C3), and outputs the data output of the corresponding address. Start (timing C4).
Here, the semiconductor device 102 reads the data string from the timing C6, and acquires new second data string information in which the first value is 00h, the second value is BCh, and the count value is 2.
The first and second data string information obtained in the timing charts T531 and T534 do not match.
From this result, it is determined that the number of address bytes of the connected serial memory is 2.
For the address output from the semiconductor device 102, the least significant 1 byte in the timing chart T533 and the least significant 2 bytes in the timing chart T534 are set to zero in the above description. However, any value may be used because the serial memory 101 does not refer to these values.

最後に、半導体装置102へアドレスバイト数1のシリアルメモリ101を接続する場合を説明する。
シリアルメモリ101には、図14に示すデータが格納されている。
図18A〜18Dに示す、タイミングチャートT541、T542、T543及びT544おいては、シリアルメモリのアドレスバイト数が1である。従って、シリアルメモリ101は、シリアルメモリ用データ入力信号N103に入力された読み出し命令コード(タイミングC1)と上位1バイトのアドレス00h(タイミングC2)とを認識し、認識したアドレスのデータ出力を開始(タイミングC3)する。一方、半導体装置102は、タイミングC5までは、アドレスを出力する処理を実施するため、タイミングC6から第1及び第2データ列を読み出す。その結果、タイミングチャートT541〜T544において、半導体装置102は、第1及び第2データ列情報ともに、第1の値が00h、第2の値がBCh、カウント値が2となる情報を取得する。
タイミングチャートT541〜T544で得られる第1データ列情報と、三つの第2データ列情報とは、一致する。
Finally, a case where the serial memory 101 having the address byte number 1 is connected to the semiconductor device 102 will be described.
The serial memory 101 stores data shown in FIG.
In the timing charts T541, T542, T543, and T544 shown in FIGS. 18A to 18D, the number of address bytes of the serial memory is one. Accordingly, the serial memory 101 recognizes the read instruction code (timing C1) and the upper 1 byte address 00h (timing C2) input to the serial memory data input signal N103, and starts outputting data of the recognized address ( Timing C3). On the other hand, the semiconductor device 102 reads the first and second data strings from the timing C6 in order to perform the process of outputting the address until the timing C5. As a result, in the timing charts T541 to T544, the semiconductor device 102 acquires information in which the first value is 00h, the second value is BCh, and the count value is 2, for both the first and second data string information.
The first data string information obtained from the timing charts T541 to T544 matches the three second data string information.

この結果から、接続されたシリアルメモリのアドレスバイト数は、1であると判断する。
なお、半導体装置102から出力されるアドレスについて、タイミングチャートT543における最下位1バイトと、タイミングチャートT544における最下位2バイトとを、上述した説明ではゼロに設定した。しかし、シリアルメモリ101がこれらの値を参照することが無いため、任意の値でもよい。
From this result, it is determined that the number of address bytes of the connected serial memory is 1.
For the address output from the semiconductor device 102, the least significant 1 byte in the timing chart T543 and the least significant 2 bytes in the timing chart T544 are set to zero in the above description. However, any value may be used because the serial memory 101 does not refer to these values.

* 実施形態1のメカニズムおよび効果
以上説明したとおり、本実施形態のアドレスバイト数判定装置及び方法を用いると、シリアルメモリ101に格納されている既存のデータを読み出すことによって、シリアルメモリ101のアドレスバイト数を判定する。これは、シリアルメモリ101のアドレスバイト数の判定に、既知の判定用データをシリアルメモリ101に書き込むことを必要としない。これにより、マスクROMやプロテクト済みの書込み不能なシリアルメモリであってもアドレスバイト数を判定するという有利な効果を生じる。
また、シリアルメモリ101への判定用データの書き込みが不要であるので、シリアルメモリ101に格納されていたデータを破壊しない効果も生じる。
さらに、シリアルメモリ101への判定用のデータを書き込みが不要であるので、書き込みが遅いNOR型FLASHやEEPROM等であっても、アドレスバイト数の判定時間が延びない効果も生じる。
また、本実施形態のアドレスバイト数判定装置では、プルアップ抵抗によって与えられるシリアルデータ出力信号の常時電位を利用せずに、シリアルメモリから出力されるデータのみを用いてアドレスバイト数の判定を行う。これにより、ノイズ耐性が高く、またシリアルデータ出力信号の常時電位をハイ・レベルに保つプルアップ抵抗が不要となる効果も生じる。
* Mechanism and Effect of First Embodiment As described above, when the apparatus and method for determining the number of address bytes according to this embodiment are used, the address bytes of the serial memory 101 are read by reading the existing data stored in the serial memory 101. Determine the number. This does not require writing known determination data to the serial memory 101 for determining the number of address bytes of the serial memory 101. This produces an advantageous effect of determining the number of address bytes even in a mask ROM or a protected non-writable serial memory.
In addition, since it is not necessary to write the determination data to the serial memory 101, there is an effect that the data stored in the serial memory 101 is not destroyed.
Further, since it is not necessary to write determination data to the serial memory 101, an effect that the determination time of the number of address bytes does not increase even if the writing is slow, such as NOR type FLASH, EEPROM, or the like, also occurs.
Further, in the address byte number determination device according to the present embodiment, the address byte number is determined using only the data output from the serial memory without using the constant potential of the serial data output signal given by the pull-up resistor. . As a result, noise immunity is high, and an effect of eliminating the need for a pull-up resistor that maintains the constant potential of the serial data output signal at a high level.

実施形態2.
実施形態2では、メモリコントローラ型のシリアルメモリインタフェースを用いる半導体装置へ一実施形態のアドレスバイト数判定装置を搭載する場合のシステムの一態様を説明する。
* 実施形態2の構成
図19は、実施形態2における、アドレスバイト数判定装置を搭載する半導体装置のシステム構成例を示す図である。実施形態2のシステム構成例は、シリアルメモリ101と、一実施形態のアドレスバイト数判定装置を搭載する半導体装置401とで構成される。半導体装置401は、シリアルメモリ101と外部接続する。
半導体装置401は、クロック生成モジュール103、CPU104、RAM106、アドレスバイト数検出モジュール108、SPIメモリ・コントローラ・モジュール402、インバータ403、及び、SPI信号切り替えモジュール110で構成される。
SPIメモリ・コントローラ・モジュール402は、システムバスN115に接続されたバススレーブであり、ホールド要求信号N405と、アドレスバイト数検出結果信号N114と、SPI入出力用データ出力信号N404とを受け、SPI入出力用デバイス選択信号N401と、SPI入出力用クロック信号N402と、SPI入出力用データ入力信号N403とを出力する。SPIメモリ・コントローラ・モジュール402は、メモリバイト数が検出された後、シリアルメモリ101とのデータの入出力を制御する機能を担う。
インバータ403は、アドレスバイト数検出完了信号N113を受け、ホールド要求信号N405を出力する。
図4と同じ符号の構成要素は同様であるため、説明を省略する。
Embodiment 2. FIG.
In the second embodiment, an aspect of a system in the case where the address byte number determination device of one embodiment is mounted on a semiconductor device using a memory controller type serial memory interface will be described.
* Configuration of Second Embodiment FIG. 19 is a diagram illustrating a system configuration example of a semiconductor device in which an address byte number determination device according to the second embodiment is mounted. The system configuration example of the second embodiment includes a serial memory 101 and a semiconductor device 401 on which the address byte number determination device of one embodiment is mounted. The semiconductor device 401 is externally connected to the serial memory 101.
The semiconductor device 401 includes a clock generation module 103, a CPU 104, a RAM 106, an address byte count detection module 108, an SPI memory controller module 402, an inverter 403, and an SPI signal switching module 110.
The SPI memory controller module 402 is a bus slave connected to the system bus N115, and receives the hold request signal N405, the address byte count detection result signal N114, and the SPI input / output data output signal N404, and receives the SPI input. An output device selection signal N401, an SPI input / output clock signal N402, and an SPI input / output data input signal N403 are output. The SPI memory controller module 402 has a function of controlling data input / output with the serial memory 101 after the number of memory bytes is detected.
Inverter 403 receives address byte count detection completion signal N113 and outputs hold request signal N405.
Since the components with the same reference numerals as those in FIG. 4 are the same, the description thereof is omitted.

* 実施形態2の動作
図19で説明した半導体装置401の動作を、図20のフローチャートを用いて説明する。
図19のシステムに電源が投入されると(ステップS701)、半導体装置401では、クロック生成モジュール103は、リセット信号N117をアサートするとともに(ステップS702)、クロック信号N116にクロックの出力を開始する。リセット信号N117がアサートされたことにより、アドレスバイト数検出モジュール108は、アドレスバイト数検出完了信号N113をデアサート状態に初期化する。さらに、インバータ403は、アドレスバイト数検出完了信号N113がデアサートされると、ホールド要求信号N405をアサートする。
そして、クロック生成モジュール103は、所定時間経過後に、リセット信号N117をデアサートする(ステップS703)。
リセット信号N117がデアサートされると、CPU104は、ブート処理を開始する(ステップS704)。一方、アドレスバイト数検出モジュール108では、リセット信号N117がデアサートされたことにより、アドレスバイト数を判定する処理を開始する。
そして、CPU104は、命令コード取得のために、システムバスN115経由でSPIメモリ・コントローラ・モジュール402に対するリードアクセスを開始する(ステップS705)
この時、アドレスバイト数検出モジュール108は、アドレスバイト数の検出が完了していないため、アドレスバイト数検出完了信号N113は、デアサートされ、またホールド要求信号N405は、アサートされた状態である。
SPIメモリ・コントローラ・モジュール402は、ホールド要求信号N405がアサートされているため(ステップS706、NO)、シリアルメモリのバス・サイクル発行を保留し、CPU104からのアクセス要求をウエイト状態に保つ。
* Operation of Second Embodiment The operation of the semiconductor device 401 described with reference to FIG. 19 will be described with reference to the flowchart of FIG.
When the system of FIG. 19 is turned on (step S701), in the semiconductor device 401, the clock generation module 103 asserts the reset signal N117 (step S702) and starts outputting the clock to the clock signal N116. When the reset signal N117 is asserted, the address byte number detection module 108 initializes the address byte number detection completion signal N113 to a deasserted state. Further, when address byte count detection completion signal N113 is deasserted, inverter 403 asserts hold request signal N405.
Then, the clock generation module 103 deasserts the reset signal N117 after a predetermined time has elapsed (step S703).
When the reset signal N117 is deasserted, the CPU 104 starts a boot process (step S704). On the other hand, the address byte count detection module 108 starts processing for determining the address byte count when the reset signal N117 is deasserted.
Then, the CPU 104 starts read access to the SPI memory controller module 402 via the system bus N115 to acquire the instruction code (step S705).
At this time, since the address byte count detection module 108 has not detected the address byte count, the address byte count detection completion signal N113 is deasserted, and the hold request signal N405 is asserted.
Since the hold request signal N405 is asserted (step S706, NO), the SPI memory controller module 402 suspends the serial memory bus cycle issuance and keeps the access request from the CPU 104 in the wait state.

その後、アドレスバイト数検出モジュール108は、接続されたシリアルメモリ101のアドレスバイト数の検出を完了すると、アドレスバイト数検出結果信号N114に検出したアドレスバイト情報を出力し、アドレスバイト数検出完了信号N113をアサートする。
インバータ403は、アドレスバイト数検出完了信号N113がアサートされたため、ホールド要求信号N405をデアサートする。
SPIメモリ・コントローラ・モジュール402は、ホールド要求信号N405がデアサートされると(ステップS706、YES)、保留していたシリアルメモリのバス・サイクルを開始する(ステップS707)。この時、シリアルメモリのバス・サイクルは、アドレスバイト数検出結果信号N114で示されるアドレスバイト数に従って組み立てられ、CPU104からのアクセス要求に対応したデータが取得される。
SPIメモリ・コントローラ・モジュール402は、CPU104からのアクセス要求に対応したデータをシステムバスN115に出力し、ウエイトを解除してCPU104からのアクセスを完了させる(ステップS708)。
以降、SPIメモリ・コントローラ・モジュール402は、CPU104からのアクセス要求に応じ、シリアルメモリ101からデータを取得した値をシステムバスN115に出力する。
Thereafter, when the detection of the number of address bytes of the connected serial memory 101 is completed, the address byte number detection module 108 outputs the detected address byte information to the address byte number detection result signal N114, and the address byte number detection completion signal N113. Is asserted.
The inverter 403 deasserts the hold request signal N405 because the address byte count detection completion signal N113 is asserted.
When the hold request signal N405 is deasserted (YES in step S706), the SPI memory controller module 402 starts a serial memory bus cycle that has been suspended (step S707). At this time, the bus cycle of the serial memory is assembled according to the number of address bytes indicated by the address byte number detection result signal N114, and data corresponding to the access request from the CPU 104 is acquired.
The SPI memory controller module 402 outputs data corresponding to the access request from the CPU 104 to the system bus N115, releases the wait, and completes the access from the CPU 104 (step S708).
Thereafter, in response to an access request from the CPU 104, the SPI memory controller module 402 outputs a value obtained from the serial memory 101 to the system bus N115.

* 実施形態2の効果
メモリコントローラ型のシリアルメモリインタフェースであっても、実施形態1で説明した周辺I/O型のシリアルメモリインタフェースと同様に、判定用データをシリアルメモリ101へ書き込まないで、アドレスバイト数の検出を行うことが出来る。
* Effects of the second embodiment Even in the case of a memory controller type serial memory interface, as in the peripheral I / O type serial memory interface described in the first embodiment, the address is not written to the serial memory 101 without determining data. The number of bytes can be detected.

実施形態3.
上記各実施形態では、第1アドレスの特定ビットを判定させて第2アドレスを生成するときに、特定ビットを一つとして説明したが、これに限られることはない。例えば、一つのアドレス部位うちのの二つのビットを判定させることを排除するものではない。
さらに、上記各実施形態では、第2アドレスの特定ビットを、1番目から最大バイト数までの複数のアドレス部位のうち、最大バイト数のアドレス部位の最下位ビットから一つずつ上位のアドレス部位の最下位ビットへ順番に移動している動作例を説明した。しかし、これに限られるわけではない。例えは、2番目のアドレス部位から順番に最大バイト数までのアドレス部位の最下位ビット(または最下位ビットを含む複数のビット)を反転し、各アドレス部位の有効・無効を判別した後、アドレスバイト数を判定する手順であってもよい。この場合には、第1データ列情報と第2データ列情報との比較結果が不一致であること、かつ、他の上位のアドレス部位の有効である場合に、アドレスバイト数を判定する。加えて、比較結果が一致であり、2番目から最大バイト数までのアドレス部位が無効である場合には、アドレスバイト数を1と判定する。動作例は、図1,3を参照して説明した動作と同様であるため、ここでは説明を省略する。
Embodiment 3. FIG.
In each of the above embodiments, when the specific address of the first address is determined to generate the second address, the specific bit is described as one. However, the present invention is not limited to this. For example, it does not exclude that two bits of one address part are determined.
Further, in each of the above embodiments, the specific bit of the second address is assigned to the upper address part one by one from the least significant bit of the address part of the maximum number of bytes among the plurality of address parts from the first to the maximum number of bytes. An example of operation that moves to the least significant bit in order has been described. However, it is not limited to this. For example, the least significant bit (or a plurality of bits including the least significant bit) of the address part in order from the second address part up to the maximum number of bytes is inverted to determine the validity / invalidity of each address part, and then the address It may be a procedure for determining the number of bytes. In this case, the number of address bytes is determined when the comparison result between the first data string information and the second data string information is inconsistent and the other upper address part is valid. In addition, when the comparison result is coincident and the address part from the second to the maximum number of bytes is invalid, the number of address bytes is determined as 1. An example of the operation is the same as the operation described with reference to FIGS.

実施形態4.
上記各実施形態で説明したアドレスバイト数判定装置及び方法、例えば、図5のアドレスバイト数検出モジュール108は、ハードウェアで実現する場合に限られるものではなく、ソフトウェアや、組み込みシステムのように、ハードウェアとソフトウェアとの組合せにより実現してもよい。ハードウェア、ファームウェア、ソフトウェアのいずれか、あるいは、これらの二つ以上の組合せにより実現してもよい。
例えば、アドレス数判定方法は、コンピュータに各処理を実行させるプログラムによって実現することができる。プログラムは、例えば、少なくとも次の各処理をコンピュータに実行させる。
Embodiment 4 FIG.
The address byte count determination apparatus and method described in each of the above embodiments, for example, the address byte count detection module 108 in FIG. 5 is not limited to being realized by hardware. It may be realized by a combination of hardware and software. It may be realized by any one of hardware, firmware, software, or a combination of two or more thereof.
For example, the address number determination method can be realized by a program that causes a computer to execute each process. For example, the program causes the computer to execute at least the following processes.

(1)シリアルメモリのアドレスの最大バイト数を仮定し、最大バイト数を有する第1アドレスをシリアルメモリへ出力する処理。
(2)第1アドレスの出力に応じて、第1データ列として、最初に取得する第1先頭データ値から、前記第1先頭データ値と異なる第1末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出す処理。
(3)第1アドレスの特定ビットを反転した第2アドレスをシリアルメモリへ出力する処理。
(4)第2アドレスの出力に応じて、第2データ列として、最初に取得する第2先頭データ値から、第2先頭データ値と異なる第2末尾データ値が検出されるまでのデータ列をシリアルメモリから読み出す処理。
(5)第1データ列と第2データ列とを比較する処理。
(6)第1データ列と第2データ列とが不一致であることを検出すると、特定ビットを含むアドレス部位に基づいて前記シリアルメモリのアドレスバイト数を判定する処理。
これらの処理は、図3を参照して説明した動作と同様であり、また、図8A〜10Bが具体的な動作の一例となるため、詳細な説明を省略する。
(1) A process of outputting the first address having the maximum number of bytes to the serial memory assuming the maximum number of bytes of the address of the serial memory.
(2) A data string from the first head data value acquired first as a first data string until a first tail data value different from the first head data value is detected according to the output of the first address Is read from the serial memory.
(3) A process of outputting the second address obtained by inverting the specific bit of the first address to the serial memory.
(4) According to the output of the second address, as the second data string, a data string from the first head data value acquired first until a second tail data value different from the second head data value is detected Processing to read from serial memory.
(5) Processing for comparing the first data string and the second data string.
(6) A process of determining the number of address bytes of the serial memory based on an address part including a specific bit when it is detected that the first data string and the second data string do not match.
These processes are the same as the operations described with reference to FIG. 3, and FIGS. 8A to 10B are examples of specific operations, and thus detailed description thereof is omitted.

また、プログラムは、例えば、図21に示す半導体装置801内で実行させることができる。図21の構成例は、図4に示す半導体装置102から、汎用入出力ポート107、アドレスバイト数検出モジュール108、SPI信号切り替えモジュール110を除いた構成である。加えて、クロックド・シリアル・インタフェース・モジュール109は、シリアルメモリ101と直接接続されるように構成される。
半導体装置801では、プログラムは、ROM105に格納され、電源がONになると、ROM105からプログラムが読み出される。プログラムは、CPU104の制御のもとで、実行される。プログラムは、クロックド・シリアル・インタフェース・モジュール109によって、シリアルメモリ101との入出力を実施する。
図21の構成例では、半導体装置801に示すように、一般的な半導体装置の構成に特別な回路を追加することなく、プログラムをROM105に組み込むことによって、一実施形態のアドレスバイト数判定方法を実施することが可能になる。
Further, the program can be executed, for example, in the semiconductor device 801 shown in FIG. The configuration example of FIG. 21 is a configuration in which the general-purpose input / output port 107, the address byte count detection module 108, and the SPI signal switching module 110 are removed from the semiconductor device 102 shown in FIG. In addition, the clocked serial interface module 109 is configured to be directly connected to the serial memory 101.
In the semiconductor device 801, the program is stored in the ROM 105, and when the power is turned on, the program is read from the ROM 105. The program is executed under the control of the CPU 104. The program performs input / output with the serial memory 101 by the clocked serial interface module 109.
In the configuration example of FIG. 21, as shown in the semiconductor device 801, the address byte count determination method according to the embodiment is implemented by incorporating a program into the ROM 105 without adding a special circuit to the configuration of a general semiconductor device. It becomes possible to carry out.

さらに、上述の例において、プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(Random Access Memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。   Further, in the above example, the program can be stored using various types of non-transitory computer readable media and supplied to the computer. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / W, semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (Random Access Memory)) are included. The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.

上記各実施形態で説明したように、一実施形態のアドレスバイト数判定装置及び方法は、次の処理を実行する。
SPIに準拠した不揮発性シリアルメモリのアドレスバイト数の判定方法であって、想定される最大のアドレスバイト数を仮定して、第1アドレスからシリアルメモリの読み出しサイクルを開始し、少なくとも1回のデータ変化を含む第1データ列(第1のバイト列データ)を取得すること。想定される最大のアドレスバイト数を仮定して、第1アドレスの特定ビットを反転して得られる第2アドレスからシリアルメモリの読み出しサイクルを開始し、少なくとも1回のデータ変化を含む第2データ列(第2のバイト列データ)を取得すること。第1データ列と第2データ列を比較すること。比較結果が一致する場合には、特定ビットを含むアドレス部位が有効であると判断し、一致しない場合には、特定ビットを含むアドレス部位が無効であると判断すること。
このような各処理を実行することにより、シリアルメモリに判定用データを書き込むことなく、シリアルメモリのアドレスバイト数を判定する。これにより、書き換え不能な不揮発性シリアルメモリに対するアドレスバイト数の自動判定が可能となる。
As described in the above embodiments, the apparatus and method for determining the number of address bytes according to an embodiment performs the following processing.
A method for determining the number of address bytes of a non-volatile serial memory compliant with SPI, assuming a maximum possible number of address bytes, starting a read cycle of the serial memory from the first address, and at least one data Obtaining a first data string (first byte string data) including a change. Assuming the maximum possible number of address bytes, the second data string including at least one data change is started by starting a read cycle of the serial memory from the second address obtained by inverting the specific bit of the first address. Obtain (second byte string data). Comparing the first data string and the second data string; When the comparison results match, it is determined that the address part including the specific bit is valid, and when the result does not match, it is determined that the address part including the specific bit is invalid.
By executing each of these processes, the number of address bytes in the serial memory is determined without writing determination data in the serial memory. This makes it possible to automatically determine the number of address bytes for a non-rewritable nonvolatile serial memory.

以上、本発明者によってなされた発明を実施形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

101 シリアルメモリ
102、401、801 半導体装置
103 クロック生成モジュール
104 CPU
105 ROM
106 RAM
107 汎用入出力ポート
108 アドレスバイト数検出モジュール
109 クロックド・シリアル・インタフェース・モジュール
110 SPI信号切り替えモジュール
201 シリアル転送クロック生成モジュール
202 シーケンス制御モジュール
203 バイト選択モジュール
204 ビット反転制御モジュール
205 パラレル/シリアル変換モジュール
206 ANDゲート
207 シリアル/パラレル変換モジュール
208、209、210、211 1バイト・レジスタ
212、213 カウンタ
214、215,216,217,218 比較器
219 ANDゲート
301,302,303 セレクタ
304、305 バッファ
402 SPIメモリ・コントローラ・モジュール
403 インバータ
N101 シリアルメモリ用デバイス選択信号
N102 シリアルメモリ用クロック信号
N103 シリアルメモリ用データ入力信号
N104 シリアルメモリ用データ出力信号
N105 アドレスバイト数検出用デバイス選択信号
N106 アドレスバイト数検出用クロック信号
N107 アドレスバイト数検出用データ入力信号
N108 アドレスバイト数検出用データ出力信号
N109 SPI入出力用デバイス選択信号
N110 SPI入出力用クロック信号
N111 SPI入出力用データ入力信号
N112 SPI入出力用データ出力信号
N113 アドレスバイト数検出完了信号
N114 アドレスバイト数検出結果信号
N115 システムバス
N116 バスのクロック信号
N117 バスのリセット信号
N201 シリアル転送クロック信号
N202 アドレスバイト数検出用アドレス信号
N203 アドレスバイト数検出用命令コード
N204 出力バイトデータ選択信号
N205 出力バイトデータ
N206 ビット反転制御信号
N207 ビット反転制御済みアドレス
N208 データ更新制御信号
N209 クロック出力許可信号
N210 受信データ
N211 受信データキャプチャ制御信号
N212 受信データキャプチャ制御信号
N213 受信データキャプチャ制御信号
N214 受信データキャプチャ制御信号
N215 キャプチャ済み受信データ
N216 キャプチャ済み受信データ
N217 キャプチャ済み受信データ
N218 キャプチャ済み受信データ
N219 カウンタ初期化信号
N220 カウントクロック
N221 カウンタ初期化信号
N222 カウントクロック
N223 カウント結果
N224 カウント結果
N225、N226、N227、N228、N229 比較結果出力信号
N230 比較結果出力信号
N401 SPI入出力用デバイス選択信号
N402 SPI入出力用クロック信号
N403 SPI入出力用データ入力信号
N404 SPI入出力用データ出力信号
N405 ホールド要求信号
101 Serial Memory 102, 401, 801 Semiconductor Device 103 Clock Generation Module 104 CPU
105 ROM
106 RAM
107 General-purpose I / O port 108 Address byte count detection module 109 Clocked serial interface module 110 SPI signal switching module 201 Serial transfer clock generation module 202 Sequence control module 203 Byte selection module 204 Bit inversion control module 205 Parallel / serial conversion module 206 AND gate 207 Serial / parallel conversion module 208, 209, 210, 211 1 byte register 212, 213 Counter 214, 215, 216, 217, 218 Comparator 219 AND gate 301, 302, 303 Selector 304, 305 Buffer 402 SPI Memory controller module 403 Inverter N101 Serial memory device selection signal N 02 Serial memory clock signal N103 Serial memory data input signal N104 Serial memory data output signal N105 Address byte count detection device selection signal N106 Address byte count detection clock signal N107 Address byte count detection data input signal N108 Address byte count Detection data output signal N109 SPI input / output device selection signal N110 SPI input / output clock signal N111 SPI input / output data input signal N112 SPI input / output data output signal N113 Address byte count detection completion signal N114 Address byte count detection result signal N115 System bus N116 Bus clock signal N117 Bus reset signal N201 Serial transfer clock signal N202 Address byte number detection address signal N203 Address byte count detection instruction code N204 Output byte data selection signal N205 Output byte data N206 Bit inversion control signal N207 Bit inversion controlled address N208 Data update control signal N209 Clock output enable signal N210 Reception data N211 Reception data capture control signal N212 Reception data Capture control signal N213 Received data capture control signal N214 Received data capture control signal N215 Captured received data N216 Captured received data N217 Captured received data N218 Captured received data N219 Counter initialization signal N220 Count clock N221 Counter initialization signal N222 Count Clock N223 Count result N224 Count result N225, N226, N227, N228, N229 Comparison result output signal N230 Comparison result output signal N401 SPI input / output device selection signal N402 SPI input / output clock signal N403 SPI input / output data input signal N404 SPI input / output data output signal N405 Hold request signal

Claims (16)

シリアルメモリへアドレスを出力し、前記アドレスに応じて前記シリアルメモリから連続するデータ列を受け取るメモリ入出力部と、
前記シリアルメモリのアドレスの最大バイト数を仮定し、前記最大バイト数を有する第1アドレスを前記メモリ入出力部へ送り、その後、前記第1アドレスの特定ビットを反転した第2アドレスを前記メモリ入出力部へ送るアドレス生成部と、
前記シリアルメモリへの前記第1アドレスの出力に応じて、前記メモリ入出力部を介して最初に取得する第1先頭データ値から、前記第1先頭データ値と異なる第1末尾データ値が検出されるまでの第1データ列を取得する第1データ列取得部と、
前記シリアルメモリへの前記第2アドレスの出力に応じて、前記メモリ入出力部を介して最初に取得する第2先頭データ値から、前記第2先頭データ値と異なる第2末尾データ値が検出されるまでの第2データ列を取得する第2データ列取得部と、
前記第1データ列と前記第2データ列とが一致するか、不一致であるかを示す比較結果を出力する比較部と、
前記比較結果が不一致であることを検出すると、前記特定ビットを含むアドレス部位に基づいて前記シリアルメモリのアドレスバイト数を出力する制御部と、
を備えるアドレスバイト数判定装置。
A memory input / output unit that outputs an address to a serial memory and receives a continuous data string from the serial memory according to the address;
Assuming the maximum number of bytes of the address of the serial memory, the first address having the maximum number of bytes is sent to the memory input / output unit, and then the second address obtained by inverting the specific bit of the first address is input to the memory. An address generation unit to be sent to the output unit;
In response to the output of the first address to the serial memory, a first tail data value different from the first head data value is detected from the first head data value first obtained through the memory input / output unit. A first data string acquisition unit for acquiring a first data string until
In response to the output of the second address to the serial memory, a second tail data value different from the second head data value is detected from the second head data value first obtained through the memory input / output unit. A second data string acquisition unit for acquiring a second data string until
A comparison unit that outputs a comparison result indicating whether the first data string and the second data string match or not; and
When detecting that the comparison result does not match, a control unit that outputs the number of address bytes of the serial memory based on an address portion including the specific bit;
A device for determining the number of address bytes.
前記制御部は、前記比較結果が一致を示す場合、前記特定ビットを異なる位置に変更した前記第2アドレスを前記メモリ入出力部へ送るように、前記アドレス生成部を制御し、
前記第2データ列取得部は、前記シリアルメモリへの前記第2アドレスの新たな出力に応じて、前記第2データ列を取得し、
前記比較部は、前記第2データ列取得部が前記第2データ列を新たに取得すると、前記比較結果を更新するように構成されていることを特徴とする請求項1記載のアドレスバイト数判定装置。
The control unit controls the address generation unit to send the second address in which the specific bit is changed to a different position to the memory input / output unit when the comparison result indicates a match;
The second data string acquisition unit acquires the second data string in response to a new output of the second address to the serial memory,
2. The address byte count determination according to claim 1, wherein the comparison unit is configured to update the comparison result when the second data string acquisition unit newly acquires the second data string. apparatus.
前記第1アドレスが1番目から最大バイト数までのアドレス部位からなるとすると、
前記アドレス生成部は、前記第2アドレスの最初の特定ビットを最大バイト数のアドレス部位の最下位ビットとし、その後に生成する第2アドレスの特定ビットを、一つ前に生成した第2アドレスの特定ビットを含むアドレス部位より一つ上位のアドレス部位の最下位ビットとすることを特徴とする請求項2記載のアドレスバイト数判定装置。
If the first address consists of the first to the maximum number of bytes,
The address generation unit sets the first specific bit of the second address as the least significant bit of the address portion of the maximum number of bytes, and then generates the specific bit of the second address generated after that of the second address generated immediately before 3. The address byte number determination apparatus according to claim 2, wherein the least significant bit of the address part one higher than the address part including the specific bit is used.
前記アドレス生成部は、前記第1アドレスの1番目から最大バイト数までのいずれかのアドレス部位の最下位ビットを前記特定ビットとすることを特徴とする請求項2記載のアドレスバイト数判定装置。   3. The address byte number determination apparatus according to claim 2, wherein the address generation unit uses the least significant bit of any address part from the first to the maximum number of bytes of the first address as the specific bit. 前記制御部は、前記比較結果が不一致である場合には、前記アドレスバイト数が、1番目から前記特定ビットを含むアドレス部位までのバイト数であると判定することを特徴とする請求項3記載のアドレスバイト数判定装置。   4. The control unit according to claim 3, wherein when the comparison result does not match, the control unit determines that the number of address bytes is the number of bytes from the first to the address part including the specific bit. Address byte number determination device. 前記制御部は、前記比較結果が一致であり、かつ、前記特定ビットが2番目のアドレス部位である場合には、前記アドレスバイト数が、1バイトであると判定することを特徴とする請求項3記載のアドレスバイト数判定装置。   The control unit, when the comparison result is coincident and the specific bit is a second address part, determines that the number of address bytes is 1 byte. 3. The address byte count determination device according to 3. 前記制御部は、前記アドレスバイト数が判定可能となるまで、前記特定ビットを異なる位置に変更した前記第2アドレスを前記メモリ入出力部へ送ることを繰り返すように、前記アドレス生成部を制御することを特徴とする請求項2乃至6のいずれか一項に記載のアドレスバイト数判定装置。   The control unit controls the address generation unit to repeatedly send the second address in which the specific bit is changed to a different position to the memory input / output unit until the number of address bytes can be determined. The address byte number determination apparatus according to any one of claims 2 to 6, 前記第1データ列取得部は、前記第1データ列として、前記第1先頭データ値、前記第1末尾データ値、及び、前記第1データ列の長さを示す第1データ長を含む第1データ列情報を保持し、
前記第2データ列取得部は、前記第2データ列として、前記第2先頭データ値、前記第2末尾データ値、及び、前記第2データ列の長さを示す第2データ長を含む第2データ列情報を保持し、
前記比較部は、前記第1データ列情報及び前記第2データ列情報の各要素のすべてが一致する場合には、前記比較結果を一致とし、いずれかの要素が不一致である場合には、前記比較結果を不一致とすることを特徴とする請求項1記載のアドレスバイト数判定装置。
The first data string acquisition unit includes, as the first data string, a first data value indicating a length of the first data string, a first data value, and a first data value indicating a length of the first data string. Holds data column information,
The second data string acquisition unit includes, as the second data string, a second data length that includes the second head data value, the second tail data value, and a second data length indicating a length of the second data string. Holds data column information,
The comparison unit sets the comparison result to match when all the elements of the first data string information and the second data string information match, and when any element does not match, 2. The address byte number determination apparatus according to claim 1, wherein the comparison result is inconsistent.
前記第1データ列取得部は、前記第1先頭データ値を保持する第1レジスタ、前記第1末尾データ値を保持する第2レジスタ、前記第1レジスタが保持する値と前記第2レジスタが保持する値とを比較する第1比較器、及び、前記第1データ長をカウントする第1カウンタを備え、
前記第2データ列取得部は、前記第2先頭データ値を保持する第3レジスタ、前記第2末尾データ値を保持する第4レジスタ、前記第3レジスタが保持する値と前記第4レジスタが保持する値とを比較する第2比較器、及び、前記第2データ長をカウントする第2カウンタを備え、
前記制御部は、前記第1レジスタに前記第1先頭データ値を保持させ、前記第1比較器の出力が不一致を示すまで、前記第1データ列の2番目に取得する値から順番に前記第2レジスタに取り込むことによって前記第1末尾データ値を前記第2レジスタに保持させ、前記第3レジスタに前記第2先頭データ値を保持させ、前記第2比較器の出力が不一致を示すまで、前記第2データ列の2番目に取得する値から順番に前記第4レジスタに取り込むことによって前記第2末尾データ値を前記第4レジスタに保持させるように制御することを特徴とする請求項8記載のアドレスバイト数判定装置。
The first data string acquisition unit includes a first register that holds the first head data value, a second register that holds the first tail data value, a value held by the first register, and a second register A first comparator that compares a value to be measured, and a first counter that counts the first data length;
The second data string acquisition unit includes a third register that holds the second head data value, a fourth register that holds the second tail data value, a value held by the third register, and a fourth register A second comparator for comparing with a value to be performed, and a second counter for counting the second data length,
The control unit holds the first head data value in the first register, and sequentially outputs the first data value from the second value acquired in the first data string until the output of the first comparator indicates a mismatch. Until the second tail data value is held in the second register, the second head data value is held in the third register, and the output of the second comparator indicates a mismatch. 9. The control according to claim 8, wherein the second end data value is controlled to be held in the fourth register by taking the value into the fourth register in order from the second acquired value of the second data string. Address byte count determination device.
シリアルメモリのアドレスの最大バイト数を仮定し、前記最大バイト数を有する第1アドレスをシリアルメモリへ出力し、
前記第1アドレスの出力に応じて、第1データ列として、最初に取得する第1先頭データ値から、前記第1先頭データ値と異なる第1末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出し、
前記第1アドレスの特定ビットを反転した第2アドレスを前記シリアルメモリへ出力し、
前記第2アドレスの出力に応じて、第2データ列として、最初に取得する第2先頭データ値から、前記第2先頭データ値と異なる第2末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出し、
前記第1データ列と前記第2データ列とを比較し、
前記第1データ列と前記第2データ列とが不一致であることを検出すると、前記特定ビットを含むアドレス部位に基づいて前記シリアルメモリのアドレスバイト数を判定するアドレスバイト数判定方法。
Assuming the maximum number of bytes of the address of the serial memory, the first address having the maximum number of bytes is output to the serial memory,
According to the output of the first address, a data string from the first head data value acquired first to a first tail data value different from the first head data value is detected as the first data string. Read from serial memory,
A second address obtained by inverting a specific bit of the first address is output to the serial memory;
According to the output of the second address, a data string from the first leading data value acquired first to the second trailing data value different from the second leading data value is detected as the second data string. Read from serial memory,
Comparing the first data string and the second data string;
An address byte number determination method for determining the number of address bytes of the serial memory based on an address part including the specific bit when detecting that the first data string and the second data string do not match.
前記第1データ列と前記第2データ列とが一致する場合、前記特定ビットを異なる位置に変更した前記第2アドレスを前記シリアルメモリへ出力し、
前記第2アドレスの新たな出力に応じて、前記第2データ列を取得し、
前記第1データ列と、新たに取得した前記第2データ列とを比較し、
前記アドレスバイト数を判定するまで、前記シリアルメモリへ前記変更した前記第2アドレスの出力を繰り返すことを特徴とする請求項10記載のアドレスバイト数判定方法。
When the first data string and the second data string match, the second address in which the specific bit is changed to a different position is output to the serial memory,
In response to the new output of the second address, the second data string is acquired,
Comparing the first data string and the newly acquired second data string;
11. The address byte number determination method according to claim 10, wherein output of the changed second address to the serial memory is repeated until the address byte number is determined.
前記第1アドレスが1番目から最大バイト数までのアドレス部位からなるとすると、
前記第2アドレスの最初の特定ビットは、最大バイト数のアドレス部位の最下位ビットであり、
その後に生成する第2アドレスの特定ビットは、一つ前に生成した第2アドレスの特定ビットを含むアドレス部位より一つ上位のアドレス部位の最下位ビットであることを特徴とする請求項11記載のアドレスバイト数判定方法。
If the first address consists of the first to the maximum number of bytes,
The first specific bit of the second address is the least significant bit of the address part of the maximum number of bytes;
12. The specific bit of the second address generated thereafter is the least significant bit of the address portion one higher than the address portion including the specific bit of the second address generated immediately before. To determine the number of address bytes.
前記アドレスバイト数は、前記第1データ列と前記第2データ列とが不一致であることを検出した場合には、前記アドレスバイト数が、1番目から前記特定ビットを含むアドレス部位までのバイト数であると判定することを特徴とする請求項12記載のアドレスバイト数判定方法。   When it is detected that the first data string and the second data string do not match, the address byte number is the number of bytes from the first to the address part including the specific bit. 13. The method for determining the number of address bytes according to claim 12, wherein the number of address bytes is determined. 前記アドレスバイト数は、前記第1データ列と前記第2データ列とが一致し、かつ、前記特定ビットが2番目のアドレス部位である場合には、前記アドレスバイト数が、1バイトであると判定することを特徴とする請求項12または13記載のアドレスバイト数判定方法。   When the first data string and the second data string match and the specific bit is the second address part, the address byte number is 1 byte. 14. The method for determining the number of address bytes according to claim 12, wherein the determination is performed. コンピュータに、
シリアルメモリのアドレスの最大バイト数を仮定し、前記最大バイト数を有する第1アドレスをシリアルメモリへ出力する処理と、
前記第1アドレスの出力に応じて、第1データ列として、最初に取得する第1先頭データ値から、前記第1先頭データ値と異なる第1末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出す処理と、
前記第1アドレスの特定ビットを反転した第2アドレスを前記シリアルメモリへ出力する処理と、
前記第2アドレスの出力に応じて、第2データ列として、最初に取得する第2先頭データ値から、前記第2先頭データ値と異なる第2末尾データ値が検出されるまでのデータ列を前記シリアルメモリから読み出す処理と、
前記第1データ列と前記第2データ列とを比較する処理と、
前記第1データ列と前記第2データ列とが不一致であることを検出すると、前記特定ビットを含むアドレス部位に基づいて前記シリアルメモリのアドレスバイト数を判定する処理と、
を実行させるプログラム。
On the computer,
Assuming the maximum number of bytes of the address of the serial memory, a process of outputting the first address having the maximum number of bytes to the serial memory;
According to the output of the first address, a data string from the first head data value acquired first to a first tail data value different from the first head data value is detected as the first data string. Reading from serial memory,
A process of outputting a second address obtained by inverting a specific bit of the first address to the serial memory;
According to the output of the second address, a data string from the first leading data value acquired first to the second trailing data value different from the second leading data value is detected as the second data string. Reading from serial memory,
A process of comparing the first data string and the second data string;
When detecting that the first data string and the second data string do not match, a process of determining the number of address bytes of the serial memory based on an address portion including the specific bit;
A program that executes
シリアルメモリとのデータの入出力を制御するシリアルインタフェース部と、
請求項1乃至6、8、9のいずれか一項に記載のアドレスバイト数判定装置と、
前記シリアルインタフェース部と前記アドレスバイト数判定装置とを切り替えて、シリアルメモリと接続するスイッチ部と、を備える半導体集積装置。
A serial interface unit that controls input / output of data to / from the serial memory;
The address byte number determination device according to any one of claims 1 to 6, 8, and 9,
A semiconductor integrated device comprising: a switch unit that switches between the serial interface unit and the address byte number determination device and connects to a serial memory.
JP2012038512A 2012-02-24 2012-02-24 Address byte count determination device, address byte count determination method, program, and semiconductor device Pending JP2013175014A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012038512A JP2013175014A (en) 2012-02-24 2012-02-24 Address byte count determination device, address byte count determination method, program, and semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012038512A JP2013175014A (en) 2012-02-24 2012-02-24 Address byte count determination device, address byte count determination method, program, and semiconductor device

Publications (1)

Publication Number Publication Date
JP2013175014A true JP2013175014A (en) 2013-09-05

Family

ID=49267868

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012038512A Pending JP2013175014A (en) 2012-02-24 2012-02-24 Address byte count determination device, address byte count determination method, program, and semiconductor device

Country Status (1)

Country Link
JP (1) JP2013175014A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014078296A (en) * 2012-10-10 2014-05-01 Mitsubishi Electric Corp Memory inspection device, memory inspection method and memory inspection program
CN113448894A (en) * 2020-03-27 2021-09-28 株式会社村田制作所 Data communication device and data communication module

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014078296A (en) * 2012-10-10 2014-05-01 Mitsubishi Electric Corp Memory inspection device, memory inspection method and memory inspection program
CN113448894A (en) * 2020-03-27 2021-09-28 株式会社村田制作所 Data communication device and data communication module
CN113448894B (en) * 2020-03-27 2023-10-20 株式会社村田制作所 Data communication device and data communication module

Similar Documents

Publication Publication Date Title
US10592448B2 (en) Master-slave system, command execution method and data access method with use of serial peripheral interface (SPI)
US8769160B2 (en) Multi-interface memory card and method of operation
TW486668B (en) A single-chip data processing apparatus incorporating an electrically rewritable nonvolatile memory and method of operating the same
JP4901285B2 (en) Memory card that can improve read performance
JP4896450B2 (en) Storage device
US8103817B2 (en) Systems for accessing memory card and methods for accessing memory card by a control unit
JP5378360B2 (en) Automatic detection of memory page size
US20230004331A1 (en) Nand raid controller
US20140082267A1 (en) EMBEDDED MULTIMEDIA CARD (eMMC), HOST CONTROLLING eMMC, AND METHOD OPERATING eMMC SYSTEM
US20070288703A1 (en) Portable storage apparatus and method for freely changing data bus width
KR20150106524A (en) Semiconductor device and semiconductor system for conducting trainning method
CN109686391B (en) Nonvolatile memory device, method of operating the same, and nonvolatile memory package
CN109493910B (en) Microcontroller and operating method thereof and memory system having the same
EP1403814B1 (en) Electronic apparatus, information processing apparatus, adapter apparatus, and information exchange system
JP4588427B2 (en) Memory system and data transmission speed setting method between host and memory card
CN105843766B (en) Method and apparatus for configuring serial device
JP2013175014A (en) Address byte count determination device, address byte count determination method, program, and semiconductor device
US9760509B2 (en) Memory storage device and control method thereof and memory control circuit unit and module
TWI467579B (en) Electronic device, method for controlling memory thereof and associated computer-readable storage medium
CN106919343B (en) Peripheral interface circuit and peripheral memory system
JP2009252109A (en) Memory card control device
US20140372666A1 (en) Semiconductor device with configurable support for multiple command specifications, and method regarding the same
US10453072B2 (en) Electronic device having disassemble monitoring device
US11093421B2 (en) Operation device
US20220147469A1 (en) Method for managing an operation for modifying the stored content of a memory device, and corresponding memory device