Waveform output method and apparatus, hardware device, and computer readable storage medium
By storing waveform fragment sets in the quantum measurement and control system and using tags and instruction packets to change the output combination method, the problem of low efficiency caused by the large amount of pulse waveform data in the quantum measurement and control system is solved, and fast and flexible waveform output is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-03-03
AI Technical Summary
The large amount of pulse waveform data in existing quantum measurement and control systems results in poor flexibility, leading to long output pulse waveform times and low efficiency.
By storing a set of waveform segments sent by the software device in the hardware device, and using the tags and instruction packets of the waveform segments, the output combination of the waveforms can be changed to achieve the output of arbitrary waveforms, thereby reducing the amount of data that needs to be transmitted.
By changing the output combination method while using the same set of waveform segments, arbitrary waveforms can be output quickly, improving output efficiency and flexibility.
Smart Images

Figure CN115629646B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of radio management and detection technology, and in particular to a waveform output method, apparatus, hardware device, and computer-readable storage medium. Background Technology
[0002] In quantum computing, when implementing qubit measurement and control, quantum logic gates need to be compiled and converted into specific pulse signal sequences and transmitted to the quantum chip to manipulate the state of the qubits within the chip. The quantum measurement and control system outputs pulse waveforms to control the quantum chip, and this system features arbitrary waveform shape, controllable waveform length, and convenient waveform loading.
[0003] Existing quantum measurement and control systems output pulse waveforms by first combining the desired pulse waveforms in software, then sending the combined waveforms to hardware, which in turn receives and outputs them. However, this method requires recombining the pulse waveforms whenever necessary to modify them, and then sending the software-to-hardware combination again. Because the pulse waveform data is large and lacks flexibility, the entire output process is time-consuming, resulting in low output efficiency. Summary of the Invention
[0004] This invention provides a waveform output method, apparatus, hardware device, and computer-readable storage medium to address the shortcomings of existing technologies where the large data volume and poor flexibility of pulse waveforms result in a long output time and low output efficiency. The invention enables the creation of arbitrary waveforms by changing the output combination method of the same waveform segment set. For the hardware device, changing the output waveform only requires receiving a small amount of updated output waveform combination data from the software device. This not only shortens the output time of arbitrary waveforms but also improves their output efficiency.
[0005] This invention provides a waveform output method applied to a hardware device. The hardware device stores a set of waveform segments sent by a software device. The set of waveform segments includes at least one waveform segment, and each waveform segment corresponds to a tag. The method includes:
[0006] The software device receives a waveform combination method, which is obtained by arranging the labels of each waveform segment.
[0007] Receive the instruction packet sent by the software device, and output any waveform corresponding to the waveform combination method based on the instruction packet.
[0008] According to a waveform output method provided by the present invention, each waveform segment corresponds to a physical address. The method of outputting an arbitrary waveform corresponding to the waveform combination mode based on the instruction packet includes: obtaining the instruction type of the instruction data in the instruction packet, wherein the instruction type includes at least one of the following: out-of-order playback instruction, wait delay instruction, and loop playback instruction; and outputting an arbitrary waveform corresponding to the waveform combination mode based on the instruction type and the physical address.
[0009] According to a waveform output method provided by the present invention, the physical address includes a start address and an end address. The method outputs any waveform corresponding to a waveform combination mode based on the instruction type and the physical address, comprising: reading a first start address and a first end address corresponding to a first waveform segment in the waveform combination mode, wherein the first waveform segment is any waveform segment in the waveform combination mode; triggering a randomized playback instruction when the first end address is the same as a first trigger address in the instruction packet; obtaining a first jump address based on the randomized playback instruction, and reading a second start address that is the same as the first jump address, wherein the second start address is different from the first start address; or, triggering a wait-delay instruction when the first end address is the same as a second trigger address in the instruction packet; adding a delay parameter after the first end address based on the wait-delay instruction; or, triggering a loop playback instruction when the first end address is the same as a third trigger address in the instruction packet; obtaining a second jump address based on the loop playback instruction, wherein the second jump address is the first start address, and reading the first start address again.
[0010] According to a waveform output method provided by the present invention, the waveform combination method is obtained by the software device arranging the labels of each waveform segment according to the sequence number, wherein the sequence number corresponding to the first waveform segment is the first sequence number, and the output of any waveform corresponding to the waveform combination method includes: after reading the first waveform segment, obtaining the next sequence number of the first sequence number; and reading the second waveform segment corresponding to the next sequence number.
[0011] According to a waveform output method provided by the present invention, before receiving the waveform combination mode sent by the software device, the method further includes: receiving a control packet sent by the software device; and adjusting the operating parameters corresponding to the output of any waveform corresponding to the waveform combination mode by the hardware device according to the control packet.
[0012] According to a waveform output method provided by the present invention: after outputting the arbitrary waveform corresponding to the preset number of times, the method further includes: repeatedly outputting the arbitrary waveform and obtaining the current number of times the arbitrary waveform is output; when the current number of times is reached, controlling the hardware device to be in a standby / power-off state.
[0013] According to a waveform output method provided by the present invention, the control package further includes: the output time corresponding to the arbitrary waveform, the gain parameter and the offset parameter corresponding to the superposition of the arbitrary waveform.
[0014] The present invention also provides a waveform output device applied to a hardware device, the hardware device storing a set of waveform segments sent by a software device, the set of waveform segments including at least one waveform segment, each waveform segment corresponding to a tag, the waveform output device comprising:
[0015] The transceiver module is used to receive waveform combination methods sent by the software device, which are obtained by arranging the tags of each waveform segment by the software device; and to receive instruction packets sent by the software device.
[0016] The output module is used to output any waveform corresponding to the waveform combination method based on the instruction package.
[0017] The present invention also provides a hardware device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the waveform output method as described above.
[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the waveform output method as described above.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the waveform output method as described above.
[0020] The present invention provides a waveform output method, apparatus, hardware device, and computer-readable storage medium. The hardware device stores a set of waveform segments sent by a software device. The set of waveform segments includes at least one waveform segment, and each waveform segment corresponds to a tag. The device receives a waveform combination method sent by the software device, which is obtained by arranging the tags of each waveform segment. The device also receives an instruction packet sent by the software device and outputs an arbitrary waveform corresponding to the waveform combination method based on the instruction packet.
[0021] This method addresses the shortcomings of existing technologies where the large data volume and poor flexibility of pulse waveforms lead to long output times and low efficiency. By using the same set of waveform segments, different waveform combinations can be obtained simply by changing the output waveform combination method, thus achieving arbitrary waveform output. For the hardware, changing the output waveform only requires receiving a small amount of updated output waveform combination data from the software device. This not only shortens the output time of arbitrary waveforms but also improves their output efficiency. In other words, this method can flexibly output arbitrary combinations of waveform segments while significantly reducing the amount of data transmitted when changing the output waveform, thereby increasing the loading speed of waveform segments. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the waveform output method provided by the present invention;
[0024] Figure 2a This is a schematic diagram of the output of arbitrary waveforms corresponding to the disordered playback command provided by the present invention;
[0025] Figure 2b This is a schematic diagram of the output of any waveform corresponding to the loop playback command provided by the present invention;
[0026] Figure 2c This is a schematic diagram of the output of any waveform corresponding to the output waveform combination method provided by the present invention;
[0027] Figure 2d This is a schematic diagram of the decomposition of any waveform corresponding to the output waveform combination method provided by the present invention;
[0028] Figure 2e This is a schematic diagram of a scenario for the waveform output method provided by the present invention;
[0029] Figure 3 This is a schematic diagram of the waveform output device provided by the present invention;
[0030] Figure 4 This is a schematic diagram of the hardware device provided by the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0032] It should be noted that the hardware device involved in the embodiments of the present invention can also be called a quantum measurement and control hardware platform (hereinafter referred to as the hardware platform). The hardware platform is a hardware board equipped with a field-programmable gate array (FPGA) chip, at least one digital to analog converter (DAC) channel, and a 10 Gigabit Ethernet interface.
[0033] For example, the number of DACs is 4.
[0034] The software device involved in the embodiments of the present invention can also be called a quantum measurement and control software platform (hereinafter referred to as the software platform). The software platform is a communication platform that is matched with the hardware platform and can interact with the user and the hardware platform respectively.
[0035] Optionally, the hardware device and the software device can be connected via wireless communication technology, which may include, but is not limited to, one of the following: fourth-generation mobile communication technology (4G), fifth-generation mobile communication technology (5G), and wireless Fidelity (WiFi).
[0036] The waveform output method of the present invention is applied to the above-mentioned hardware device, which stores a set of waveform segments sent by the above-mentioned software device. The set of waveform segments may include at least one waveform segment, and each waveform segment corresponds to a tag.
[0037] The user first imports the unprocessed waveform segment dataset (hereinafter referred to as the waveform segment set) sequentially into the software device. Then, after acquiring the unprocessed waveform segment set, the software device can label each waveform segment data (hereinafter referred to as the waveform segment) in the unprocessed waveform segment set, so that each waveform segment corresponds to a label. In addition, the software device can automatically assign a corresponding physical address to each label. Next, the software device sends the processed waveform segment set to the hardware device. The processed waveform segment set may include at least one waveform segment with a label and a physical address. Then, after receiving the processed waveform segment set, the hardware device can store the waveform segments sequentially, wherein the physical address is the address corresponding to each waveform segment stored in the hardware device.
[0038] It should be noted that different waveform segments have different labels, therefore, the labels are unique.
[0039] Optionally, the software device may send the processed waveform segment set to the hardware device, which may include: the software device sending the processed waveform segment set as a waveform packet to the hardware device via a 10 Gigabit network.
[0040] This can increase the transmission rate of waveform packets.
[0041] Optionally, the hardware device may store waveform segments sequentially, which may include storing the waveform segments sequentially into a waveform buffer.
[0042] This allows hardware devices to efficiently read the corresponding waveform segments directly from the waveform buffer according to their physical addresses.
[0043] It should be noted that the execution entity involved in the embodiments of the present invention can be a waveform output device or a hardware device. The embodiments of the present invention will be further described below using a hardware device as an example.
[0044] like Figure 1 The diagram shown is a flowchart of the waveform output method provided by the present invention. This method may include:
[0045] 101. Waveform combination method sent by the receiving software device.
[0046] The waveform combination method is obtained by the software device arranging the labels of each waveform segment.
[0047] After the software device sets a corresponding label for each waveform segment in the unprocessed waveform segment set, it can set the output sequence of the waveform segments based on the label, that is, arrange the labels to obtain the corresponding waveform combination mode. Then, the software device sends the waveform combination mode to the hardware device. Next, the hardware device receives the waveform combination mode sent by the software device so that the hardware device can effectively output any waveform corresponding to the waveform combination mode.
[0048] Optionally, in determining the waveform combination method, the software device can arbitrarily combine various waveform segments. That is, the software device arranges the tags, and in addition to obtaining the output order of each waveform segment, it can also obtain the number of times each waveform segment is repeated and the output time interval between each waveform segment based on these tags.
[0049] For example, a first square wave corresponds to a first tag, and a second square wave corresponds to a second tag. The first square wave and the second square wave are different. Based on the first tag, the software device can determine that the first tag is repeated 3 times and is the second in output order; based on the second tag, it can determine that the second tag is repeated 1 time and is the first in output order. The output time interval between the first tag and the second tag is 1 second. In this way, the software device can obtain a waveform combination method based on the first tag and the second tag, and send the waveform combination method to the hardware device.
[0050] Optionally, when using the same waveform segment dataset, the number of waveform combination methods is at least one, and the arbitrary waveforms corresponding to different waveform combination methods are also different.
[0051] In other words, when using the same waveform segment dataset, the software device can change the waveform output to obtain different waveform combinations, and send these different waveform combinations to the hardware device respectively.
[0052] It should be noted that the data volume of this waveform segment dataset is much larger than the data volume of this waveform combination method.
[0053] Optionally, in the waveform combination method, different waveform segments correspond to different operation types. When a waveform segment needs to be repeatedly output, the operation type corresponding to that waveform segment is loop playback operation; when another waveform segment needs to be output after a certain waveform segment is output, the operation corresponding to that waveform segment is random playback operation; when another waveform segment needs to be output after a certain waveform segment with a delay, the operation corresponding to that waveform segment is wait delay operation.
[0054] In some embodiments, before the hardware device receives the waveform combination method sent by the software device, the method may further include: the hardware device receiving a control packet sent by the software device; and the hardware device adjusting the operating parameters corresponding to any waveform when outputting the waveform combination method according to the control packet.
[0055] In some embodiments, the control package may include, but is not limited to: the preset number of outputs corresponding to any waveform, the output time corresponding to any waveform, the gain parameter and offset parameter corresponding to the superposition of any waveform, etc.
[0056] The software device sets some control information for the hardware device and sends this control information as a control packet to the hardware device. After receiving the control packet, the hardware device can adjust its operating parameters based on the control packet, so that the adjusted hardware device can output any waveform corresponding to the waveform combination method more effectively and accurately.
[0057] Optionally, the hardware device receiving control packets sent by the software device may include: the hardware device receiving control packets sent by the software device via a 10 Gigabit Ethernet network.
[0058] This can increase the transmission rate of control packets.
[0059] 102. Receive instruction packets sent by the software device, and output arbitrary waveforms corresponding to the waveform combination mode based on the instruction packets.
[0060] After the hardware device obtains the waveform combination method and instruction packet sent by the software device, it can read the physical address in the waveform combination method in sequence based on the instruction packet, thereby accurately and effectively outputting any waveform corresponding to the waveform combination method.
[0061] In other words, the process of the hardware device outputting arbitrary waveforms corresponding to the waveform combination method is actually the process of the hardware device reading the physical addresses corresponding to each waveform segment in the waveform buffer in sequence.
[0062] In some embodiments, each waveform segment corresponds to a physical address. The hardware device outputs an arbitrary waveform corresponding to the waveform combination method based on the instruction packet. This may include: the hardware device obtaining the instruction data in the instruction packet; the hardware device outputting an arbitrary waveform corresponding to the waveform combination method based on the instruction type and the physical address.
[0063] The instruction type can include at least one of the following: out-of-order playback instruction, wait delay instruction, and loop playback instruction. Each instruction type will correspond to a trigger address and a jump address.
[0064] After acquiring the waveform combination method, the software device can determine the instruction type corresponding to each waveform segment based on the operation type corresponding to each waveform segment in the waveform combination method; then, the software device sends the instruction type and the corresponding physical address to the hardware device.
[0065] Among them, the loop playback operation corresponds to the loop playback instruction; the random playback operation corresponds to the random playback instruction; and the wait delay operation corresponds to the wait delay instruction.
[0066] Optionally, the software device may send the instruction type and its corresponding physical address to the hardware device, which may include: the software device sending the instruction type and its corresponding physical address as an instruction packet to the hardware device via a 10 Gigabit Ethernet network.
[0067] This can increase the transmission rate of instruction packets.
[0068] Next, after receiving the instruction packet, the hardware device can read the physical address corresponding to each waveform segment in the waveform combination method in sequence based on the instruction data in the instruction packet, so as to output any waveform corresponding to the output waveform combination method.
[0069] Optionally, after receiving the instruction packet, the method may further include: the hardware device storing the instruction packet in an instruction cache.
[0070] This allows the hardware device to efficiently read the corresponding waveform segments sequentially from the waveform buffer based on the instruction packets in the instruction cache.
[0071] In some embodiments, the physical address includes a start address and an end address. Based on the instruction type and the physical address, the hardware device outputs an arbitrary waveform corresponding to the waveform combination method, which may include, but is not limited to, one of the following implementation methods:
[0072] Implementation Method 1: The hardware device reads the first start address and the first end address corresponding to the first waveform segment in the waveform combination method; if the first end address is the same as the first trigger address in the instruction packet, the hardware device triggers a random playback instruction; based on the random playback instruction, the first jump address is obtained, and the second start address, which is the same as the first jump address, is read, but the second start address is different from the first start address.
[0073] The first waveform segment is any waveform segment in the waveform combination method.
[0074] The random playback command is mainly used to output different waveform segments in any order.
[0075] For example, such as Figure 2a The diagram shown is a schematic representation of the output of an arbitrary waveform corresponding to the out-of-order playback command provided by this invention. Figure 2aIn the waveform buffer, three waveform segments are stored: waveform segment A, waveform segment B, and waveform segment C. The physical addresses corresponding to these three waveform segments are ab, cd, and ef, respectively. Among them, the starting address of waveform segment A is a, and the ending address is b; the starting address of waveform segment B is c, and the ending address is d; and the starting address of waveform segment C is e, and the ending address is f.
[0076] The first trigger address corresponding to the out-of-order playback instruction is b, and the first jump address is e.
[0077] The hardware device reads the physical address corresponding to waveform segment A from the waveform buffer. If the termination address b corresponding to waveform segment A is the same as the first trigger address b in the instruction packet, the device triggers the execution of the out-of-order playback instruction and obtains the first jump address e. Then, the hardware device reads the second starting address, which is the same as the first jump address e. The second starting address is the starting address corresponding to waveform segment C.
[0078] In other words, after the hardware device finishes outputting waveform segment A, it directly jumps to the starting address corresponding to waveform segment C and outputs waveform segment C. Then, the above-mentioned out-of-order playback instruction is executed.
[0079] Implementation Method 2: The hardware device reads the first start address and the first end address corresponding to the first waveform segment in the waveform combination method; if the first end address is the same as the second trigger address in the instruction packet, the hardware device triggers a wait delay instruction; based on the wait delay instruction, a delay parameter is added after the first end address.
[0080] The wait delay instruction is mainly used to add a delay parameter between waveform segments. The wait delay instruction has a set delay duration. During the execution of the wait instruction, the hardware device needs to ensure that the wait duration after the current waveform segment is output can reach or even exceed the set delay duration.
[0081] For example, the waveform buffer stores waveform segment A, which has a starting address of a and an ending address of b.
[0082] The second trigger address corresponding to the waiting delay instruction is b, and the set delay duration is ts.
[0083] The hardware device reads the physical address corresponding to waveform segment A from the waveform buffer. If the termination address b corresponding to waveform segment A is the same as the second trigger address b in the instruction packet, it triggers the execution of the wait delay instruction. At this time, the output of termination address b remains unchanged, and the timer starts to obtain the waiting time of termination address b, until the waiting time is equal to the set delay time t.
[0084] In other words, after the hardware device outputs waveform segment A, it adds ts after waveform segment A, and then the above-mentioned wait delay instruction finishes execution.
[0085] Implementation method 3: The hardware device reads the first start address and the first end address corresponding to the first waveform segment in the waveform combination method; if the first end address is the same as the third trigger address in the instruction packet, the hardware device triggers a loop playback instruction; based on the loop playback instruction, the second jump address is obtained, the second jump address is the first start address, and the first start address is read again.
[0086] The loop playback command is mainly used to repeatedly output a waveform segment with consecutive physical addresses. The number of repetitions is at least twice, and the loop playback command has a parameter for the number of repetitions.
[0087] For example, such as Figure 2b The diagram shown is a schematic representation of the output of an arbitrary waveform corresponding to the loop playback command provided by this invention. Figure 2b In the waveform buffer, waveform segment A is stored. The starting address of waveform segment A is a, and the ending address is b.
[0088] The third trigger address corresponding to the loop playback instruction is b, the corresponding third jump address is a, and the repeated output number parameter is set to n times, where n≥2.
[0089] The hardware device reads the physical address corresponding to waveform segment A from the waveform buffer. If the termination address b corresponding to waveform segment A is the same as the third trigger address b in the instruction packet, the device triggers the execution of the loop playback instruction and obtains the third jump address a, which is the starting address corresponding to waveform segment A. Then, the hardware device reads waveform segment A again until the number of times waveform segment A is read reaches the set number of repetition output parameters n.
[0090] In other words, the above loop playback instruction ends after the hardware device repeatedly outputs waveform segment A n times.
[0091] It should be noted that implementation method 1 can be combined with implementation method 2, or implementation method 1 can be combined with implementation method 3. The new implementation methods obtained are also within the protection scope of the embodiments of the present invention, and will not be described in detail here.
[0092] In some embodiments, the waveform combination method is obtained by the software device arranging the labels of each waveform segment according to the sequence number, the sequence number corresponding to the first waveform segment is the first sequence number, and the hardware device outputs any waveform corresponding to the waveform combination method, which may include: after reading the first waveform segment, the hardware device obtains the next sequence number of the first sequence number; the hardware device reads the second waveform segment corresponding to the next sequence number.
[0093] The software device sorts the tags corresponding to each waveform segment to obtain a tag sequence. The waveform segments corresponding to this tag sequence are the waveform combination methods. Then, the software device sends the waveform combination methods to the hardware device.
[0094] In the waveform combination method, the sequence number corresponding to the first waveform segment is the first sequence number, the sequence number corresponding to the second waveform segment is the second sequence number, the first sequence number and the second sequence number are adjacent, and so on, the sequence number corresponding to the m-th waveform segment is the m-th sequence number, and m≥2.
[0095] After acquiring the waveform combination method, the hardware device can read each waveform segment in sequence. For example, it can first read the first waveform segment corresponding to the first sequence number, then read the second waveform segment corresponding to the second sequence number, and so on, until all waveform segments are read, thus completing the output of any waveform corresponding to the waveform combination method.
[0096] The instruction types corresponding to each waveform segment can be the same or different; no specific limitation is made here.
[0097] For example, such as Figure 2c The diagram shown is a schematic representation of the output of any waveform corresponding to the output waveform combination method provided by this invention. Figure 2c In the instruction buffer, there are y waveform segments, where y ≥ 1. These y waveform segments are labeled A0, A1, ..., Ax, ..., Ay, and their corresponding physical addresses are a0-b0, b0-b1, ..., ax-bx, ..., ay-by. Each of these y waveform segments corresponds to a waveform combination method. Then, based on the instruction packet in the instruction buffer and the waveform combination method, the hardware device accurately outputs any waveform corresponding to these y waveform segments.
[0098] For example, such as Figure 2d The diagram shown is a decomposition schematic of an arbitrary waveform corresponding to the output waveform combination method provided by this invention. Figure 2d Based on this arbitrary waveform, it can be determined that there are three waveform segments, namely waveform segment 1, waveform segment 2 and waveform segment 3; the waveform combination corresponding to this arbitrary waveform is to output waveform segment 1 with 4 times, waveform segment 3 with 5 times and waveform segment 2 with 1 time.
[0099] In some embodiments, the control package may include: a preset number of outputs corresponding to any waveform. After the hardware device outputs any waveform corresponding to the combination of output waveforms, the method may further include: the hardware device repeatedly outputting the arbitrary waveform and obtaining the current number of outputs of the arbitrary waveform; when the current number of outputs reaches the preset number of outputs, the hardware device is controlled to be in a standby / power-off state.
[0100] The preset number of outputs can be set before the hardware device leaves the factory or it can be user-defined; no specific limitation is made here.
[0101] After acquiring an arbitrary waveform, the hardware device can output the arbitrary waveform and record the current number of times the arbitrary waveform is output until the current number of outputs reaches the preset number of outputs. At this time, the hardware device can be controlled to be in standby mode or in power-off mode to reduce the power consumption of the hardware device.
[0102] It should be noted that, as Figure 2e The image shown is a schematic diagram illustrating a scenario of the waveform output method provided by this invention. Figure 2e In this process, the FPGA in the hardware platform reads the instruction types and physical addresses from the instruction cache sequentially and executes the corresponding instruction data one by one. The process of the FPGA controlling the combination of output waveforms to correspond to arbitrary waveforms is actually the process of reading physical addresses from the waveform cache (referred to as: read address). The accumulation or jump of the read address of the waveform cache depends on the instruction data of the instruction packet in the instruction cache (for example, when executing the out-of-order playback instruction of waveform segments, the instruction type in the current instruction data can be judged, and then the waveform cache read address can be controlled to perform out-of-order jump).
[0103] Nested state machines are used in FPGAs to control the output of arbitrary waveforms corresponding to different waveform combinations. A nested state machine can include a master state machine and child state machines. The master state machine controls the overall output flow and the loading of the waveform buffer, while the child state machines control the loading of the instruction buffer and the execution of the corresponding instruction types. The execution process is as follows:
[0104] Step 1: The default read address of the waveform cache in the FPGA is 0, and the default read address of the instruction cache is also 0.
[0105] Step 2: After the FPGA receives the control packet sent by the software device, the main state machine starts working and determines whether to enable the waveform output and whether to enable the sub-state machine based on the working mode in the control packet.
[0106] Step 3: The sub-state machine is mainly used to control the read address of the instruction cache and determine whether to execute according to the instruction type in the current instruction data. The condition for triggering the execution of the instruction type in the current instruction data is: when the read address of the current waveform cache is the same as the start address in the current instruction data, the sub-state machine starts running according to the instruction type in the instruction data. After the instruction type is executed, the read address of the instruction cache is incremented by one to point to the next instruction data, and the instruction end flag signal is enabled. After the main state machine recognizes the instruction end flag signal, it continues to increment the physical address of the waveform cache and waits to trigger the next instruction data.
[0107] The instruction end flag signal corresponds to the instruction end operation, which is mainly used to indicate the end of instruction data. When the sub-state machine detects the instruction end flag signal, it sets the read address of the instruction cache to 0.
[0108] Step 4: After the instruction data reading is complete, it indicates that the hardware device has completed the output of any waveform corresponding to the waveform combination method in one waveform combination. At this time, the sub-state machine ends and feeds back the end signal to the main state machine. The main state machine determines whether the current output count of the arbitrary waveform has reached the preset output count in the control package. If the current output count is less than the preset output count in the control package, the main state machine re-enables the sub-state, that is, it starts outputting the above arbitrary waveform again; if the current output count equals the preset output count, the main state machine ends. At this time, it indicates that the hardware platform has completed the output of the set arbitrary waveform.
[0109] In this embodiment of the invention, a waveform combination method sent by a software device is received; an instruction packet sent by the software device is received, and based on the instruction packet, an arbitrary waveform corresponding to the waveform combination method is output. This method addresses the shortcomings of existing technologies where the large data volume and poor flexibility of pulse waveforms lead to a long output time and low output efficiency. By using the same set of waveform segments, different waveform combinations can be obtained simply by changing the output combination method, thus achieving arbitrary waveform output. For the hardware device, changing the output waveform only requires receiving a small amount of updated output waveform combination method from the software device. This not only shortens the output time of arbitrary waveforms but also improves their output efficiency. In other words, this method can flexibly output arbitrarily combined waveform segments and significantly reduces the amount of data required to change the output waveform, thereby improving the loading speed of waveform segments.
[0110] The waveform output device provided by the present invention is described below. The waveform output device described below and the waveform output method described above can be referred to in correspondence.
[0111] like Figure 3 The diagram shown is a structural schematic of the waveform output device provided by the present invention, applied to a hardware device. This hardware device stores a set of waveform segments sent by a software device. The waveform segment set includes at least one waveform segment, and each waveform segment corresponds to a tag. The waveform output device may include:
[0112] The transceiver module 301 is used to receive the waveform combination method sent by the software device, which is obtained by the software device arranging the tags of each waveform segment; and to receive the instruction packets sent by the software device.
[0113] The output module 302 is used to output any waveform corresponding to the waveform combination method based on the instruction package.
[0114] Optionally, the waveform output device may include: an acquisition module 303, wherein each waveform segment corresponds to a physical address;
[0115] The acquisition module 303 is used to acquire the instruction type of the instruction data in the instruction packet. The instruction type includes at least one of the following: out-of-order playback instruction, wait delay instruction, and loop playback instruction.
[0116] The output module 302 is specifically used to output any waveform corresponding to the waveform combination method based on the instruction type and the physical address.
[0117] Optionally, the output module 302 may include: a reading unit 3021, a triggering unit 3022, an acquisition unit 3033, and an adding unit 3034, wherein the physical address includes a start address and an end address.
[0118] The reading unit 3021 is used to read the first start address and the first end address corresponding to the first waveform segment in the waveform combination method, wherein the first waveform segment is any waveform segment in the waveform combination method.
[0119] Trigger unit 3022 is used to trigger the out-of-order playback instruction when the first termination address is the same as the first trigger address in the instruction packet;
[0120] The acquisition unit 3033 is used to acquire the first jump address based on the out-of-order playback instruction;
[0121] The reading unit 3021 is also configured to read a second starting address that is the same as the first jump address, wherein the second starting address is different from the first starting address; or,
[0122] Trigger unit 3022 is also used to trigger the wait delay instruction when the first termination address is the same as the second trigger address in the instruction packet;
[0123] Adding unit 3034 is used to add a delay parameter after the first termination address based on the wait delay instruction; or,
[0124] Trigger unit 3022 is also used to trigger the loop playback instruction when the first termination address is the same as the third trigger address in the instruction packet;
[0125] The acquisition unit 3033 is also used to acquire a second jump address based on the loop playback instruction, wherein the second jump address is the first starting address;
[0126] The reading unit 3021 is also used to read the first starting address again.
[0127] Optionally, this waveform combination method is obtained by the software device arranging the labels of each waveform segment according to their sequence numbers.
[0128] The acquisition module 303 is also used to acquire the next sequence number of the first sequence number after the reading unit 3021 reads the first waveform segment;
[0129] The reading unit 3021 is also used to read the second waveform segment corresponding to the next sequence number.
[0130] Optionally, the waveform output device may include: a processing module 304.
[0131] The transceiver module 301 is also used to receive control packets sent by the software device;
[0132] The processing module 304 is used to adjust the operating parameters corresponding to the output of any waveform corresponding to the waveform combination method of the hardware device according to the control package.
[0133] Optionally, the control package includes: a preset number of outputs corresponding to any waveform; and an output module 302, which is also used to repeatedly output the arbitrary waveform.
[0134] The acquisition module 303 is also used to obtain the current number of outputs of the arbitrary waveform;
[0135] The processing module 304 is also used to control the hardware device to be in standby / power-off state when the current output count reaches the preset output count.
[0136] Optionally, the control package may also include: the output time corresponding to the arbitrary waveform, the gain parameter and offset parameter corresponding to the superposition of the arbitrary waveform.
[0137] like Figure 4The diagram shows the structure of the hardware device provided by the present invention. The hardware device may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440. The processor 410, communication interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions stored in the memory 430 to execute a waveform output method. This method is applied to the hardware device, which stores a set of waveform segments sent by a software device. This set of waveform segments includes at least one waveform segment, and each waveform segment corresponds to a tag. The method includes: receiving a waveform combination method sent by the software device, where the waveform combination method is obtained by arranging the tags of each waveform segment by the software device; receiving an instruction packet sent by the software device; and outputting an arbitrary waveform corresponding to the waveform combination method based on the instruction packet.
[0138] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the waveform output method provided by the above methods. The method is applied to a hardware device that stores a set of waveform segments sent by a software device. The set of waveform segments includes at least one waveform segment, and each waveform segment corresponds to a tag. The method includes: receiving a waveform combination method sent by the software device, which is obtained by the software device arranging the tags of each waveform segment; receiving an instruction packet sent by the software device; and outputting an arbitrary waveform corresponding to the waveform combination method based on the instruction packet.
[0140] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the waveform output method provided by the above methods. The method is applied to a hardware device that stores a set of waveform segments sent by a software device. The set of waveform segments includes at least one waveform segment, and each waveform segment corresponds to a tag. The method includes: receiving a waveform combination method sent by the software device, the waveform combination method being obtained by the software device arranging the tags of each waveform segment; receiving an instruction packet sent by the software device, and outputting an arbitrary waveform corresponding to the waveform combination method based on the instruction packet.
[0141] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do 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 waveform output method characterized by, The method is applied to a hardware device, the hardware device stores a waveform segment set sent by a software device, the waveform segment set includes at least one waveform segment, each waveform segment corresponds to a label, and the method includes the following steps. Receiving a waveform combination mode sent by the software device, the waveform combination mode is obtained by arranging the labels of the waveform segments by the software device; Receiving an instruction package sent by the software device, and outputting an arbitrary waveform corresponding to the waveform combination mode based on the instruction package, each waveform segment corresponds to a physical address, and the outputting of the arbitrary waveform corresponding to the waveform combination mode based on the instruction package includes the following steps. Obtaining an instruction type of instruction data in the instruction package, the instruction type includes at least one of a disorderly playing instruction, a waiting delay instruction and a loop playing instruction; Based on the instruction type and the physical address, output the arbitrary waveform corresponding to the waveform combination mode.
2. The method of claim 1, wherein, The physical address includes a start address and an end address, and the outputting of the arbitrary waveform corresponding to the waveform combination mode based on the instruction type and the physical address includes the following steps. Reading a first start address and a first end address corresponding to a first waveform segment in the waveform combination mode, the first waveform segment is any waveform segment in the waveform combination mode; In the case that the first end address is the same as a first trigger address in the instruction package, triggering the disorderly playing instruction, obtaining a first jump address based on the disorderly playing instruction, and reading a second start address which is the same as the first jump address and different from the first start address; or, In the case that the first end address is the same as a second trigger address in the instruction package, triggering the waiting delay instruction, adding a delay parameter after the first end address based on the waiting delay instruction; or, In the case that the first end address is the same as a third trigger address in the instruction package, triggering the loop playing instruction, obtaining a second jump address based on the loop playing instruction, the second jump address is the first start address, and reading the first start address again.
3. The method of claim 2, wherein, The waveform combination mode is obtained by arranging the labels of the waveform segments according to serial numbers by the software device, the first waveform segment corresponds to a first serial number, and the outputting of the arbitrary waveform corresponding to the waveform combination mode includes the following steps. After reading the first waveform segment, obtaining a next serial number of the first serial number; Reading a second waveform segment corresponding to the next serial number.
4. The method according to any one of claims 1-3, characterized in that, Before the receiving of the waveform combination mode sent by the software device, the method further includes the following steps. Receiving a control package sent by the software device; Adjusting a working parameter corresponding to the output of the arbitrary waveform corresponding to the waveform combination mode by the hardware device according to the control package.
5. The method of claim 4, wherein, The control package includes a preset output frequency of the arbitrary waveform, and after the output of the arbitrary waveform corresponding to the waveform combination mode, the method further includes the following steps. Repeating the output of the arbitrary waveform and obtaining a current output frequency of the arbitrary waveform; In a case where the current output times reaches the preset output times, the hardware device is controlled to be in a standby / off state.
6. The method of claim 5, wherein, The control package further includes: an output time corresponding to the arbitrary waveform, a gain parameter and an offset parameter corresponding to the arbitrary waveform when being superimposed.
7. A waveform output device characterized by comprising: The hardware device stores a waveform segment set sent by a software device, the waveform segment set includes at least one waveform segment, each waveform segment corresponds to a tag, and the waveform output device includes: A transceiving module, configured to receive a waveform combination mode sent by the software device, the waveform combination mode being obtained by the software device by arranging tags of each waveform segment; and receive an instruction package sent by the software device; An output module, configured to output an arbitrary waveform corresponding to the waveform combination mode based on the instruction package. Each waveform segment corresponds to a physical address, and the output module is specifically configured to: Obtain an instruction type of instruction data in the instruction package, the instruction type including at least one of an out-of-order playing instruction, a waiting delay instruction and a loop playing instruction; Output the arbitrary waveform corresponding to the waveform combination mode based on the instruction type and the physical address.
8. A hardware apparatus comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, The processor executes the program to implement the waveform output method in any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the waveform output method in any one of claims 1 to 6.
Citation Information
Patent Citations
Waveform sequence creation device and method, electronic equipment and storage medium
CN114089806A
Arbitrary waveform generator based on instruction architecture
US20180032099A1