CN117785388B - Method, device, medium and equipment for generating pseudo random sequence calculation program - Google Patents

Method, device, medium and equipment for generating pseudo random sequence calculation program Download PDF

Info

Publication number
CN117785388B
CN117785388B CN202410213638.7A CN202410213638A CN117785388B CN 117785388 B CN117785388 B CN 117785388B CN 202410213638 A CN202410213638 A CN 202410213638A CN 117785388 B CN117785388 B CN 117785388B
Authority
CN
China
Prior art keywords
expression
pseudo
random sequence
calculated
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410213638.7A
Other languages
Chinese (zh)
Other versions
CN117785388A (en
Inventor
常博森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Niuxin Semiconductor Shenzhen Co ltd
Original Assignee
Niuxin Semiconductor Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Niuxin Semiconductor Shenzhen Co ltd filed Critical Niuxin Semiconductor Shenzhen Co ltd
Priority to CN202410213638.7A priority Critical patent/CN117785388B/en
Publication of CN117785388A publication Critical patent/CN117785388A/en
Application granted granted Critical
Publication of CN117785388B publication Critical patent/CN117785388B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses a method, a device, a medium and equipment for generating a pseudo random sequence calculation program, wherein the method comprises the following steps: acquiring bit width, polynomial and initial value of a pseudo-random sequence to be calculated; determining a target expression of the pseudo-random sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated; therefore, the application can rapidly determine the target expression corresponding to the pseudo-random sequence to be calculated without manual calculation, and can save the time for determining the target expression; and finally, in response to executing the specified script, generating a target program for calculating the pseudo-random sequence based on the target expression, so that the target program for calculating the pseudo-random sequence is automatically generated through the specified script, the programming workload is reduced, and the programming working efficiency is improved.

Description

Method, device, medium and equipment for generating pseudo random sequence calculation program
Technical Field
The invention belongs to the technical field of pseudo-random sequence calculation, and particularly relates to a method, a device, a medium and equipment for generating a pseudo-random sequence calculation program.
Background
At present, for languages such as C language which are executed in series, pseudo-random sequence (PRBS) calculation is simpler, but for languages such as verilog which are executed in parallel, the PRBS calculation can greatly increase the workload of writing verilog codes along with the increase of the data bit width. For small bit width data, the calculation formula of each bit of data in the PRBS can be manually calculated and then written into the verilog code. However, when the bit width of the PRBS to be calculated is increased, for example, when the data bit width of the PRBS to be calculated is 512 bits, the workload of manual calculation is huge, and a great deal of time cost and labor cost are required, resulting in low work efficiency of calculating the pseudo random sequence.
Disclosure of Invention
The invention aims to provide a method, a device, a medium and equipment for generating a pseudo-random sequence calculation program, which are used for solving the problem that a verilog program for calculating a pseudo-random sequence cannot be written efficiently.
According to an aspect of an embodiment of the present application, there is provided a method of generating a pseudo random sequence calculation program, the method comprising:
acquiring bit width, polynomial and initial value of a pseudo-random sequence to be calculated;
Determining a target expression of the pseudo-random sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated;
In response to executing the specified script, a target program that calculates a pseudo-random sequence is generated based on the target expression.
In one embodiment of the present application, determining a target expression of a pseudo-random sequence to be calculated in a specified script based on a bit width of the pseudo-random sequence to be calculated, a polynomial, and an initial value, includes: determining an initial expression corresponding to each pseudorandom code to be calculated in the pseudorandom sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudorandom sequence to be calculated; summarizing the initial expression corresponding to each pseudo-random code to be calculated to obtain a target expression.
In one embodiment of the present application, summarizing initial expressions corresponding to each pseudorandom code to be calculated to obtain a target expression includes: acquiring the number of initial values contained in an initial expression; determining a simplified expression corresponding to the initial expression according to the number of initial values contained in the initial expression; summarizing the simplified expressions to obtain the target expression.
In one embodiment of the present application, determining a simplified expression corresponding to an initial expression according to the number of initial values included in the initial expression includes: if the number of the current initial values contained in the initial expression is an odd number, one current initial value in the initial expression is reserved; deleting the current initial value in the initial expression if the number of the current initial values contained in the initial expression is even; and summarizing the reserved initial values to obtain a simplified expression.
In one embodiment of the present application, generating a target program for calculating a pseudo random sequence based on a target expression in response to executing a specified script, comprises: outputting the target expression to the target program file in response to executing the specified script; the program described in the target program file is set as the target program.
In one embodiment of the present application, after obtaining the bit width and the polynomial of the pseudo-random sequence to be calculated, the method further comprises: setting a definition write command corresponding to the bit width of the pseudo-random sequence to be calculated in a specified script; writing module definition information of the target program in the target program file in response to executing the definition write command; the module definition information is used to define the function of the target program and the number of bits of the calculated pseudo-random sequence to be calculated.
In one embodiment of the application, before generating the target program that calculates the pseudo-random sequence based on the target expression in response to executing the specified script, the method further comprises: setting an end statement writing command corresponding to the target program in the specified script; when executing the end statement writing command, the end statement corresponding to the target program is written into the target program file.
According to an aspect of an embodiment of the present application, there is provided an apparatus for generating a pseudo random sequence calculation program, the apparatus including:
The acquisition module is used for acquiring the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated;
The expression determining module is used for determining a target expression of the pseudo-random sequence to be calculated in the specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated;
and the program generating module is used for generating a target program for calculating the pseudo random sequence based on the target expression in response to executing the specified script.
According to an aspect of an embodiment of the present application, there is provided a computer medium having stored thereon a computer program which, when executed by a processor, implements the method for generating a pseudo random sequence calculation program provided by any one of the embodiments of the present application.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; a memory for storing executable instructions of the processor; execution of the executable instructions by the processor causes the electronic device to perform the method of generating a pseudo-random sequence calculation program provided by any one of the embodiments of the present application.
In the technical scheme of the application, the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated are obtained; determining a target expression of the pseudo-random sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated; therefore, the application can rapidly determine the target expression corresponding to the pseudo-random sequence to be calculated without manual calculation, and can save the time for determining the target expression; and finally, in response to executing the specified script, generating a target program for calculating the pseudo-random sequence based on the target expression, so that the target program for calculating the pseudo-random sequence is automatically generated through the specified script, the programming workload is reduced, and the programming working efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 schematically shows a schematic diagram of the calculation of a pseudo-random sequence.
Fig. 2 schematically illustrates a flowchart of a method for generating a pseudo random sequence calculation program according to an embodiment of the present application.
Fig. 3 schematically shows a block diagram of an apparatus for generating a pseudo random sequence calculation program according to an embodiment of the present application.
Fig. 4 schematically shows a block diagram of an electronic device according to an embodiment of the application.
Fig. 5 schematically shows a block diagram of a computer system of a self-mobile device for implementing an embodiment of the application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics of the application may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
First, a calculation rule of a pseudo random sequence is described, taking a pseudo random sequence PRBS7 as an example, as shown in fig. 1, the initial values of the pseudo random sequence have 7, for example, an initial value ct0, an initial value ct1, an initial value ct2, an initial value ct3, an initial value ct4, an initial value ct5, and an initial value ct6, which respectively correspond to x1, x2, x3, x4, x5, x6, and x7 in a shift register. If the data bit width of the pseudorandom sequence is 64 bits, the polynomial is x7+x6+1, and each bit of data of the pseudorandom sequence is the result of performing an exclusive-or operation on the initial value, the first bit pseudorandom sequence code nt [0] =x7 =x6=ct6 and ct5 of the pseudorandom sequence can be obtained, wherein x7 in the polynomial of the pseudorandom sequence PRBS7 corresponds to the initial value ct6 and x6 corresponds to the initial value ct5. Then, the second pseudo random sequence code nt [1] =x7 =x6=ct5 and ct4 is the second pseudo random sequence code, where x7 in the polynomial of the pseudo random sequence PRBS7 corresponds to the initial value ct5 and x6 corresponds to the initial value ct4. It can be seen that when the pseudo-random sequence is calculated, the initial value is shifted bit by bit, and then when nt [0] becomes x7, the corresponding pseudo-random code nt [6] =nt [0] is ]. If the calculation is performed in a serial language such as C, the results of nt 0 and nt 1 are already obtained when nt 6 is calculated, then nt 6 can also be calculated. However, for parallel languages such as verilog, nt [0], nt [1] … … nt [62] and nt [63] are calculated simultaneously, i.e., the specific values of nt [0] and nt [1] are not obtained when calculating nt [6 ]. However, the values of nt [0] and nt [1] which are not known as the result can be converted, that is, the values are expressed by the corresponding calculation expressions, so that nt [6] =ct6 =ct5 # -ct5 # -ct 4 can be obtained, and the pseudo-random sequence is calculated in verilog. Based on the principle of the above pseudo random sequence calculation, the present application provides a method for generating a pseudo random sequence calculation program, as shown in fig. 2, the method includes S210 to S230, and the specific embodiments are as follows.
S210, acquiring the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated.
Specifically, the bit width refers to the number of bits of the pseudo-random sequence to be calculated, for example, the bit width of the pseudo-random sequence to be calculated is 5, that is, the calculated pseudo-random sequence has 5 bits of data. The polynomial is an item that is operated when the pseudo-random sequence is calculated, for example, the polynomial is x7+x6+1, that is, x7 and x6 are exclusive-or, and, not, or exclusive-or, and the like, and if the polynomial is x7+x4+1, that is, x7 and x4 are exclusive-or, and, not, or exclusive-or, and the like. The initial values may be preset, for example, the pseudo random sequence PRBS7 includes 7 initial values, and ct0=1, ct1=1, ct2=0, ct3=0, ct4=1, ct5=0, and ct6=1 may be set, so that the result of each bit of data in the pseudo random sequence to be calculated may be determined according to the initial values.
In one embodiment of the present application, after obtaining the bit width and the polynomial of the pseudo-random sequence to be calculated, the method further comprises: setting a definition write command corresponding to the bit width of the pseudo-random sequence to be calculated in a specified script; writing module definition information of the target program in the target program file in response to executing the definition write command; the module definition information is used to define the function of the target program and the number of bits of the calculated pseudo-random sequence to be calculated.
Specifically, a module in a program refers to a code block capable of realizing a specific function, and when a code corresponding to the module is written at present, the content such as the function or variable of the module needs to be defined at the beginning of the module, and the content which needs to be defined in the module is module definition information. The application automatically generates the target program by executing the specified script, so that the write command of the module definition information corresponding to the target program is required to be set in the specified script, for example, the following definition write command is set in the shell script:
echo "function [${data_width}-1:0] prbs7_gen(input [6:0]ct);">prbs7_new.v
echo "reg [${data_width}-1:0] nt;">>prbs7_new.v
echo "begin">>prbs7_new.v
in this way, when executing the above-described definition write command in the shell script, the module definition information for calculating PRBS7 may be automatically generated in the verilog file.
S220, determining a target expression of the pseudo-random sequence to be calculated in the specified script based on the bit width of the pseudo-random sequence to be calculated, the polynomial and the initial value.
Specifically, the specified script refers to a script such as a shell script, which can implement automatic programming, and the system or the device can parse the command in the script and execute the command accordingly. According to the calculation rule of the pseudo-random sequence, after the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated are determined, the expression corresponding to each bit of data in the pseudo-random sequence to be calculated can be determined, and the process is converted into a command in a specified script, namely the multi-bit data is determined in a cyclic manner. For example, the expression may be calculated in the shell script by for loop, and specific commands are as follows:
for((j=7;j<=${data_width}))
do
nt[j]=${nt[j-6]}^${nt[j-7]}
done
executing the loop sentence, expressions of nt [0] to nt [63] can be obtained, so that a target expression of the pseudo random sequence to be calculated can be determined.
In one embodiment of the present application, determining a target expression of a pseudo-random sequence to be calculated in a specified script based on a bit width of the pseudo-random sequence to be calculated, a polynomial, and an initial value, includes: determining an initial expression corresponding to each pseudorandom code to be calculated in the pseudorandom sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudorandom sequence to be calculated; summarizing the initial expression corresponding to each pseudo-random code to be calculated to obtain a target expression.
Specifically, an initial expression corresponding to each pseudo-random code to be calculated is determined in a specified script through a predetermined command statement, for example, initial expressions corresponding to nt [0] to nt [63] are determined in a shell script through a for-loop statement:
nt[0]=ct6⊕ct5
nt[1]=ct5⊕ct4
……
nt[7]=ct6⊕ct5⊕ct5⊕ct4
nt[8]=ct5⊕ct4⊕ct4⊕ct3
……
nt[14]=ct5⊕ct4⊕ct4⊕ct3⊕ct6⊕ct5⊕ct5⊕ct4
……
then, the initial expressions corresponding to nt [0] to nt [63] are summarized to obtain a calculation formula required for the target program to calculate PRBS 7.
In one embodiment of the present application, summarizing initial expressions corresponding to each pseudorandom code to be calculated to obtain a target expression includes: acquiring the number of initial values contained in an initial expression; determining a simplified expression corresponding to the initial expression according to the number of initial values contained in the initial expression; summarizing the simplified expressions to obtain the target expression.
Specifically, as can be seen from the observation of the initial expressions corresponding to nt [0] to nt [63] of the PRBS7, as the number of bits of the pseudo-random code calculated increases, the length of the initial expression corresponding thereto becomes longer and longer, and is a logical operation between the initial values. It is known that when the same initial value is exclusive-ored an even number of times, the obtained result is identical to the result of exclusive-ored operation not performed on the initial value. Then, the initial expression can be simplified according to the characteristics, and the calculation amount of the pseudo random sequence can be reduced. For example, nt [14] =ct5 # -ct4 # -ct3 # -ct6 # -ct5 # -ct4, wherein the initial expression of nt [4] includes an initial value ct3, an initial value ct4, an initial value ct5 and an initial value ct6, then the number of initial values ct3 is determined to be 1, the number of initial values ct4 is determined to be 3, the number of initial values ct5 is determined to be 3, and the number of initial values ct6 is determined to be 1.
Further, in one embodiment of the present application, determining a simplified expression corresponding to the initial expression according to the number of initial values included in the initial expression includes: if the number of the current initial values contained in the initial expression is an odd number, one current initial value in the initial expression is reserved; deleting the current initial value in the initial expression if the number of the current initial values contained in the initial expression is even; and summarizing the reserved initial values to obtain a simplified expression.
Specifically, when the xor operation is performed for an even number of times according to the same initial value, the obtained result is the same as the result of the xor operation not performed for the initial value, if the number of the current initial values included in the initial expression is odd, one current initial value cannot be eliminated, and one current initial value needs to be reserved; otherwise, the current initial value can just perform the exclusive-or operation every two, and the calculation result is equivalent to that of the current initial value, so that all the current initial values in the initial expression are deleted. And finally, summarizing the initial values reserved after simplification to obtain a simplified expression. For example, the initial expression of nt [4] contains 1 number of initial values ct3, 3 number of initial values ct4, 3 number of initial values ct5, and 1 number of initial values ct 6; the initial expression based on nt 4 has odd number of initial values, so that one initial value ct3, one initial value ct4, one initial value ct5 and one initial value ct6 are reserved, and thus, a simplified expression nt 4=ct3, ct4, ct5 and ct6 is obtained. It should be appreciated that the present application is not limited to exclusive or operations, and that other logical operations having the same or similar characteristics may also simplify the expression by determining the number of initial values.
In another embodiment of the present application, determining a simplified expression corresponding to an initial expression according to the number of initial values included in the initial expression includes: dividing the number of the current initial values contained in the initial expression by 2 to obtain remainder; if the remainder is 1, a current initial value in the initial expression is reserved; deleting the current initial value in the initial expression if the remainder is 0; and summarizing the reserved initial values to obtain a simplified expression.
Specifically, as described above, when the exclusive or operation is performed an even number of times based on the same initial value, the result obtained is the same as the result of the exclusive or operation not performed on the initial value, and therefore, it is possible to determine whether or not to hold the current initial value included in the initial expression by dividing the number of the current initial values included in the initial expression by 2 to obtain the remainder. For example, the initial expression of nt [4] contains 1 number of initial values ct3, 3 number of initial values ct4, 3 number of initial values ct5, and 1 number of initial values ct 6; the remainder of dividing each initial value by 2 is 1, so that one of the initial values is preserved in the initial expression for exclusive-or operation.
S230, generating a target program for calculating the pseudo random sequence based on the target expression in response to executing the specified script.
Specifically, the target program may be a program such as a verilog program that can be executed in parallel, that is, when the pseudo-random sequence is calculated by the target program, calculation of each bit of data in the pseudo-random sequence is performed in parallel, not in series. The specified script comprises command sentences, the command sentences in the specified script are analyzed and executed, and corresponding operations can be realized, wherein the operations comprise automatically creating a target program file, writing a target expression into the target program, and generating a program sentence corresponding to the calculation pseudo-random sequence in the target program file.
In the technical scheme of the application, the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated are obtained; determining a target expression of the pseudo-random sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated; therefore, the application can rapidly determine the target expression corresponding to the pseudo-random sequence to be calculated without manual calculation, and can save the time for determining the target expression; and finally, in response to executing the specified script, generating a target program for calculating the pseudo-random sequence based on the target expression, so that the target program for calculating the pseudo-random sequence is automatically generated through the specified script, the programming workload is reduced, and the programming working efficiency is improved.
In one embodiment of the present application, generating a target program for calculating a pseudo random sequence based on a target expression in response to executing a specified script, comprises: outputting the target expression to the target program file in response to executing the specified script; the program described in the target program file is set as the target program.
Specifically, the object program file is an executable file of the object program, and when the object program in the object program file is executed, the calculation of the specified pseudo-random sequence can be realized. After executing the command statement in the specified script, the target expression can be correspondingly written into the target program file, and then the target program for calculating the pseudo-random sequence can be obtained by combining other programs in the target program file.
In one embodiment of the application, before generating the target program that calculates the pseudo-random sequence based on the target expression in response to executing the specified script, the method further comprises: setting an end statement writing command corresponding to the target program in the specified script; when executing the end statement writing command, the end statement corresponding to the target program is written into the target program file.
Specifically, the current programming language is generally provided with a corresponding end statement to exit the current task or output the result to the next node or module. Therefore, when the target program is automatically generated through the specified script, a write command corresponding to the end statement of the target program is also required to be set in the specified script, so that when the specified script is executed, the end statement of the target program can be generated in the corresponding target program file, the system or the processing module can be caused to exit the current task for calculating the pseudo-random sequence, and the fact that the execution of the subsequent task is influenced by excessive completed tasks can be prevented. For example, the following end statement write command may be written in the shell script:
echo "prbs7_gen=nt;">>prbs7_new.v
echo "end;">>prbs7_new.v
echo "endfunction;">>prbs7_new.v
Thus, when the end statement writing command in the shell script is executed, the end statement in the quotation mark can be automatically written in the verilog file.
According to the method embodiment of the application, the short command sentences are arranged in the specified script, so that the corresponding target program can be automatically generated in the target program file, a large number of target expressions can be automatically written into the target program, the workload of determining and writing the target expressions can be reduced, errors caused by manual writing can be reduced, and the accuracy of the target program is improved.
An embodiment of the apparatus of the present application is described below, and as shown in fig. 3, the present application provides an apparatus for generating a pseudo random sequence calculation program, the apparatus including:
an obtaining module 310, configured to obtain a bit width, a polynomial, and an initial value of a pseudo random sequence to be calculated;
An expression determining module 320, configured to determine a target expression of the pseudo-random sequence to be calculated in the specified script based on the bit width, the polynomial, and the initial value of the pseudo-random sequence to be calculated;
The program generating module 330 is configured to generate a target program for calculating a pseudo random sequence based on the target expression in response to executing the specified script.
In one embodiment of the application, the expression determination module 320 includes: the initial expression determining unit is used for determining an initial expression corresponding to each pseudorandom code to be calculated in the pseudorandom sequence to be calculated in the specified script based on the bit width, the polynomial and the initial value of the pseudorandom sequence to be calculated; and the summarizing unit is used for summarizing the initial expression corresponding to each pseudo-random code to be calculated to obtain the target expression.
In one embodiment of the present application, the summarizing unit is further configured to obtain the number of initial values included in the initial expression; determining a simplified expression corresponding to the initial expression according to the number of initial values contained in the initial expression; summarizing the simplified expressions to obtain the target expression.
In one embodiment of the present application, the summarizing unit is further configured to reserve one current initial value in the initial expression if the number of current initial values included in the initial expression is an odd number; deleting the current initial value in the initial expression if the number of the current initial values contained in the initial expression is even; and summarizing the reserved initial values to obtain a simplified expression.
In one embodiment of the application, program generation module 330 includes: an expression output unit for outputting the target expression to the target program file in response to execution of the specified script; program specifying means for setting a program described in the target program file as a target program.
In one embodiment of the present application, the apparatus provided by the present application further includes: the definition module is used for setting a definition write command corresponding to the bit width of the pseudo-random sequence to be calculated in the appointed script after acquiring the bit width and the polynomial of the pseudo-random sequence to be calculated; writing module definition information of the target program in the target program file in response to executing the definition write command; the module definition information is used to define the function of the target program and the number of bits of the calculated pseudo-random sequence to be calculated.
In one embodiment of the present application, the apparatus provided by the present application further includes: the ending module is used for setting an ending statement writing command corresponding to the target program in the appointed script before the target program for calculating the pseudo random sequence is generated based on the target expression in response to the appointed script; when executing the end statement writing command, the end statement corresponding to the target program is written into the target program file.
It should be noted that, the specific implementation of the apparatus embodiment of the present application has been described in the corresponding method embodiment, and will not be described herein.
The following describes an electronic device of the present application, as shown in fig. 4, the present application provides an electronic device 400, comprising: a processor 410 and a memory 420, the memory 420 for storing executable instructions of the processor; execution of the executable instructions by the processor 410 causes the electronic device to perform the method of generating a pseudo-random sequence calculation program provided by any one of the embodiments of the present application.
Specifically, the method for generating the pseudo random sequence calculating program provided by the application is stored in the memory 420, and the method for generating the pseudo random sequence calculating program is executed by the processor 410, so that the bit width, the polynomial and the initial value of the pseudo random sequence to be calculated are obtained; determining a target expression of the pseudo-random sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated; therefore, the application can rapidly determine the target expression corresponding to the pseudo-random sequence to be calculated without manual calculation, and can save the time for determining the target expression; and finally, in response to executing the specified script, generating a target program for calculating the pseudo-random sequence based on the target expression, so that the target program for calculating the pseudo-random sequence is automatically generated through the specified script, the programming workload is reduced, and the programming working efficiency is improved.
It should be noted that the specific implementation content of the electronic device in the present application has been explained in detail in the corresponding method embodiments, and will not be described herein.
Fig. 5 schematically shows a block diagram of a computer system of an electronic device for implementing an embodiment of the application.
It should be noted that the computer system 500 of the self-mobile device shown in fig. 5 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a processor 501, and the processor 501 may be CPU (Central Processing Unit) or MCU (Microcontroller Unit), and the processor 501 may perform various appropriate actions and processes according to a program stored in a Read-Only Memory 502 (ROM) or a program loaded from a storage portion 508 into a random access Memory 503 (Random Access Memory, RAM). In the random access memory 503, various programs and data required for the system operation are also stored. The processor 501, the rom 502, and the ram 503 are connected to each other via a bus 504. An Input/Output interface 505 (i.e., an I/O interface) is also connected to bus 504.
The following components are connected to the input/output interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), and a speaker, etc.; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a local area network card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the input/output interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, the processes described in the various method flowcharts may be implemented as computer software programs according to embodiments of the application. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The computer programs, when executed by the processor 501, perform the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), a flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the embodiments according to the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (7)

1. A method of generating a pseudo-random sequence calculation program, comprising:
acquiring bit width, polynomial and initial value of a pseudo-random sequence to be calculated;
determining an initial expression corresponding to each pseudorandom code to be calculated in the pseudorandom sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudorandom sequence to be calculated;
acquiring the number of initial values contained in the initial expression;
If the number of the current initial values contained in the initial expression is an odd number, one current initial value in the initial expression is reserved;
deleting the current initial value in the initial expression if the number of the current initial values contained in the initial expression is even;
summarizing the reserved initial values to obtain a simplified expression;
summarizing the simplified expression to obtain a target expression;
in response to executing the specified script, a target program is generated that calculates the pseudo-random sequence based on the target expression.
2. The method of generating a pseudo-random sequence calculating program according to claim 1, wherein said generating a target program for calculating the pseudo-random sequence based on the target expression in response to executing the specified script comprises:
outputting the target expression to a target program file in response to executing the specified script;
and taking the program recorded in the target program file as the target program.
3. The method of generating a pseudorandom sequence calculation program according to claim 1 wherein after obtaining the bit width and polynomial of the pseudorandom sequence to be calculated, the method further comprises:
Setting a definition writing command corresponding to the bit width of the pseudo-random sequence to be calculated in a specified script;
Writing module definition information of the target program in the target program file in response to executing the definition writing command; the module definition information is used for defining the function of the target program and the calculated bit number of the pseudo-random sequence to be calculated.
4. The method of generating a pseudo-random sequence calculating program according to claim 1, wherein before generating a target program for calculating the pseudo-random sequence based on the target expression in response to executing the specified script, the method further comprises:
Setting an end statement writing command corresponding to the target program in the specified script; when the end statement writing command is executed, the end statement corresponding to the target program is written into the target program file.
5. An apparatus for generating a pseudo-random sequence calculation program, comprising:
The acquisition module is used for acquiring the bit width, the polynomial and the initial value of the pseudo-random sequence to be calculated;
The expression determining module is used for determining an initial expression corresponding to each pseudorandom code to be calculated in the pseudorandom sequence to be calculated in a specified script based on the bit width, the polynomial and the initial value of the pseudorandom sequence to be calculated; acquiring the number of initial values contained in the initial expression; if the number of the current initial values contained in the initial expression is an odd number, one current initial value in the initial expression is reserved; deleting the current initial value in the initial expression if the number of the current initial values contained in the initial expression is even; summarizing the reserved initial values to obtain a simplified expression; summarizing the simplified expression to obtain a target expression;
And the program generating module is used for generating a target program for calculating the pseudo random sequence based on the target expression in response to executing the specified script.
6. A computer readable medium having stored thereon a computer program, which when executed by a processor implements the method of generating a pseudo random sequence calculation program according to any of claims 1 to 4.
7. An electronic device, comprising:
A processor;
A memory for storing executable instructions of the processor;
Execution of the executable instructions by the processor causes the electronic device to implement the method of generating a pseudo-random sequence calculation program as claimed in any one of the preceding claims 1 to 4.
CN202410213638.7A 2024-02-27 2024-02-27 Method, device, medium and equipment for generating pseudo random sequence calculation program Active CN117785388B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410213638.7A CN117785388B (en) 2024-02-27 2024-02-27 Method, device, medium and equipment for generating pseudo random sequence calculation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410213638.7A CN117785388B (en) 2024-02-27 2024-02-27 Method, device, medium and equipment for generating pseudo random sequence calculation program

Publications (2)

Publication Number Publication Date
CN117785388A CN117785388A (en) 2024-03-29
CN117785388B true CN117785388B (en) 2024-04-26

Family

ID=90387286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410213638.7A Active CN117785388B (en) 2024-02-27 2024-02-27 Method, device, medium and equipment for generating pseudo random sequence calculation program

Country Status (1)

Country Link
CN (1) CN117785388B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145901A (en) * 2007-07-06 2008-03-19 哈尔滨工程大学 Ultra-chaos pseudo random sequence generator
CN101674180A (en) * 2008-09-10 2010-03-17 中国人民解放军信息工程大学 Pseudorandom sequence generation method and pseudorandom sequence encryption method
CN101925056A (en) * 2009-06-10 2010-12-22 华为技术有限公司 Scrambling code sequence generation method, device and system for scrambling or descrambling
CN114047905A (en) * 2022-01-11 2022-02-15 北京百瑞互联技术有限公司 Pseudo-random sequence generation method, device, medium and equipment
CN116610289A (en) * 2023-07-17 2023-08-18 牛芯半导体(深圳)有限公司 Pseudo-random binary sequence generating device, pseudo-random binary sequence generating method, pseudo-random binary sequence detecting device, and pseudo-random binary sequence storing medium
CN117331530A (en) * 2023-08-31 2024-01-02 天津七一二通信广播股份有限公司 Method, device, electronic equipment and storage medium for fast jump of long pseudo-random sequence

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110302397A1 (en) * 2010-04-12 2011-12-08 Mitola Iii Joseph Method and Apparatus for Improved Secure Computing and Communications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145901A (en) * 2007-07-06 2008-03-19 哈尔滨工程大学 Ultra-chaos pseudo random sequence generator
CN101674180A (en) * 2008-09-10 2010-03-17 中国人民解放军信息工程大学 Pseudorandom sequence generation method and pseudorandom sequence encryption method
CN101925056A (en) * 2009-06-10 2010-12-22 华为技术有限公司 Scrambling code sequence generation method, device and system for scrambling or descrambling
CN114047905A (en) * 2022-01-11 2022-02-15 北京百瑞互联技术有限公司 Pseudo-random sequence generation method, device, medium and equipment
CN116610289A (en) * 2023-07-17 2023-08-18 牛芯半导体(深圳)有限公司 Pseudo-random binary sequence generating device, pseudo-random binary sequence generating method, pseudo-random binary sequence detecting device, and pseudo-random binary sequence storing medium
CN117331530A (en) * 2023-08-31 2024-01-02 天津七一二通信广播股份有限公司 Method, device, electronic equipment and storage medium for fast jump of long pseudo-random sequence

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GOLD序列的生成及平衡码的讨论;严春林 等;四川省电子学会航空航天电子学学术交流会论文集;20001101;第104-108页 *
基于双向扩散机制融合伪随机数同步生成器的快速图像加密算法研究;许爽 等;科学技术与工程;20140704;第14卷(第7期);第45-50页 *

Also Published As

Publication number Publication date
CN117785388A (en) 2024-03-29

Similar Documents

Publication Publication Date Title
CN109739478B (en) Front-end project automatic construction method and device, storage medium and electronic equipment
US20110154299A1 (en) Apparatus and method for executing instrumentation code
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN111208933A (en) Data access method, device, equipment and storage medium
CN110955438A (en) Method, device and equipment for monitoring performance of small program and storage medium
US9311348B2 (en) Method and system for implementing an array using different data structures
CN107977292A (en) The test method and device of SPI-NAND
CN117785388B (en) Method, device, medium and equipment for generating pseudo random sequence calculation program
US11055100B2 (en) Processor, and method for processing information applied to processor
JP6458626B2 (en) Debug circuit, semiconductor device, and debugging method
CN112988578A (en) Automatic testing method and device
CN109766088B (en) Program generation method, program generation device, data processing method and server
CN113158177A (en) Dynamic measurement method, device, equipment and storage medium
CN111159278A (en) Data display method and device, electronic equipment and computer readable storage medium
US9436587B2 (en) Test context generation
CN111737040B (en) Program code repairing method and device
CN114743586A (en) Mirror image storage implementation method and device of storage model and storage medium
CN112905090A (en) Spreadsheet processing method, device, terminal and storage medium
CN109669668B (en) Method and device for realizing simulated transaction execution in system performance test
CN111338968A (en) Project function module debugging method, device, medium and electronic equipment
US10303832B2 (en) Architecture generating device
CN112486854B (en) NAND Flash Nand Flash storage management method and device
CN107562442B (en) Method and device for reading data
CN111506299B (en) Front-end data verification method and device and computer equipment
CN110245086B (en) Application program stability testing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant