A highly flexible source of random number entropy

By introducing a register configuration module, a cross-clock domain module and a random number generation module into the random number generation technology, and using an oscillating ring circuit and an XOR gate to generate random numbers, the problems of insufficient flexibility and portability in the existing technology are solved. It achieves flexible application and efficient random number generation in different chip processes and scenarios.

CN118349215BActive Publication Date: 2024-08-30GUANGZHOU XINYUNYUAN MICROELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410772524.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-08-30
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Existing random number generation technology has deficiencies in flexibility and portability. It is especially difficult to adapt to different chip processes and scenarios, and its cost and power consumption are high.

Method used

A highly flexible random number entropy source including a register configuration module, a cross-clock domain module and a random number generation module is designed. It uses an oscillating ring circuit to generate high-frequency analog signals, and generates random numbers through an XOR gate and a data selector. It supports Multi-stage oscillator ring circuits are independently configured and operated by XOR to achieve flexible topology and portability.

Benefits of technology

It enables flexible application in different chip processes and scenarios, supports LFSR behavioral simulation and hardening functions, improves the flexibility and portability of random number generation, and reduces cost and power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349215B
    Figure CN118349215B
Patent Text Reader

Abstract

The invention relates to random number generation, and in particular to a highly flexible random number entropy source, a register configuration module, which configures registers through an AMBA bus interface; a cross-clock domain module, which completes signal synchronization of two asynchronous clock domains, an AMBA clock domain and a sampling clock domain; a random number generation module, which generates a high-frequency analog signal by using an oscillation ring circuit, samples the high-frequency analog signal, obtains a random signal, and generates random numbers by processing the random signals corresponding to a single or multiple oscillation ring circuits; the technical solution provided by the invention can effectively overcome the defects of the prior art, that is, poor flexibility and inability to be used in different chip processes and different scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to random number generation, and in particular to a highly flexible random number entropy source. Background Art

[0002] In order to generate true random numbers, there are currently three typical random number generation methods:

[0003] 1) Use a power amplifier to amplify the high-frequency noise signal in the MOSFET, and then use an ADC to collect the output signal of the power amplifier. The disadvantage of this method is that it requires a power amplifier and an ADC, which has a high implementation cost, large power consumption and large area.

[0004] 2) The random number generator based on the ring oscillator TERO has the disadvantage of having high requirements for chip layout and wiring, and the delay of the line needs to be strictly controlled during layout and wiring;

[0005] 3) Use inverters to build a combinational logic ring. This method has the advantages of low cost, low power consumption, and no stringent requirements on layout and wiring, but its flexibility is limited and its corresponding portability is poor. Summary of the invention

[0006] In view of the above-mentioned shortcomings of the prior art, the present invention provides a highly flexible random number entropy source, which can effectively overcome the defects of the prior art such as poor flexibility and inability to be used in different chip processes and different scenarios.

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0008] A highly flexible random number entropy source, including a register configuration module, a cross-clock domain module, and a random number generation module;

[0009] Register configuration module, configures registers through AMBA bus interface;

[0010] The cross-clock domain module completes the signal synchronization of two asynchronous clock domains: the AMBA clock domain and the sampling clock domain.

[0011] The random number generation module generates a high-frequency analog signal using an oscillation ring circuit, obtains a random signal after sampling the high-frequency analog signal, and generates a random number by processing the random signal corresponding to a single / multiple oscillation ring circuit.

[0012] Preferably, the random number generation module comprises a three-stage oscillation ring, a D flip-flop D[3][n], an XOR gate XOR3, a data selector MUX1 and an XOR gate XOR1, wherein the high-frequency analog signal dout_ro3[n] generated by each oscillation ring circuit in the three-stage oscillation ring is sampled by the D flip-flop D[3][n] to obtain a corresponding random signal qout[3][n], and the random signal qout[3][n] corresponding to each oscillation ring circuit in the three-stage oscillation ring is sampled by the XOR gate XOR3 to obtain a three-stage oscillation ring XOR output result xor_ro3, and the three-stage oscillation ring XOR output result xor_ro3 is input into the data selector MUX1 and the XOR gate XOR1 respectively;

[0013] in, , that is, the 3-level oscillation ring contains 32 oscillation ring circuits, namely ro_3[0], ro_3[1], …, ro_3

[31] .

[0014] Preferably, the random number generation module comprises a 5-level oscillation ring, a D flip-flop D[5][n] and an XOR gate XOR5, wherein the high-frequency analog signal dout_ro5[n] generated by each oscillation ring circuit in the 5-level oscillation ring is sampled by the D flip-flop D[5][n] to obtain a corresponding random signal qout[5][n], and the random signal qout[5][n] corresponding to each oscillation ring circuit in the 5-level oscillation ring is sampled by the XOR gate XOR5 to obtain a 5-level oscillation ring XOR output result xor_ro5, and the 5-level oscillation ring XOR output result xor_ro5 is input into a data selector MUX1 and an XOR gate XOR1 respectively;

[0015] Among them, the 5-level oscillation ring contains 32 oscillation ring circuits, namely ro_5[0], ro_5[1], ..., ro_5

[31] .

[0016] Preferably, the random number generation module comprises a 7-level oscillation ring, a D flip-flop D[7][n] and an XOR gate XOR7, wherein the high-frequency analog signal dout_ro7[n] generated by each oscillation ring circuit in the 7-level oscillation ring is sampled by the D flip-flop D[7][n] to obtain a corresponding random signal qout[7][n], and the random signal qout[7][n] corresponding to each oscillation ring circuit in the 7-level oscillation ring is sampled by the XOR gate XOR7 to obtain a 7-level oscillation ring XOR output result xor_ro7, and the 7-level oscillation ring XOR output result xor_ro7 is input into a data selector MUX1 and an XOR gate XOR1 respectively;

[0017] Among them, the 7-level oscillation ring contains 32 oscillation ring circuits, namely ro_7[0], ro_7[1], ..., ro_7

[31] .

[0018] Preferably, the random number generation module comprises a 9-level oscillation ring, a D flip-flop D[9][n] and an XOR gate XOR9, wherein the high-frequency analog signal dout_ro9[n] generated by each oscillation ring circuit in the 9-level oscillation ring is sampled by the D flip-flop D[9][n] to obtain a corresponding random signal qout[9][n], and the random signal qout[9][n] corresponding to each oscillation ring circuit in the 9-level oscillation ring is sampled by the XOR gate XOR9 to obtain a 9-level oscillation ring XOR output result xor_ro9, and the 9-level oscillation ring XOR output result xor_ro9 is input into a data selector MUX1 and an XOR gate XOR1 respectively;

[0019] Among them, the 9-level oscillation ring contains 32 oscillation ring circuits, namely ro_9[0], ro_9[1], ..., ro_9

[31] .

[0020] Preferably, the random number generation module comprises an 11-stage oscillation ring, a D flip-flop D

[11] [n] and an XOR gate XOR11, wherein the high-frequency analog signal dout_ro11[n] generated by each oscillation ring circuit in the 11-stage oscillation ring is sampled by the D flip-flop D

[11] [n] to obtain a corresponding random signal qout

[11] [n], and the random signal qout

[11] [n] corresponding to each oscillation ring circuit in the 11-stage oscillation ring is sampled by the XOR gate XOR11 to obtain an 11-stage oscillation ring XOR output result xor_ro11, and the 11-stage oscillation ring XOR output result xor_ro11 is input into a data selector MUX1 and an XOR gate XOR1 respectively;

[0021] Among them, the 11-level oscillation ring contains 32 oscillation ring circuits, namely ro_11[0], ro_11[1], ..., ro_11

[31] .

[0022] Preferably, the random number generation module further includes a data selector MUX2 and a D flip-flop D1, the 3-level oscillation ring XOR output result xor_ro3, the 5-level oscillation ring XOR output result xor_ro5, the 7-level oscillation ring XOR output result xor_ro7, the 9-level oscillation ring XOR output result xor_ro9, and the 11-level oscillation ring XOR output result xor_ro11 are passed through an XOR gate XOR1 to obtain a mixed result xor_mix, and the mixed result xor_mix is ​​input into the data selector MUX1;

[0023] The data selector MUX2 receives the output result mux_out of the data selector MUX1, and inputs the output result mux_out to the D flip-flop D1, and the D flip-flop D1 samples the output result mux_out to generate a random number output random_bit_raw;

[0024] Among them, the data selector MUX1 is configured by the register sel_amba[2:0] to select the first-level oscillation ring in the entropy source to output the XOR result xor_ro* or the mixed result xor_mix. , and get the output result mux_out.

[0025] Preferably, the random number generation module further comprises a counter cnt[15:0] and an AND gate A1 for delaying the random number sampling moment, one input end of the AND gate A1 inputs cnt[15:0]==num_wait[15:0], another input end of the AND gate A1 inputs trigger_en, and the output end of the AND gate A1 inputs the random number enable signal random_bit_enable to the data selector MUX2;

[0026] When the random number enable signal random_bit_enable=1, the D flip-flop D1 samples the output result mux_out, and the generated random number output random_bit_raw is valid; when the random number enable signal random_bit_enable=0, the random number output random_bit_raw generated by the D flip-flop D1 is invalid;

[0027] Among them, cnt[15:0]==num_wait[15:0] means that when the count value of counter cnt[15:0] is equal to the configuration value of num_wait[15:0], it returns 1, otherwise it returns 0;

[0028] num_wait[15:0] is configured by register num_wait_amba[15:0], and trigger_en is configured by register trigger_en_amba.

[0029] Preferably, among the 3-stage oscillation ring, 5-stage oscillation ring, 7-stage oscillation ring, 9-stage oscillation ring, and 11-stage oscillation ring, for the nth oscillation ring circuit in the *-stage oscillation ring, , , whose circuit structure includes a combinational logic oscillation ring composed of a NAND gate and a NOT gate for generating a high-frequency analog signal, and an OR gate O[*][n] that makes the Boolean logic value of the input end of the D flip-flop D[*][n] equal to the output end of the corresponding LFSR pseudo-random number generator, and the combinational logic oscillation ring includes a NAND gate NAND1[*][n], a NAND gate NAND2[*][n], and cascaded (*-2) NOT gates;

[0030] One input end of the NAND gate NAND1[*][n] and the OR gate O[*][n] are both input to en_ro*[n], the other input end of the OR gate O[*][n] is input to lfsr_en_ro*[n], the output ends of the NAND gate NAND1[*][n] and the OR gate O[*][n] are respectively connected to the input end of the NAND gate NAND2[*][n], the output end of the NAND gate NAND2[*][n] is connected to the cascaded (*-2) NOT gates, the output end of the last NOT gate N(*-2)[*][n] of the cascaded (*-2) NOT gates is respectively connected to the other input end of the NAND gate NAND1[*][n] and the D flip-flop D[*][n];

[0031] Among them, the cascaded (*-2) NOT gates are N1[*][n], N2[*][n], ..., N(*-2)[*][n], the sampling clock of the D flip-flop D[*][n] is sample_clk, and the clock frequency of sample_clk is 1 / 5 of the oscillation frequency of the oscillation ring circuit;

[0032] en_ro*[n] is configured by the en_ro*_amba[31:0] register, and lfsr_en_ro*[n] is generated by the LFSR pseudo-random number generator.

[0033] Preferably, the random number entropy source further includes a LFSR pseudo-random number generator, which is enabled only when the system is in LFSR simulation mode and is not hardened during tape-out;

[0034] Among them, each oscillation ring circuit in the 3-level oscillation ring, the 5-level oscillation ring, the 7-level oscillation ring, the 9-level oscillation ring, and the 11-level oscillation ring is provided with a corresponding LFSR pseudo-random number generator.

[0035] Compared with the prior art, the highly flexible random number entropy source provided by the present invention has the following beneficial effects:

[0036] 1) Each of the 3-level oscillation ring, 5-level oscillation ring, 7-level oscillation ring, 9-level oscillation ring, and 11-level oscillation ring is equipped with 32 oscillation ring circuits that can be independently configured, and the configuration scheme is flexible and changeable;

[0037] 2) Supports mutual exclusive OR of the outputs of a single oscillator ring circuit or multiple oscillator ring circuits, and flexibly configures the oscillator ring circuit topology to generate random bit data streams;

[0038] 3) The 6 to 1 data selector MUX1 can be used to select the random bit data stream corresponding to the output result xor_ro* or the mixed result xor_mix of the first-level oscillation ring, and output it as a single-bit true random number;

[0039] 4) In order to ensure that the oscillation rings at all levels have entered a stable oscillation state when random number sampling occurs, and to flexibly change the phase point of random number sampling, the present invention can flexibly configure the register num_wait_amba[15:0] to delay the random number sampling moment;

[0040] 5) In the oscillation ring circuit, by connecting an OR gate O[*][n] in parallel to the first-stage NAND gate NAND1[*][n], the noise source can meet the requirements of actual hardening while also meeting the requirements of simulation based on the LFSR pseudo-random number generator;

[0041] 6) It has a high degree of configuration freedom and can be flexibly applied to different chip processes and different scenarios. It has good portability and can simultaneously support LFSR-based behavioral simulation functions and actual tape-out hardening functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 It is a schematic diagram of the system of the present invention;

[0044] Figure 2 For the present invention Figure 1 Schematic diagram of the circuit structure of the random number generation module;

[0045] Figure 3 For the present invention Figure 2 The circuit structure diagram of the nth oscillation ring circuit in the middle * level oscillation ring;

[0046] Figure 4 For the present invention Figure 2 Schematic diagram of the circuit structure of counter cnt[15:0];

[0047] Figure 5 This is a schematic diagram of the working process of the system in the normal working mode of the present invention;

[0048] Figure 6 Schematic diagram of the working process of the system in the LFSR simulation mode of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] A highly flexible source of random number entropy, such as Figure 1 As shown, it includes a register configuration module, a cross-clock domain module and a random number generation module;

[0051] Register configuration module, configures registers through AMBA bus interface;

[0052] The cross-clock domain module completes the signal synchronization of two asynchronous clock domains: the AMBA clock domain and the sampling clock domain.

[0053] The random number generation module generates a high-frequency analog signal using an oscillation ring circuit, obtains a random signal after sampling the high-frequency analog signal, and generates a random number by processing the random signal corresponding to a single / multiple oscillation ring circuit.

[0054] like Figure 1 As shown, the register configuration module works in the AMBA clock domain and configures the registers as follows through the AMBA bus interface:

[0055] Table 1 Register en_ro3_amba configuration description table

[0056]

[0057] Table 2 Register en_ro5_amba configuration description table

[0058]

[0059] Table 3 Register en_ro7_amba configuration description table

[0060]

[0061] Table 4 Register en_ro9_amba configuration description table

[0062]

[0063] Table 5 Register en_ro11_amba configuration description table

[0064]

[0065] Table 6 Register seed_lfsr_amba configuration description table

[0066]

[0067] Table 7 Register reg_control_amba configuration description table

[0068]

[0069] Table 8 Register trigger_en_amba configuration description table

[0070]

[0071] like Figure 2 As shown, the random number generation module includes a three-level oscillation ring, a D flip-flop D[3][n], an XOR gate XOR3, a data selector MUX1 and an XOR gate XOR1. The high-frequency analog signal dout_ro3[n] generated by each oscillation ring circuit in the three-level oscillation ring is sampled by the D flip-flop D[3][n] to obtain a corresponding random signal qout[3][n]. The random signal qout[3][n] corresponding to each oscillation ring circuit in the three-level oscillation ring is sampled by the XOR gate XOR3 to obtain a three-level oscillation ring XOR output result xor_ro3. The three-level oscillation ring XOR output result xor_ro3 is input into the data selector MUX1 and the XOR gate XOR1 respectively.

[0072] in, , that is, the 3-level oscillation ring contains 32 oscillation ring circuits, namely ro_3[0], ro_3[1], …, ro_3

[31] .

[0073] like Figure 2 As shown, the random number generation module includes a 5-level oscillation ring, a D flip-flop D[5][n] and an XOR gate XOR5. The high-frequency analog signal dout_ro5[n] generated by each oscillation ring circuit in the 5-level oscillation ring is sampled by the D flip-flop D[5][n] to obtain a corresponding random signal qout[5][n]. The random signal qout[5][n] corresponding to each oscillation ring circuit in the 5-level oscillation ring is sampled by the XOR gate XOR5 to obtain a 5-level oscillation ring XOR output result xor_ro5. The 5-level oscillation ring XOR output result xor_ro5 is input into the data selector MUX1 and the XOR gate XOR1 respectively.

[0074] Among them, the 5-level oscillation ring contains 32 oscillation ring circuits, namely ro_5[0], ro_5[1], ..., ro_5

[31] .

[0075] like Figure 2As shown, the random number generation module includes a 7-level oscillation ring, a D flip-flop D[7][n] and an XOR gate XOR7. The high-frequency analog signal dout_ro7[n] generated by each oscillation ring circuit in the 7-level oscillation ring is sampled by the D flip-flop D[7][n] to obtain a corresponding random signal qout[7][n]. The random signal qout[7][n] corresponding to each oscillation ring circuit in the 7-level oscillation ring is sampled by the XOR gate XOR7 to obtain a 7-level oscillation ring XOR output result xor_ro7. The 7-level oscillation ring XOR output result xor_ro7 is input into the data selector MUX1 and the XOR gate XOR1 respectively.

[0076] Among them, the 7-level oscillation ring contains 32 oscillation ring circuits, namely ro_7[0], ro_7[1], ..., ro_7

[31] .

[0077] like Figure 2 As shown, the random number generation module includes a 9-level oscillation ring, a D flip-flop D[9][n] and an XOR gate XOR9. The high-frequency analog signal dout_ro9[n] generated by each oscillation ring circuit in the 9-level oscillation ring is sampled by the D flip-flop D[9][n] to obtain a corresponding random signal qout[9][n]. The random signal qout[9][n] corresponding to each oscillation ring circuit in the 9-level oscillation ring is sampled by the XOR gate XOR9 to obtain a 9-level oscillation ring XOR output result xor_ro9. The 9-level oscillation ring XOR output result xor_ro9 is input into the data selector MUX1 and the XOR gate XOR1 respectively.

[0078] Among them, the 9-level oscillation ring contains 32 oscillation ring circuits, namely ro_9[0], ro_9[1], ..., ro_9

[31] .

[0079] like Figure 2 As shown, the random number generation module includes an 11-stage oscillation ring, a D flip-flop D

[11] [n] and an XOR gate XOR11. The high-frequency analog signals dout_ro11[n] generated by each oscillation ring circuit in the 11-stage oscillation ring are sampled by the D flip-flop D

[11] [n] to obtain the corresponding random signals qout

[11] [n]. The random signals qout

[11] [n] corresponding to each oscillation ring circuit in the 11-stage oscillation ring are sampled by the XOR gate XOR11 to obtain the XOR output result xor_ro11 of the 11-stage oscillation ring. The XOR output result xor_ro11 of the 11-stage oscillation ring is input into the data selector MUX1 and the XOR gate XOR1 respectively.

[0080] Among them, the 11-level oscillation ring contains 32 oscillation ring circuits, namely ro_11[0], ro_11[1], ..., ro_11

[31] .

[0081] like Figure 2As shown, the random number generation module also includes a data selector MUX2 and a D flip-flop D1, and the 3-level oscillation ring XOR output result xor_ro3, the 5-level oscillation ring XOR output result xor_ro5, the 7-level oscillation ring XOR output result xor_ro7, the 9-level oscillation ring XOR output result xor_ro9, and the 11-level oscillation ring XOR output result xor_ro11 are passed through an XOR gate XOR1 to obtain a mixed result xor_mix, and the mixed result xor_mix is ​​input into the data selector MUX1;

[0082] The data selector MUX2 receives the output result mux_out of the data selector MUX1, and inputs the output result mux_out to the D flip-flop D1, and the D flip-flop D1 samples the output result mux_out to generate a random number output random_bit_raw;

[0083] Among them, the data selector MUX1 is configured by the register sel_amba[2:0] to select the first-level oscillation ring in the entropy source to output the XOR result xor_ro* or the mixed result xor_mix. , and get the output result mux_out.

[0084] Taking the 3-level oscillation ring as an example, after enabling the corresponding oscillation ring circuit through the register en_ro3_amba configuration, and then configuring trigger_en_amba=1, the corresponding oscillation ring circuit in the 3-level oscillation ring starts to work. In order to further improve the randomness, the random signal qout[3][n] obtained after sampling each oscillation ring circuit of these 3-level oscillation rings by the D trigger D[3][n] is XOR-operated to obtain the XOR output result xor_ro3 of the 3-level oscillation ring.

[0085] Similarly, the 5th level oscillation ring XOR output result xor_ro5, the 7th level oscillation ring XOR output result xor_ro7, the 9th level oscillation ring XOR output result xor_ro9, and the 11th level oscillation ring XOR output result xor_ro11 are obtained respectively, and the mixed result xor_mix is ​​obtained after XORing the output results of each level of oscillation ring XOR. Through the configuration of register sel_amba[2:0], the 6 to 1 data selector MUX1 can be used to select the random bit data stream corresponding to the *th level oscillation ring XOR output result xor_ro* or the mixed result xor_mix, and output it as a single-bit true random number.

[0086] like Figure 2 and Figure 4As shown, the random number generation module also includes a counter cnt[15:0] and an AND gate A1 for delaying the random number sampling moment, one input end of the AND gate A1 inputs cnt[15:0]==num_wait[15:0], another input end of the AND gate A1 inputs trigger_en, and the output end of the AND gate A1 inputs the random number enable signal random_bit_enable to the data selector MUX2;

[0087] When the random number enable signal random_bit_enable=1, the D flip-flop D1 samples the output result mux_out, and the generated random number output random_bit_raw is valid; when the random number enable signal random_bit_enable=0, the random number output random_bit_raw generated by the D flip-flop D1 is invalid;

[0088] Among them, cnt[15:0]==num_wait[15:0] means that when the count value of counter cnt[15:0] is equal to the configuration value of num_wait[15:0], it returns 1, otherwise it returns 0;

[0089] num_wait[15:0] is configured by register num_wait_amba[15:0], and trigger_en is configured by register trigger_en_amba.

[0090] In order to ensure that the oscillation rings at all levels have entered a stable oscillation state when random number sampling occurs, and to flexibly change the phase point of random number sampling, the register num_wait_amba[15:0] can be flexibly configured to delay the random number sampling moment. When trigger_en=1, the counter cnt[15:0] starts counting, and when trigger_en=1 and cnt[15:0]=num_wait[15:0], the random number enable signal random_bit_enable=1.

[0091] When the random number enable signal random_bit_enable=1, the D flip-flop D1 samples the output result mux_out, and the generated random number output random_bit_raw is valid; when the random number enable signal random_bit_enable=0, the random number output random_bit_raw generated by the D flip-flop D1 is invalid.

[0092] like Figure 4As shown, when trigger_en = 1, the counter cnt[15:0] starts counting (if cnt[15:0] < num_wait[15:0], the counter cnt[15:0] keeps incrementing, and cnt_en = 1). When cnt[15:0] = num_wait[15:0], the counter cnt[15:0] stops counting (at this time, the random number enable signal random_bit_enable = 1). When trigger_en = 0 or power-on reset occurs, the counter cnt[15:0] is reset to 16'b0.

[0093] As Figure 3 shown, in the 3-stage oscillator ring, 5-stage oscillator ring, 7-stage oscillator ring, 9-stage oscillator ring, and 11-stage oscillator ring, for the nth oscillator ring circuit in the *-stage oscillator ring, , , its circuit structure includes a combinational logic oscillator ring composed of NAND gates and NOT gates for generating high-frequency analog signals, and an OR gate O[*][n] that makes the Boolean logic value at the input end of the D flip-flop D[*][n] equal to the output value of the corresponding LFSR pseudo-random number generator. The combinational logic oscillator ring includes NAND gate NAND1[*][n], NAND gate NAND2[*][n], and (* - 2) cascaded NOT gates;

[0094] One input terminal of NAND gate NAND1[*][n] and OR gate O[*][n] both inputs en_ro*[n], the other input terminal of OR gate O[*][n] inputs lfsr_en_ro*[n], the output terminals of NAND gate NAND1[*][n] and OR gate O[*][n] are respectively connected to the input terminals of NAND gate NAND2[*][n], the output terminal of NAND gate NAND2[*][n] is connected to (* - 2) cascaded NOT gates, and the output terminal of the last NOT gate N(* - 2)[*][n] in the (* - 2) cascaded NOT gates is respectively connected to the other input terminal of NAND gate NAND1[*][n] and D flip-flop D[*][n];

[0095] Among them, the (* - 2) cascaded NOT gates are respectively N1[*][n], N2[*][n], …, N(* - 2)[*][n], the sampling clock of D flip-flop D[*][n] is sample_clk, and the clock frequency of sample_clk is 1 / 5 of the oscillation frequency of the oscillator ring circuit;

[0096] en_ro*[n] is configured by the en_ro*_amba[31:0] register, and lfsr_en_ro*[n] is generated by the LFSR pseudo-random number generator.

[0097] As Figure 3As shown in the figure, in the normal working mode, the system turns off the LFSR pseudo-random number generator (lfsr_en_ro*[n]=0). If the nth oscillation ring circuit in the first-stage oscillation ring is enabled (en_ro*[n]=1), the output of the OR gate O[*][n] is always 1, and the behavior of the second-stage NAND gate NAND2[*][n] is equivalent to a NOT gate. Because the output end of the last NOT gate N(*-2)[*][n] in the cascaded (*-2) NOT gates is directly connected to the input end of the first-stage NAND gate NAND1[*][n], a combinational logic oscillation ring is formed by using the NAND gate and the NOT gate. The output of the combinational logic oscillation ring generates a high-frequency analog signal dout_ro*[n]. Subsequently, the D flip-flop D[*][n] driven by the sample_clk clock (the frequency of this clock is about 1 / 5 of the oscillation frequency of the oscillation ring circuit) samples the high-frequency analog signal dout_ro*[n] to obtain a random signal qout[*][n] in the digital domain.

[0098] like Figure 3 As shown, in the LFSR simulation mode, the system turns off the oscillation ring (en_ro*[n]=0). If the LFSR pseudo-random number generator corresponding to the nth oscillation ring circuit in the first-level oscillation ring is enabled (lfsr_en_ro*[n]=1), at this time, since en_ro*[n]=0, the output of the first-level NAND gate NAND1[*][n] is always 1, which is equivalent to "disconnecting the combinational logic oscillation ring". At this time, the output of the OR gate O[*][n] is the same as that of lfsr_en_ro*[n]. Because there is a second-level NAND gate NAND2[*][n] and an odd number of NOT gates between the output of the OR gate O[*][n] and the high-frequency analog signal dout_ro*[n] node, the Boolean logic value of the high-frequency analog signal dout_ro*[n] node and lfsr_en_ro*[n] is the same, which is equivalent to turning off the combinational logic oscillation ring and enabling the corresponding LFSR pseudo-random number generator. The high-frequency analog signal dout_ro*[n] is then sampled using a D-type flip-flop D[*][n] driven by the sample_clk clock (the frequency of this clock is approximately 1 / 5 of the oscillation frequency of the oscillation ring circuit) to obtain a random signal qout[*][n] in the digital domain.

[0099] like Figure 1 As shown, the random number entropy source also includes a LFSR pseudo-random number generator, which is enabled only when the system is in LFSR simulation mode and is not hardened during tape-out;

[0100] Among them, each oscillation ring circuit in the 3-level oscillation ring, the 5-level oscillation ring, the 7-level oscillation ring, the 9-level oscillation ring, and the 11-level oscillation ring is provided with a corresponding LFSR pseudo-random number generator.

[0101] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A highly flexible random number entropy source system, characterized by: Including register configuration module, cross-clock domain module and random number generation module; Register configuration module, configures registers through AMBA bus interface; The cross-clock domain module completes the signal synchronization of two asynchronous clock domains: the AMBA clock domain and the sampling clock domain. The random number generation module generates a high-frequency analog signal using an oscillation ring circuit, samples the high-frequency analog signal, obtains a random signal, and generates a random number by processing the random signal corresponding to a single / multiple oscillation ring circuits; The random number generation module comprises a three-level oscillation ring, a D flip-flop D[3][n], an XOR gate XOR3, a data selector MUX1 and an XOR gate XOR1. The high-frequency analog signals dout_ro3[n] generated by each oscillation ring circuit in the three-level oscillation ring are sampled by the D flip-flop D[3][n] to obtain corresponding random signals qout[3][n]. The random signals qout[3][n] corresponding to each oscillation ring circuit in the three-level oscillation ring are sampled by the XOR gate XOR3 to obtain a three-level oscillation ring XOR output result xor_ro3. The three-level oscillation ring XOR output result xor_ro3 is input into the data selector MUX1 and the XOR gate XOR1 respectively. in, , that is, the 3-level oscillation ring contains 32 oscillation ring circuits, namely ro_3[0], ro_3[1], ..., ro_3[31]; The random number generation module includes a 5-level oscillation ring, a D flip-flop D[5][n] and an XOR gate XOR5. The high-frequency analog signal dout_ro5[n] generated by each oscillation ring circuit in the 5-level oscillation ring is sampled by the D flip-flop D[5][n] to obtain a corresponding random signal qout[5][n]. The random signal qout[5][n] corresponding to each oscillation ring circuit in the 5-level oscillation ring is sampled by the XOR gate XOR5 to obtain a 5-level oscillation ring XOR output result xor_ro5. The 5-level oscillation ring XOR output result xor_ro5 is input into a data selector MUX1 and an XOR gate XOR1 respectively. Among them, the 5-level oscillation ring contains 32 oscillation ring circuits, namely ro_5[0], ro_5[1], ..., ro_5[31]; The random number generation module comprises a 7-level oscillation ring, a D flip-flop D[7][n] and an XOR gate XOR7. The high-frequency analog signals dout_ro7[n] generated by each oscillation ring circuit in the 7-level oscillation ring are sampled by the D flip-flop D[7][n] to obtain corresponding random signals qout[7][n]. The random signals qout[7][n] corresponding to each oscillation ring circuit in the 7-level oscillation ring are sampled by the XOR gate XOR7 to obtain a 7-level oscillation ring XOR output result xor_ro7. The 7-level oscillation ring XOR output results xor_ro7 are input into a data selector MUX1 and an XOR gate XOR1 respectively. Among them, the 7-level oscillation ring contains 32 oscillation ring circuits, namely ro_7[0], ro_7[1], ..., ro_7[31]; The random number generation module includes a 9-level oscillation ring, a D flip-flop D[9][n] and an XOR gate XOR9. The high-frequency analog signals dout_ro9[n] generated by each oscillation ring circuit in the 9-level oscillation ring are sampled by the D flip-flop D[9][n] to obtain corresponding random signals qout[9][n]. The random signals qout[9][n] corresponding to each oscillation ring circuit in the 9-level oscillation ring are sampled by the XOR gate XOR9 to obtain a 9-level oscillation ring XOR output result xor_ro9. The 9-level oscillation ring XOR output results xor_ro9 are input into a data selector MUX1 and an XOR gate XOR1 respectively. Among them, the 9-level oscillation ring contains 32 oscillation ring circuits, namely ro_9[0], ro_9[1], ..., ro_9[31]; The random number generation module includes an 11-stage oscillation ring, a D flip-flop D[11][n] and an XOR gate XOR11. The high-frequency analog signals dout_ro11[n] generated by each oscillation ring circuit in the 11-stage oscillation ring are sampled by the D flip-flop D[11][n] to obtain corresponding random signals qout[11][n]. The random signals qout[11][n] corresponding to each oscillation ring circuit in the 11-stage oscillation ring are sampled by the XOR gate XOR11 to obtain an XOR output result xor_ro11 of the 11-stage oscillation ring. The XOR output results xor_ro11 of the 11-stage oscillation ring are input into a data selector MUX1 and an XOR gate XOR1 respectively. Among them, the 11-level oscillation ring contains 32 oscillation ring circuits, namely ro_11[0], ro_11[1], ..., ro_11[31]; The random number generation module also includes a data selector MUX2 and a D flip-flop D1. The 3-level oscillation ring XOR output result xor_ro3, the 5-level oscillation ring XOR output result xor_ro5, the 7-level oscillation ring XOR output result xor_ro7, the 9-level oscillation ring XOR output result xor_ro9, and the 11-level oscillation ring XOR output result xor_ro11 are passed through an XOR gate XOR1 to obtain a mixed result xor_mix, and the mixed result xor_mix is ​​input into the data selector MUX1. The data selector MUX2 receives the output result mux_out of the data selector MUX1, and inputs the output result mux_out to the D flip-flop D1, and the D flip-flop D1 samples the output result mux_out to generate a random number output random_bit_raw; Among them, the data selector MUX1 is configured by the register sel_amba[2:0] to select the first-level oscillation ring in the entropy source to output the XOR result xor_ro* or the mixed result xor_mix. , and get the output result mux_out.

2. The highly flexible random number entropy source system according to claim 1, characterized in that: The random number generation module further includes a counter cnt[15:0] and an AND gate A1 for delaying the random number sampling time, wherein one input end of the AND gate A1 inputs cnt[15:0]==num_wait[15:0], another input end of the AND gate A1 inputs trigger_en, and the output end of the AND gate A1 inputs a random number enable signal random_bit_enable to the data selector MUX2; When the random number enable signal random_bit_enable=1, the D flip-flop D1 samples the output result mux_out, and the generated random number output random_bit_raw is valid; when the random number enable signal random_bit_enable=0, the random number output random_bit_raw generated by the D flip-flop D1 is invalid; Among them, cnt[15:0]==num_wait[15:0] means that when the count value of counter cnt[15:0] is equal to the configuration value of num_wait[15:0], it returns 1, otherwise it returns 0; num_wait[15:0] is configured by register num_wait_amba[15:0], and trigger_en is configured by register trigger_en_amba.

3. The highly flexible random number entropy source system according to claim 1, characterized in that: Among the 3-level oscillation ring, 5-level oscillation ring, 7-level oscillation ring, 9-level oscillation ring, and 11-level oscillation ring, for the nth oscillation ring circuit in the *-level oscillation ring, , , whose circuit structure includes a combinational logic oscillation ring composed of a NAND gate and a NOT gate for generating a high-frequency analog signal, and an OR gate O[*][n] that makes the Boolean logic value of the input end of the D flip-flop D[*][n] equal to the output end of the corresponding LFSR pseudo-random number generator, and the combinational logic oscillation ring includes a NAND gate NAND1[*][n], a NAND gate NAND2[*][n], and cascaded (*-2) NOT gates; One input end of the NAND gate NAND1[*][n] and the OR gate O[*][n] are both input to en_ro*[n], the other input end of the OR gate O[*][n] is input to lfsr_en_ro*[n], the output ends of the NAND gate NAND1[*][n] and the OR gate O[*][n] are respectively connected to the input end of the NAND gate NAND2[*][n], the output end of the NAND gate NAND2[*][n] is connected to the cascaded (*-2) NOT gates, the output end of the last NOT gate N(*-2)[*][n] of the cascaded (*-2) NOT gates is respectively connected to the other input end of the NAND gate NAND1[*][n] and the D flip-flop D[*][n]; Among them, the cascaded (*-2) NOT gates are N1[*][n], N2[*][n], ..., N(*-2)[*][n], the sampling clock of the D flip-flop D[*][n] is sample_clk, and the clock frequency of sample_clk is 1 / 5 of the oscillation frequency of the oscillation ring circuit; en_ro*[n] is configured by the en_ro*_amba[31:0] register, and lfsr_en_ro*[n] is generated by the LFSR pseudo-random number generator.

4. The highly flexible random number entropy source system according to claim 3, characterized in that: The random number entropy source system also includes a LFSR pseudo-random number generator, which is enabled only when the system is in LFSR simulation mode and is not hardened during tape-out; Among them, each oscillation ring circuit in the 3-level oscillation ring, the 5-level oscillation ring, the 7-level oscillation ring, the 9-level oscillation ring, and the 11-level oscillation ring is provided with a corresponding LFSR pseudo-random number generator.

Citation Information

Patent Citations

  • True random number generator

    CN101515228A