WO2018120612A1 - Data sampling method, chip and computer storage medium - Google Patents
Data sampling method, chip and computer storage medium Download PDFInfo
- Publication number
- WO2018120612A1 WO2018120612A1 PCT/CN2017/085606 CN2017085606W WO2018120612A1 WO 2018120612 A1 WO2018120612 A1 WO 2018120612A1 CN 2017085606 W CN2017085606 W CN 2017085606W WO 2018120612 A1 WO2018120612 A1 WO 2018120612A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- module
- selection
- delay
- output
- sub
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Definitions
- the present invention relates to electronic technologies, and more particularly to a data sampling method, a chip, and a computer storage medium.
- the Serial Peripheral Interface is a high-speed, full-duplex, synchronous communication bus that occupies only four wires on the pins of the chip, saving the pins of the chip and printing.
- the layout of the printed circuit board (PCB) saves space and provides convenience. Due to the ease of use of SPI, more and more chips integrate this communication protocol. With the increasing use of SPI flash (SPI Flash), the speed is getting higher and higher, the original chip design can not meet the demand of high-speed sampling data, and need to increase the support for high speed, this is because SPI FLASH only has input.
- FIG. 1 shows the clock and data path delay of the chip and SPI Flash.
- the data path delay of the chip and SPI Flash mainly includes: chip clock output delay, PCB clock trace delay, and particle clock input. Delay, particle data output delay, PCB data trace delay, chip input delay.
- the existing solutions mainly have the following Two kinds:
- the embodiment of the invention provides a data sampling method, a chip and a computer storage medium, which can meet the requirement of sampling SPI data of different rates, realize stable sampling of data, and has the characteristics of strong compatibility and software controllability.
- An embodiment of the present invention provides a chip, where the chip includes: a controller and an SPI connected to the controller, where the controller includes: a clock generation module, an input and output module, a configuration acquisition module, and a clock delay module. a sampling module, the input and output module is connected to the SPI, wherein
- the clock generation module is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module;
- the input/output module is configured to output the output clock signal to the SPI Flash through the SPI, and output the output clock signal to the clock delay module;
- the configuration obtaining module is configured to acquire a configuration parameter and a delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module;
- the clock delay module is configured to generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter, and output the sampling clock signal to the sampling module;
- the sampling module is configured to receive SPI data through the SPI, and sample the SPI data according to the sampling clock signal.
- the configuration obtaining module is configured to configure a delay line level M, a delay unit level N, and the delay enable signal, and the delay line level M, the delay The unit number of stages N and the delay enable signal are output to the clock delay module; wherein, M and N are both natural numbers greater than or equal to one.
- the clock delay module includes: a first selection module, a second selection module, and a delay module; wherein
- the clock delay module is configured to configure a first level according to the delay line level M, the first level is a number of stages of the second selection module, and according to the delay line level M configuring a second level, the second level being the number of stages of the delay module;
- a first input end of the first selection module is connected to the input and output module, a second input end of the first selection module is connected to the second selection module, and a third input end of the first selection module Connected to the configuration acquisition module, the output end of the first selection module is connected to the sampling module;
- the second selection module is composed of an M-level first selection sub-module; wherein, in the k-th stage, there are 2M-k first selection sub-modules; wherein k is a natural number greater than or equal to 1 and less than or equal to M;
- the delay module is composed of a 2M-level delay sub-module.
- the first input of the first selection sub-module of the second selection module is connected to the first-stage delay sub-module; the second input of the first selection sub-module The terminal is connected to the second-stage delay sub-module; the output end of the first selection sub-module is connected to the first selection module.
- the first input end of the ith first selection submodule in the first stage is connected to the 2i-1th delay submodule in the 2M level delay submodule;
- the second input end of the first selection sub-module is connected to the 2i-th delay sub-module of the 2M-level delay sub-module; when i is an even number, the output end of the i-th first selection sub-module Connected to the i/2th first selection submodule of the second stage, or when i is an odd number, the output of the i th first selection submodule and the (i+1)/2 of the second stage
- the first selection sub-modules are connected; wherein i is a natural number greater than or equal to 1 and less than or equal to 2M;
- the first input end of the jth first selection submodule in the kth stage is connected to the 2j-1 first selection submodule in the k-1th stage;
- the second input end of the j first selection sub-modules is connected to the 2j first selection sub-module in the k-1th stage; when j is an even number, the output end of the j-th first selection sub-module
- the j/2th first selection submodule in the k+1th stage is connected, or when j is an odd number, the output of the jth first selection submodule and the (k+th)th 1)/2 first selection sub-modules are connected; wherein j is a natural number greater than or equal to 1 and less than or equal to 2M-k;
- the first input of the first selection submodule in the Mth stage is connected to the first first selection submodule of the M-1th stage; the second input of the first selection submodule The terminal is connected to the second first selection submodule in the M-1th stage; the output end of the first selection submodule is connected to the first selection module.
- the delay sub-module includes: a third selection module and a registration module; wherein
- the clock delay module is configured to configure a third level according to the delay unit number N, the third level is a number of stages of the third selection module, and according to the delay unit level N configuring a fourth level, the fourth level being the number of stages of the registration module;
- the third selection module is composed of an N-level second selection sub-module; wherein, in the h-th stage, there are 2M-h second selection sub-modules; wherein h is a natural number greater than or equal to 1 and less than or equal to N;
- the registration module is composed of a 2N-level registration sub-module.
- the first input end of the second selection sub-module of the third selection module is connected to the first-level registration sub-module; the second input end of the second selection sub-module Connected to the second level storage submodule; the output end of the second selection submodule is connected to the second selection module;
- N is greater than 1, for the second selection sub-module of the h-th level in the third selection module:
- the first input end of the pth second selection submodule in the first stage is connected to the 2p-1 level registration submodule in the 2N level register submodule;
- the second input end of the second selection sub-module is connected to the second p-level registration sub-module of the 2N-level registration sub-module; when p is an even number, the output end of the p-th second selection sub-module a second p/2 second selection module, or an output of the pth second selection submodule and a (p+1)/2 second selection of the second level when p is an odd number a submodule connection; wherein p is a natural number greater than or equal to 1 and less than or equal to 2N;
- the first input end of the qth second selection submodule in the hth stage is connected with the 2q-1 second selection submodule in the h-1th stage;
- the second input end of the q second selection sub-modules is connected to the 2q second second selection sub-module in the h-1th stage; when q is an even number, the output end of the q-th second selection sub-module
- the q/2th second selection submodule in the h+1th stage, or the output of the qth second selection submodule and the (h+)th in the h+1th level when q is an odd number 1)/2 second selection sub-modules are connected; wherein q is a natural number greater than or equal to 1 and less than or equal to 2N-h;
- the first input of the second selection sub-module in the Nth stage is connected to the first second selection sub-module of the N-1th stage; the second input of the second selection sub-module End and The second second selection sub-module of the N-1 stage is connected; the output end of the second selection sub-module is connected to the second selection module.
- the first selection submodule and the second selection submodule are selectors
- the registration sub-module is a register.
- the embodiment of the invention further provides a data sampling method, the method comprising:
- the SPI data is received, and the SPI data is sampled by the sampling clock signal.
- the configuration parameter includes a delay line level M and a delay unit level N; wherein M and N are both natural numbers greater than or equal to 1.
- the method before the receiving the SPI data, the method further includes:
- the determining, according to the sampling data and the check sampling data, whether the configuration parameter meets a preset rule further includes:
- the configuration parameter is adjusted until the adjusted configuration parameter meets the preset rule.
- the adjusting the configuration parameter includes:
- the delay line level M and the delay unit level N are adjusted according to a preset method.
- the method further includes:
- the sampled data is read according to a preset clock domain to obtain updated sample data
- the updated sampled data is used.
- the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the data sampling method according to the embodiment of the invention.
- the current clock signal is acquired, an output clock signal is generated according to the current clock signal, and the configuration parameter and the delay enable signal are acquired, according to the delay enable signal, the output clock signal, and the configuration.
- the parameter generates a sampling clock signal; receives the SPI data, samples the SPI data by the sampling clock signal, and obtains the sampling data. That is to say, in the technical solution proposed by the present invention, the sampling clock signal can be acquired according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data.
- the technical solution of the embodiment of the present invention can meet the requirement of sampling SPI data of different rates, realize stable sampling of data, and has the characteristics of strong compatibility and software controllability.
- Figure 1 is a schematic diagram of the clock and data path delay of the chip and SPI Flash;
- FIG. 2 is a schematic diagram of a first component structure of a chip according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of chip clock signal transmission in an embodiment of the present invention.
- FIG. 4 is a schematic diagram showing a second component structure of a chip according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a first connection structure of a clock delay module according to an embodiment of the present invention.
- FIG. 6 is a schematic diagram of a second connection structure of a clock delay module according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a third component of a chip according to an embodiment of the present invention.
- FIG. 8 is a schematic diagram of a first connection structure of a delay sub-module according to an embodiment of the present invention.
- FIG. 9 is a schematic flowchart of an implementation process of a data sampling method according to an embodiment of the present invention.
- FIG. 10 is a schematic flowchart of an implementation process of a method for verifying configuration parameters according to an embodiment of the present invention
- FIG. 11 is a schematic diagram of a delay of a sampling clock signal according to an embodiment of the present invention.
- FIG. 2 is a schematic diagram of a first component structure of a chip according to an embodiment of the present invention.
- the chip 1 includes: a controller 10 and an SPI 11 connected to the controller 10, wherein The controller 10 can generate an output clock by using any one of a single data line, two data lines, and four data lines.
- the controller 10 includes a clock generation module 100, an input and output module 101, a configuration acquisition module 102, a clock delay module 103, and a sampling module 104.
- the input and output module 101 is connected to the SPI 11.
- the clock generation module 100 is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module 101.
- the clock generation module 100 can acquire the current clock signal of the current working clock domain, and then generate an output clock signal according to the current clock signal, and output the clock signal to the input/output module 101.
- the clock generating module 100 needs to convert the acquired current clock signal to obtain an output clock signal.
- the clock generation module 100 may output the output clock signal to the input/output module 101 through any one of a single data line, two data lines, and four data lines.
- the clock generation module 100 is configured to output the clock signal At the same time as the input/output module 101, a preset enable signal is output to the input/output module 101, and the preset enable signal is used to control whether the input/output module 101 outputs the output clock signal.
- the input and output module 101 is configured to output an output clock signal to the SPI Flash through the SPI 11 and output the output clock signal to the clock delay module 103.
- the input and output module 101 can simultaneously output the output clock signal to the SPI Flash and the clock delay module 103.
- the input/output module 101 outputs an output clock signal through the SPI 11.
- the input and output module 101 receives the output clock signal sent by the clock generation module 100, and the input and output module 101 further receives the preset enable signal sent by the clock generation module 100.
- the enable signal is used to control whether the input/output module 101 outputs the output clock signal.
- the input and output module 101 when the preset enable signal corresponds to a preset enable signal, the input and output module 101 simultaneously outputs the output clock signal to the SPI Flash and the clock delay module 103; When the enable signal corresponds to a preset off signal, the input/output module 101 will not output the output clock signal.
- the configuration obtaining module 102 is configured to acquire configuration parameters and a delay enable signal, and output the configuration parameters and the delay enable signal to the clock delay module 103.
- the configuration parameter and the delay enable signal are output to the clock delay module 103.
- the configuration parameters and the delay enable signal may be pre-stored in a register in the chip and then sent to the configuration acquisition module 102 by the register.
- the configuration obtaining module 102 is configured to configure a configuration parameter and a delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module 103.
- the configuration parameters include: a delay line level M and a delay unit level N; wherein, M and N are natural numbers greater than or equal to 1.
- the configuration parameters are used to configure the composition of the clock delay module 103, and the delay enable signal is used to control whether the clock delay module 103 outputs the sampling clock signal.
- the clock delay module 103 is configured to generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter, and output the sampling clock signal to the sampling module 104.
- the clock delay module 103 is enabled according to the delay.
- the signal, the output clock signal, and the configuration parameters generate a sampling clock signal, and the sampling clock signal is output to the sampling module 104.
- the sampling module 104 is configured to receive SPI data through the SPI 11 and sample the SPI data according to the sampling clock signal.
- the sampling module 104 can receive the SPI data through the SPI11, and then sample the SPI data according to the sampling clock signal, and finally obtain the sampling data.
- the clock generation module 100 acquires a current clock signal wclk, generates an output clock signal spi_clk_o, and a preset enable signal spi_clk_oe, and outputs the output clock signal and a pre- An enable signal is provided to the input/output module 101; the input/output module 101 outputs the output clock signal spi_clk_o as a communication synchronous clock signal spi_clk to the SPI Flash through the SPI 11, and outputs the output clock signal spi_clk_o as an input clock signal clk_in to the clock delay module 103.
- the clock delay module 103 receives the output clock signal sent by the input/output module 101, the configuration parameters M and N sent by the configuration acquisition module 102, and the delay enable signal tapdly_en, according to the delay enable signal and the output clock. Signal and configuration parameters, generate sampling clock signal clk_sample, output sampling clock signal to sampling module 104; sampling module 104 can receive SPI data spi_dat through SPI11, After that, the SPI data is sampled according to the sampling clock signal, and finally the sampling data is obtained, and the sampling data is output to the first-in first-out queue to_fifo.
- the clock delay module 103 includes a first selection module 1030, a second selection module 1031, and a delay module 1032.
- the module 1031 includes a first selection sub-module 10310
- the delay module 1032 includes a delay sub-module 10320.
- the clock delay module 103 is configured to configure a first level according to the delay line number M, wherein the first level is the number of stages of the second selection module 1031, and according to The delay line level M is configured with a second level, and the second level is the number of stages of the delay module 1032.
- the clock delay module 103 configures the first level to be 3, and the second level is also set to 3.
- the second selection module 1031 is composed of an M-level first selection sub-module 10310; wherein, in the k-th stage, there are 2M-k first selection sub-modules 10310; wherein k is greater than or equal to 1 And the natural number is less than or equal to M; the delay module 1032 is composed of the 2M-level delay sub-module 10320.
- FIG. 5 is a schematic diagram of a first connection structure of a clock delay module according to an embodiment of the present invention.
- a first input end of the first selection module 1030 is connected to the input/output module 101, and a second selection module 1030 is second.
- the input end is connected to the second selection module 1031, the third input end of the first selection module 1030 is connected to the configuration acquisition module 102, and the output end of the first selection module 1030 is connected to the sampling module 104.
- the first selection module 1030 acquires the output clock signal sent by the input and output module 101, and the first selection module 1030 acquires the sampling clock signal sent by the second selection module 1031, and at the same time, the first selection The module 1030 obtains the delay enable signal sent by the configuration acquisition module 102, and the first selection module 1030 selects and outputs the output according to the delay enable signal.
- the clock signal is output, or the sampling clock signal is output.
- the delay enable signal sent by the configuration obtaining module 102 is used to control the output of the first selection module 1030.
- the delay enable signal is configured according to the rate of the output clock signal. of.
- the delay enable signal when the rate of the output clock signal is greater than a preset threshold, the delay enable signal may be set to 1, indicating that the first selection module 1030 is controlled to output the sampling clock signal; when the rate of the clock signal is output When the threshold is less than the preset threshold, the delay enable signal may be set to 0, indicating that the first selection module 1030 is controlled to output a clock signal.
- FIG. 6 is a schematic diagram of a second connection structure of a clock delay module according to an embodiment of the present invention.
- the delay module 1032 is composed of the 2-level delay sub-module 10320.
- the first input end of the first selection submodule 10310 in the second selection module 1031 is connected to the first stage delay submodule 10320; the second input end of the first selection submodule 10310 is connected to the second stage delay submodule 10320.
- the output of the first selection sub-module 10310 is coupled to the first selection module 1030.
- the second selection module 1031 is composed of the M-level first selection sub-module 10310
- the delay module 1032 is composed of the 2M-level delay sub-module 10320.
- the first input of the i-th first selection sub-module 10310 in the first stage is connected to the 2i-1-th delay sub-module 10320 in the 2M-stage delay sub-module 10320; the ith The second input end of the first selection sub-module 10310 is connected to the 2i-th delay sub-module 10320 in the 2M-level delay sub-module 10320; when i is an even number, the output of the i-th first selection sub-module 10310 is The i/2th first selection submodule 10310 of the second stage is connected, or when i is an odd number, the output of the i th first selection submodule 10310 and the (i+1)/2th of the second level
- the first selection sub-module 10310 is connected; wherein i is a natural number greater than or equal to 1 and less than or equal to 2M; when k is greater than 1 and less than M, the first input end of the jth first selection submodule 10310 in the kth stage is
- the first first selection in the first stage The first input end of the sub-module 10310 is connected to the first-stage delay sub-module 10320 in the 8-level delay sub-module 10320; the second input end of the first first selection sub-module 10310 and the 8-level delay sub-module 10320
- the second stage delay sub-module 10320 is connected; the output of the first first selection sub-module 10310 is connected to the second first selection sub-module 10310 of the second stage; the second first in the second stage
- the first input of the selection sub-module 10310 is connected to the third first selection sub-module 10310 of the first stage; the second input of the second first selection sub-module 10310 and the fourth of the first level A selection sub-module 10310 is connected; the output of the second first selection sub-module 10310 is connected to the first first selection sub-module 10310
- FIG. 7 is a schematic diagram of a third component structure of a chip according to an embodiment of the present invention.
- the delay sub-module 10320 includes a third selection module 103200 and a registration module 103201, wherein the third selection module 103200 includes a second selector.
- the clock delay module 103 is configured to configure a third level according to the delay unit level N, wherein the third level is the number of stages of the third selection module 103200, and according to the delay
- the unit number N configures a fourth level, which is the number of stages of the registration module 103201.
- the delay unit number N is 3
- the clock delay module 103 configures the number of stages of the third selection module 103200 to be 3
- the number of stages of the configuration registration module 103201 is also 3.
- the third selection module 103200 is composed of an N-level second selection sub-module 1032000; wherein, in the k-th stage, there are 2N-k second selection sub-modules 1032000; wherein k is greater than or equal to 1 And a natural number less than or equal to M; the registration module 103201 is composed of a 2N-level registration sub-module 1032010.
- FIG. 8 is a schematic diagram of a first connection structure of a delay sub-module according to an embodiment of the present invention.
- the third selection module 10320 is constituted by the 1-stage second selection sub-module 1032000
- the registration module 103201 is constituted by the 2-level registration sub-module 1032010.
- the first input end of the second selection sub-module 1032000 in the third selection module 103200 is connected to the first-level registration sub-module 1032010; the second input end of the second selection sub-module 1032000 is connected to the second-level registration sub-module 1032010;
- the output of the second selection submodule 1032000 is connected to the second selection module 1031;
- the third selection module 103200 is constituted by the N-level second selection sub-module 1032000
- the registration module 103201 is constituted by the 2N-level registration sub-module 1032010.
- the first input of the pth second selection submodule 1032000 in the first stage is connected to the 2p-1 level registration submodule 1032010 in the 2N level registration submodule 1032010; the pth second The second input of the selection sub-module 1032000 is connected to the 2p-level registration sub-module 1032010 in the 2N-level registration sub-module 1032010; when p is an even number, the output of the p-th second selection sub-module 1032000 and the second-level The p/2 second selection modules 1032000 are connected, or when p is an odd number, the output of the pth second selection submodule 1032000 and the (p+1)/2 second selection submodules of the second stage 1032000 connection; wherein p is a natural number greater than or equal to 1 and less than or equal to 2N; when h is greater than 1 and less than N, the first input end and the h-1th of the qth second selection submodule 1032000 in the
- the first one in the first stage The first input end of the second selection sub-module 1032000 is connected to the first-level registration sub-module 1032010 in the 8-level registration sub-module 1032010; the second input end of the first second selection sub-module 1032000 and the 8-level registration sub-module 1032010
- the second level storage sub-module 1032010 is connected; the output of the first second selection sub-module 1032000 is connected to the first second selection sub-module 1032000 of the second level;
- the first input of the second second selection sub-module 1032000 in the second stage is coupled to the third second selection sub-module 1032000 in the first stage; the second input of the second second selection sub-module 1032000 Connected to the fourth second selection sub-module 1032000 in the first stage; the output of the second second selection sub-
- the first selection sub-module 10310 and the second selection sub-module 1032000 may be selectors, and the registration sub-module 1032010 may be a register.
- the chip includes: a controller and an SPI connected to the controller, wherein the controller includes: a clock generation module, an input and output module, a configuration acquisition module, a clock delay module, and a sampling module.
- the input and output modules are connected to the SPI.
- the clock generation module is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module; the input/output module is configured to output the output clock signal to the SPI Flash through the SPI, and output the output The clock signal is output to the clock delay module; the configuration acquisition module is configured to obtain the configuration parameter and the delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module; the clock delay module is configured to be based on the delay The signal, the output clock signal and the configuration parameters generate a sampling clock signal, and the sampling clock signal is output to the sampling module; the sampling module is configured to receive the SPI data through the SPI, and sample the SPI data according to the sampling clock signal.
- the sampling clock signal can be obtained according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data.
- a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, and realize data stabilization. Fixed sampling, with strong compatibility and software controllable features; and, it is simple and convenient to implement, easy to popularize, and has a wider application range.
- FIG. 9 is a schematic flowchart of an implementation of a data sampling method according to an embodiment of the present invention. As shown in FIG. 9 , in a specific embodiment of the present invention, a method for data sampling specifically includes the following steps:
- Step 101 Acquire a current clock signal, and generate an output clock signal according to the current clock signal.
- the controller may acquire a current clock signal of the current working clock domain and then generate an output clock signal according to the current clock signal.
- the controller needs to convert the acquired current clock signal to obtain an output clock signal.
- the controller may output the output clock signal by any one of a single data line, two data lines, and four data lines.
- the controller generates the output clock signal and also generates a preset enable signal for controlling whether to output the output clock signal.
- the controller when the preset enable signal corresponds to a preset turn-on signal, the controller outputs the output clock signal; when the preset enable signal corresponds to a preset turn-off signal, the control The output clock signal will not be output.
- Step 102 Acquire a configuration parameter and a delay enable signal, and generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter.
- the controller may acquire a configuration parameter and a delay enable signal, and generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter.
- the configuration parameters and the delay enable signal can be pre-stored in a register in the chip, and then registered The device is sent to the controller.
- the configuration parameters include: a delay line level M and a delay unit level N; wherein, M and N are both natural numbers greater than or equal to 1.
- the configuration parameters are used to configure the generation of the sampling clock signal, and the delay enable signal is used to control the output of the sampling clock signal.
- Step 103 Receive SPI data, sample the SPI data by using a sampling clock signal, and obtain sampling data.
- the controller may receive the SPI data through the SPI, and then sample the SPI data according to the sampling clock signal, and finally obtain the sampling data.
- the data sampling method proposed by the specific embodiment of the present invention further includes the following steps:
- Step 104 Output the sampled data to a register.
- Step 105 When acquiring a read request, reading the sampled data according to a preset clock domain to obtain updated sample data;
- Step 106 using the updated sample data.
- the controller may synchronize the sampled data obtained by sampling the SPI data into a preset clock domain for reading, thereby obtaining updated sample data, and finally performing the next update data. Level of processing and use.
- FIG. 10 is a schematic flowchart of a method for verifying configuration parameters in an embodiment of the present invention. As shown in FIG. 10, in a specific embodiment of the present invention, a method for verifying configuration parameters specifically includes the following steps:
- Step 201 Acquire preset verification data, and sample preset calibration data by using a sampling clock signal to obtain verification sampling data.
- the controller obtains a preset school before receiving the SPI data.
- the data is verified, and the preset verification data is sampled by the sampling clock signal to obtain the verification sampling data.
- the configuration parameter needs to be verified to determine whether the configuration parameter can be configured to satisfy the sampling requirement of the sampling requirement.
- the method for verifying the configuration parameters by the controller may be: acquiring preset verification data, sampling the preset verification data by using the sampling clock signal, and obtaining verification sampling data.
- Step 202 Determine, according to the sampling data and the verification sampling data, whether the configuration parameter satisfies a preset rule. If the configuration parameter satisfies the preset rule, the SPI data is sampled.
- the controller may determine, according to the sampling data and the verification sampling data, whether the configuration parameter satisfies a preset rule, and if the configuration parameter satisfies the preset rule, The SPI data is sampled.
- the controller after acquiring the verification sampling data, the controller compares the verification sampling data with the verification data to obtain a comparison result, and the controller may determine, according to the comparison, whether the preset rule is met, if the , the above configuration parameters can be considered to meet the preset requirements of the data sampling, and the sampling signal can be configured according to the above configuration parameters.
- the method for verifying configuration parameters further includes:
- Step 203 If the configuration parameter does not meet the preset rule, the configuration parameter is adjusted until the adjusted configuration parameter meets the preset rule.
- the controller adjusts the configuration parameter, generates a sampling signal according to the adjusted configuration parameter, and then resamples the sampled data until the adjusted configuration.
- the parameters satisfy the preset rules.
- the controller may adjust the configuration parameter according to the preset method, that is, the controller may perform the preset method according to the preset method.
- the delay line level M and the delay unit level N are adjusted.
- FIG. 11 is a schematic diagram of a delay of a sampling clock signal according to an embodiment of the present invention.
- the sampling clock signal in the case of not delaying the sampling clock signal in (a), the sampling clock signal can satisfy the sampling time.
- the order relationship, just on the rising edge of clk_sample, can just sample spi_datX (X can be 1, 2 or 4 bits). Since the phase of spi_datX in (b) is shifted later than the phase of (a), if the clk_in is not delayed, it is impossible to effectively sample spi_datX on the rising edge of clk_sample. Therefore, the delay enable signal tapdly_en and the configuration parameter M need to be configured. N. The spi_datX in (c) moves more backward than the phase of (b), so it is necessary to delay the clk_in more.
- the data sampling method provided by the embodiment of the present invention acquires a current clock signal, generates an output clock signal according to the current clock signal, acquires a configuration parameter and a delay enable signal, and generates a sampling according to the delay enable signal, the output clock signal, and the configuration parameter.
- the clock signal ; receiving the SPI data, sampling the SPI data by the sampling clock signal, and obtaining the sampling data. That is to say, in the technical solution proposed by the present invention, the sampling clock signal can be acquired according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data.
- a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, achieve stable sampling of data, have strong compatibility, and are software controllable.
- the characteristics are; simple, convenient to implement, easy to popularize, and a wider range of applications.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- the technical solution of the embodiment of the present invention can obtain a sampling clock signal according to a current clock signal, and then sample the SPI data by using the sampling clock signal, thereby obtaining sampling data.
- a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, achieve stable sampling of data, have strong compatibility, and are software controllable. The characteristics are; simple, convenient to implement, easy to popularize, and a wider range of applications.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Pulse Circuits (AREA)
Abstract
A chip, comprising a controller (10) and an SPI (11) connected to the controller, wherein the controller comprises: a clock generation module (100), an input/output module (101), a configuration acquisition module (102), a clock delay module (103), and a sampling module (104); the clock generation module (100) acquires a current clock signal, generates an output clock signal according to the current clock signal, and outputs the output clock signal to the input/output module (101); the input/output module (101) outputs the output clock signal from the SPI (11) to an SPI Flash, and outputs the output clock signal to the clock delay module (103); the configuration acquisition module (102) acquires a configuration parameter and a delay enable signal, and outputs the configuration parameter and the delay enable signal to the clock delay module (103); the clock delay module (103) generates a sampling clock signal according to the delay enable signal, the output clock signal and the configuration parameter, and outputs the sampling clock signal to the sampling module (104); and the sampling module (104) receives SPI data by means of the SPI (11) and samples the SPI data by means of the sampling clock signal.
Description
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201611239614.0、申请日为2016年12月28日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application No. 20161123961, filed on Dec.
本发明涉及电子技术,尤其涉及一种数据采样方法、芯片和计算机存储介质。The present invention relates to electronic technologies, and more particularly to a data sampling method, a chip, and a computer storage medium.
串行外设接口(Serial Peripheral Interface,SPI)是一种高速的、全双工、同步的通信总线,并且在芯片的管脚上只占用四根线,节约了芯片的管脚,同时为印刷电路板(PCB,Printed Circuit Board)的布局上节省空间,提供方便。由于SPI具有简单易用的特性,越来越多的芯片集成了这种通信协议。随着SPI闪存(SPI Flash)越来越广泛的应用,速度越来越高,原有的芯片的设计已经无法满足高速采样数据的需求,需要增加对高速的支持,这是由于SPI FLASH只有输入时钟,没有输出时钟,输出的数据送给控制器采样,控制器通过内部的时钟采样,因为不同的Flash厂家输出延时不一样,PCB板级引入延时,可能还有桥接芯片引入更大延时,会降低芯片中控制器进行数据采样的稳定性。图1为芯片与SPI Flash的时钟、数据路径延时示意图,如图1所示,芯片与SPI Flash的数据路径延时主要包括:芯片时钟输出延时、PCB时钟走线延时、颗粒时钟输入延时、颗粒数据输出延时、PCB数据走线延时、芯片输入延时。现有的解决方案主要有以下
两种:The Serial Peripheral Interface (SPI) is a high-speed, full-duplex, synchronous communication bus that occupies only four wires on the pins of the chip, saving the pins of the chip and printing. The layout of the printed circuit board (PCB) saves space and provides convenience. Due to the ease of use of SPI, more and more chips integrate this communication protocol. With the increasing use of SPI flash (SPI Flash), the speed is getting higher and higher, the original chip design can not meet the demand of high-speed sampling data, and need to increase the support for high speed, this is because SPI FLASH only has input. Clock, no output clock, the output data is sent to the controller for sampling, the controller samples through the internal clock, because different Flash manufacturers output delay is different, PCB board level introduces delay, and possibly bridge chip introduces more delay This will reduce the stability of the data sampling of the controller in the chip. Figure 1 shows the clock and data path delay of the chip and SPI Flash. As shown in Figure 1, the data path delay of the chip and SPI Flash mainly includes: chip clock output delay, PCB clock trace delay, and particle clock input. Delay, particle data output delay, PCB data trace delay, chip input delay. The existing solutions mainly have the following
Two kinds:
(1)在芯片外部增加环路时钟输入,从而补偿芯片内部输出延时和输入延时。(1) Add a loop clock input outside the chip to compensate for the chip's internal output delay and input delay.
(2)在芯片内部增加高频时钟去采样。(2) Add high frequency clock to sample inside the chip.
在实现本发明的过程中,发明人发现现有技术中至少存在如下问题:In the process of implementing the present invention, the inventors have found that at least the following problems exist in the prior art:
(1)在芯片外部增加环路时钟仅仅能补偿芯片内部输出延时和输入延时,但是不能补偿PCB延时和外接电平转换芯片延时,另一方面,每个Flash厂家颗粒延时范围都不一致,因此也无法进行准确补偿。(1) Adding a loop clock outside the chip can only compensate the chip's internal output delay and input delay, but it can't compensate PCB delay and external level shifting chip delay. On the other hand, each Flash manufacturer's particle delay range They are all inconsistent and therefore cannot be accurately compensated.
(2)在芯片内部增加高频时钟,通过高频时钟的不同周期去采样。但是,高频时钟给时钟树带来麻烦,使采样操作变得繁琐。(2) Add a high-frequency clock inside the chip and sample it through different periods of the high-frequency clock. However, the high frequency clock causes trouble to the clock tree, making the sampling operation cumbersome.
发明内容Summary of the invention
本发明实施例提供一种数据采样方法、芯片和计算机存储介质,能够满足对不同速率的SPI数据进行采样的需求,实现数据的稳定采样,具有兼容性强,软件可控的特点。The embodiment of the invention provides a data sampling method, a chip and a computer storage medium, which can meet the requirement of sampling SPI data of different rates, realize stable sampling of data, and has the characteristics of strong compatibility and software controllability.
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种芯片,所述芯片包括:控制器及与所述控制器连接的SPI,所述控制器包括:时钟产生模块、输入输出模块、配置获取模块、时钟延时模块以及采样模块,所述输入输出模块与所述SPI连接,其中,An embodiment of the present invention provides a chip, where the chip includes: a controller and an SPI connected to the controller, where the controller includes: a clock generation module, an input and output module, a configuration acquisition module, and a clock delay module. a sampling module, the input and output module is connected to the SPI, wherein
所述时钟产生模块,配置为获取当前时钟信号,根据所述当前时钟信号生成输出时钟信号,输出所述输出时钟信号至所述输入输出模块;The clock generation module is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module;
所述输入输出模块,配置为将所述输出时钟信号通过所述SPI输出至SPI Flash,以及将所述输出时钟信号输出至所述时钟延时模块;The input/output module is configured to output the output clock signal to the SPI Flash through the SPI, and output the output clock signal to the clock delay module;
所述配置获取模块,配置为获取配置参数和延时使能信号,将所述配置参数和所述延时使能信号输出至所述时钟延时模块;
The configuration obtaining module is configured to acquire a configuration parameter and a delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module;
所述时钟延时模块,配置为根据所述延时使能信号、所述输出时钟信号和所述配置参数,生成采样时钟信号,将所述采样时钟信号输出至所述采样模块;The clock delay module is configured to generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter, and output the sampling clock signal to the sampling module;
所述采样模块,配置为通过所述SPI接收SPI数据,根据所述采样时钟信号对所述SPI数据进行采样。The sampling module is configured to receive SPI data through the SPI, and sample the SPI data according to the sampling clock signal.
在一实施例中,所述配置获取模块,配置为配置延时线级数M、延时单元级数N和所述延时使能信号,将所述延时线级数M、所述延时单元级数N以及所述延时使能信号输出至所述时钟延时模块;其中,M和N均为大于等于1的自然数。In an embodiment, the configuration obtaining module is configured to configure a delay line level M, a delay unit level N, and the delay enable signal, and the delay line level M, the delay The unit number of stages N and the delay enable signal are output to the clock delay module; wherein, M and N are both natural numbers greater than or equal to one.
在一实施例中,所述时钟延时模块包括:第一选择模块、第二选择模块和延时模块;其中,In an embodiment, the clock delay module includes: a first selection module, a second selection module, and a delay module; wherein
所述时钟延时模块,配置为根据所述延时线级数M配置第一级数,所述第一级数为所述第二选择模块的级数,以及根据所述延时线级数M配置第二级数,所述第二级数为所述延时模块的级数;The clock delay module is configured to configure a first level according to the delay line level M, the first level is a number of stages of the second selection module, and according to the delay line level M configuring a second level, the second level being the number of stages of the delay module;
所述第一选择模块的第一输入端与所述输入输出模块连接,所述第一选择模块的第二输入端与所述第二选择模块连接,所述第一选择模块的第三输入端与所述配置获取模块连接,所述第一选择模块的输出端与所述采样模块连接;a first input end of the first selection module is connected to the input and output module, a second input end of the first selection module is connected to the second selection module, and a third input end of the first selection module Connected to the configuration acquisition module, the output end of the first selection module is connected to the sampling module;
所述第二选择模块由M级第一选择子模块构成;其中,第k级中有2M-k个第一选择子模块;其中,k为大于等于1且小于等于M的自然数;The second selection module is composed of an M-level first selection sub-module; wherein, in the k-th stage, there are 2M-k first selection sub-modules; wherein k is a natural number greater than or equal to 1 and less than or equal to M;
所述延时模块由2M级延时子模块构成。The delay module is composed of a 2M-level delay sub-module.
在一实施例中,如果M等于1,所述第二选择模块中的第一选择子模块的第一输入端与第1级延时子模块连接;所述第一选择子模块的第二输入端与第2级延时子模块连接;所述第一选择子模块的输出端与所述第一选择模块连接。
In an embodiment, if M is equal to 1, the first input of the first selection sub-module of the second selection module is connected to the first-stage delay sub-module; the second input of the first selection sub-module The terminal is connected to the second-stage delay sub-module; the output end of the first selection sub-module is connected to the first selection module.
在一实施例中,如果M大于1,对于所述第二选择模块中的第k级第一选择子模块:In an embodiment, if M is greater than 1, for the kth first selection submodule of the second selection module:
当k等于1时,第一级中的第i个第一选择子模块的第一输入端与所述2M级延时子模块中的第2i-1级延时子模块连接;所述第i个第一选择子模块的第二输入端与所述2M级延时子模块中的第2i级延时子模块连接;当i为偶数时,所述第i个第一选择子模块的输出端与第2级的第i/2个第一选择子模块连接,或者当i为奇数时,所述第i个第一选择子模块的输出端与第2级的第(i+1)/2个第一选择子模块连接;其中,i为大于等于1且小于等于2M的自然数;When k is equal to 1, the first input end of the ith first selection submodule in the first stage is connected to the 2i-1th delay submodule in the 2M level delay submodule; The second input end of the first selection sub-module is connected to the 2i-th delay sub-module of the 2M-level delay sub-module; when i is an even number, the output end of the i-th first selection sub-module Connected to the i/2th first selection submodule of the second stage, or when i is an odd number, the output of the i th first selection submodule and the (i+1)/2 of the second stage The first selection sub-modules are connected; wherein i is a natural number greater than or equal to 1 and less than or equal to 2M;
当k大于1且小于M时,第k级中的第j个第一选择子模块的第一输入端与第k-1级中的第2j-1个第一选择子模块连接;所述第j个第一选择子模块的第二输入端与第k-1级中的第2j个第一选择子模块连接;当j为偶数时,所述第j个第一选择子模块的输出端与第k+1级中的第j/2个第一选择子模块连接,或者当j为奇数时,所述第j个第一选择子模块的输出端与第k+1级的第(j+1)/2个第一选择子模块连接;其中j为大于等于1且小于等于2M-k的自然数;When k is greater than 1 and less than M, the first input end of the jth first selection submodule in the kth stage is connected to the 2j-1 first selection submodule in the k-1th stage; The second input end of the j first selection sub-modules is connected to the 2j first selection sub-module in the k-1th stage; when j is an even number, the output end of the j-th first selection sub-module The j/2th first selection submodule in the k+1th stage is connected, or when j is an odd number, the output of the jth first selection submodule and the (k+th)th 1)/2 first selection sub-modules are connected; wherein j is a natural number greater than or equal to 1 and less than or equal to 2M-k;
当k等于M时,第M级中的第一选择子模块的第一输入端与第M-1级中的第一个第一选择子模块连接;所述第一选择子模块的第二输入端与第M-1级中的第二个第一选择子模块连接;所述第一选择子模块的输出端与所述第一选择模块连接。When k is equal to M, the first input of the first selection submodule in the Mth stage is connected to the first first selection submodule of the M-1th stage; the second input of the first selection submodule The terminal is connected to the second first selection submodule in the M-1th stage; the output end of the first selection submodule is connected to the first selection module.
在一实施例中,所述延时子模块包括:第三选择模块和寄存模块;其中,In an embodiment, the delay sub-module includes: a third selection module and a registration module; wherein
所述时钟延时模块,配置为根据所述延时单元级数N配置第三级数,所述第三级数为所述第三选择模块的级数,以及根据所述延时单元级数N配置第四级数,所述第四级数为所述寄存模块的级数;
The clock delay module is configured to configure a third level according to the delay unit number N, the third level is a number of stages of the third selection module, and according to the delay unit level N configuring a fourth level, the fourth level being the number of stages of the registration module;
所述第三选择模块由N级第二选择子模块构成;其中,第h级中有2M-h个第二选择子模块;其中,h为大于等于1且小于等于N的自然数;The third selection module is composed of an N-level second selection sub-module; wherein, in the h-th stage, there are 2M-h second selection sub-modules; wherein h is a natural number greater than or equal to 1 and less than or equal to N;
所述寄存模块由2N级寄存子模块构成。The registration module is composed of a 2N-level registration sub-module.
在一实施例中,如果N等于1,所述第三选择模块中的第二选择子模块的第一输入端与第一级寄存子模块连接;所述第二选择子模块的第二输入端与第二级寄存子模块连接;所述第二选择子模块的输出端与所述第二选择模块连接;In an embodiment, if N is equal to 1, the first input end of the second selection sub-module of the third selection module is connected to the first-level registration sub-module; the second input end of the second selection sub-module Connected to the second level storage submodule; the output end of the second selection submodule is connected to the second selection module;
在一实施例中,如果N大于1,对于所述第三选择模块中的第h级第二选择子模块:In an embodiment, if N is greater than 1, for the second selection sub-module of the h-th level in the third selection module:
当h等于1时,所述第一级中的第p个第二选择子模块的第一输入端与所述2N级寄存子模块中的第2p-1级寄存子模块连接;所述第p个第二选择子模块的第二输入端与所述2N级寄存子模块中的第2p级寄存子模块连接;当p为偶数时,所述第p个第二选择子模块的输出端与第二级的第p/2个第二选择模块,或者当p为奇数时,所述第p个第二选择子模块的输出端与第二级的第(p+1)/2个第二选择子模块连接;其中,p为大于等于1且小于等于2N的自然数;When h is equal to 1, the first input end of the pth second selection submodule in the first stage is connected to the 2p-1 level registration submodule in the 2N level register submodule; The second input end of the second selection sub-module is connected to the second p-level registration sub-module of the 2N-level registration sub-module; when p is an even number, the output end of the p-th second selection sub-module a second p/2 second selection module, or an output of the pth second selection submodule and a (p+1)/2 second selection of the second level when p is an odd number a submodule connection; wherein p is a natural number greater than or equal to 1 and less than or equal to 2N;
当h大于1且小于N时,第h级中的第q个第二选择子模块的第一输入端与第h-1级中的第2q-1个第二选择子模块连接;所述第q个第二选择子模块的第二输入端与第h-1级中的第2q个第二选择子模块连接;当q为偶数时,所述第q个第二选择子模块的输出端与第h+1级中的第q/2个第二选择子模块,或者当q为奇数时,所述第q个第二选择子模块的输出端与第h+1级中的第(q+1)/2个第二选择子模块连接;其中,q为大于等于1且小于等于2N-h的自然数;When h is greater than 1 and less than N, the first input end of the qth second selection submodule in the hth stage is connected with the 2q-1 second selection submodule in the h-1th stage; The second input end of the q second selection sub-modules is connected to the 2q second second selection sub-module in the h-1th stage; when q is an even number, the output end of the q-th second selection sub-module The q/2th second selection submodule in the h+1th stage, or the output of the qth second selection submodule and the (h+)th in the h+1th level when q is an odd number 1)/2 second selection sub-modules are connected; wherein q is a natural number greater than or equal to 1 and less than or equal to 2N-h;
当h等于N时,第N级中的第二选择子模块的第一输入端与第N-1级中的第一个第二选择子模块连接;所述第二选择子模块的第二输入端与第
N-1级中的第二个第二选择子模块连接;所述第二选择子模块的输出端与所述第二选择模块连接。When h is equal to N, the first input of the second selection sub-module in the Nth stage is connected to the first second selection sub-module of the N-1th stage; the second input of the second selection sub-module End and
The second second selection sub-module of the N-1 stage is connected; the output end of the second selection sub-module is connected to the second selection module.
在一实施例中,所述第一选择子模块和第二选择子模块为选择器;In an embodiment, the first selection submodule and the second selection submodule are selectors;
所述寄存子模块为寄存器。The registration sub-module is a register.
本发明实施例还提供了一种数据采样方法,所述方法包括:The embodiment of the invention further provides a data sampling method, the method comprising:
获取当前时钟信号,根据所述当前时钟信号生成输出时钟信号;Acquiring a current clock signal, and generating an output clock signal according to the current clock signal;
获取配置参数和延时使能信号,根据所述延时使能信号、所述输出时钟信号和所述配置参数,生成采样时钟信号;Obtaining a configuration parameter and a delay enable signal, and generating a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter;
接收SPI数据,通过所述采样时钟信号对所述SPI数据进行采样。The SPI data is received, and the SPI data is sampled by the sampling clock signal.
在一实施例中,所述配置参数包括延时线级数M和延时单元级数N;其中,M和N均为大于等于1的自然数。In an embodiment, the configuration parameter includes a delay line level M and a delay unit level N; wherein M and N are both natural numbers greater than or equal to 1.
在一实施例中,所述接收SPI数据之前,所述方法还包括:In an embodiment, before the receiving the SPI data, the method further includes:
获取预设校验数据,通过所述采样时钟信号对所述预设校验数据进行采样,获得校验采样数据;Acquiring preset verification data, sampling the preset verification data by using the sampling clock signal, and obtaining verification sampling data;
根据所述采样数据和所述校验采样数据判断所述配置参数是否满足预设规则,如果所述配置参数满足所述预设规则,则对所述SPI数据进行采样。Determining, according to the sampling data and the check sampling data, whether the configuration parameter meets a preset rule, and if the configuration parameter satisfies the preset rule, sampling the SPI data.
在一实施例中,所述根据所述采样数据和所述校验采样数据判断所述配置参数是否满足预设规则,还包括:In an embodiment, the determining, according to the sampling data and the check sampling data, whether the configuration parameter meets a preset rule, further includes:
如果所述配置参数不满足所述预设规则,则对所述配置参数进行调整,直到调整后的配置参数满足所述预设规则。If the configuration parameter does not meet the preset rule, the configuration parameter is adjusted until the adjusted configuration parameter meets the preset rule.
在一实施例中,所述对所述配置参数进行调整,包括:In an embodiment, the adjusting the configuration parameter includes:
根据预设方法对所述延时线级数M和所述延时单元级数N进行调整。The delay line level M and the delay unit level N are adjusted according to a preset method.
在一实施例中,所述获得采样数据之后,所述方法还包括:In an embodiment, after the obtaining the sampling data, the method further includes:
将所述采样数据输出至寄存器;
Outputting the sampled data to a register;
当获取读取请求时,将所述采样数据按照预设时钟域进行读取,获得更新的采样数据;When the read request is obtained, the sampled data is read according to a preset clock domain to obtain updated sample data;
使用所述更新的采样数据。The updated sampled data is used.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的数据采样方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the data sampling method according to the embodiment of the invention.
由此可见,在本发明实施例的技术方案中,获取当前时钟信号,根据当前时钟信号生成输出时钟信号;获取配置参数和延时使能信号,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号;接收SPI数据,通过采样时钟信号对SPI数据进行采样,获得采样数据。也就是说,在本发明提出的技术方案中,可以根据当前时钟信号获取采样时钟信号,然后通过采样时钟信号对SPI数据进行采样,从而获得采样数据。显然,和现有技术相比,本发明实施例的技术方案,能够满足对不同速率的SPI数据进行采样的需求,实现数据的稳定采样,具有兼容性强,软件可控的特点。Therefore, in the technical solution of the embodiment of the present invention, the current clock signal is acquired, an output clock signal is generated according to the current clock signal, and the configuration parameter and the delay enable signal are acquired, according to the delay enable signal, the output clock signal, and the configuration. The parameter generates a sampling clock signal; receives the SPI data, samples the SPI data by the sampling clock signal, and obtains the sampling data. That is to say, in the technical solution proposed by the present invention, the sampling clock signal can be acquired according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data. Obviously, compared with the prior art, the technical solution of the embodiment of the present invention can meet the requirement of sampling SPI data of different rates, realize stable sampling of data, and has the characteristics of strong compatibility and software controllability.
图1为芯片与SPI Flash的时钟、数据路径延时示意图;Figure 1 is a schematic diagram of the clock and data path delay of the chip and SPI Flash;
图2为本发明实施例中本发明实施例中芯片的第一组成结构示意图;2 is a schematic diagram of a first component structure of a chip according to an embodiment of the present invention;
图3为本发明实施例中芯片时钟信号传输示意图;3 is a schematic diagram of chip clock signal transmission in an embodiment of the present invention;
图4为本发明实施例中芯片的第二组成结构示意图;4 is a schematic diagram showing a second component structure of a chip according to an embodiment of the present invention;
图5为本发明实施例中时钟延时模块的第一连接结构示意图FIG. 5 is a schematic diagram of a first connection structure of a clock delay module according to an embodiment of the present invention;
图6为本发明实施例中时钟延时模块的第二连接结构示意图;6 is a schematic diagram of a second connection structure of a clock delay module according to an embodiment of the present invention;
图7为本发明实施例中芯片的第三组成结构示意图;FIG. 7 is a schematic structural diagram of a third component of a chip according to an embodiment of the present invention; FIG.
图8为本发明实施例中延时子模块的第一连接结构示意图;8 is a schematic diagram of a first connection structure of a delay sub-module according to an embodiment of the present invention;
图9为本发明实施例中数据采样方法的实现流程示意图;
FIG. 9 is a schematic flowchart of an implementation process of a data sampling method according to an embodiment of the present invention; FIG.
图10为本发明实施例中校验配置参数方法的实现流程示意图;10 is a schematic flowchart of an implementation process of a method for verifying configuration parameters according to an embodiment of the present invention;
图11为本发明实施例中采样时钟信号延时示意图。FIG. 11 is a schematic diagram of a delay of a sampling clock signal according to an embodiment of the present invention.
下面结合附图对本发明实施例提供的一种数据采样方法和芯片进行详细地描述。A data sampling method and a chip provided by an embodiment of the present invention are described in detail below with reference to the accompanying drawings.
实施例一 Embodiment 1
本发明实施例公开了一种芯片1,图2为本发明实施例中芯片的第一组成结构示意图,如图2所示,芯片1包括:控制器10及与控制器10连接的SPI11,其中,上述控制器10可以通过单根数据线、双根数据线以及四根数据线中的任意一种产生输出时钟。The embodiment of the present invention discloses a chip 1. FIG. 2 is a schematic diagram of a first component structure of a chip according to an embodiment of the present invention. As shown in FIG. 2, the chip 1 includes: a controller 10 and an SPI 11 connected to the controller 10, wherein The controller 10 can generate an output clock by using any one of a single data line, two data lines, and four data lines.
在本发明的具体实施例中,控制器10包括:时钟产生模块100、输入输出模块101、配置获取模块102、时钟延时模块103以及采样模块104,其中,输入输出模块101与SPI11连接。In a specific embodiment of the present invention, the controller 10 includes a clock generation module 100, an input and output module 101, a configuration acquisition module 102, a clock delay module 103, and a sampling module 104. The input and output module 101 is connected to the SPI 11.
时钟产生模块100,配置为获取当前时钟信号,根据当前时钟信号生成输出时钟信号,输出上述输出时钟信号至输入输出模块101。The clock generation module 100 is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module 101.
在本发明的具体实施例中,时钟产生模块100可以获取当前工作时钟域的当前时钟信号,然后根据当前时钟信号生成输出时钟信号,将上述输出时钟信号至输入输出模块101。In a specific embodiment of the present invention, the clock generation module 100 can acquire the current clock signal of the current working clock domain, and then generate an output clock signal according to the current clock signal, and output the clock signal to the input/output module 101.
在本发明的具体实施例中,由于当前工作时钟域的频率为输出时钟信号的两倍,时钟产生模块100需要对获取的当前时钟信号进行转换,获得输出时钟信号。In a specific embodiment of the present invention, since the frequency of the current working clock domain is twice the output clock signal, the clock generating module 100 needs to convert the acquired current clock signal to obtain an output clock signal.
在本发明的具体实施例中,时钟产生模块100可以通过单根数据线、双根数据线以及四根数据线中的任意一种将上述输出时钟信号输出至输入输出模块101。In a specific embodiment of the present invention, the clock generation module 100 may output the output clock signal to the input/output module 101 through any one of a single data line, two data lines, and four data lines.
在本发明的具体实施例中,时钟产生模块100在将上述输出时钟信号
至输入输出模块101的同时,还向输入输出模块101输出预设使能信号,该预设使能信号用于控制输入输出模块101是否对上述输出时钟信号进行输出。In a specific embodiment of the present invention, the clock generation module 100 is configured to output the clock signal
At the same time as the input/output module 101, a preset enable signal is output to the input/output module 101, and the preset enable signal is used to control whether the input/output module 101 outputs the output clock signal.
输入输出模块101,配置为将输出时钟信号通过SPI11输出至SPI Flash,以及将输出时钟信号输出至时钟延时模块103。The input and output module 101 is configured to output an output clock signal to the SPI Flash through the SPI 11 and output the output clock signal to the clock delay module 103.
在本发明的具体实施例中,输入输出模块101接收到时钟产生模块100发送的输出时钟信号后,可以将该输出时钟信号同时输出至SPI Flash以及时钟延时模块103。其中,输入输出模块101通过SPI11将输出时钟信号进行输出。In an embodiment of the present invention, after receiving the output clock signal sent by the clock generation module 100, the input and output module 101 can simultaneously output the output clock signal to the SPI Flash and the clock delay module 103. The input/output module 101 outputs an output clock signal through the SPI 11.
在本发明的具体实施例中,输入输出模块101接收到时钟产生模块100发送的输出时钟信号的同时,输入输出模块101还接收到时钟产生模块100发送的预设使能信号,该预设使能信号用于控制输入输出模块101是否对上述输出时钟信号进行输出。In the specific embodiment of the present invention, the input and output module 101 receives the output clock signal sent by the clock generation module 100, and the input and output module 101 further receives the preset enable signal sent by the clock generation module 100. The enable signal is used to control whether the input/output module 101 outputs the output clock signal.
在本发明的具体实施例中,当预设使能信号对应的为预设的开启信号时,输入输出模块101将该输出时钟信号同时输出至SPI Flash以及时钟延时模块103;当预设使能信号对应的为预设的关闭信号时,输入输出模块101将不对该输出时钟信号进行输出。In a specific embodiment of the present invention, when the preset enable signal corresponds to a preset enable signal, the input and output module 101 simultaneously outputs the output clock signal to the SPI Flash and the clock delay module 103; When the enable signal corresponds to a preset off signal, the input/output module 101 will not output the output clock signal.
所述配置获取模块102,配置为获取配置参数和延时使能信号,将配置参数和延时使能信号输出至时钟延时模块103。The configuration obtaining module 102 is configured to acquire configuration parameters and a delay enable signal, and output the configuration parameters and the delay enable signal to the clock delay module 103.
在本发明的具体实施例中,所述配置获取模块102获取配置参数和延时使能信号之后,将配置参数和延时使能信号输出至时钟延时模块103。其中,配置参数和延时使能信号可以预先存储在芯片中的寄存器中,然后由寄存器发送给配置获取模块102。In a specific embodiment of the present invention, after the configuration obtaining module 102 acquires the configuration parameter and the delay enable signal, the configuration parameter and the delay enable signal are output to the clock delay module 103. The configuration parameters and the delay enable signal may be pre-stored in a register in the chip and then sent to the configuration acquisition module 102 by the register.
在本发明的具体实施例中,所述配置获取模块102配置为配置配置参数和延时使能信号,将配置参数和延时使能信号输出至时钟延时模块103。
其中,配置参数包括:延时线级数M和延时单元级数N;其中,M和N均为大于等于1的自然数。In a specific embodiment of the present invention, the configuration obtaining module 102 is configured to configure a configuration parameter and a delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module 103.
The configuration parameters include: a delay line level M and a delay unit level N; wherein, M and N are natural numbers greater than or equal to 1.
在本发明的具体实施例中,配置参数用于配置时钟延时模块103的组成结构,延时使能信号用于控制时钟延时模块103是否输出采样时钟信号。In a specific embodiment of the present invention, the configuration parameters are used to configure the composition of the clock delay module 103, and the delay enable signal is used to control whether the clock delay module 103 outputs the sampling clock signal.
所述时钟延时模块103,配置为根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号,将采样时钟信号输出至采样模块104。The clock delay module 103 is configured to generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter, and output the sampling clock signal to the sampling module 104.
在本发明的具体实施例中,时钟延时模块103在接收到由输入输出模块101发送的输出时钟信号、由配置获取模块102发送的配置参数和延时使能信号之后,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号,将采样时钟信号输出至采样模块104。In a specific embodiment of the present invention, after receiving the output clock signal sent by the input/output module 101, the configuration parameters sent by the configuration acquisition module 102, and the delay enable signal, the clock delay module 103 is enabled according to the delay. The signal, the output clock signal, and the configuration parameters generate a sampling clock signal, and the sampling clock signal is output to the sampling module 104.
所述采样模块104,配置为通过SPI11接收SPI数据,根据采样时钟信号对SPI数据进行采样。The sampling module 104 is configured to receive SPI data through the SPI 11 and sample the SPI data according to the sampling clock signal.
在本发明的具体实施例中,采样模块104在获取由时钟延时模块103发送的采样时钟信号以后,可以通过SPI11接收SPI数据,然后根据采样时钟信号对SPI数据进行采样,最终得到采样数据。In a specific embodiment of the present invention, after acquiring the sampling clock signal sent by the clock delay module 103, the sampling module 104 can receive the SPI data through the SPI11, and then sample the SPI data according to the sampling clock signal, and finally obtain the sampling data.
图3为本发明实施例中芯片时钟信号传输示意图,如图3所示,时钟产生模块100获取当前时钟信号wclk,生成输出时钟信号spi_clk_o以及预设使能信号spi_clk_oe,输出上述输出时钟信号以及预设使能信号至输入输出模块101;输入输出模块101将输出时钟信号spi_clk_o作为通讯同步时钟信号spi_clk通过SPI11输出至SPI Flash,以及将输出时钟信号spi_clk_o作为输入时钟信号clk_in输出至时钟延时模块103;时钟延时模块103在接收到由输入输出模块101发送的输出时钟信号、由配置获取模块102发送的配置参数M、N和延时使能信号tapdly_en之后,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号clk_sample,将采样时钟信号输出至采样模块104;采样模块104可以通过SPI11接收SPI数据spi_dat,然
后根据采样时钟信号对SPI数据进行采样,最终得到采样数据,将采样数据输出至先入先出队列to_fifo。3 is a schematic diagram of chip clock signal transmission according to an embodiment of the present invention. As shown in FIG. 3, the clock generation module 100 acquires a current clock signal wclk, generates an output clock signal spi_clk_o, and a preset enable signal spi_clk_oe, and outputs the output clock signal and a pre- An enable signal is provided to the input/output module 101; the input/output module 101 outputs the output clock signal spi_clk_o as a communication synchronous clock signal spi_clk to the SPI Flash through the SPI 11, and outputs the output clock signal spi_clk_o as an input clock signal clk_in to the clock delay module 103. The clock delay module 103 receives the output clock signal sent by the input/output module 101, the configuration parameters M and N sent by the configuration acquisition module 102, and the delay enable signal tapdly_en, according to the delay enable signal and the output clock. Signal and configuration parameters, generate sampling clock signal clk_sample, output sampling clock signal to sampling module 104; sampling module 104 can receive SPI data spi_dat through SPI11,
After that, the SPI data is sampled according to the sampling clock signal, and finally the sampling data is obtained, and the sampling data is output to the first-in first-out queue to_fifo.
实施例二Embodiment 2
图4为本发明实施例中芯片的第二组成结构示意图,如图4所示,时钟延时模块103包括第一选择模块1030、第二选择模块1031以及延时模块1032,其中,第二选择模块1031包括第一选择子模块10310,延时模块1032包括延时子模块10320。4 is a schematic diagram of a second component structure of a chip according to an embodiment of the present invention. As shown in FIG. 4, the clock delay module 103 includes a first selection module 1030, a second selection module 1031, and a delay module 1032. The module 1031 includes a first selection sub-module 10310, and the delay module 1032 includes a delay sub-module 10320.
在本发明的具体实施例中,时钟延时模块103配置为根据上述延时线级数M配置第一级数,所述第一级数为所述第二选择模块1031的级数,同时根据上述延时线级数M配置第二级数,所述第二级数为所述延时模块1032的级数。例如,当延时线级数M为3时,时钟延时模块103配置第一级数为3,同时配置第二级数也为3。In a specific embodiment of the present invention, the clock delay module 103 is configured to configure a first level according to the delay line number M, wherein the first level is the number of stages of the second selection module 1031, and according to The delay line level M is configured with a second level, and the second level is the number of stages of the delay module 1032. For example, when the delay line level M is 3, the clock delay module 103 configures the first level to be 3, and the second level is also set to 3.
在本发明的具体实施例中,第二选择模块1031由M级第一选择子模块10310构成;其中,第k级中有2M-k个第一选择子模块10310;其中,k为大于等于1且小于等于M的自然数;延时模块1032由2M级延时子模块10320构成。In a specific embodiment of the present invention, the second selection module 1031 is composed of an M-level first selection sub-module 10310; wherein, in the k-th stage, there are 2M-k first selection sub-modules 10310; wherein k is greater than or equal to 1 And the natural number is less than or equal to M; the delay module 1032 is composed of the 2M-level delay sub-module 10320.
图5为本发明实施例中时钟延时模块的第一连接结构示意图,如图5所示,第一选择模块1030的第一输入端与输入输出模块101连接,第一选择模块1030的第二输入端与第二选择模块1031连接,第一选择模块1030的第三输入端与配置获取模块102连接,第一选择模块1030的输出端与采样模块104连接。FIG. 5 is a schematic diagram of a first connection structure of a clock delay module according to an embodiment of the present invention. As shown in FIG. 5, a first input end of the first selection module 1030 is connected to the input/output module 101, and a second selection module 1030 is second. The input end is connected to the second selection module 1031, the third input end of the first selection module 1030 is connected to the configuration acquisition module 102, and the output end of the first selection module 1030 is connected to the sampling module 104.
在本发明的具体实施例中,第一选择模块1030获取由输入输出模块101发送的输出时钟信号,且第一选择模块1030获取由第二选择模块1031发送的采样时钟信号,同时,第一选择模块1030获取由配置获取模块102发送的延时使能信号,第一选择模块1030根据延时使能信号选择输出上述输
出时钟信号,或者,输出上述采样时钟信号。In a specific embodiment of the present invention, the first selection module 1030 acquires the output clock signal sent by the input and output module 101, and the first selection module 1030 acquires the sampling clock signal sent by the second selection module 1031, and at the same time, the first selection The module 1030 obtains the delay enable signal sent by the configuration acquisition module 102, and the first selection module 1030 selects and outputs the output according to the delay enable signal.
The clock signal is output, or the sampling clock signal is output.
在本发明的具体实时例中,配置获取模块102发送的延时使能信号用于控制第一选择模块1030的输出,作为一种实施方式,延时使能信号是根据输出时钟信号的速率配置的。In a specific real-time example of the present invention, the delay enable signal sent by the configuration obtaining module 102 is used to control the output of the first selection module 1030. As an implementation manner, the delay enable signal is configured according to the rate of the output clock signal. of.
在本发明的具体实施例中,当输出时钟信号的速率大于预设阈值时,可以将延时使能信号置为1,表示控制第一选择模块1030输出采样时钟信号;当输出时钟信号的速率小于预设阈值时,可以将延时使能信号置为0,表示控制第一选择模块1030输出时钟信号。In a specific embodiment of the present invention, when the rate of the output clock signal is greater than a preset threshold, the delay enable signal may be set to 1, indicating that the first selection module 1030 is controlled to output the sampling clock signal; when the rate of the clock signal is output When the threshold is less than the preset threshold, the delay enable signal may be set to 0, indicating that the first selection module 1030 is controlled to output a clock signal.
图6为本发明实施例中时钟延时模块的第二连接结构示意图。FIG. 6 is a schematic diagram of a second connection structure of a clock delay module according to an embodiment of the present invention.
如图6所示,当M等于1,即第二选择模块1031由1级第一选择子模块10310构成,延时模块1032由2级延时子模块10320构成。第二选择模块1031中的第一选择子模块10310的第一输入端与第一级延时子模块10320连接;第一选择子模块10310的第二输入端与第二级延时子模块10320连接;第一选择子模块10310的输出端与第一选择模块1030连接。As shown in FIG. 6, when M is equal to 1, that is, the second selection module 1031 is composed of the first-order first selection sub-module 10310, the delay module 1032 is composed of the 2-level delay sub-module 10320. The first input end of the first selection submodule 10310 in the second selection module 1031 is connected to the first stage delay submodule 10320; the second input end of the first selection submodule 10310 is connected to the second stage delay submodule 10320. The output of the first selection sub-module 10310 is coupled to the first selection module 1030.
如上述图6所示,当M大于1,即第二选择模块1031由M级第一选择子模块10310构成,延时模块1032由2M级延时子模块10320构成。As shown in FIG. 6 above, when M is greater than 1, that is, the second selection module 1031 is composed of the M-level first selection sub-module 10310, and the delay module 1032 is composed of the 2M-level delay sub-module 10320.
在本发明的具体实施例中,对于第二选择模块1031中的第k级第一选择子模块10310:In a specific embodiment of the present invention, for the kth level first selection submodule 10310 in the second selection module 1031:
当k等于1时,第1级中的第i个第一选择子模块10310的第一输入端与2M级延时子模块10320中的第2i-1级延时子模块10320连接;第i个第一选择子模块10310的第二输入端与2M级延时子模块10320中的第2i级延时子模块10320连接;当i为偶数时,第i个第一选择子模块10310的输出端与第2级的第i/2个第一选择子模块10310连接,或者当i为奇数时,第i个第一选择子模块10310的输出端与第2级的第(i+1)/2个第一选择子模块10310连接;其中,i为大于等于1且小于等于2M的自然数;当k大于
1且小于M时,第k级中的第j个第一选择子模块10310的第一输入端与第k-1级中的第2j-1个第一选择子模块10310连接;第j个第一选择子模块10310的第二输入端与第k-1级中的第2j个第一选择子模块10310连接;当j为偶数时,第j个第一选择子模块10310的输出端与第k+1级中的第j/2个第一选择子模块10310连接,或者当j为奇数时,第j个第一选择子模块10310的输出端与第k+1级的第(j+1)/2个第一选择子模块10310连接;其中j为大于等于1且小于等于2M-k的自然数;当k等于M时,第M级中的第一选择子模块10310的第一输入端与第M-1级中的第一个第一选择子模块10310连接;第一选择子模块10310的第二输入端与第M-1级中的第二个第一选择子模块10310连接;第一选择子模块10310的输出端与第一选择模块1030连接。When k is equal to 1, the first input of the i-th first selection sub-module 10310 in the first stage is connected to the 2i-1-th delay sub-module 10320 in the 2M-stage delay sub-module 10320; the ith The second input end of the first selection sub-module 10310 is connected to the 2i-th delay sub-module 10320 in the 2M-level delay sub-module 10320; when i is an even number, the output of the i-th first selection sub-module 10310 is The i/2th first selection submodule 10310 of the second stage is connected, or when i is an odd number, the output of the i th first selection submodule 10310 and the (i+1)/2th of the second level The first selection sub-module 10310 is connected; wherein i is a natural number greater than or equal to 1 and less than or equal to 2M; when k is greater than
1 and less than M, the first input end of the jth first selection submodule 10310 in the kth stage is connected to the 2j-1 first selection submodule 10310 in the k-1th stage; the jth The second input end of a selection submodule 10310 is connected to the 2jth first selection submodule 10310 in the k-1th stage; when j is an even number, the output end of the jth first selection submodule 10310 and the kth The j/2th first selection sub-module 10310 in the +1 level is connected, or when j is an odd number, the output end of the jth first selection sub-module 10310 and the (k+1)th of the k+1th level /2 first selection sub-modules 10310 are connected; wherein j is a natural number greater than or equal to 1 and less than or equal to 2M-k; when k is equal to M, the first input end of the first selection sub-module 10310 in the M-th stage The first first selection sub-module 10310 in the M-1 level is connected; the second input end of the first selection sub-module 10310 is connected to the second first selection sub-module 10310 in the M-1th stage; The output of the sub-module 10310 is coupled to the first selection module 1030.
在本发明的具体实施例中,基于上述图6的钟延时模块的第三连接结构示意图,例如,当M=3,i=1,j=2时,第一级中的第一个第一选择子模块10310的第一输入端与8级延时子模块10320中的第一级延时子模块10320连接;第一个第一选择子模块10310的第二输入端与8级延时子模块10320中的第二级延时子模块10320连接;第一个第一选择子模块10310的输出端与第2级的第二个第一选择子模块10310连接;第二级中的第二个第一选择子模块10310的第一输入端与第一级中的第三个第一选择子模块10310连接;第二个第一选择子模块10310的第二输入端与第一级中的第四个第一选择子模块10310连接;第二个第一选择子模块10310的输出端与第三级的第一个第一选择子模块10310连接;第三级中的第一选择子模块10310的第一输入端与第二级中的第一个第一选择子模块10310连接;第一选择子模块10310的第二输入端与第二级中的第二个第一选择子模块10310连接;第一选择子模块10310的输出端与第一选择模块1030连接。In a specific embodiment of the present invention, based on the third connection structure diagram of the clock delay module of FIG. 6, for example, when M=3, i=1, j=2, the first first selection in the first stage The first input end of the sub-module 10310 is connected to the first-stage delay sub-module 10320 in the 8-level delay sub-module 10320; the second input end of the first first selection sub-module 10310 and the 8-level delay sub-module 10320 The second stage delay sub-module 10320 is connected; the output of the first first selection sub-module 10310 is connected to the second first selection sub-module 10310 of the second stage; the second first in the second stage The first input of the selection sub-module 10310 is connected to the third first selection sub-module 10310 of the first stage; the second input of the second first selection sub-module 10310 and the fourth of the first level A selection sub-module 10310 is connected; the output of the second first selection sub-module 10310 is connected to the first first selection sub-module 10310 of the third-level; the first input of the first selection sub-module 10310 in the third level The terminal is connected to the first first selection submodule 10310 in the second stage; the first selection submodule 10310 second input terminal of the second stage of the second sub first selection module 10310 is connected; a first output terminal selection sub-module 10310 and the first selection module 1030 is connected.
实施例三
Embodiment 3
图7为本发明实施例中芯片的第三组成结构示意图,如图7所示,延时子模块10320包括第三选择模块103200和寄存模块103201,其中,第三选择模块103200包括第二选择子模块1032000,寄存模块103201包括寄存子模块1032010。FIG. 7 is a schematic diagram of a third component structure of a chip according to an embodiment of the present invention. As shown in FIG. 7, the delay sub-module 10320 includes a third selection module 103200 and a registration module 103201, wherein the third selection module 103200 includes a second selector. Module 1032000, registration module 103201 includes a registration sub-module 1032010.
在本发明的具体实施例中,时钟延时模块103配置根据上述延时单元级数N配置第三级数,所述第三级数为第三选择模块103200的级数,以及根据上述延时单元级数N配置第四级数,所述第四级数为所述寄存模块103201的级数。例如,当延时单元级数N为3时,时钟延时模块103配置第三选择模块103200的级数为3,同时配置寄存模块103201的级数也为3。In a specific embodiment of the present invention, the clock delay module 103 is configured to configure a third level according to the delay unit level N, wherein the third level is the number of stages of the third selection module 103200, and according to the delay The unit number N configures a fourth level, which is the number of stages of the registration module 103201. For example, when the delay unit number N is 3, the clock delay module 103 configures the number of stages of the third selection module 103200 to be 3, and the number of stages of the configuration registration module 103201 is also 3.
在本发明的具体实施例中,第三选择模块103200由N级第二选择子模块1032000构成;其中,第k级中有2N-k个第二选择子模块1032000;其中,k为大于等于1且小于等于M的自然数;寄存模块103201由2N级寄存子模块1032010构成。In a specific embodiment of the present invention, the third selection module 103200 is composed of an N-level second selection sub-module 1032000; wherein, in the k-th stage, there are 2N-k second selection sub-modules 1032000; wherein k is greater than or equal to 1 And a natural number less than or equal to M; the registration module 103201 is composed of a 2N-level registration sub-module 1032010.
图8为本发明实施例中延时子模块的第一连接结构示意图。FIG. 8 is a schematic diagram of a first connection structure of a delay sub-module according to an embodiment of the present invention.
如图8所示,当N等于1,即第三选择模块103200由1级第二选择子模块1032000构成,寄存模块103201由2级寄存子模块1032010构成。第三选择模块103200中的第二选择子模块1032000的第一输入端与第一级寄存子模块1032010连接;第二选择子模块1032000的第二输入端与第二级寄存子模块1032010连接;第二选择子模块1032000的输出端与第二选择模块1031连接;As shown in FIG. 8, when N is equal to 1, that is, the third selection module 10320 is constituted by the 1-stage second selection sub-module 1032000, the registration module 103201 is constituted by the 2-level registration sub-module 1032010. The first input end of the second selection sub-module 1032000 in the third selection module 103200 is connected to the first-level registration sub-module 1032010; the second input end of the second selection sub-module 1032000 is connected to the second-level registration sub-module 1032010; The output of the second selection submodule 1032000 is connected to the second selection module 1031;
如上述图8所示,当N大于1,即第三选择模块103200由N级第二选择子模块1032000构成,寄存模块103201由2N级寄存子模块1032010构成。As shown in FIG. 8 above, when N is greater than 1, that is, the third selection module 103200 is constituted by the N-level second selection sub-module 1032000, and the registration module 103201 is constituted by the 2N-level registration sub-module 1032010.
在本发明的具体实施例中,对于第三选择模块103200中的第h级第二选择子模块1032000:
In a specific embodiment of the present invention, for the second selection submodule 1032000 in the third selection module 10320:
当h等于1时,第一级中的第p个第二选择子模块1032000的第一输入端与2N级寄存子模块1032010中的第2p-1级寄存子模块1032010连接;第p个第二选择子模块1032000的第二输入端与2N级寄存子模块1032010中的第2p级寄存子模块1032010连接;当p为偶数时,第p个第二选择子模块1032000的输出端与第2级的第p/2个第二选择模块1032000连接,或者当p为奇数时,第p个第二选择子模块1032000的输出端与第2级的第(p+1)/2个第二选择子模块1032000连接;其中,p为大于等于1且小于等于2N的自然数;当h大于1且小于N时,第h级中的第q个第二选择子模块1032000的第一输入端与第h-1级中的第2q-1个第二选择子模块1032000连接;第q个第二选择子模块1032000的第二输入端与第h-1级中的第2q个第二选择子模块1032000连接;当q为偶数时,所述第q个第二选择子模块1032000的输出端与第h+1级中的第q/2个第二选择子模块1032000连接,或者当q为奇数时,所述第q个第二选择子模块1032000的输出端与第h+1级中的第(q+1)/2个第二选择子模块1032000连接;其中,q为大于等于1且小于等于2N-h的自然数;当h等于N时,第N级中的第二选择子模块1032000的第一输入端与第N-1级中的第一个第二选择子模块1032000连接;第二选择子模块1032000的第二输入端与第N-1级中的第二个第二选择子模块1032000连接;第二选择子模块1032000的输出端与第二选择模块1031连接。When h is equal to 1, the first input of the pth second selection submodule 1032000 in the first stage is connected to the 2p-1 level registration submodule 1032010 in the 2N level registration submodule 1032010; the pth second The second input of the selection sub-module 1032000 is connected to the 2p-level registration sub-module 1032010 in the 2N-level registration sub-module 1032010; when p is an even number, the output of the p-th second selection sub-module 1032000 and the second-level The p/2 second selection modules 1032000 are connected, or when p is an odd number, the output of the pth second selection submodule 1032000 and the (p+1)/2 second selection submodules of the second stage 1032000 connection; wherein p is a natural number greater than or equal to 1 and less than or equal to 2N; when h is greater than 1 and less than N, the first input end and the h-1th of the qth second selection submodule 1032000 in the hth stage The 2q-1 second selection sub-modules 1032000 in the stage are connected; the second input end of the qth second selection sub-module 1032000 is connected to the 2qth second selection sub-module 1032000 in the h-1th level; When q is an even number, the output of the qth second selection submodule 1032000 and the q/2th second selection submodule 1 of the h+1th stage 032000 is connected, or when q is an odd number, the output of the qth second selection sub-module 1032000 is connected to the (q+1)/2 second selection sub-module 1032000 in the h+1th stage; , q is a natural number greater than or equal to 1 and less than or equal to 2N-h; when h is equal to N, the first input end of the second selection sub-module 1032000 in the Nth stage and the first second of the N-1th stage The selection sub-module 1032000 is connected; the second input end of the second selection sub-module 1032000 is connected to the second second selection sub-module 1032000 in the N-1th stage; the output end of the second selection sub-module 1032000 and the second selection module 1031 connection.
在本发明的具体实施例中,基于上述图8的延时子模块的第一连接结构示意图,例如,当N=3,p=1,q=2时,第一级中的第一个第二选择子模块1032000的第一输入端与8级寄存子模块1032010中的第一级寄存子模块1032010连接;第一个第二选择子模块1032000的第二输入端与8级寄存子模块1032010中的第二级寄存子模块1032010连接;第一个第二选择子模块1032000的输出端与第二级的第一个第二选择子模块1032000连接;
第二级中的第二个第二选择子模块1032000的第一输入端与第一级中的第三个第二选择子模块1032000连接;第二个第二选择子模块1032000的第二输入端与第一级中的第四个第二选择子模块1032000连接;第二个第二选择子模块1032000的输出端与第三级中的第一个第二选择子模块1032000连接;第三级中的第二选择子模块1032000的第一输入端与第二级中的第一个第二选择子模块1032000连接;第二选择子模块1032000的第二输入端与第二级中的第二个第二选择子模块1032000连接;第二选择子模块1032000的输出端与第二选择模块1031连接。In a specific embodiment of the present invention, based on the first connection structure diagram of the delay sub-module of FIG. 8 above, for example, when N=3, p=1, q=2, the first one in the first stage The first input end of the second selection sub-module 1032000 is connected to the first-level registration sub-module 1032010 in the 8-level registration sub-module 1032010; the second input end of the first second selection sub-module 1032000 and the 8-level registration sub-module 1032010 The second level storage sub-module 1032010 is connected; the output of the first second selection sub-module 1032000 is connected to the first second selection sub-module 1032000 of the second level;
The first input of the second second selection sub-module 1032000 in the second stage is coupled to the third second selection sub-module 1032000 in the first stage; the second input of the second second selection sub-module 1032000 Connected to the fourth second selection sub-module 1032000 in the first stage; the output of the second second selection sub-module 1032000 is connected to the first second selection sub-module 1032000 in the third stage; The first input of the second selection sub-module 1032000 is coupled to the first second selection sub-module 1032000 of the second stage; the second input of the second selection sub-module 1032000 and the second of the second level The second selection sub-module 1032000 is connected; the output end of the second selection sub-module 1032000 is connected to the second selection module 1031.
在本发明的具体实施例中,作为一种实施方式,第一选择子模块10310和第二选择子模块1032000可以为选择器,寄存子模块1032010可以为寄存器。In an embodiment of the present invention, as an embodiment, the first selection sub-module 10310 and the second selection sub-module 1032000 may be selectors, and the registration sub-module 1032010 may be a register.
本发明实施例提出的芯片,上述芯片包括:控制器及与控制器连接的SPI,其中,所述控制器包括:时钟产生模块、输入输出模块、配置获取模块、时钟延时模块以及采样模块,输入输出模块与SPI连接。其中,时钟产生模块配置为获取当前时钟信号,根据当前时钟信号生成输出时钟信号,输出上述输出时钟信号至输入输出模块;输入输出模块配置为将输出时钟信号通过SPI输出至SPI Flash,以及将输出时钟信号输出至时钟延时模块;配置获取模块配置为获取配置参数和延时使能信号,将配置参数和延时使能信号输出至时钟延时模块;时钟延时模块配置为根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号,将采样时钟信号输出至采样模块;采样模块配置为通过SPI接收SPI数据,根据采样时钟信号对SPI数据进行采样。在本发明提出的技术方案中,可以根据当前时钟信号获取采样时钟信号,然后通过采样时钟信号对SPI数据进行采样,从而获得采样数据。显然,和现有技术相比,本发明实施例提出的一种数据采样方法和芯片,能够满足对不同速率的SPI数据进行采样的需求,实现数据的稳
定采样,具有兼容性强,软件可控的特点;并且,实现起来简单方便,便于普及,适用范围更广。In the chip of the embodiment of the present invention, the chip includes: a controller and an SPI connected to the controller, wherein the controller includes: a clock generation module, an input and output module, a configuration acquisition module, a clock delay module, and a sampling module. The input and output modules are connected to the SPI. The clock generation module is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module; the input/output module is configured to output the output clock signal to the SPI Flash through the SPI, and output the output The clock signal is output to the clock delay module; the configuration acquisition module is configured to obtain the configuration parameter and the delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module; the clock delay module is configured to be based on the delay The signal, the output clock signal and the configuration parameters generate a sampling clock signal, and the sampling clock signal is output to the sampling module; the sampling module is configured to receive the SPI data through the SPI, and sample the SPI data according to the sampling clock signal. In the technical solution proposed by the present invention, the sampling clock signal can be obtained according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data. Obviously, compared with the prior art, a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, and realize data stabilization.
Fixed sampling, with strong compatibility and software controllable features; and, it is simple and convenient to implement, easy to popularize, and has a wider application range.
实施例四Embodiment 4
图9为本发明实施例中数据采样方法的实现流程示意图,如图9所示,本发明具体实施例中,数据采样的方法具体包括以下步骤:FIG. 9 is a schematic flowchart of an implementation of a data sampling method according to an embodiment of the present invention. As shown in FIG. 9 , in a specific embodiment of the present invention, a method for data sampling specifically includes the following steps:
步骤101、获取当前时钟信号,根据所述当前时钟信号生成输出时钟信号。Step 101: Acquire a current clock signal, and generate an output clock signal according to the current clock signal.
在本发明的具体实施例中,控制器可以获取当前工作时钟域的当前时钟信号,然后根据当前时钟信号生成输出时钟信号。In a specific embodiment of the invention, the controller may acquire a current clock signal of the current working clock domain and then generate an output clock signal according to the current clock signal.
在本发明的具体实施例中,由于当前工作时钟域的频率为输出时钟信号的两倍,控制器需要对获取的当前时钟信号进行转换,获得输出时钟信号。In a specific embodiment of the present invention, since the frequency of the current working clock domain is twice the output clock signal, the controller needs to convert the acquired current clock signal to obtain an output clock signal.
在本发明的具体实施例中,控制器可以通过单根数据线、双根数据线以及四根数据线中的任意一种将上述输出时钟信号输出。In a specific embodiment of the present invention, the controller may output the output clock signal by any one of a single data line, two data lines, and four data lines.
在本发明的具体实施例中,控制器生成上述输出时钟信号的同时,还生产预设使能信号,该预设使能信号用于控制是否对上述输出时钟信号进行输出。In a specific embodiment of the present invention, the controller generates the output clock signal and also generates a preset enable signal for controlling whether to output the output clock signal.
在本发明的具体实施例中,当预设使能信号对应的为预设的开启信号时,控制器输出该输出时钟信号;当预设使能信号对应的为预设的关闭信号时,控制器将不对该输出时钟信号进行输出。In a specific embodiment of the present invention, when the preset enable signal corresponds to a preset turn-on signal, the controller outputs the output clock signal; when the preset enable signal corresponds to a preset turn-off signal, the control The output clock signal will not be output.
步骤102、获取配置参数和延时使能信号,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号。Step 102: Acquire a configuration parameter and a delay enable signal, and generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter.
在本发明的具体实施例中,控制器可以获取配置参数和延时使能信号,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号。其中,配置参数和延时使能信号可以预先存储在芯片中的寄存器中,然后由寄存
器发送给控制器。In a specific embodiment of the present invention, the controller may acquire a configuration parameter and a delay enable signal, and generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter. Wherein, the configuration parameters and the delay enable signal can be pre-stored in a register in the chip, and then registered
The device is sent to the controller.
在本发明的具体实施例中,配置参数包括:延时线级数M和延时单元级数N;其中,M和N均为大于等于1的自然数。In a specific embodiment of the present invention, the configuration parameters include: a delay line level M and a delay unit level N; wherein, M and N are both natural numbers greater than or equal to 1.
在本发明的具体实施例中,配置参数用于配置采样时钟信号的生成,延时使能信号用于控制采样时钟信号的输出。In a specific embodiment of the invention, the configuration parameters are used to configure the generation of the sampling clock signal, and the delay enable signal is used to control the output of the sampling clock signal.
步骤103、接收SPI数据,通过采样时钟信号对SPI数据进行采样,获得采样数据。Step 103: Receive SPI data, sample the SPI data by using a sampling clock signal, and obtain sampling data.
在本发明的具体实施例中,控制器在获取由时钟延时模块103发送的采样时钟信号以后,可以通过SPI接收SPI数据,然后根据采样时钟信号对SPI数据进行采样,最终得到采样数据。In a specific embodiment of the present invention, after acquiring the sampling clock signal sent by the clock delay module 103, the controller may receive the SPI data through the SPI, and then sample the SPI data according to the sampling clock signal, and finally obtain the sampling data.
如上述图9所示,在获得采样数据之后,本发明具体实施例提出的数据采样方法还包括以下步骤:As shown in FIG. 9 above, after the sampling data is obtained, the data sampling method proposed by the specific embodiment of the present invention further includes the following steps:
步骤104、将所述采样数据输出至寄存器;Step 104: Output the sampled data to a register.
步骤105、当获取读取请求时,将采样数据按照预设时钟域进行读取,获得更新的采样数据;Step 105: When acquiring a read request, reading the sampled data according to a preset clock domain to obtain updated sample data;
步骤106、使用更新的采样数据。 Step 106, using the updated sample data.
在本发明的具体实施例中,控制器可以将对SPI数据采样后得到的采样数据同步到预设时钟域中进行读取,从而获得更新的采样数据,最终可以对更新的采样数据进行下一级的处理和使用。In a specific embodiment of the present invention, the controller may synchronize the sampled data obtained by sampling the SPI data into a preset clock domain for reading, thereby obtaining updated sample data, and finally performing the next update data. Level of processing and use.
实施例五Embodiment 5
图10为本发明实施例中校验配置参数方法的实现流程示意图,如图10所示,本发明具体实施例中,校验配置参数的方法具体包括以下步骤:10 is a schematic flowchart of a method for verifying configuration parameters in an embodiment of the present invention. As shown in FIG. 10, in a specific embodiment of the present invention, a method for verifying configuration parameters specifically includes the following steps:
步骤201、获取预设校验数据,通过采样时钟信号对预设校验数据进行采样,获得校验采样数据。Step 201: Acquire preset verification data, and sample preset calibration data by using a sampling clock signal to obtain verification sampling data.
在本发明的具体实施例中,控制器在接收SPI数据之前,获取预设校
验数据,通过采样时钟信号对预设校验数据进行采样,获得校验采样数据。In a specific embodiment of the invention, the controller obtains a preset school before receiving the SPI data.
The data is verified, and the preset verification data is sampled by the sampling clock signal to obtain the verification sampling data.
在本发明的具体实施例中,控制器在对SPI数据进行采样之前,需要对配置参数进行校验,从而确定上述配置参数是否可以配置满足采样需求的采样信号。其中,控制器对配置参数进行校验的方法可以为获取预设校验数据,通过采样时钟信号对预设校验数据进行采样,获得校验采样数据。In a specific embodiment of the present invention, before the controller samples the SPI data, the configuration parameter needs to be verified to determine whether the configuration parameter can be configured to satisfy the sampling requirement of the sampling requirement. The method for verifying the configuration parameters by the controller may be: acquiring preset verification data, sampling the preset verification data by using the sampling clock signal, and obtaining verification sampling data.
步骤202、根据采样数据和校验采样数据判断配置参数是否满足预设规则,如果配置参数满足预设规则,则对SPI数据进行采样。Step 202: Determine, according to the sampling data and the verification sampling data, whether the configuration parameter satisfies a preset rule. If the configuration parameter satisfies the preset rule, the SPI data is sampled.
在本发明的具体实施例中,控制器在根据配置参数获得校验采样数据之后,可以根据采样数据和校验采样数据判断配置参数是否满足预设规则,如果配置参数满足预设规则,则对SPI数据进行采样。In a specific embodiment of the present invention, after obtaining the verification sampling data according to the configuration parameter, the controller may determine, according to the sampling data and the verification sampling data, whether the configuration parameter satisfies a preset rule, and if the configuration parameter satisfies the preset rule, The SPI data is sampled.
在本发明的具体实施例中,控制器获取校验采样数据后,将校验采样数据与校验数据进行比对获取比对结果,控制器可以根据比对判断是否满足预设规则,如果满足,则可以认为上述配置参数符合数据采样的预设要求,便可以根据上述配置参数配置采样信号。In a specific embodiment of the present invention, after acquiring the verification sampling data, the controller compares the verification sampling data with the verification data to obtain a comparison result, and the controller may determine, according to the comparison, whether the preset rule is met, if the , the above configuration parameters can be considered to meet the preset requirements of the data sampling, and the sampling signal can be configured according to the above configuration parameters.
如上述图10所示,校验配置参数的方法还包括:As shown in FIG. 10 above, the method for verifying configuration parameters further includes:
步骤203、如果配置参数不满足预设规则,则对配置参数进行调整,直到调整后的配置参数满足预设规则。Step 203: If the configuration parameter does not meet the preset rule, the configuration parameter is adjusted until the adjusted configuration parameter meets the preset rule.
在本发明的具体实施例中,如果配置参数不满足预设规则,控制器则对配置参数进行调整,根据调整后的配置参数生成采样信号,然后重新对采样数据进行采样,直到调整后的配置参数满足预设规则。In a specific embodiment of the present invention, if the configuration parameter does not satisfy the preset rule, the controller adjusts the configuration parameter, generates a sampling signal according to the adjusted configuration parameter, and then resamples the sampled data until the adjusted configuration. The parameters satisfy the preset rules.
在本发明的具体实施例中,当校验采样数据与校验数据的比对结果不满足预设规则,控制器可以根据预设方法对配置参数进行调整,即控制器可以根据预设方法对延时线级数M和延时单元级数N进行调整。In a specific embodiment of the present invention, when the comparison result of the verification sampling data and the verification data does not satisfy the preset rule, the controller may adjust the configuration parameter according to the preset method, that is, the controller may perform the preset method according to the preset method. The delay line level M and the delay unit level N are adjusted.
图11为本发明实施例中采样时钟信号延时示意图,如图11所示,(a)中在不对采样时钟信号进行延时的情况下,采样时钟信号能满足采样的时
序关系,在clk_sample上升沿时,刚好能采样到spi_datX(X可以为1,2或4比特)。由于(b)中的spi_datX比(a)的相位往后移动了,此时如果不对clk_in延时,clk_sample上升沿不可能对spi_datX有效采样,因此需要配置延时使能信号tapdly_en和配置参数M、N。(c)中的spi_datX比(b)的相位更往后移动,因此需要对clk_in延时更大。FIG. 11 is a schematic diagram of a delay of a sampling clock signal according to an embodiment of the present invention. As shown in FIG. 11 , in the case of not delaying the sampling clock signal in (a), the sampling clock signal can satisfy the sampling time.
The order relationship, just on the rising edge of clk_sample, can just sample spi_datX (X can be 1, 2 or 4 bits). Since the phase of spi_datX in (b) is shifted later than the phase of (a), if the clk_in is not delayed, it is impossible to effectively sample spi_datX on the rising edge of clk_sample. Therefore, the delay enable signal tapdly_en and the configuration parameter M need to be configured. N. The spi_datX in (c) moves more backward than the phase of (b), so it is necessary to delay the clk_in more.
本发明实施例提出的数据采样方法,获取当前时钟信号,根据当前时钟信号生成输出时钟信号;获取配置参数和延时使能信号,根据延时使能信号、输出时钟信号和配置参数,生成采样时钟信号;接收SPI数据,通过采样时钟信号对SPI数据进行采样,获得采样数据。也就是说,在本发明提出的技术方案中,可以根据当前时钟信号获取采样时钟信号,然后通过采样时钟信号对SPI数据进行采样,从而获得采样数据。显然,和现有技术相比,本发明实施例提出的一种数据采样方法和芯片,能够满足对不同速率的SPI数据进行采样的需求,实现数据的稳定采样,具有兼容性强,软件可控的特点;并且,实现起来简单方便,便于普及,适用范围更广。The data sampling method provided by the embodiment of the present invention acquires a current clock signal, generates an output clock signal according to the current clock signal, acquires a configuration parameter and a delay enable signal, and generates a sampling according to the delay enable signal, the output clock signal, and the configuration parameter. The clock signal; receiving the SPI data, sampling the SPI data by the sampling clock signal, and obtaining the sampling data. That is to say, in the technical solution proposed by the present invention, the sampling clock signal can be acquired according to the current clock signal, and then the SPI data is sampled by the sampling clock signal, thereby obtaining sampling data. Obviously, compared with the prior art, a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, achieve stable sampling of data, have strong compatibility, and are software controllable. The characteristics are; simple, convenient to implement, easy to popularize, and a wider range of applications.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现
在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Realize
A means of function specified in a flow or a flow and/or a block diagram of a block or blocks.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
本发明实施例的技术方案可以根据当前时钟信号获取采样时钟信号,然后通过采样时钟信号对SPI数据进行采样,从而获得采样数据。显然,和现有技术相比,本发明实施例提出的一种数据采样方法和芯片,能够满足对不同速率的SPI数据进行采样的需求,实现数据的稳定采样,具有兼容性强,软件可控的特点;并且,实现起来简单方便,便于普及,适用范围更广。
The technical solution of the embodiment of the present invention can obtain a sampling clock signal according to a current clock signal, and then sample the SPI data by using the sampling clock signal, thereby obtaining sampling data. Obviously, compared with the prior art, a data sampling method and a chip proposed by the embodiments of the present invention can meet the requirement of sampling SPI data of different rates, achieve stable sampling of data, have strong compatibility, and are software controllable. The characteristics are; simple, convenient to implement, easy to popularize, and a wider range of applications.
Claims (16)
- 一种芯片,所述芯片包括:控制器及与所述控制器连接的串行外设接口SPI,所述控制器包括:时钟产生模块、输入输出模块、配置获取模块、时钟延时模块以及采样模块,所述输入输出模块与所述SPI连接,其中,A chip comprising: a controller and a serial peripheral interface SPI connected to the controller, the controller comprising: a clock generation module, an input and output module, a configuration acquisition module, a clock delay module, and sampling a module, the input and output module is connected to the SPI, wherein所述时钟产生模块,配置为获取当前时钟信号,根据所述当前时钟信号生成输出时钟信号,输出所述输出时钟信号至所述输入输出模块;The clock generation module is configured to acquire a current clock signal, generate an output clock signal according to the current clock signal, and output the output clock signal to the input/output module;所述输入输出模块,配置为将所述输出时钟信号通过所述SPI输出至SPI Flash,以及将所述输出时钟信号输出至所述时钟延时模块;The input/output module is configured to output the output clock signal to the SPI Flash through the SPI, and output the output clock signal to the clock delay module;所述配置获取模块,配置为获取配置参数和延时使能信号,将所述配置参数和所述延时使能信号输出至所述时钟延时模块;The configuration obtaining module is configured to acquire a configuration parameter and a delay enable signal, and output the configuration parameter and the delay enable signal to the clock delay module;所述时钟延时模块,配置为根据所述延时使能信号、所述输出时钟信号和所述配置参数,生成采样时钟信号,将所述采样时钟信号输出至所述采样模块;The clock delay module is configured to generate a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter, and output the sampling clock signal to the sampling module;所述采样模块,配置为通过所述SPI接收SPI数据,根据所述采样时钟信号对所述SPI数据进行采样。The sampling module is configured to receive SPI data through the SPI, and sample the SPI data according to the sampling clock signal.
- 根据权利要求1所述的芯片,其中,The chip according to claim 1, wherein所述配置获取模块,配置为配置延时线级数M、延时单元级数N和所述延时使能信号,将所述延时线级数M、所述延时单元级数N以及所述延时使能信号输出至所述时钟延时模块;其中,M和N均为大于等于1的自然数。The configuration obtaining module is configured to configure a delay line level M, a delay unit level N, and the delay enable signal, and the delay line level M, the delay unit level N, and The delay enable signal is output to the clock delay module; wherein M and N are both natural numbers greater than or equal to 1.
- 根据权利要求2所述的芯片,其中,所述时钟延时模块包括:第一选择模块、第二选择模块和延时模块;其中,The chip of claim 2, wherein the clock delay module comprises: a first selection module, a second selection module, and a delay module; wherein所述时钟延时模块,配置为根据所述延时线级数M配置第一级数,所述第一级数为所述第二选择模块的级数;以及根据所述延时线级数M配置第二级数,所述第二级数为所述延时模块的级数; The clock delay module is configured to configure a first level according to the delay line level M, the first level is a number of stages of the second selection module, and according to the delay line level M configuring a second level, the second level being the number of stages of the delay module;所述第一选择模块的第一输入端与所述输入输出模块连接,所述第一选择模块的第二输入端与所述第二选择模块连接,所述第一选择模块的第三输入端与所述配置获取模块连接,所述第一选择模块的输出端与所述采样模块连接;a first input end of the first selection module is connected to the input and output module, a second input end of the first selection module is connected to the second selection module, and a third input end of the first selection module Connected to the configuration acquisition module, the output end of the first selection module is connected to the sampling module;所述第二选择模块由M级第一选择子模块构成;其中,第k级中有2M-k个第一选择子模块;其中,k为大于等于1且小于等于M的自然数;The second selection module is composed of an M-level first selection sub-module; wherein, in the k-th stage, there are 2M-k first selection sub-modules; wherein k is a natural number greater than or equal to 1 and less than or equal to M;所述延时模块由2M级延时子模块构成。The delay module is composed of a 2M-level delay sub-module.
- 根据权利要求3所述的芯片,其中,The chip according to claim 3, wherein如果M等于1,所述第二选择模块中的第一选择子模块的第一输入端与第1级延时子模块连接;所述第一选择子模块的第二输入端与第2级延时子模块连接;所述第一选择子模块的输出端与所述第一选择模块连接。If M is equal to 1, the first input end of the first selection sub-module of the second selection module is connected to the first-stage delay sub-module; the second input end of the first selection sub-module and the second-order extension The sub-module is connected; the output of the first selection sub-module is connected to the first selection module.
- 根据权利要求3所述的芯片,其中,The chip according to claim 3, wherein如果M大于1,对于所述第二选择模块中的第k级第一选择子模块:If M is greater than 1, for the kth first selection submodule in the second selection module:当k等于1时,第一级中的第i个第一选择子模块的第一输入端与所述2M级延时子模块中的第2i-1级延时子模块连接;所述第i个第一选择子模块的第二输入端与所述2M级延时子模块中的第2i级延时子模块连接;当i为偶数时,所述第i个第一选择子模块的输出端与第2级的第i/2个第一选择子模块连接,或者当i为奇数时,所述第i个第一选择子模块的输出端与第2级的第(i+1)/2个第一选择子模块连接;其中,i为大于等于1且小于等于2M的自然数;When k is equal to 1, the first input end of the ith first selection submodule in the first stage is connected to the 2i-1th delay submodule in the 2M level delay submodule; The second input end of the first selection sub-module is connected to the 2i-th delay sub-module of the 2M-level delay sub-module; when i is an even number, the output end of the i-th first selection sub-module Connected to the i/2th first selection submodule of the second stage, or when i is an odd number, the output of the i th first selection submodule and the (i+1)/2 of the second stage The first selection sub-modules are connected; wherein i is a natural number greater than or equal to 1 and less than or equal to 2M;当k大于1且小于M时,第k级中的第j个第一选择子模块的第一输入端与第k-1级中的第2j-1个第一选择子模块连接;所述第j个第一选择子模块的第二输入端与第k-1级中的第2j个第一选择子模块连接;当j为偶数时,所述第j个第一选择子模块的输出端与第k+1级中的第j/2个第一选择子模块连接,或者当j为奇数时,所述第j个第一选择子模块的输出端与第 k+1级的第(j+1)/2个第一选择子模块连接;其中j为大于等于1且小于等于2M-k的自然数;When k is greater than 1 and less than M, the first input end of the jth first selection submodule in the kth stage is connected to the 2j-1 first selection submodule in the k-1th stage; The second input end of the j first selection sub-modules is connected to the 2j first selection sub-module in the k-1th stage; when j is an even number, the output end of the j-th first selection sub-module The j/2th first selection submodule in the k+1th stage is connected, or when j is an odd number, the output end of the jth first selection submodule The (j+1)/2th first selection submodule of k+1 level is connected; wherein j is a natural number greater than or equal to 1 and less than or equal to 2M-k;当k等于M时,第M级中的第一选择子模块的第一输入端与第M-1级中的第一个第一选择子模块连接;所述第一选择子模块的第二输入端与第M-1级中的第二个第一选择子模块连接;所述第一选择子模块的输出端与所述第一选择模块连接。When k is equal to M, the first input of the first selection submodule in the Mth stage is connected to the first first selection submodule of the M-1th stage; the second input of the first selection submodule The terminal is connected to the second first selection submodule in the M-1th stage; the output end of the first selection submodule is connected to the first selection module.
- 根据权利要求3所述的芯片,其中,所述延时子模块包括:第三选择模块和寄存模块;其中,The chip according to claim 3, wherein the delay sub-module comprises: a third selection module and a registration module; wherein所述时钟延时模块,配置为根据所述延时单元级数N配置第三级数,所述第三级数为所述第三选择模块的级数,以及根据所述延时单元级数N配置第四级数,所述第四级数为所述寄存模块的级数;The clock delay module is configured to configure a third level according to the delay unit number N, the third level is a number of stages of the third selection module, and according to the delay unit level N configuring a fourth level, the fourth level being the number of stages of the registration module;所述第三选择模块由N级第二选择子模块构成;其中,第h级中有2M-h个第二选择子模块;其中,h为大于等于1且小于等于N的自然数;The third selection module is composed of an N-level second selection sub-module; wherein, in the h-th stage, there are 2M-h second selection sub-modules; wherein h is a natural number greater than or equal to 1 and less than or equal to N;所述寄存模块由2N级寄存子模块构成。The registration module is composed of a 2N-level registration sub-module.
- 根据权利要求6所述的芯片,其中,The chip according to claim 6, wherein如果N等于1,所述第三选择模块中的第二选择子模块的第一输入端与第一级寄存子模块连接;所述第二选择子模块的第二输入端与第二级寄存子模块连接;所述第二选择子模块的输出端与所述第二选择模块连接;If N is equal to 1, the first input end of the second selection sub-module of the third selection module is connected to the first-level registration sub-module; the second input end and the second-level storage sub-module of the second selection sub-module a module connection; an output end of the second selection submodule is connected to the second selection module;
- 根据权利要求6所述的芯片,其中,The chip according to claim 6, wherein如果N大于1,对于所述第三选择模块中的第h级第二选择子模块:If N is greater than 1, for the second selection sub-module of the h-th level in the third selection module:当h等于1时,所述第一级中的第p个第二选择子模块的第一输入端与所述2N级寄存子模块中的第2p-1级寄存子模块连接;所述第p个第二选择子模块的第二输入端与所述2N级寄存子模块中的第2p级寄存子模块连接;当p为偶数时,所述第p个第二选择子模块的输出端与第二级的第p/2个第二选择模块,或者当p为奇数时,所述第p个第二选择子模块的输 出端与第二级的第(p+1)/2个第二选择子模块连接;其中,p为大于等于1且小于等于2N的自然数;When h is equal to 1, the first input end of the pth second selection submodule in the first stage is connected to the 2p-1 level registration submodule in the 2N level register submodule; The second input end of the second selection sub-module is connected to the second p-level registration sub-module of the 2N-level registration sub-module; when p is an even number, the output end of the p-th second selection sub-module The p/2 second selection modules of the second level, or when the p is an odd number, the transmission of the pth second selection submodule The output is connected to the (p+1)/2 second selection submodules of the second level; wherein p is a natural number greater than or equal to 1 and less than or equal to 2N;当h大于1且小于N时,第h级中的第q个第二选择子模块的第一输入端与第h-1级中的第2q-1个第二选择子模块连接;所述第q个第二选择子模块的第二输入端与第h-1级中的第2q个第二选择子模块连接;当q为偶数时,所述第q个第二选择子模块的输出端与第h+1级中的第q/2个第二选择子模块,或者当q为奇数时,所述第q个第二选择子模块的输出端与第h+1级中的第(q+1)/2个第二选择子模块连接;其中,q为大于等于1且小于等于2N-h的自然数;When h is greater than 1 and less than N, the first input end of the qth second selection submodule in the hth stage is connected with the 2q-1 second selection submodule in the h-1th stage; The second input end of the q second selection sub-modules is connected to the 2q second second selection sub-module in the h-1th stage; when q is an even number, the output end of the q-th second selection sub-module The q/2th second selection submodule in the h+1th stage, or the output of the qth second selection submodule and the (h+)th in the h+1th level when q is an odd number 1)/2 second selection sub-modules are connected; wherein q is a natural number greater than or equal to 1 and less than or equal to 2N-h;当h等于N时,第N级中的第二选择子模块的第一输入端与第N-1级中的第一个第二选择子模块连接;所述第二选择子模块的第二输入端与第N-1级中的第二个第二选择子模块连接;所述第二选择子模块的输出端与所述第二选择模块连接。When h is equal to N, the first input of the second selection sub-module in the Nth stage is connected to the first second selection sub-module of the N-1th stage; the second input of the second selection sub-module The terminal is connected to the second second selection submodule of the N-1th stage; the output of the second selection submodule is connected to the second selection module.
- 根据权利要求3或5所述的芯片,其中,The chip according to claim 3 or 5, wherein所述第一选择子模块和第二选择子模块为选择器;The first selection submodule and the second selection submodule are selectors;所述寄存子模块为寄存器。The registration sub-module is a register.
- 一种数据采样方法,所述方法包括:A data sampling method, the method comprising:获取当前时钟信号,根据所述当前时钟信号生成输出时钟信号;Acquiring a current clock signal, and generating an output clock signal according to the current clock signal;获取配置参数和延时使能信号,根据所述延时使能信号、所述输出时钟信号和所述配置参数,生成采样时钟信号;Obtaining a configuration parameter and a delay enable signal, and generating a sampling clock signal according to the delay enable signal, the output clock signal, and the configuration parameter;接收SPI数据,通过所述采样时钟信号对所述SPI数据进行采样。The SPI data is received, and the SPI data is sampled by the sampling clock signal.
- 根据权利要求10所述的方法,其中,所述配置参数包括延时线级数M和延时单元级数N;其中,M和N均为大于等于1的自然数。The method according to claim 10, wherein said configuration parameter comprises a delay line level number M and a delay unit level number N; wherein M and N are both natural numbers greater than or equal to one.
- 根据权利要求10所述的方法,其中,所述接收SPI数据之前,所述方法还包括: The method of claim 10, wherein before the receiving the SPI data, the method further comprises:获取预设校验数据,通过所述采样时钟信号对所述预设校验数据进行采样,获得校验采样数据;Acquiring preset verification data, sampling the preset verification data by using the sampling clock signal, and obtaining verification sampling data;根据所述采样数据和所述校验采样数据判断所述配置参数是否满足预设规则,如果所述配置参数满足所述预设规则,则对所述SPI数据进行采样。Determining, according to the sampling data and the check sampling data, whether the configuration parameter meets a preset rule, and if the configuration parameter satisfies the preset rule, sampling the SPI data.
- 根据权利要求12所述的方法,其中,所述方法还包括:The method of claim 12, wherein the method further comprises:如果所述配置参数不满足所述预设规则,则对所述配置参数进行调整,直到调整后的配置参数满足所述预设规则。If the configuration parameter does not meet the preset rule, the configuration parameter is adjusted until the adjusted configuration parameter meets the preset rule.
- 根据权利要求13所述的方法,其中,所述对所述配置参数进行调整,包括:The method of claim 13, wherein the adjusting the configuration parameters comprises:根据预设方法对所述延时线级数M和所述延时单元级数N进行调整。The delay line level M and the delay unit level N are adjusted according to a preset method.
- 根据权利10所述的方法,其中,所述获得采样数据之后,所述方法还包括:The method of claim 10, wherein after the obtaining the sampled data, the method further comprises:将所述采样数据输出至寄存器;Outputting the sampled data to a register;当获取读取请求时,将所述采样数据按照预设时钟域进行读取,获得更新的采样数据;When the read request is obtained, the sampled data is read according to a preset clock domain to obtain updated sample data;使用所述更新的采样数据。The updated sampled data is used.
- 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求10至15任一项所述的数据采样方法。 A computer storage medium having stored therein computer executable instructions for performing the data sampling method of any one of claims 10 to 15.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611239614.0A CN108255231B (en) | 2016-12-28 | 2016-12-28 | Data sampling method and chip |
CN201611239614.0 | 2016-12-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018120612A1 true WO2018120612A1 (en) | 2018-07-05 |
Family
ID=62706861
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/085606 WO2018120612A1 (en) | 2016-12-28 | 2017-05-24 | Data sampling method, chip and computer storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108255231B (en) |
WO (1) | WO2018120612A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111801656A (en) * | 2018-10-29 | 2020-10-20 | 深圳配天智能技术研究院有限公司 | Robot control system, heartbeat monitoring method, heartbeat monitoring module and storage medium |
CN111800109A (en) * | 2020-06-12 | 2020-10-20 | 烽火通信科技股份有限公司 | Method and device for aligning multi-channel high-speed data |
CN114048470A (en) * | 2022-01-13 | 2022-02-15 | 浙江大学 | Method and device for defending hardware attack based on TDC module and electronic equipment |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110673524B (en) * | 2019-09-27 | 2020-09-22 | 安凯(广州)微电子技术有限公司 | High-speed SPI master mode controller |
TWI767234B (en) * | 2020-05-21 | 2022-06-11 | 大陸商北京集創北方科技股份有限公司 | Method for increasing transmission rate of serial peripheral interface, data transmission circuit and information processing device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102866979A (en) * | 2012-09-05 | 2013-01-09 | 四川省绵阳西南自动化研究所 | Synchronous serial interface signal sensor data acquisition device |
US20140297922A1 (en) * | 2013-03-29 | 2014-10-02 | Nitin V. Sarangdhar | Method and apparatus for managing serial peripheral interface (spi) flash |
CN104809094A (en) * | 2015-05-25 | 2015-07-29 | 中国电子科技集团公司第四十七研究所 | SPI (Serial Peripheral Interface) controller and communication method for SPI controller |
CN105335322A (en) * | 2015-10-28 | 2016-02-17 | 上海斐讯数据通信技术有限公司 | Method for converting I2C (Inter-Integrated Circuit) bus interface by SPI (Serial Peripheral Interface) and converter |
CN105550147A (en) * | 2015-12-11 | 2016-05-04 | 上海华冠电子设备有限责任公司 | SPI bus expansion system and communication method therefor |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100587653C (en) * | 2007-08-03 | 2010-02-03 | 上海摩波彼克半导体有限公司 | High speed synchronous peripheral clock phase control device in SOC system processor chip |
CN105634493A (en) * | 2014-10-29 | 2016-06-01 | 中兴通讯股份有限公司 | Data sampling method and data sampling device |
CN204423111U (en) * | 2015-01-26 | 2015-06-24 | 北京神州龙芯集成电路设计有限公司 | A kind of SOC (system on a chip) be applied in intelligent grid concentrator |
CN105591650B (en) * | 2015-12-18 | 2019-01-18 | 豪威科技(上海)有限公司 | Analog-digital converter and its automatic correcting method |
CN105975691B (en) * | 2016-05-05 | 2018-08-07 | 福州瑞芯微电子股份有限公司 | The method and device of SPI adjust automatically sampling phases |
-
2016
- 2016-12-28 CN CN201611239614.0A patent/CN108255231B/en active Active
-
2017
- 2017-05-24 WO PCT/CN2017/085606 patent/WO2018120612A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102866979A (en) * | 2012-09-05 | 2013-01-09 | 四川省绵阳西南自动化研究所 | Synchronous serial interface signal sensor data acquisition device |
US20140297922A1 (en) * | 2013-03-29 | 2014-10-02 | Nitin V. Sarangdhar | Method and apparatus for managing serial peripheral interface (spi) flash |
CN104809094A (en) * | 2015-05-25 | 2015-07-29 | 中国电子科技集团公司第四十七研究所 | SPI (Serial Peripheral Interface) controller and communication method for SPI controller |
CN105335322A (en) * | 2015-10-28 | 2016-02-17 | 上海斐讯数据通信技术有限公司 | Method for converting I2C (Inter-Integrated Circuit) bus interface by SPI (Serial Peripheral Interface) and converter |
CN105550147A (en) * | 2015-12-11 | 2016-05-04 | 上海华冠电子设备有限责任公司 | SPI bus expansion system and communication method therefor |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111801656A (en) * | 2018-10-29 | 2020-10-20 | 深圳配天智能技术研究院有限公司 | Robot control system, heartbeat monitoring method, heartbeat monitoring module and storage medium |
CN111801656B (en) * | 2018-10-29 | 2023-12-22 | 深圳配天机器人技术有限公司 | Robot control system, heartbeat monitoring method, heartbeat monitoring module and storage medium |
CN111800109A (en) * | 2020-06-12 | 2020-10-20 | 烽火通信科技股份有限公司 | Method and device for aligning multi-channel high-speed data |
CN114048470A (en) * | 2022-01-13 | 2022-02-15 | 浙江大学 | Method and device for defending hardware attack based on TDC module and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN108255231B (en) | 2020-10-02 |
CN108255231A (en) | 2018-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018120612A1 (en) | Data sampling method, chip and computer storage medium | |
US8686773B1 (en) | In-system margin measurement circuit | |
US20090167572A1 (en) | Serial/Parallel data conversion apparatus and method thereof | |
CN105183423B (en) | A kind of cross-clock domain asynchronous data treating method and apparatus | |
US10348279B2 (en) | Skew control | |
CN109032498B (en) | Waveform quantization synchronization method of multi-FPGA multi-channel acquisition system | |
WO2016130360A8 (en) | Circuits for and methods of filtering inter-symbol interference for serdes applications | |
US10564664B2 (en) | Integrated skew control | |
US20170214398A1 (en) | Skew Adjustment Circuit, Semiconductor Device, and Skew Calibration Method | |
US8578074B2 (en) | First in first out device and method thereof | |
KR101172270B1 (en) | Duty-cycle correction in a delay-locked loop | |
WO2022247681A1 (en) | Delay modulation circuit and method, chip, and server | |
JP2013109637A (en) | Memory interface circuit and operation method thereof | |
JP6201401B2 (en) | Timing control circuit | |
US7454543B2 (en) | Early high speed serializer-deserializer (HSS)internal receive (Rx) interface for data sampling clock signals on parallel bus | |
CN113132044B (en) | Audio synchronous processing circuit and method thereof | |
JP2008147922A (en) | A/d converting device | |
US9378175B2 (en) | Data transfer between a master and slave | |
CN106897233B (en) | Source synchronous circuit of data transmission interface | |
Romoth et al. | Optimizing inter-FPGA communication by automatic channel adaptation | |
US9804634B2 (en) | Peripheral interface circuit at host side and electronic system using the same | |
KR100734521B1 (en) | Intellectual Property Module for System on Chip | |
JP6737642B2 (en) | Serial data receiving circuit, receiving method, transceiver circuit, electronic device | |
JP2004022750A (en) | Semiconductor device | |
CN113204503A (en) | Data synchronous output method and circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17889366 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17889366 Country of ref document: EP Kind code of ref document: A1 |