BUS SWITCH, SIMULATION DEVICE, AND SIGNAL RELAY METHOD
A bus switch using an FPGA ensures sufficient signal processing time for slave devices in bidirectional communication by maintaining signal values, addressing the limitations of existing FPGA integration in synchronous systems and enhancing flexibility and efficiency.
Patent Information
- Application Number
- JP2020097830
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-06-04
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-06-04
AI Technical Summary
Existing methods for incorporating field programmable gate arrays (FPGAs) into bidirectional communication buses fail to ensure sufficient signal processing time for slave devices due to the inability to propagate high impedance states, leading to issues in clock stretching mechanisms in synchronous communication systems like I2C.
A bus switch that relays clock and data signals between devices, using a reprogrammable logic device like an FPGA, where the logical value of signals is maintained for a specific duration to ensure sufficient processing time for slave devices, even when the master device does not sense the clock stretching.
Secures sufficient signal processing time for slave devices, allowing flexible terminal assignments and connection relationships post-manufacture, reducing development time and costs, while maintaining bidirectional communication without interfering with clock stretching mechanisms.
Smart Images

Figure 0007557285000008 
Figure 0007557285000007 
Figure 0007557285000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a bus switch, a simulation device, and a signal relay method. [Background technology]
[0002] One advantage of implementing a bus switch that connects an integrated circuit (IC) to other circuit elements on a board as a reprogrammable logic device is that the assignment of IC terminals can be changed after the board is manufactured. Field programmable gate arrays (FPGAs) are a widely used example of a reprogrammable logic device. For example, by implementing a bus switch that connects CPUs as an FPGA, the assignment of CPU input / output terminals and the bus connection relationship can be changed even after the board is manufactured, according to the specifications of the program executed by the CPU. This makes it possible to start manufacturing the board before the CPU specifications are decided, which can contribute to shortening the product development period.
[0003] However, logic devices such as FPGAs cannot propagate a so-called high impedance state from one side of the logic device to the other side. A high impedance state refers to a state of a terminal that exhibits high resistance to an electric signal. A high impedance state is typically used to avoid collisions of signals that may be output to a bus from multiple devices connected to the bus. When an FPGA is incorporated into a bus for bidirectional communication, since a high impedance state cannot be propagated, it is necessary to avoid signal collisions by other methods. For example, Patent Document 1 proposes a method of appropriately switching the communication direction by analyzing a control signal on the bus and regulating the flow of signals based on the result of the judgment. Patent Document 2 proposes a method of converting a bidirectional bus into a unidirectional bus in a manner similar to that proposed by Patent Document 1, but the selection of the communication direction is based on a change in the logical value (pulling down from High to Low) at one end of the bus. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2013-105284 A [Patent Document 2] Japanese Patent Application Publication No. 56-42251 Summary of the Invention [Problem to be solved by the invention]
[0005] However, the methods proposed so far cause problems with clock stretching in synchronous communication methods such as the I2C communication method. Clock stretching is a mechanism in which a slave device, which processes a data signal according to a clock signal supplied from a master device, delays the progress of the clock by maintaining the state of the signal on the clock bus at a specific logical value. Clock stretching is often used to ensure that a slave device, which has inferior signal processing performance compared to a master device, has sufficient signal processing time. However, in the method proposed by Patent Document 2, the communication direction is determined when the master device pulls down the logical value from High to Low, and even if the slave device tries to maintain the logical value on the clock bus, the master device does not sense it. In the method proposed by Patent Document 1, it is assumed that the communication direction of the clock signal is from the master device to the slave device, and the master device does not sense the logical value of the clock bus on the slave side.
[0006] Therefore, an object of the present disclosure is to realize a mechanism that enables a device to have sufficient signal processing time, similar to clock stretching, when incorporating a logic device such as an FPGA into a bus for bidirectional communication. [Means for solving the problem]
[0007] According to one point of view, It is the master device First device and A slave device capable of clock stretchingA bus switch relaying a clock signal on a clock bus and a data signal on a data bus between the first device and a second device, comprising: a first signal processing means for monitoring a data signal on a first data bus connected to the first device and a data signal on a second data bus connected to the second device, and reflecting the logical value of a data signal on one of the data signals on the first data bus and the data signals on the second data bus, the logical value of which has changed first, in a data signal on the other data bus; The first device outputs and second signal processing means for reflecting the logical value of the clock signal in a clock signal on a second clock bus connected to the second device, the second signal processing means comprising: At least at the timing when the second device performs the clock stretching, When the logic value of the clock signal on the first clock bus changes from a first value to a second value, the logic values of both the clock signal on the first clock bus and the clock signal on the second clock bus are maintained at the second value for a certain length of time T. The time length T is preset as a time length longer than both half the period of the clock signal output from the first device and a possible maximum time length of the clock stretch by the second device. A bus switch is provided. Effect of the Invention
[0008] According to the present disclosure, when a logic device such as an FPGA is incorporated in a bus for bidirectional communication between two devices, it is possible to ensure sufficient signal processing time for the device. [Brief description of the drawings]
[0009] [Figure 1] FIG. 2 is a block diagram showing an example of the configuration of a bus switch according to the first embodiment. [Diagram 2] 5 is a flowchart showing an example of the flow of a data signal relay process according to the first embodiment. [Diagram 3] 4 is a timing chart showing a time series of changes in the logical value of a data signal in the first embodiment. [Figure 4] 5 is a flowchart showing an example of the flow of a clock signal relay process according to the first embodiment. [Diagram 5] 4 is a timing chart showing a time series of changes in the logical value of a clock signal in the first embodiment. [Figure 6] 10 is a flowchart showing an example of the flow of a clock signal relay process according to the second embodiment. [Figure 7] 10 is a timing chart showing a time series of changes in the logical value of a clock signal in the second embodiment. [Figure 8] FIG. 1 is a block diagram showing an example of a configuration of a simulation device according to an application example. [Figure 9] 9 is an explanatory diagram for explaining a paper transport path simulated in the application example of FIG. 8; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a number of features, not all of these features are essential to the invention, and the features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0011] <<1. First embodiment>> <1-1. Overview> In a first embodiment of the technology disclosed herein, a serial bus switch is implemented as an FPGA between two devices that perform bidirectional communication on one board. As an example, the bidirectional communication is performed according to an I2C (Inter-Integrated Circuit) communication method. In the I2C communication method, one or more slave devices can be connected to one master device, but for the sake of simplicity, in this embodiment, it is assumed that there is one slave device. The connection between the master device and the slave device is configured by two buses. One of the buses is a serial clock bus, which is also referred to as SCL below. The other is a serial data bus, which is also referred to as SDA below. The master device supplies a clock signal on SCL to the slave device. The data signal flowing on SDA is read at the rising edge of the clock signal (change from Low to High). The slave device starts communication when it reads an address assigned to itself from SDA, and receives a data signal from the master device in write mode and transmits a data signal to the master device in read mode according to the value of the control bit following the address. A slave device can force the logical value of the clock signal on SCL to be kept low to delay the progression of the clock in order to ensure time to process the data signal. This is called clock stretching.
[0012] In the following explanation, data signals refer to all signals that flow on the data bus (SDA). For example, the following signals that flow on the SDA in I2C communication are all included in the scope of "data signals": Starting conditions Slave address Read / write (R / W) request Information bits Acknowledgement (ACK) Stop Condition Repeated start condition
[0013] <1-2. Bus switch configuration example> FIG. 1 is a block diagram showing an example of the configuration of a bus switch according to the present embodiment. FIG. 1 shows an FPGA 101, a master device 102, and a slave device 103. The FPGA 101 is a bus switch as a reprogrammable logic device. The FPGA 101 relays a clock signal on a clock bus (SCL) and a data signal on a data bus (SDA) between the master device 102 and the slave device 103. The master device 102 is a device that operates as a master of I2C communication. The master device 102 outputs a clock signal to the clock bus for communication with the slave device 103. The slave device 103 is a device that operates as a slave of I2C communication. The slave device 103 acquires a data signal input from the data bus or outputs a data signal to the data bus according to a clock signal input from the clock bus. The master device 102 and the slave device 103 may be, for example, a CPU (Central Processing Unit) or other ICs (Integrated Circuits). The master device 102 and the slave device 103 may be the same type of device or different types of devices.
[0014] As shown in FIG. 1, the FPGA 101 includes an SCL bus switch 121 and an SDA bus switch 122. The SCL bus switch 121 is connected to the master device 102 via the master side SCL 106, and is connected to the slave device 103 via the slave side SCL 107. The SDA bus switch 122 is connected to the master device 102 via the master side SDA 110, and is connected to the slave device 103 via the slave side SDA 111. The master side SCL 106, the slave side SCL 107, the master side SDA 110, and the slave side SDA 111 are connected to a power supply via pull-up resistors 104, 105, 108, and 109, respectively. Due to the presence of these pull-up resistors, the signal levels of the master side SCL 106, the slave side SCL 107, the master side SDA 110, and the slave side SDA 111 are maintained at High during a period when no communication is being performed.
[0015] The FPGA 101 is further connected to the master device 102 via an auxiliary bus 151, and is connected to the slave device 103 via an auxiliary bus 152. After the FPGA 101 is mounted on the board, if a developer desires to change the assignment of terminals of the master device 102, the developer can reprogram the FPGA 101 to use, for example, the auxiliary bus 151 as the SCL or SDA on the master side. Similarly, if a developer desires to change the assignment of terminals of the slave device 103, the developer can reprogram the FPGA 101 to use, for example, the auxiliary bus 152 as the SCL or SDA on the slave side.
[0016] The SCL bus switch 121 includes an IO buffer 131 , an IO buffer 132 , and an SCL processing unit 133 .
[0017] The IO buffer 131 is a bus buffer for the master side clock signal. One end of the signal input / output of the IO buffer 131 is connected to the master device 102 via the master side SCL 106, and the other end is connected to the SCL processing unit 133 via the internal SCL 136. The control input of the IO buffer 131 is connected to the SCL processing unit 133 via a control input line 134. The IO buffer 131 enables the input of a signal from the master side SCL 106 to the internal SCL 136 while the control signal from the control input line 134 indicates Low, that is, enables a signal to flow from the master device 102 to the SCL processing unit 133. On the other hand, the IO buffer 131 does not flow a clock signal from the master device 102 to the SCL processing unit 133 while the control signal from the control input line 134 indicates High, and fixes the signal levels of the master side SCL 106 and the internal SCL 136 to Low.
[0018] The IO buffer 132 is a bus buffer for the slave side clock signal. One end of the signal input / output of the IO buffer 132 is connected to the slave device 103 via the slave side SCL 107, and the other end is connected to the SCL processing unit 133 via the internal SCL 137. The control input of the IO buffer 132 is connected to the SCL processing unit 133 via a control input line 135. The IO buffer 132 enables the input of a signal from the slave side SCL 107 to the internal SCL 137 while the control signal from the control input line 135 indicates Low, that is, enables a signal to flow from the slave device 103 to the SCL processing unit 133. On the other hand, the IO buffer 132 does not pass a signal from the slave device 103 to the SCL processing unit 133 while the control signal from the control input line 135 indicates High, and fixes the signal levels of the slave side SCL 107 and the internal SCL 137 to Low.
[0019] The SCL processing unit 133 is a signal processing means that controls the relay of the clock signal between the master device 102 and the slave device 103. In this embodiment, the SCL processing unit 133 reflects the logical value of the clock signal on the master side SCL 106 in the clock signal on the slave side SCL 107. However, when the logical value of the clock signal input via the internal SCL 136 changes from High to Low, the SCL processing unit 133 maintains the logical values of both the clock signals on the master side SCL 106 and the slave side SCL 107 at Low for a certain length of time T. Such control performed by the SCL processing unit 133 will be explained in more detail later.
[0020] The SDA bus switch 122 includes an IO buffer 141 , an IO buffer 142 , and an SDA processing unit 143 .
[0021] The IO buffer 141 is a bus buffer for a data signal on the master side. One end of the signal input / output of the IO buffer 141 is connected to the master device 102 via the master side SDA 110, and the other end is connected to the SDA processing unit 143 via the internal SDA 146. The control input of the IO buffer 141 is connected to the SDA processing unit 143 via a control input line 144. The IO buffer 141 enables the input of a signal from the master side SDA 110 to the internal SDA 146 while the control signal from the control input line 144 indicates Low, that is, enables a signal to flow from the master device 102 to the SDA processing unit 143. On the other hand, the IO buffer 141 does not pass a data signal from the master device 102 to the SDA processing unit 143 while the control signal of the control input line 144 indicates High, and fixes the signal levels of the master side SDA 110 and the internal SDA 146 to Low.
[0022] The IO buffer 142 is a bus buffer for slave-side data signals. One end of the signal input / output of the IO buffer 142 is connected to the slave device 103 via the slave-side SDA 111, and the other end is connected to the SDA processing unit 143 via the internal SDA 147. The control input of the IO buffer 142 is connected to the SDA processing unit 143 via a control input line 145. The IO buffer 142 enables the input of a signal from the slave-side SDA 111 to the internal SDA 147 while the control signal of the control input line 145 indicates Low, that is, enables a signal to flow from the slave device 103 to the SDA processing unit 143. On the other hand, the IO buffer 142 does not pass a signal from the slave device 103 to the SDA processing unit 143 while the control signal of the control input line 145 indicates High, and fixes the signal levels of the slave-side SDA 111 and the internal SDA 147 to Low.
[0023] The SDA processing unit 143 is a signal processing means that controls the relay of data signals between the master device 102 and the slave device 103. In this embodiment, the SDA processing unit 143 monitors the data signal input from the internal SDA 146 and the data signal input from the internal SDA 147. The SDA processing unit 143 then reflects the logical value of the data signal on one of the data buses that has changed logical value first among the data signals, on the data signal on the other data bus. Such control performed by the SDA processing unit 143 will be described in more detail later.
[0024] <1-3. Data bus relay control> Fig. 2 is a flowchart showing an example of the flow of the data signal relay process performed by the SDA processing unit 143 according to this embodiment. This data signal relay process can be described, for example, using some hardware description language (HDL) and configured as a logical function of the FPGA 101. Fig. 3 is a timing chart showing, in a time series, changes in the logical value of a data signal that can occur according to the data signal relay process shown in Fig. 2. In the following description, a processing step is abbreviated as S (step).
[0025] As already explained, during periods when no communication is taking place, such as immediately after powering on the device or between the end of the previous communication and the start of the next communication, the logical values of the master-side SDA 110 and the slave-side SDA 111 are High due to the contribution of pull-up resistors. In S201, the SDA processing unit 143 outputs a control signal indicating Low to the IO buffers 141 and 142, thereby enabling input and output of data signals on both the master and slave sides. The logical value of the signal input from the IO buffer 141 becomes the same as the logical value of the master-side SDA 110, and therefore becomes High. Similarly, the logical value of the signal input from the IO buffer 142 becomes the same as the logical value of the slave-side SDA 111, and therefore becomes High (from time T0 to T 11 to).
[0026] In S203a and S203b, the SDA processing unit 143 monitors the data signal from the master device 102, i.e., the logical value of the input from the IO buffer 141, and the data signal from the slave device 103, i.e., the logical value of the input from the IO buffer 142. Here, if the logical value of the data signal on the master side changes from High to Low first, the process proceeds to S205. On the other hand, if the logical value of the data signal on the slave side changes from High to Low first, the process proceeds to S211.
[0027] When a data signal is transmitted from the master device 102 to the slave device 103, the logical value of the data signal on the master side changes from High to Low first (at time T 11 In this case, in S205, the SDA processor 143 drives the slave side SDA 111 to Low by outputting a control signal indicating High to the IO buffer 142. In this way, the logical value of the data signal on the master side is reflected in the data signal on the slave side (at time T 12 ).
[0028] Next, in S207, the SDA processing unit 143 monitors the data signal from the master device 102, i.e., the logical value of the input from the IO buffer 141. When the logical value of the data signal on the master side returns from Low to High (time T 13 ), and in S209, the SDA processor 143 drives the slave side SDA 111 to High by outputting a control signal indicating Low to the IO buffer 142. In this way, the logical value of the data signal on the master side is reflected again in the data signal on the slave side (time T 14 ).
[0029] The process of FIG. 2 then returns to monitoring the data signals on both the master and slave sides in S203a and S203b.
[0030] When a data signal is transmitted from the slave device 103 to the master device 102, the logical value of the data signal on the slave side changes from High to Low first (at time T 21In this case, in S211, the SDA processor 143 drives the master side SDA 110 to Low by outputting a control signal indicating High to the IO buffer 141. In this way, the logical value of the data signal on the slave side is reflected in the data signal on the master side (time T 22 ).
[0031] Next, in S213, the SDA processing unit 143 monitors the data signal from the slave device 103, that is, the logical value of the input from the IO buffer 142. When the logical value of the data signal on the slave side returns from Low to High (time T 23 ), in S215, the SDA processor 143 drives the master side SDA 110 to High by outputting a control signal indicating Low to the IO buffer 141. In this way, the logical value of the data signal on the slave side is reflected again in the data signal on the master side (at time T 24 ).
[0032] The process of FIG. 2 then returns to monitoring the data signals on both the master and slave sides in S203a and S203b.
[0033] As described herein, the SDA bus switch 122 relays data signals between the master device 102 and the slave device 103, so that the master device 102 and the slave device 103 can transmit and receive data signals in both directions.
[0034] <1-4. Clock bus relay control> Fig. 4 is a flowchart showing an example of the flow of the clock signal relay process performed by the SCL processing unit 133 according to this embodiment. This clock signal relay process can be described, for example, using some hardware description language (HDL) and configured as a logical function of the FPGA 101. Fig. 5 is a timing chart showing, in time series, changes in the logical value of the clock signal that can occur according to the clock signal relay process shown in Fig. 4.
[0035] As with the SDA described above, during periods when no communication is taking place, the logical values of the master-side SCL 106 and the slave-side SCL 107 are High due to the contribution of pull-up resistors. In S401, the SCL processing unit 133 outputs a control signal indicating Low to the IO buffers 131 and 132, thereby enabling input and output of clock signals on both the master and slave sides. The logical value of the signal input from the IO buffer 131 becomes the same as the logical value of the master-side SCL 106, and therefore becomes High. Similarly, the logical value of the signal input from the IO buffer 132 becomes the same as the logical value of the slave-side SCL 107, and therefore becomes High (at time T in FIG. 5). 31 to).
[0036] In S403, the SCL processing unit 133 monitors the clock signal from the master device 102, that is, the logical value of the input from the IO buffer 131. When the logical value of the clock signal on the master side changes from High to Low, the process proceeds to S405 (time T 31 ).
[0037] When the logical value of the master side clock signal changes from High to Low, in S405, the SCL processing unit 133 outputs control signals indicating High in parallel to the IO buffer 131 and the IO buffer 132. As a result, both the master side SCL 106 and the slave side SCL 107 are driven to Low. In this way, the logical value of the master side clock signal is reflected in the slave side clock signal (at time T 32 ).
[0038] After that, in S407, the SCL processing unit 133 maintains the logical values of the clock signals on the master side SCL 106 and the slave side SCL 107 at Low by keeping the control signals to the IO buffer 131 and the IO buffer 132 at High for a certain time length T. The time length T can be preset as a time length that satisfies the condition of the following formula (1): T > max(Tm,Ts) (1)
[0039] In formula (1), Tm represents the maximum length of time that the master device 102 maintains the logical value of the clock signal on the master-side SCL 106 at low. Ts represents the maximum length of time that the slave device 103 maintains the logical value of the clock signal on the slave-side SCL 107 at low. Formula (1) represents the condition that the above-mentioned time length T is longer than both of the time lengths Tm and Ts.
[0040] The time length Tm may correspond to half the clock period set in the master device 102. The time length Ts may correspond to the maximum possible time length of clock stretching by the slave device 103. The values of Tm and Ts may be calculated in advance based on the specifications of the master device 102 and the slave device 103 and the specifications of the software running on these devices, and may be stored in the internal memory of the SCL processing unit 133.
[0041] As a result of S407, the master SCL 106 and the slave SCL 107 are driven low for a period of time T. 32 From T 35 The figure shows that the logical values of the master and slave clock signals are kept low until time T 32 Time T when a time length Tm has elapsed since 33 At this time, the master device 102 attempts to release the master side SCL 106, but the logical value of the master side SCL 106 is fixed to low by the IO buffer 131. Therefore, the master device 102 determines that the slave device 103 is performing clock stretching, and does not advance the clock. During this time, the slave device 103 continues processing the data signal, and may be performing clock stretching. However, the slave device 103 will not be able to process the data signal until time T 32 Time T when a time length Ts has elapsed since 34 It ends at.
[0042] Then, when the time length T has elapsed, the process in FIG. 4 returns to S401. The SCL processing unit 133 outputs a control signal indicating Low to the IO buffers 131 and 132, and the logical values of the clock signals on the master side SCL 106 and the slave side SCL 107 return to High (at time T in FIG. 5). 35 At this point, the clock signal input and output on the master and slave sides are re-enabled.
[0043] 5, the waveform of the master side SCL 106 and the waveform of the slave side SCL 107 are substantially identical, and the clock signal remains low for a period longer than the time length Ts. Therefore, it can be seen that sufficient signal processing time is ensured for the slave device 103, and clock progression similar to the case where the slave device 103 performs clock stretching is achieved.
[0044] By implementing the bus switches between devices on the board as reprogrammable logic devices as in this embodiment, it is possible to flexibly change the assignment of terminals in the devices and the connection relationships between the devices even after the board has been manufactured. This brings about advantages such as shortening the product development period and reducing the costs associated with design, development, and testing.
[0045] In the present embodiment, an example in which the master device 102 and the slave device 103 perform bidirectional communication according to the I2C communication method has been mainly described, but the present embodiment can be applied to any communication method having a clock stretch mechanism. The master device 102 and the slave device 103 are not limited to CPUs, and may be any type of device capable of communicating according to a communication method having a clock stretch mechanism. The bus switch may be implemented as another type of logic device, such as a PAL (Programmable Array Logic) or a CPLD (Complex Programmable Logic Device), instead of an FPGA. Clock stretching may be performed by the master device in order to ensure signal processing time on the master side rather than on the slave side.
[0046] <<2. Second embodiment>> In the first embodiment, every time the logical value of the clock signal output from the master device 102 changes to Low, that is, for all bits, the FPGA 101 maintains the logical value on the clock bus at Low for a time length T. In this case, assuming that it is sufficient to perform clock stretching only once after a 10-bit signal is transmitted and received, for example, a communication time delay of 9 times {T-max(Tm, Ts)} occurs. Generally, most devices that perform I2C communication perform clock stretching only when an acknowledgement is transmitted. In I2C communication, an acknowledgement (ACK) bit is transmitted once every 8 bits of information bits (or slave address + R / W request) are transmitted and received after 1 bit of start condition. Therefore, in the second embodiment described in this section, the logical value on the clock bus is maintained at Low only when the number of clocks measured reaches a predetermined value, not for all clocks. This makes it possible to reduce the communication time delay.
[0047] The configuration of the bus switch according to the second embodiment may be the same as the configuration of the FPGA 101 described with reference to Fig. 1. Furthermore, the signal processing in the FPGA 101 may be the same as that in the first embodiment, except for the contents of the clock signal relay processing performed by the SCL processing unit 133. Therefore, the following description will focus on the contents of the clock signal relay processing.
[0048] In this embodiment, the SCL processing unit 133 of the SCL bus switch 121 of the FPGA 101 measures the number of clocks of the clock signal input from the master device 102 via the IO buffer 131. Then, when the measured number of clocks reaches a predetermined reference value N, the SCL processing unit 133 maintains the logical values of both the clock signal on the master side SCL 106 and the clock signal on the slave side SCL 107 at Low for a time length T. The predetermined value here may be, for example, N=9 excluding one bit of the start condition (if the start condition is included, N=10 only for the first time).
[0049] Fig. 6 is a flowchart showing an example of the flow of the clock signal relay process performed by the SCL processing unit 133 according to this embodiment. This clock signal relay process can be described, for example, using some hardware description language (HDL) and configured as a logical function of the FPGA 101. Fig. 7 is a timing chart showing, in time series, changes in the logical value of the clock signal that can occur according to the clock signal relay process shown in Fig. 6.
[0050] First, in S600, the SCL processing unit 133 initializes the counter value of the clock signal, which is an internal variable, to zero. Next, in S601, the SCL processing unit 133 outputs a control signal indicating Low to the IO buffers 131 and 132, thereby enabling input and output of the clock signal on both the master side and the slave side. The logical value of the signal input from the IO buffer 131 becomes High, which is the same as the logical value of the master side SCL 106. Similarly, the logical value of the signal input from the IO buffer 132 becomes High, which is the same as the logical value of the slave side SCL 107 (at time T in FIG. 7). 41 to).
[0051] Next, in S603, the SCL processing unit 133 monitors the clock signal from the master device 102, that is, the logical value of the input from the IO buffer 131. When the logical value of the clock signal on the master side changes from High to Low, the process proceeds to S605 (time T 41 ).
[0052] When the logical value of the master-side clock signal changes from High to Low, in S605, the SCL processing unit 133 increments the counter value. The subsequent process branches depending on whether the counter value has reached the above-mentioned predetermined value N in S607. If the counter value has not reached N, the process proceeds to S609. On the other hand, if the counter value has reached N, the process proceeds to S613.
[0053] If the counter value has not reached N, in S609, the SCL processing unit 133 drives the slave side SCL 107 to Low by outputting a control signal indicating High to the IO buffer 132. Next, in S611, the SCL processing unit 133 monitors the clock signal from the master device 102, i.e., the logical value of the input from the IO buffer 131. When the logical value of the master side clock signal changes from Low to High (at time T in FIG. 7), 42 ), and the process returns to S601. The SCL processing unit 133 outputs a control signal indicating Low to the IO buffer 132, thereby returning the logical value of the slave side SCL 107 to High. This relay of the clock signal from the master side to the slave side can be repeated until just before the counter value reaches N (time T in FIG. 7). 41 From T 43 ).
[0054] In S607, the Nth falling edge of the clock signal (time T 44 7), in S613, the SCL processing unit 133 outputs a control signal indicating High in parallel to the IO buffer 131 and the IO buffer 132. As a result, both the master side SCL 106 and the slave side SCL 107 are driven to Low (time T 45 ).
[0055] After that, in S615, the SCL processing unit 133 maintains the logical values of the clock signals on the master-side SCL 106 and the slave-side SCL 107 at Low by keeping the control signals to the IO buffer 131 and the IO buffer 132 at High for the time length T. As in the first embodiment, the time length T is a predetermined length that satisfies the condition of formula (1) that it is longer than both the time length Tm and the time length Ts.
[0056] As a result of S615, the master SCL 106 and the slave SCL 107 are driven low for a period of time T. 45 From T 461 shows how the logical values of the clock signals on the master and slave sides are maintained low until the slave device 103 reaches the clock stretching state. During this time, the master device 102 determines that the slave device 103 is performing clock stretching, and does not advance the clock. The processing of the data signal by the slave device 103 is completed at the latest during this time.
[0057] 6 returns to S600 after the time length T has elapsed. After initializing the counter value, the SCL processing unit 133 re-enables input and output of the clock signal on the master side and the slave side.
[0058] 7, the waveform of the master side SCL 106 and the waveform of the slave side SCL 107 are almost identical. The clock signal indicates a low level for a period exceeding the time length Ts only at the timing when an acknowledgement is transmitted in normal I2C communication. In other words, it can be seen that a sufficient signal processing time for the slave device 103 is still ensured, and at the same time, the communication time delay is reduced compared to the first embodiment.
[0059] <<3. Application Examples>> The constraint condition formula (1) above prescribes the lower limit of the time length T, but does not prescribe the upper limit of the time length T. However, if the time length T is long, the delay in communication time increases, so if the time length T is too long, it is also disadvantageous in practical use. Therefore, in this section, as one application example of the above-mentioned bus switch, an application with a constraint on communication time is dealt with. One example of such an application is the transportation of paper in an image forming device (for example, a multifunction device, a copier, or a printer). A typical image forming device has multiple motors (transport means) for transporting paper along a transport path, and by driving the motors at appropriate timing, multiple papers are transported in sequence and an image is formed on each paper. If the control of the motors is delayed from the appropriate timing, the transport of the paper is delayed, and so-called jams occur. In order to appropriately design the control timing of the motors, it is effective to simulate the transport of paper using a paper transport simulator and verify the validity of the control timing. Therefore, as one application example of the technology related to the present disclosure, the paper transport simulator is configured using the above-mentioned bus switch.
[0060] FIG. 8 is a block diagram showing an example of the configuration of a simulation device 800 according to an application example. FIG. 9 is an explanatory diagram for explaining a paper transport path 901 simulated in the application example of FIG. 8. The simulation device 800 shown in FIG. 8 includes an FPGA 801, a first processor 802, and a second processor 803. The paper transport path 901 is configured from upstream to downstream with a first motor 905, a first sensor 909, a second motor 915, and a second sensor 919. The first motor 905 is a transport means that transports a paper along the transport path 901. The first sensor 909 is located between the first motor 905 and the second motor 915, and is a detection means that detects that a paper has reached the sensor position. The second motor 915 is a transport means that transports a paper along the transport path 901 downstream of the first motor 905. The second sensor 919 is located downstream of the second motor 915, and is a detection means that detects that a paper has reached the sensor position.
[0061] The first processor 802 of the simulation device 800 is a processor (e.g., a CPU) that simulates the control of the first motor 905. The second processor 803 is a processor (e.g., a CPU) that simulates the control of the second motor 915. The first processor 802 and the second processor 803 may be configured similarly to a controller that actually controls a motor. The first processor 802 may operate as a master of I2C communication. The first processor 802 outputs a clock signal to a clock bus for communication with the second processor 803. The second processor 803 may operate as a slave of I2C communication. The second processor 803 obtains a data signal input from a data bus or outputs a data signal to the data bus according to a clock signal input from the clock bus.
[0062] The FPGA 801 includes a motor model 805, a paper model 807, a sensor model 809, a motor model 815, a sensor model 819, an SCL bus switch 821, and an SDA bus switch 122. The motor model 805 is a virtual model that simulates the operation of the first motor 905 according to the control by the first processor 802. The paper model 807 is a virtual model that simulates the movement of the paper along the conveying direction according to the conveying amount calculated by the motor model 805 and the motor model 815. The sensor model 809 is a virtual model that simulates the operation of the first sensor 909. The motor model 815 is a virtual model that simulates the operation of the second motor 915 according to the control by the second processor 803. The sensor model 819 is a virtual model that simulates the operation of the second sensor 919. The SCL bus switch 821 has a similar configuration to the SCL bus switch 121 of the FPGA 101 according to the first or second embodiment, except that the time length T is set to satisfy an additional constraint. The SDA bus switch 122 has a similar configuration to the SDA bus switch 122 of the FPGA 101 according to the first or second embodiment.
[0063] In the simulation of paper transport, the first processor 802 outputs a motor drive signal 804 to the FPGA 801 to virtually rotate the motor model 805. The motor model 805 calculates the paper transport amount based on the motor drive signal 804, and outputs the calculated paper transport amount to the paper model 807. The paper model 807 calculates the paper position representing the virtual position of the paper on the transport path 901 based on the paper transport amount input from the motor model 805, and outputs the calculated paper position to the sensor model 809. The sensor model 809 determines whether the paper has reached a predetermined position, and outputs a paper presence / absence signal 810 indicating the determination result to the first processor 802. When the sensor model 809 detects that the paper has reached the predetermined position, the first processor 802 instructs the second processor 803 to drive the subsequent motors via I2C communication. The second processor 803 outputs a motor drive signal 814 to the FPGA 801 to virtually rotate the motor model 815. The motor model 815 calculates the paper transport amount based on the motor drive signal 814, and outputs the calculated paper transport amount to the paper model 807. The paper model 807 calculates the paper position representing the virtual position of the paper on the transport path 901 based on the paper transport amount input from the motor model 815, and outputs the calculated paper position to the sensor model 819. The sensor model 819 determines whether the paper has reached a predetermined position, and outputs a paper presence / absence signal 820 indicating the determination result to the second processor 803. The second processor 803 continues the virtual rotational drive of the second motor 915 until the rear end of the paper passes the second motor 915, and then stops the rotational drive. This ends the simulation of the paper transport.
[0064] In the above-mentioned transport control, by virtually rotating the motor model 815 earlier than the time when the paper reaches the second motor 915 modeled by the motor model 815, the paper can be transported smoothly on the transport path 901 without jamming. In this application example, a restriction is set on the communication time for each opportunity for data communication between the first processor 802 and the second processor 803. As an example, it is assumed that a single failure in I2C communication will not cause a jam, but two consecutive failures will cause a jam. Under this assumption, the time length T during which the SCL bus switch 821 maintains the state of the signal on the clock bus at a specific logical value satisfies the following equation (2) in addition to the above-mentioned equation (1): T delay >{T-max(Tm,Ts)}×C num (2)
[0065] In formula (2), C num represents the number of pseudo clock stretches in one data communication opportunity. In the first embodiment, when the state of the signal on the clock bus is maintained low for a time length T for each clock (i.e., pseudo clock stretching is performed), C num T may correspond to the total number of clocks consumed in one data communication opportunity. delay represents the delay time required for one retry of I2C communication. By setting the time length T in advance to a time length short enough not to exceed the constraint expressed by formula (2), it is possible to smoothly transport paper without causing a jam on the transport path 901, unless the I2C communication fails two consecutive times. Note that, without being limited to the above example, a constraint condition that allows two or more retries of I2C communication may be imposed on the time length T.
[0066] <<4. Summary>> Up to this point, several embodiments and application examples of the present disclosure have been described in detail with reference to FIGS. 1 to 9. In the above-described embodiment, in a bus switch that relays a clock signal and a data signal between two devices, the logical value of a clock signal on a first clock bus connected to a first device is reflected in a clock signal on a second clock bus connected to a second device. In addition, the logical value of the data signal on one of the data signals on the first data bus connected to the first device and the data signals on the second data bus connected to the second device, which has changed in logical value first, is reflected in the data signal on the other data bus. Then, when the logical value of the clock signal on the first clock bus changes from a first value to a second value, the logical values of both the clock signal on the first clock bus and the clock signal on the second clock bus are maintained at the second value for a certain time length T. Therefore, while enabling data signals to be communicated in both directions between these two devices, the clock progression can be delayed to ensure sufficient signal processing time in each device. Moreover, since the bus switch between the two devices relays the clock signal and the data signal by signal processing, the bus switch can be implemented as a reprogrammable logic device such as an FPGA. Therefore, even after manufacturing the board on which the first device and the second device are mounted, it is possible to flexibly change the assignment of terminals in each device and the connection relationship between the devices. This brings about advantages such as shortening the product development period and reducing the costs associated with design, development, and testing. Moreover, the time length T can be preset as a time length longer than both the maximum time length Tm during which the first device maintains the logic value of the clock signal at the second value and the maximum time length Ts during which the second device maintains the logic value of the clock signal at the second value. In this case, it is possible to reliably prevent the clock from progressing faster than the time spent by the first device and the second device for signal processing.
[0067] As an example, the first device is a master device that outputs a clock signal to the first clock bus for communication with the second device. The second device is a slave device that acquires a data signal input from the second data bus or outputs a data signal to the second data bus according to a clock signal input from the second clock bus. In this case, it is possible to ensure the signal processing time required for the master device and the slave device while basically communicating data bidirectionally according to the clock supplied from the master device.
[0068] The second device, which is a slave device, may maintain the logic value of the clock signal on the second clock bus at the second value in order to secure time to process a data signal by delaying the progress of the clock. That is, the second device may be a slave device that attempts to delay the progress of a clock managed by a master device by clock stretching. Although the logic value of the clock bus on the second device side due to this clock stretching is not actually sensed by the first device, according to the above-mentioned embodiment, the clock does not progress during the period during which the clock stretching continues. Therefore, it is possible to smoothly perform bidirectional communication without causing any trouble to the clock stretching mechanism in a synchronous communication method. For example, the first data bus and the second data bus may be serial data buses in an I2C communication method, and the first clock bus and the second clock bus may be serial clock buses in an I2C communication method. That is, the technology according to the present disclosure makes it possible to implement a bus between two or more devices that communicate with each other by an I2C communication method as a reprogrammable logic device such as an FPGA in a manner that does not hinder the clock stretching mechanism of the I2C communication method.
[0069] In one embodiment, when the number of clocks on the first clock bus reaches a predetermined value, the logical values of both the clock signal on the first clock bus and the clock signal on the second clock bus may be maintained at the second value for the time length T. In this case, it is possible to ensure sufficient signal processing time in each device while suppressing delays in communication time to a necessary and sufficient level.
[0070] As an example, the time length T may be preset as a time length short enough not to exceed the constraint of the communication time for each data communication opportunity between the first device and the second device. In this case, the bus switch may be incorporated into an apparatus (e.g., an image forming apparatus) that is driven depending on the communication between the first device and the second device, and the apparatus may be driven at an appropriate speed under time constraints.
[0071] <<5. Other embodiments>> The invention is not limited to the above-described embodiments, and various modifications and variations are possible without departing from the spirit and scope of the invention. Accordingly, the following claims are appended to apprise the public of the scope of the invention. [Explanation of symbols]
[0072] 101: FPGA (bus switch), 102: master device (first device), 103: slave device (second device), 106: master side SCL (first clock bus), 107: slave side SCL (second clock bus), 110: master side SDA (first data bus), 111: slave side SDA (second data bus), 133: SCL processing unit (second signal processing means), 143: SDA processing unit (first signal processing means), 800: simulation device, 801: first processor, 802: second processor
Claims
1. A bus switch that relays a clock signal on a clock bus and a data signal on a data bus between a first device that is a master device and a second device that is a slave device capable of performing clock stretching, comprising: a first signal processing means for monitoring a data signal on a first data bus connected to the first device and a data signal on a second data bus connected to the second device, and reflecting the logical value of the data signal on one of the data signals on the first data bus and the data signals on the second data bus, the logical value of which has changed first, in the data signal on the other data bus; a second signal processing means for reflecting a logical value of a clock signal output from the first device onto a first clock bus connected to the first device onto a clock signal on a second clock bus connected to the second device; Equipped with the second signal processing means maintains the logical values of both the clock signal on the first clock bus and the clock signal on the second clock bus at the second value for a certain length of time T when the logical value of the clock signal on the first clock bus changes from a first value to a second value at least at a timing when the second device performs the clock stretch; The time length T is preset as a time length longer than both half the period of the clock signal output from the first device and the maximum possible time length of the clock stretch by the second device. Bus switch.
2. 2. The bus switch of claim 1, the second device acquires a data signal input from the second data bus or outputs a data signal to the second data bus in accordance with a clock signal input from the second clock bus; Bus switch.
3. 3. The bus switch of claim 2, wherein the second device maintains the logical value of the clock signal on the second clock bus at the second value to delay clock progression and allow time to process data signals.
4. 4. A bus switch according to claim 3, the first data bus and the second data bus are serial data buses in an I2C communication system, the first clock bus and the second clock bus are serial clock buses in an I2C communication system; Bus switch.
5. 5. A bus switch as described in claim 3 or 4, wherein the second signal processing means measures the number of clocks on the first clock bus, and when the measured number of clocks reaches a predetermined value, maintains the logical values of both the clock signal on the first clock bus and the clock signal on the second clock bus at the second value for the time length T, the predetermined value being a reference value determined based on the timing at which the second device performs the clock stretching.
6. 6. A bus switch according to claim 1, the first device and the second device have a constraint on a communication time for each data communication opportunity; The time length T is preset as a time length short enough that the communication time for each data communication opportunity does not exceed the constraint. Bus switch.
7. 7. A bus switch according to any preceding claim, implemented as a reprogrammable logic device.
8. 8. The bus switch of claim 7, wherein the reprogrammable logic device is a field programmable gate array.
9. a first processor for simulating control of a first transport means for transporting paper along a transport path; a second processor simulating control of a second transport means located downstream of the first transport means, the second transport means transporting the paper along the transport path; A bus switch according to any one of claims 1 to 8, which relays signals between the first processor and the second processor; A simulation device comprising:
10. A signal relay method performed by a bus switch for relaying a clock signal on a clock bus and a data signal on a data bus between a first device which is a master device and a second device which is a slave device capable of performing clock stretching, comprising: A first signal processing means of the bus switch causes a logical value of a clock signal output from the first device onto a first clock bus connected to the first device to be reflected in a clock signal on a second clock bus connected to the second device; monitoring, by a second signal processing means of the bus switch, a data signal on a first data bus connected to the first device and a data signal on a second data bus connected to the second device; reflecting, by the second signal processing means, the logical value of the data signal on one of the data signals on the first data bus and the data signals on the second data bus, the logical value of which has changed first, on the data signal on the other data bus; Including, The first signal processing means reflects the logical value of the clock signal output from the first device on the clock signal on the second clock bus, and includes, at least when the logical value of the clock signal on the first clock bus changes from a first value to a second value at a timing when the second device performs the clock stretch, maintaining the logical values of both the clock signal on the first clock bus and the clock signal on the second clock bus at the second value for a certain length of time T; The time length T is preset as a time length longer than both half the period of the clock signal output from the first device and the maximum possible time length of the clock stretch by the second device. Signal relay method.
Citation Information
Patent Citations
Image recording apparatus
JP1981042251A
Signal transmitter and transmitting method
JP2005130358A
Bus driver circuit, data transmission control device, and bus driving method
JP2008066951A
Bus repeater
JP2008107937A
Design support system, design support method, and design support program
JP2008305152A
