WO2020062297A1 - Token management method and apparatus, chip, and mobile platform - Google Patents

Token management method and apparatus, chip, and mobile platform Download PDF

Info

Publication number
WO2020062297A1
WO2020062297A1 PCT/CN2018/109206 CN2018109206W WO2020062297A1 WO 2020062297 A1 WO2020062297 A1 WO 2020062297A1 CN 2018109206 W CN2018109206 W CN 2018109206W WO 2020062297 A1 WO2020062297 A1 WO 2020062297A1
Authority
WO
WIPO (PCT)
Prior art keywords
token
instruction
storage
information
tokens
Prior art date
Application number
PCT/CN2018/109206
Other languages
French (fr)
Chinese (zh)
Inventor
刘瑛
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201880042195.2A priority Critical patent/CN110799938A/en
Priority to PCT/CN2018/109206 priority patent/WO2020062297A1/en
Publication of WO2020062297A1 publication Critical patent/WO2020062297A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/22Pc multi processor system
    • G05B2219/2207Microcontroller combined with state sequencer

Definitions

  • Embodiments of the present invention relate to the technical field of chips, and in particular, to a token management method, device, chip, and mobile platform.
  • SoC System-on-chip
  • SoC refers to an integrated chip with embedded system as the core, integrating software and hardware, and pursuing the maximum tolerance of the product system. It can be applied to mobile phones, image processing, TV games and other fields.
  • the SoC usually integrates a Double Data Rate (DDR) controller to connect DDR devices to provide system memory space.
  • DDR Double Data Rate
  • Generally improving the access efficiency of the DDR controller can improve the processing performance of the entire SoC.
  • multiple access ports are configured for the DDR controller. These access ports follow certain bus standards, such as the advanced scalable interface of the Advanced Microcontroller Bus Architecture (AMBA).
  • AMBA Advanced Microcontroller Bus Architecture
  • the DDR controller has multiple access masters externally. These access masters can come from, for example, an application processor, a digital signal processor, a graphics processing unit, and multimedia.
  • the DDR controller is not an AXI bus standard interface, so a DDR controller is required to convert the read instruction and timing transmitted by the AXI bus into the read instruction and timing of the DDR device.
  • the details are as follows: After the DDR controller receives the read instruction through the AXI bus, it divides each read instruction into multiple instruction fragments, and assigns a token to each instruction fragment to record the order of the read instructions.
  • the DDR controller then re-adjusts the order of these instruction fragments according to the current state of the DDR device, and sends the re-adjusted instruction fragments to the DDR device.
  • the DDR device sequentially returns the read data according to the order of the received instruction fragments, and reads them for each The data is added to the token of the corresponding instruction fragment, wherein the token is generally stored in a first-in-first-out (FIFO) memory, and the read data corresponding to the token generated first is read out first, and the token generated later The corresponding read data is read out later, so the read data of the same read instruction is combined in order to obtain the sorted read data, where the sorted read data is consistent with the order of the corresponding read instruction, and then the sorted The read data is sent to the access master in turn.
  • FIFO first-in-first-out
  • the number and depth of FIFO memories are generally determined according to the maximum number of possible IDs N to access the MASTER and the depth of the CAM instruction of the DDR device (usually represented by 2 M ).
  • the maximum number of possible master IDs In order to cover the limit case that the read instructions all come from the same ID, the depth of each FIFO memory is equal to the CAM depth of the above DDR device instruction, that is, the width of the FIFO memory is M. It can be seen that the total storage of the FIFO memory is N times the depth of the CAM, which causes the storage resources of the FIFO to be much larger than the actual token storage resources required, resulting in a waste of resources.
  • Embodiments of the present invention provide a token management method, device, chip, and mobile platform, which are used to save resources required for storing tokens and save resource overhead.
  • an embodiment of the present invention provides a token management method, including:
  • the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • the storage address of the token's next token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • an embodiment of the present invention provides a token management method, including:
  • the plurality of instruction fragments including K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction
  • the data corresponding to the K tokens is reorganized to obtain the data read by the instruction ;
  • the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • the token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
  • an embodiment of the present invention provides a token management apparatus, including: a memory and a processor;
  • the memory is used to store program code
  • the processor is configured to call the code stored in the memory to execute the token management method according to the embodiment of the present invention in the first aspect, or the token according to the embodiment of the present invention in the second aspect Management methods.
  • an embodiment of the present invention provides a chip, including: a DDR controller and a DDR device;
  • the DDR controller is configured to execute the token management method according to the embodiment of the present invention in the first aspect, and the token management method according to the embodiment of the present invention in the second aspect;
  • the DDR device is configured to receive the reordered multiple instruction fragments sent by the DDR device, and send data read by each instruction fragment to the DDR controller.
  • a movable platform in a fifth aspect, includes a fuselage, a pan-tilt, and an imaging device.
  • the imaging device is connected to the fuselage through the pan-tilt.
  • the chip is also connected to the imaging device, and the chip is further configured to process image data collected by the imaging device.
  • an embodiment of the present invention provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program, where the computer program includes at least one piece of code, and the at least one piece of code can be executed by a computer to control
  • the computer executes the token management method according to the first aspect and / or the second aspect of the embodiments of the present invention.
  • an embodiment of the present invention provides a computer program for implementing the token management method according to the first aspect and / or the second aspect of the embodiment of the present invention when the computer program is executed by a computer.
  • the token management method, device, chip and mobile platform provided by the embodiments of the present invention, after dividing an instruction into multiple instruction fragments, sequentially allocating multiple tokens, storing the tokens in sequence, and generating token storage Information, and the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction ID to which the instruction belongs, and the instruction in the instruction.
  • the storage address of the token's next token Through the storage information, all tokens under the instruction can be obtained according to the order in which the tokens are allocated, thereby ensuring that data under the same instruction will not be wrong. There is no need to store tokens in the form of FIFO in accordance with the order in which the tokens are allocated, saving storage resources and avoiding waste of resources.
  • FIG. 1 is a schematic architecture diagram of an unmanned flight system according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a token management method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure during initialization according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of instruction division and allocation token provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of four tokens of a storage instruction 0 according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of three tokens of a storage instruction 1 according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of five tokens of a storage instruction 2 provided by an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a token reading sequence according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of four tokens of read instruction 0 according to an embodiment of the present invention.
  • 11 is a schematic diagram of three tokens of a read instruction 1 according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of five tokens of a read instruction 2 according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a token management apparatus according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a token management apparatus according to another embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of a chip according to an embodiment of the present invention.
  • FIG. 16 is a schematic structural diagram of a movable platform according to an embodiment of the present invention.
  • a component when a component is called “fixed to” another component, it may be directly on another component or a centered component may exist. When a component is considered to be “connected” to another component, it may be directly connected to another component or a centered component may coexist.
  • Embodiments of the present invention provide a token management method, device, chip, and mobile platform.
  • the movable platform may be, for example, a drone, an unmanned ship, an unmanned car, a robot, or the like.
  • the drone may be a rotorcraft, for example, a multi-rotor aircraft propelled by multiple propulsion devices through air, and the embodiment of the present invention is not limited thereto.
  • FIG. 1 is a schematic architecture diagram of an unmanned flight system according to an embodiment of the present invention. This embodiment is described by taking a rotary wing drone as an example.
  • the unmanned aerial system 100 may include a drone 110, a display device 130, and a control terminal 140.
  • the UAV 110 may include a power system 150, a flight control system 160, a rack, and a gimbal 120 carried on the rack.
  • the drone 110 may perform wireless communication with the control terminal 140 and the display device 130.
  • the frame may include a fuselage and a tripod (also called a landing gear).
  • the fuselage may include a center frame and one or more arms connected to the center frame, and one or more arms extend radially from the center frame.
  • the tripod is connected to the fuselage, and is used to support the UAV 110 when landing.
  • the power system 150 may include one or more electronic governors (referred to as ESCs) 151, one or more propellers 153, and one or more electric motors 152 corresponding to the one or more propellers 153.
  • the electric motors 152 are connected to Between the electronic governor 151 and the propeller 153, the motor 152 and the propeller 153 are arranged on the arm of the drone 110; the electronic governor 151 is used to receive the driving signal generated by the flight control system 160 and provide driving according to the driving signal Current is supplied to the motor 152 to control the rotation speed of the motor 152.
  • the motor 152 is used to drive the propeller to rotate, so as to provide power for the flight of the drone 110, and the power enables the drone 110 to achieve one or more degrees of freedom.
  • the drone 110 may rotate about one or more rotation axes.
  • the rotation axis may include a roll axis (Roll), a yaw axis (Yaw), and a pitch axis (Pitch).
  • the motor 152 may be a DC motor or an AC motor.
  • the motor 152 may be a brushless motor or a brushed motor.
  • the flight control system 160 may include a flight controller 161 and a sensing system 162.
  • the sensing system 162 is used to measure the attitude information of the drone, that is, the position information and status information of the drone 110 in space, such as three-dimensional position, three-dimensional angle, three-dimensional velocity, three-dimensional acceleration, and three-dimensional angular velocity.
  • the sensing system 162 may include, for example, at least one of a gyroscope, an ultrasonic sensor, an electronic compass, an Inertial Measurement Unit (IMU), a vision sensor, a global navigation satellite system, and a barometer.
  • the global navigation satellite system may be a Global Positioning System (Global Positioning System, GPS).
  • the flight controller 161 is used to control the flight of the drone 110.
  • the flight controller 161 may control the flight of the drone 110 according to the attitude information measured by the sensing system 162. It should be understood that the flight controller 161 may control the drone 110 according to a pre-programmed program instruction, and may also control the drone 110 by responding to one or more control instructions from the control terminal 140.
  • the gimbal 120 may include a motor 122.
  • the pan / tilt is used to carry a photographing device 123 or a microphone (not shown in the figure).
  • the flight controller 161 may control the movement of the gimbal 120 through the motor 122.
  • the PTZ 120 may further include a controller for controlling the movement of the PTZ 120 by controlling the motor 122.
  • the gimbal 120 may be independent of the drone 110 or may be a part of the drone 110.
  • the motor 122 may be a DC motor or an AC motor.
  • the motor 122 may be a brushless motor or a brushed motor.
  • the gimbal can be located on the top of the drone or on the bottom of the drone.
  • the photographing device 123 may be, for example, a device for capturing an image, such as a camera or a video camera.
  • the photographing device 123 may communicate with the flight controller and perform shooting under the control of the flight controller.
  • the photographing device 123 of this embodiment includes at least a photosensitive element.
  • the photosensitive element is, for example, a complementary metal oxide semiconductor (CMOS) sensor or a charge-coupled device (CCD) sensor. It can be understood that the shooting device 123 can also be directly fixed on the drone 110, so that the PTZ 120 can be omitted.
  • CMOS complementary metal oxide semiconductor
  • CCD charge-coupled device
  • the display device 130 is located on the ground side of the unmanned flight system 100, can communicate with the drone 110 wirelessly, and can be used to display attitude information of the drone 110. In addition, an image captured by the imaging device may be displayed on the display device 130. It should be understood that the display device 130 may be an independent device, or may be integrated in the control terminal 140.
  • the control terminal 140 is located on the ground side of the unmanned flight system 100 and can communicate with the unmanned aerial vehicle 110 in a wireless manner for remotely controlling the unmanned aerial vehicle 110.
  • the drone 110 may further include a speaker (not shown) for playing audio files.
  • the speaker may be directly fixed on the drone 110 or may be mounted on the gimbal 120.
  • the above-mentioned flight controller 161 may include a chip, and the DDR controller in the chip may be used to implement a solution described below.
  • the data mentioned in the following embodiments are, for example, image data obtained by the shooting device 123. .
  • FIG. 2 is a flowchart of a token management method according to an embodiment of the present invention.
  • the method of this embodiment can be applied to a chip (such as a system-level chip, and this embodiment is not limited to this).
  • the method in this embodiment may include:
  • S202 Store K tokens in the assigned order, and generate storage information of each token.
  • the DDR controller may receive at least one instruction through, for example, the AXI bus.
  • the received instruction is divided into K instruction fragments, and the number of instruction fragments into which each instruction is divided may be different.
  • tokens are assigned to each instruction segment in sequence. For example, an instruction is divided into instruction segment 1, instruction segment 2, and instruction segment 3 in sequence. Then, instruction segment 1 is assigned a token, instruction segment 2 is assigned a token, Instruction fragment 3 allocates a token.
  • the tokens are stored according to the order in which the tokens are allocated, that is, the tokens that are allocated first are stored first, and the tokens that are allocated later are stored later, so as to ensure that the stored token order is the same as the order of the instruction fragments.
  • the storage information of the token is generated. The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token. It should be noted that multiple different instructions may belong to the same instruction identifier.
  • the token reading information of the instruction identifier is generated.
  • the token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs. For information about reading the token, refer to the related description in S206.
  • the DDR controller reorders these instruction fragments according to the current state of the DDR device.
  • the reordered instruction fragments are: instruction fragment 2, instruction fragment 3, instruction fragment 1, then send the reordered instruction fragment to the DDR device.
  • the relative order of the reordered instruction fragments is also saved in this embodiment, for example, the relative order of the instruction fragments indicating reordering may be stored in the CAM. In one embodiment, the order of the reordered instruction fragments may be stored. Tokens are stored in the CAM in order according to the first-in, first-out rules.
  • the DDR controller receives data sent by the DDR device according to the order of the received instruction fragments.
  • the data may be data read by multiple instruction fragments, where the multiple instruction fragments may include all instruction fragments of at least one instruction.
  • This embodiment takes one instruction as an example, and the instruction includes K instruction fragments, and The K instruction fragments are all instruction fragments after reordering the instruction, and other instructions are processed similarly. Then the token corresponding to the data read by each instruction fragment can be determined.
  • the relative order of the reordered instruction fragments is also stored in this embodiment. Therefore, according to the relative order of the received data, the relative order of the instruction fragments corresponding to each data can be determined, thereby obtaining the token corresponding to each data. .
  • the tokens of the reordered instruction fragments may be sequentially stored in the CAM according to the first-in, first-out rule. Therefore, in this embodiment, the token corresponding to the data may be obtained from the CAM according to the order of receiving data.
  • S206 Determine the storage address indicated by the token reading information as the storage address of the first token of the instruction according to the token reading information identified by the instruction to which the instruction belongs, and according to the first The storage address of the token to obtain the first token.
  • one of the instructions is taken as an example.
  • the storage address indicated by the token reading information is obtained, and the storage address is determined as the first of the instruction.
  • the storage address of the token and then obtain the token stored in the storage address according to the storage address, and the token is the first token of the instruction.
  • this embodiment can obtain the storage information of the first token. Since the storage information of each token is used for Indication: The storage address of the next token for this token. Therefore, according to the storage information of the first token, the storage information of the second token can be obtained, and according to the storage information of the second token, the second token can be obtained; Store the information, obtain the storage information of the third token, and obtain the third token based on the storage information of the third token, and so on, and will not repeat them here. It should be noted that, in this embodiment, the storage information of each token is also used to indicate whether the token is the last token of the instruction.
  • the storage information of the next token of the token is continuously obtained.
  • the obtained storage information of one of the tokens indicates that the token is the last token of the instruction, it means that the storage information of all tokens under the instruction has been obtained, and the token is the Kth token. .
  • the storage information of each token is also used to indicate whether the token is the last token identified by the instruction to which the instruction belongs. If yes, it means that all the tokens under the instruction ID have been acquired. If not, it means that there are still tokens for other instructions under the instruction ID that have not been acquired.
  • S208 Reorganize the data corresponding to the K tokens according to the sequence of acquiring the K tokens of the instruction and the data corresponding to the data read by each instruction fragment to obtain the data read by the instruction. The data.
  • the division order of the instruction fragment of the instruction determines the reorganization order of the instruction data. After acquiring the K tokens of the instruction, according to the order of acquiring the K tokens (that is, the relative allocation order of the K tokens of the instruction) and the tokens corresponding to each data, the data corresponding to the tokens Reorganize according to the order of obtaining K tokens to obtain reorganized data, and the reorganized data is the correct data read by the instruction.
  • the storage information of the token is also generated in turn.
  • the storage information of each token is used to indicate that: Whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the storage address of the next token of the token in the instruction.
  • the storage information of each token is storage information of a first linked list structure;
  • the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction;
  • a storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
  • the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
  • a possible implementation manner of the above S202 may include S2021-S2023 as shown below.
  • a fourth storage indication in the storage information of the i-1th token is used to indicate that the corresponding storage resource has stored the token
  • a first storage indication is used to indicate the i-th 1 token is not the last token of the instruction
  • the second storage instruction is used to indicate that the i-1th token is the last token corresponding to the instruction identifier of the instruction
  • the third storage instruction The storage address used to indicate the next token is a preset storage address; where i is an integer greater than or equal to 2 and less than or equal to K.
  • the i-th token is stored in an idle second storage resource, and storage information of the i-th token is generated, and a fourth storage indication in the storage information of the i-th token is used to indicate
  • the corresponding storage resource has stored a token
  • the second storage instruction is used to indicate that the i-th token is the last token corresponding to the instruction ID to which the instruction belongs
  • the third storage instruction is used for the next token.
  • the storage address is a preset storage address.
  • the first storage instruction is used to indicate that the i-th token is the last token of the instruction.
  • i is not equal to K
  • the first storage instruction is used. Indicating that the i-th token is not the last token of the instruction;
  • S2023 Change the second storage instruction in the storage information of the i-1th token to indicate that the i-1th token is not the last token corresponding to the instruction ID of the instruction, and change the third storage instruction to Indicates that the storage address of the next token is the address of the second storage resource.
  • the idle first storage resource and the idle second storage resource are idle adjacent storage resources.
  • the third storage indication in the storage information of the token is changed to a preset storage address.
  • the first storage in the storage information of the token indicates that the token is the last token of the instruction, then change the first storage instruction to indicate the The token is not the last token of the instruction.
  • the fourth storage indication in the storage information of the token is changed from indicating that the token is stored to indicating that the token is not stored.
  • the second storage in the storage information of the token indicates that the token is the last token corresponding to the instruction identifier
  • the second storage instruction is changed to Indicates that the token is not the last token corresponding to the instruction ID.
  • this embodiment uses a linked list to save the storage information of the token, which can significantly reduce the token storage resources required in the prior art.
  • the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token corresponding to the instruction ID to which the instruction belongs.
  • the second linked list structure further includes: a second read instruction, where the second read instruction is used to indicate whether a token corresponding to an instruction identifier to which the instruction belongs is stored.
  • a possible implementation manner of generating the token reading information of the instruction is: after storing the first token of the instruction, generating the token reading information identified by the instruction; The second read instruction in the token read information is used to indicate that the instruction has been stored with the token, and the first read instruction is used to indicate the storage address of the first token. If the instruction is the first currently stored instruction corresponding to the corresponding instruction identifier, after storing the first token of the instruction, the token reading information of the instruction identifier is also generated, and after other tokens of the instruction are stored, Keep the token read information identified by this instruction unchanged.
  • the first read instruction is changed to indicate a preset storage address; if the second storage in the storage information of each of the K tokens indicates that the token is not the last token corresponding to the instruction ID, then Changing the first read instruction to indicate a first storage address; the first storage address is: a third storage instruction that belongs to the same storage information as the first storage instruction indicating that the token is the last token of the instruction, The indicated storage address.
  • the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction identifier, changing the second reading indication to A token indicating that the instruction was not stored.
  • the form of a linked list is used to save the token reading information identified by the instruction, which can significantly reduce the token storage resources required in the prior art.
  • token writing information identified by an instruction to which the instruction belongs is further generated, where The token write information is used to indicate that the storage address corresponding to the recently stored token corresponding to the instruction identifier is the address of the first storage resource.
  • an implementation manner of storing the i-th token in the idle second storage resource is: determining the idle second storage resource according to the token write information; and storing the i-th token Tokens are stored in a spare second storage resource.
  • the token write information is also updated, and the updated token write information is used to indicate that the instruction identifier corresponds to a recently stored token
  • the storage address of is the address of the second storage resource.
  • the token writing information is token writing information of a third linked list structure
  • the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to a recently stored The storage address of the token.
  • the second storage indication in the storage information of one of the K tokens indicates that the token is the last token identified by the instruction
  • the The token write information of the instruction identifier is changed to indicate that the storage address of the recently stored token corresponding to the instruction identifier is a preset storage address.
  • a form of a linked list is used to save the token write information identified by the instruction, which can significantly reduce the token storage resources required in the prior art.
  • first linked list structure, the second linked list structure, and the third linked list structure may be stored in the same linked list, or may be stored in different linked lists.
  • the following describes the token storage instructions and the process of obtaining the tokens of the instructions, respectively.
  • the following uses the storage information of the tokens of the first linked list structure as the token storage structure, and the token reading information of the instruction identifier of the second linked list structure as the ID read pointer storage structure and the token identification of the instruction identifier of the third linked list structure.
  • the information is an ID write pointer storage structure as an example for illustration.
  • the ID described below indicates the instruction ID to which the instruction belongs.
  • the token storage structure includes: flag, ind , Last, token, next_ptr, where flag is used to indicate whether the token in the same row has a stored token, for example: flag equal to 1 means stored, and flag equal to 0 means not stored.
  • flag indicates whether the token stored in the same row is the last token of an ID, for example: ind equals 0 means no, and ind equals 1 means yes.
  • last indicates whether the token stored in the token in the same line is the last token of an instruction.
  • token is used to store tokens.
  • next_ptr indicates a pointer to the storage location of the next token of this token relative to the same ID.
  • the ID read pointer storage structure includes: flag, rd_ptr. flag indicates whether a valid token exists before this ID, flag equals 1 to indicate existence, and flag equals 0 to indicate no existence. rd_ptr is used to point to the storage address of the token to be read next time with this ID.
  • the ID write pointer storage structure includes: wr_ptr. wr_ptr is used to point to the storage address of the latest token of this ID.
  • the possible number of IDs can be determined in advance according to the system architecture and scheme, but the value of the ID cannot be controlled, so when the number of IDs is N, but its value is not fixed from 0 to N- 1, so you can map N different ID values to 0 ⁇ N-1 numbers, and use this number as the internal ID.
  • N the numbering information in 0 to N-1.
  • FIG. 4 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure during initialization according to an embodiment of the present invention. As shown in FIG. 4, the foregoing parameters are all 0.
  • Instruction 0 is divided into 4 instruction fragments, corresponding to the generation of 4 tokens, which are 60-63.
  • Instruction 1 is divided into 3 instruction fragments, corresponding to the generation of 3 tokens, 57-59 respectively.
  • Instruction 2 is divided into 5 instruction fragments, corresponding to the generation of 5 tokens, respectively 52-56.
  • Instruction 3 is divided into three instruction fragments, which correspondingly generate 3 tokens, which are 49-51.
  • Instruction 4 is divided into four instruction fragments, which correspondingly generate 4 tokens, which are 45-48, as shown in FIG. 5 for example.
  • FIG. 6 is a schematic diagram of four tokens of a storage instruction 0 according to an embodiment of the present invention. Among them, instruction 0 is divided into 4 DDR device instructions, and the allocated tokens are 63, 62, 61, 60, respectively.
  • the token in the second line is the next token of the token in the first line, and the position pointer of the second line is 1, so the next_ptr in the first line is updated to 1.
  • the token in the third line is the next token of the token in the second line, and the pointer in the third line is 2, so the next_ptr in the second line is updated to 2.
  • the token in the fourth line is the next token of the token in the third line, and the pointer in the fourth line is 3, so the next_ptr in the third line is updated to 3.
  • FIG. 7 is a schematic diagram of three tokens of a storage instruction 1 according to an embodiment of the present invention. Among them, instruction 1 is divided into three instruction fragments, and the allocated tokens are 59, 58, 57 respectively.
  • the token in the sixth line is the next token of the token in the fifth line, and the position pointer of the sixth line is 5, so the next_ptr in the fifth line is updated to 5.
  • the token in the seventh line is the next token of the token in the sixth line, and the pointer in the seventh line is 6, so the next_ptr in the sixth line is updated to 6.
  • FIG. 8 is a schematic diagram of five tokens of a storage instruction 2 according to an embodiment of the present invention. Among them, instruction 2 is divided into 5 instruction fragments, and the allocated tokens are 56, 55, 54, 53, 52, respectively.
  • the token in the eighth line is the next token of the token in the fourth line, and the position pointer of the eighth line is 7, so the next_ptr in the fourth line is updated to 7.
  • the token in the ninth line is the next token of the token in the eighth line, and the position pointer of the ninth line is 8, so the next_ptr in the eighth line is updated to 8.
  • the token in the tenth line is the next token of the token in the ninth line, and the position pointer of the tenth line is 9, so the next_ptr in the ninth line is updated to 9.
  • the token in the eleventh line is the next token of the token in the tenth line, and the position pointer of the eleventh line is 10, so the next_ptr in the tenth line is updated to 10.
  • the token in the twelfth line is the next token of the token in the eleventh line, and the position pointer of the twelfth line is 11, so the next_ptr in the eleventh line is updated to 11.
  • the instruction is optimized and sent to the DDR device.
  • the token order is also adjusted in the DDR controller at this time. The DDR controller recovers the corresponding token information for each returned data.
  • the following describes the process of the DDR controller after receiving the above instructions 0-2, dividing it into instruction fragments and sending it to the DDR device, and then receiving the data returned by the DDR device.
  • the token storage structure and the read pointer information of ID 0, it is 0, and the fourth Last in the line is 1, you can infer that the position pointer of the token storage structure needs to be read is 0, 1, 2, 3, so that the token 63, 62, 61, 60 is read, and then the position pointer in the token storage structure is read
  • the flags corresponding to 0, 1, 2, and 3 are set to 0, that is, the flags in the first, second, third, and fourth rows are set to 0, the token storage structure is released, and then the tokens 63, 62, 61, and 60 are queried. Get the read address of the ReadReorder buff, so you can get the correct data for instruction 0.
  • the corresponding flag is set to 0, that is, the flags in the fifth, sixth, and seventh rows are set to 0, the token storage structure is released, and then the token 59, 58, 57 is queried to obtain the read address of the Read, Reorder, and Buff.
  • the corresponding flag is set to 0, that is, the flags in the fifth, sixth,
  • the token storage structure is released, and then used again.
  • the storage resources required to store the token storage structure, ID read pointer storage structure, and ID write pointer storage structure according to the embodiments of the present invention are as follows:
  • Token storage resource 2 M * (1 + 1 + 1 + M + M) bit
  • ID read pointer storage resource N * M bit
  • ID write pointer storage resource N * M bit
  • N is the number of IDs of the above instructions
  • 2 M is the instruction CAM depth of the DDR device.
  • the embodiments of the present invention have the following improvements: multiple IDs share token storage resources, and compared with the prior art, tokens are stored by ID alone, which greatly reduces logical storage resources.
  • FIG. 13 is a schematic structural diagram of a token management apparatus according to an embodiment of the present invention.
  • the token management apparatus 1300 in this embodiment may include a memory 1301 and a processor 1302.
  • the memory 1301 is configured to store program code
  • the processor 1302 is configured to call the code stored in the memory 1301 and execute:
  • the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • the storage address of the token's next token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • the processor 1302 is further configured to:
  • the token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
  • the storage information of each token is storage information of a first linked list structure;
  • the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction;
  • a storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
  • the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
  • the processor 1302 is specifically configured to:
  • the i-1th token of the K tokens is stored in an idle first storage resource, and the i-1th token is generated
  • the storage information of the token, the fourth storage indication in the storage information of the i-1th token is used to indicate that the corresponding storage resource has stored the token, and the first storage indication is used to indicate the i-1th
  • the token is not the last token of the instruction
  • the second storage instruction is used to indicate that the i-1th token is the last token corresponding to the instruction ID to which the instruction belongs
  • the third storage instruction is used to Indicates that the storage address of the next token is a preset storage address
  • the storage resource has stored a token
  • the second storage instruction is used to indicate that the i-th token is the last token corresponding to the instruction ID to which the instruction belongs
  • the third storage instruction is a storage address for the next token It is a preset storage address.
  • the first storage instruction is used to indicate that the i-th token is the last token of the instruction.
  • i is not equal to K
  • the first storage instruction is used to indicate The i-th token is not the last token of the instruction;
  • i is an integer of 2 or more and K or less.
  • the idle first storage resource and the idle second storage resource are idle adjacent storage resources.
  • the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token corresponding to the instruction ID to which the instruction belongs.
  • the second linked list structure further includes: a second read instruction, which is used to indicate whether a token corresponding to an instruction identifier to which the instruction belongs is stored.
  • the processor 1302 is specifically configured to:
  • the second read instruction in the token read information is used to indicate that the instruction has been stored with the token
  • the first read instruction is used to indicate the storage address of the first token
  • the processor 1302 after the processor 1302 stores the (i-1) th token out of the K tokens in an idle first storage resource, it is further configured to: Token write information, where the token write information is used to indicate that a storage address corresponding to a recently stored token corresponding to the instruction identifier is an address of the first storage resource;
  • the processor 1302 When the processor 1302 stores the i-th token in an idle second storage resource, the processor 1302 is specifically configured to: determine the idle second storage resource according to the token write information; and store the i-th token Tokens are stored in an idle second storage resource;
  • the processor 1302 is further configured to update the token write information after storing the i-th token in an idle second storage resource, and the updated token write information is used to indicate the instruction identifier
  • the storage address corresponding to the recently stored token is the address of the second storage resource.
  • the token writing information is token writing information of a third linked list structure
  • the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to the most recent The storage address of the stored token.
  • the token management apparatus of this embodiment may be used to execute the technical solution related to storing tokens in the foregoing method embodiments of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 14 is a schematic structural diagram of a token management apparatus according to another embodiment of the present invention.
  • the token management apparatus 1400 of this embodiment may include a memory 1401 and a processor 1402.
  • the memory 1401 is configured to store program code
  • the processor 1402 is configured to call the code stored in the memory 1401, and execute:
  • the plurality of instruction fragments including K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction
  • the data corresponding to the K tokens is reorganized to obtain the data read by the instruction ;
  • the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction.
  • the token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
  • the storage information of each token is storage information of a first linked list structure;
  • the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction;
  • a storage indication is used to indicate whether the token is the last token of the instruction, and the second storage indication is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
  • the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, change the third storage indication in the storage information of the token to a pre- Set the storage address.
  • the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, if the first storage in the storage information of the token indicates the token Is the last token of the instruction, the first storage instruction is changed to indicate that the token is not the last token of the instruction.
  • the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
  • the processor 1402 is further configured to: for the storage information of each token, after acquiring the token, if the fourth storage indication in the storage information of the token is indicated by The stored token changed to indicate that the token was not stored.
  • the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, if the second storage in the storage information of the token indicates the token For the last token corresponding to the instruction identifier, the second storage instruction is changed to indicate that the token is not the last token corresponding to the instruction identifier.
  • the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token of the instruction.
  • the processor 1402 is further configured to:
  • the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction ID, changing the first reading indication to indicate a preset storage address;
  • the second storage in the storage information of each of the K tokens indicates that the token is not the last token corresponding to the instruction identifier, changing the first read instruction to indicate the first storage An address;
  • the first storage address is a storage address indicated by a third storage instruction that belongs to the same storage information as the first storage instruction indicating that the token is the last token of the instruction.
  • the second linked list structure further includes a second read instruction, where the second read instruction is used to indicate whether a token of the instruction has been stored.
  • the processor 1402 is further configured to: if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction identifier, Then changing the second read instruction to a token indicating that the instruction is not stored.
  • the processor 1402 is further configured to: if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token identified by the instruction, then Changing the token write information of the instruction identifier to indicate that the storage address of the most recently stored token corresponding to the instruction identifier is a preset storage address.
  • the token writing information is token writing information of a third linked list structure
  • the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to The storage address of the most recently stored token.
  • the token management apparatus of this embodiment may be used to execute the technical solution related to reading tokens in the foregoing method embodiment of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 15 is a schematic structural diagram of a chip according to an embodiment of the present invention. As shown in FIG. 15, the chip 1500 in this embodiment may include a DDR controller 1501 and a DDR device 1502.
  • the DDR controller 1501 is configured to execute the token management method in the foregoing method embodiments;
  • the DDR device 1502 is configured to receive the reordered multiple instruction fragments sent by the DDR device, and send data read by each instruction fragment to the DDR controller.
  • the chip in this embodiment may be used to implement the technical solutions of the foregoing method embodiments of the present invention.
  • the implementation principles and technical effects are similar, and are not described herein again.
  • FIG. 16 is a schematic structural diagram of a movable platform according to an embodiment of the present invention.
  • the movable platform 1600 in this embodiment may include a fuselage 1601, a pan-tilt 1602, and an imaging device 1603.
  • the imaging device 1603 is connected to the body 1601 through the pan / tilt 1602.
  • the fuselage 1601 includes a chip 1604.
  • the chip may adopt the structure of the embodiment shown in FIG. 15 and correspond to the technical solutions that can implement the foregoing method embodiments of the present invention. The implementation principles and technical effects are similar. Here, No longer.
  • the chip 1604 is also connected to the imaging device 1603, and the chip 1604 is further configured to process image data collected by the imaging device 1603.
  • the foregoing program may be stored in a computer-readable storage medium.
  • the program is executed, the program is executed.
  • the foregoing storage medium includes: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The medium.

Abstract

A token management method: after dividing a command into a plurality of command fragments and sequentially allocating a plurality of tokens, sequentially storing the tokens and generating token storage information, the storage information of each token being used for indicating: whether the token is the last token of the command, whether the token is the last token corresponding to a command ID to which the command belongs, and the storage address of the next token after said token in the command. By means of said storage information, all of the tokens under the command can be acquired on the basis of the order of allocation of the tokens, thereby ensuring that the data under the same command will not be in error. The tokens do not need to be stored in an FIFO form in the order of allocation of the tokens, saving storage resources and avoiding resource wastage.

Description

令牌管理方法、装置、芯片及可移动平台Token management method, device, chip and mobile platform 技术领域Technical field
本发明实施例涉及芯片技术领域,尤其涉及一种令牌管理方法、装置、芯片及可移动平台。Embodiments of the present invention relate to the technical field of chips, and in particular, to a token management method, device, chip, and mobile platform.
背景技术Background technique
系统级芯片(System on Chip,SoC)是指以嵌入式系统为核心,集软、硬件于一体,并追求产品系统最大包容的集成芯片,可以应用于手机,图像处理,电视游戏等领域。针对需要大容量内存的软件应用场景,SoC通常会集成一个双倍数据速率(Double Data Rate,DDR)控制器来连接DDR器件,以提供系统内存空间。一般提高DDR控制器的访问效率,就可提高整个SoC的处理性能。为了提高DDR控制器的访问效率,会为DDR控制器配置多个访问端口,这些访问端口遵循一定的总线标准,如先进微控制器总线体系结构(Advanced Microcontroller Bus Architecture,AMBA)的高级可扩展接口(Advanced eXtensible Interface,AXI),高级高性能总线(the Advanced High-performance Bus,AHB)总线接口标准。DDR控制器作为访问SLAVE,外部存在多个访问MASTER,这些访问MASTER可以来源于例如应用处理器,数字信号处理器,图形处理单元,多媒体等。System-on-chip (SoC) refers to an integrated chip with embedded system as the core, integrating software and hardware, and pursuing the maximum tolerance of the product system. It can be applied to mobile phones, image processing, TV games and other fields. For software application scenarios that require large-capacity memory, the SoC usually integrates a Double Data Rate (DDR) controller to connect DDR devices to provide system memory space. Generally improving the access efficiency of the DDR controller can improve the processing performance of the entire SoC. In order to improve the access efficiency of the DDR controller, multiple access ports are configured for the DDR controller. These access ports follow certain bus standards, such as the advanced scalable interface of the Advanced Microcontroller Bus Architecture (AMBA). (Advanced Xtensible Interface, AXI), the Advanced High-performance Bus (AHB) bus interface standard. As a SLAVE, the DDR controller has multiple access masters externally. These access masters can come from, for example, an application processor, a digital signal processor, a graphics processing unit, and multimedia.
其中,若DDR控制器与访问端口之间的总线标准为AMBA的AXI,则同一个访问MASTER发出的具有相同ID的指令与读数据的顺序保持一致,即先发出的读指令对应的读数据先返回。但是,DDR器件不是AXI总线标准接口,所以需要DDR控制器将AXI总线传输的读指令和时序转换为DDR器件的读指令和时序。具体如下:DDR控制器通过AXI总线接收到读指令后,将每条读指令分割为多个指令片段,并为每个指令片段分配令牌,以记录读指令的顺序。DDR控制器再根据当前DDR器件的状态,将这些指令片段重新调整顺序,将重新调整后的指令片段发送给DDR器件,DDR器件根据接收到的指令片段的顺序依次返回读数据,并为各个读数据添加对应的指令片段的令牌,其中,令牌一般存储在先入先出(First Input First Output,FIFO)存储器中,先产生的令牌所对应的读数据先读出,后产生的令牌所对应的读数据后读出,所以对同一读指令的读数据按照顺序组合,从而获得排序后的读数据,其中,排序后的读数据与对应的读指令的顺序一致,然后将排序后的读数据依次发送给访问MASTER。Among them, if the bus standard between the DDR controller and the access port is AXI of AMBA, the command with the same ID issued by the same access master is consistent with the order of reading data, that is, the read data corresponding to the read command issued first return. However, the DDR device is not an AXI bus standard interface, so a DDR controller is required to convert the read instruction and timing transmitted by the AXI bus into the read instruction and timing of the DDR device. The details are as follows: After the DDR controller receives the read instruction through the AXI bus, it divides each read instruction into multiple instruction fragments, and assigns a token to each instruction fragment to record the order of the read instructions. The DDR controller then re-adjusts the order of these instruction fragments according to the current state of the DDR device, and sends the re-adjusted instruction fragments to the DDR device. The DDR device sequentially returns the read data according to the order of the received instruction fragments, and reads them for each The data is added to the token of the corresponding instruction fragment, wherein the token is generally stored in a first-in-first-out (FIFO) memory, and the read data corresponding to the token generated first is read out first, and the token generated later The corresponding read data is read out later, so the read data of the same read instruction is combined in order to obtain the sorted read data, where the sorted read data is consistent with the order of the corresponding read instruction, and then the sorted The read data is sent to the access master in turn.
现有技术中,一般是根据访问MASTER可能的ID的最大个数N以及DDR器件指令CAM深度(一般用2 M来表示)来确定FIFO存储器的个数和深度,其中,FIFO存储器的个数等于MASTER可能的ID的最大个数。为了覆盖读指令都来自同一ID的极限情况,所以每个FIFO存储器的深度等于上述DDR器件指令CAM深度,即FIFO存储器的宽度为M。由此可知,FIFO存储器的存储总和是CAM深度的N倍,从而造成FIFO的存储资源远远大于实际所需的令牌存储资源,造成资源浪费。 In the prior art, the number and depth of FIFO memories are generally determined according to the maximum number of possible IDs N to access the MASTER and the depth of the CAM instruction of the DDR device (usually represented by 2 M ). The maximum number of possible master IDs. In order to cover the limit case that the read instructions all come from the same ID, the depth of each FIFO memory is equal to the CAM depth of the above DDR device instruction, that is, the width of the FIFO memory is M. It can be seen that the total storage of the FIFO memory is N times the depth of the CAM, which causes the storage resources of the FIFO to be much larger than the actual token storage resources required, resulting in a waste of resources.
发明内容Summary of the Invention
本发明实施例提供一种令牌管理方法、装置、芯片及可移动平台,用于节省存储令 牌所需的资源,节省资源开销。Embodiments of the present invention provide a token management method, device, chip, and mobile platform, which are used to save resources required for storing tokens and save resource overhead.
第一方面,本发明实施例提供一种令牌管理方法,包括:In a first aspect, an embodiment of the present invention provides a token management method, including:
将接收的指令分割为K个指令片段,并为每个指令片段依次分配令牌;Divide the received instruction into K instruction fragments, and allocate tokens for each instruction fragment in turn;
按照分配顺序存储K个令牌,并生成每个令牌的存储信息;Store K tokens in the assigned order and generate storage information for each token;
对所述K个指令片段重新排序,并发送重新排序后的K个指令片段;Reorder the K instruction fragments, and send the reordered K instruction fragments;
其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token.
第二方面,本发明实施例提供一种令牌管理方法,包括:In a second aspect, an embodiment of the present invention provides a token management method, including:
接收多个指令片段中每个指令片段所读取的数据,所述多个指令片段包括K个指令片段,所述K个指令片段为一个指令的重新排序后的所有指令片段;Receiving data read by each instruction fragment in a plurality of instruction fragments, the plurality of instruction fragments including K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction;
确定各个指令片段所读取的数据所对应的令牌;Determine the token corresponding to the data read by each instruction fragment;
根据所述指令所属指令标识的令牌读取信息,将所述令牌读取信息指示的存储地址确定为所述指令的第一个令牌的存储地址,并根据所述第一个令牌的存储地址,获取所述第一个令牌;Determine the storage address indicated by the token read information as the storage address of the first token of the instruction according to the token read information identified by the instruction to which the instruction belongs, and according to the first token The storage address of the first token;
根据所述第一个令牌的存储信息,依次获取所述指令的其它K-1个令牌的存储信息;Obtaining the storage information of the other K-1 tokens of the instruction in sequence according to the storage information of the first token;
依次根据所述K-1个令牌的存储信息,获取其它K-1个令牌;Obtaining other K-1 tokens according to the storage information of the K-1 tokens in sequence;
根据获取所述指令的K个令牌的顺序,以及各个指令片段所读取的数据所对应的令牌,对所述K个令牌对应的数据进行重组,获得所述指令所读取的数据;According to the order of obtaining the K tokens of the instruction and the tokens corresponding to the data read by each instruction fragment, the data corresponding to the K tokens is reorganized to obtain the data read by the instruction ;
其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址;The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the next token of the token;
所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
第三方面,本发明实施例提供一种令牌管理装置,包括:存储器和处理器;According to a third aspect, an embodiment of the present invention provides a token management apparatus, including: a memory and a processor;
所述存储器,用于存储程序代码;The memory is used to store program code;
所述处理器,用于调用所述存储器中存储的所述代码,执行如第一方面本发明实施例所述的令牌管理方法,或者,如第二方面本发明实施例所述的令牌管理方法。The processor is configured to call the code stored in the memory to execute the token management method according to the embodiment of the present invention in the first aspect, or the token according to the embodiment of the present invention in the second aspect Management methods.
第四方面,本发明实施例提供一种芯片,包括:DDR控制器和DDR器件;According to a fourth aspect, an embodiment of the present invention provides a chip, including: a DDR controller and a DDR device;
所述DDR控制器,用于执行如第一方面本发明实施例所述的令牌管理方法,以及,如第二方面本发明实施例所述的令牌管理方法;The DDR controller is configured to execute the token management method according to the embodiment of the present invention in the first aspect, and the token management method according to the embodiment of the present invention in the second aspect;
所述DDR器件,用于接收所述DDR器件发送的重新排序后的多个指令片段,并向所述DDR控制器发送每个指令片段所读取的数据。The DDR device is configured to receive the reordered multiple instruction fragments sent by the DDR device, and send data read by each instruction fragment to the DDR controller.
第五方面,本发明实施例一种可移动平台,包括:机身、云台以及成像装置,所述成像装置通过所述云台与所述机身连接,所述机身内包括如第四方面本发明实施例所述的芯片;In a fifth aspect, a movable platform according to an embodiment of the present invention includes a fuselage, a pan-tilt, and an imaging device. The imaging device is connected to the fuselage through the pan-tilt. Aspects of the chip according to the embodiment of the present invention;
所述芯片还与所述成像装置连接,所述芯片还用于处理所述成像装置采集的图像数据。The chip is also connected to the imaging device, and the chip is further configured to process image data collected by the imaging device.
第六方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包含至少一段代码,所述至少一段代码可由计算机执行, 以控制所述计算机执行本发明实施例第一方面和/或第二方面所述的令牌管理方法。According to a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, where the computer program includes at least one piece of code, and the at least one piece of code can be executed by a computer to control The computer executes the token management method according to the first aspect and / or the second aspect of the embodiments of the present invention.
第七方面,本发明实施例提供一种计算机程序,当所述计算机程序被计算机执行时,用于实现本发明实施例第一方面和/或第二方面所述的令牌管理方法。In a seventh aspect, an embodiment of the present invention provides a computer program for implementing the token management method according to the first aspect and / or the second aspect of the embodiment of the present invention when the computer program is executed by a computer.
本发明实施例提供的令牌管理方法、装置、芯片及可移动平台,通过在将指令分割为多个指令片段后,依次分配多个令牌后,并依次存储令牌还生成令牌的存储信息,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。通过该存储信息,可以根据令牌的分配顺序获取到该指令下的所有令牌,从而保证同一指令下的数据不会出错。无需按照令牌的分配顺序以FIFO的形式存储令牌,节省了存储资源,避免资源浪费。According to the token management method, device, chip and mobile platform provided by the embodiments of the present invention, after dividing an instruction into multiple instruction fragments, sequentially allocating multiple tokens, storing the tokens in sequence, and generating token storage Information, and the storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction ID to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token. Through the storage information, all tokens under the instruction can be obtained according to the order in which the tokens are allocated, thereby ensuring that data under the same instruction will not be wrong. There is no need to store tokens in the form of FIFO in accordance with the order in which the tokens are allocated, saving storage resources and avoiding waste of resources.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是根据本发明的实施例的无人飞行系统的示意性架构图;FIG. 1 is a schematic architecture diagram of an unmanned flight system according to an embodiment of the present invention;
图2为本发明一实施例提供的令牌管理方法的流程图;2 is a flowchart of a token management method according to an embodiment of the present invention;
图3为本发明实施例提供的令牌存储结构、ID读指针存储结构、ID写指针存储结构的示意图;3 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure according to an embodiment of the present invention;
图4为本发明实施例提供的初始化时令牌存储结构、ID读指针存储结构、ID写指针存储结构的示意图;4 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure during initialization according to an embodiment of the present invention;
图5为本发明一实施例提供的指令分割及分配令牌的示意图;FIG. 5 is a schematic diagram of instruction division and allocation token provided by an embodiment of the present invention; FIG.
图6为本发明实施例提供的存储指令0的4个令牌的示意图;6 is a schematic diagram of four tokens of a storage instruction 0 according to an embodiment of the present invention;
图7为本发明实施例提供的存储指令1的3个令牌的示意图;7 is a schematic diagram of three tokens of a storage instruction 1 according to an embodiment of the present invention;
图8为本发明实施例提供的存储指令2的5个令牌的示意图;8 is a schematic diagram of five tokens of a storage instruction 2 provided by an embodiment of the present invention;
图9为本发明一实施例提供的令牌读取顺序的示意图;9 is a schematic diagram of a token reading sequence according to an embodiment of the present invention;
图10为本发明实施例提供的读取指令0的4个令牌的示意图;FIG. 10 is a schematic diagram of four tokens of read instruction 0 according to an embodiment of the present invention; FIG.
图11为本发明实施例提供的读取指令1的3个令牌的示意图;11 is a schematic diagram of three tokens of a read instruction 1 according to an embodiment of the present invention;
图12为本发明实施例提供的读取指令2的5个令牌的示意图;FIG. 12 is a schematic diagram of five tokens of a read instruction 2 according to an embodiment of the present invention; FIG.
图13为本发明一实施例提供的令牌管理装置的结构示意图;13 is a schematic structural diagram of a token management apparatus according to an embodiment of the present invention;
图14为本发明另一实施例提供的令牌管理装置的结构示意图;14 is a schematic structural diagram of a token management apparatus according to another embodiment of the present invention;
图15为本发明一实施例提供的芯片的结构示意图;15 is a schematic structural diagram of a chip according to an embodiment of the present invention;
图16为本发明一实施例提供的可移动平台的结构示意图。FIG. 16 is a schematic structural diagram of a movable platform according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, but not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
需要说明的是,当组件被称为“固定于”另一个组件,它可以直接在另一个组件上或者也可以存在居中的组件。当一个组件被认为是“连接”另一个组件,它可以是直接连接到另 一个组件或者可能同时存在居中组件。It should be noted that when a component is called "fixed to" another component, it may be directly on another component or a centered component may exist. When a component is considered to be “connected” to another component, it may be directly connected to another component or a centered component may coexist.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。本文所使用的术语“及/或”包括一个或多个相关的所列项目的任意的和所有的组合。Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
下面结合附图,对本发明的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present invention will be described in detail with reference to the drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
本发明的实施例提供了令牌管理方法、装置、芯片及可移动平台。该可移动平台例如可以是无人机、无人船、无人汽车、机器人等。其中无人机例如可以是旋翼飞行器(rotorcraft),例如,由多个推动装置通过空气推动的多旋翼飞行器,本发明的实施例并不限于此。Embodiments of the present invention provide a token management method, device, chip, and mobile platform. The movable platform may be, for example, a drone, an unmanned ship, an unmanned car, a robot, or the like. The drone may be a rotorcraft, for example, a multi-rotor aircraft propelled by multiple propulsion devices through air, and the embodiment of the present invention is not limited thereto.
图1是根据本发明的实施例的无人飞行系统的示意性架构图。本实施例以旋翼无人机为例进行说明。FIG. 1 is a schematic architecture diagram of an unmanned flight system according to an embodiment of the present invention. This embodiment is described by taking a rotary wing drone as an example.
无人飞行系统100可以包括无人机110、显示设备130和控制终端140。其中,无人机110可以包括动力系统150、飞行控制系统160、机架和承载在机架上的云台120。无人机110可以与控制终端140和显示设备130进行无线通信。The unmanned aerial system 100 may include a drone 110, a display device 130, and a control terminal 140. The UAV 110 may include a power system 150, a flight control system 160, a rack, and a gimbal 120 carried on the rack. The drone 110 may perform wireless communication with the control terminal 140 and the display device 130.
机架可以包括机身和脚架(也称为起落架)。机身可以包括中心架以及与中心架连接的一个或多个机臂,一个或多个机臂呈辐射状从中心架延伸出。脚架与机身连接,用于在无人机110着陆时起支撑作用。The frame may include a fuselage and a tripod (also called a landing gear). The fuselage may include a center frame and one or more arms connected to the center frame, and one or more arms extend radially from the center frame. The tripod is connected to the fuselage, and is used to support the UAV 110 when landing.
动力系统150可以包括一个或多个电子调速器(简称为电调)151、一个或多个螺旋桨153以及与一个或多个螺旋桨153相对应的一个或多个电机152,其中电机152连接在电子调速器151与螺旋桨153之间,电机152和螺旋桨153设置在无人机110的机臂上;电子调速器151用于接收飞行控制系统160产生的驱动信号,并根据驱动信号提供驱动电流给电机152,以控制电机152的转速。电机152用于驱动螺旋桨旋转,从而为无人机110的飞行提供动力,该动力使得无人机110能够实现一个或多个自由度的运动。在某些实施例中,无人机110可以围绕一个或多个旋转轴旋转。例如,上述旋转轴可以包括横滚轴(Roll)、偏航轴(Yaw)和俯仰轴(pitch)。应理解,电机152可以是直流电机,也可以交流电机。另外,电机152可以是无刷电机,也可以是有刷电机。The power system 150 may include one or more electronic governors (referred to as ESCs) 151, one or more propellers 153, and one or more electric motors 152 corresponding to the one or more propellers 153. The electric motors 152 are connected to Between the electronic governor 151 and the propeller 153, the motor 152 and the propeller 153 are arranged on the arm of the drone 110; the electronic governor 151 is used to receive the driving signal generated by the flight control system 160 and provide driving according to the driving signal Current is supplied to the motor 152 to control the rotation speed of the motor 152. The motor 152 is used to drive the propeller to rotate, so as to provide power for the flight of the drone 110, and the power enables the drone 110 to achieve one or more degrees of freedom. In some embodiments, the drone 110 may rotate about one or more rotation axes. For example, the rotation axis may include a roll axis (Roll), a yaw axis (Yaw), and a pitch axis (Pitch). It should be understood that the motor 152 may be a DC motor or an AC motor. In addition, the motor 152 may be a brushless motor or a brushed motor.
飞行控制系统160可以包括飞行控制器161和传感系统162。传感系统162用于测量无人机的姿态信息,即无人机110在空间的位置信息和状态信息,例如,三维位置、三维角度、三维速度、三维加速度和三维角速度等。传感系统162例如可以包括陀螺仪、超声传感器、电子罗盘、惯性测量单元(Inertial Measurement Unit,IMU)、视觉传感器、全球导航卫星系统和气压计等传感器中的至少一种。例如,全球导航卫星系统可以是全球定位系统(Global Positioning System,GPS)。飞行控制器161用于控制无人机110的飞行,例如,可以根据传感系统162测量的姿态信息控制无人机110的飞行。应理解,飞行控制器161可以按照预先编好的程序指令对无人机110进行控制,也可以通过响应来自控制终端140的一个或多个控制指令对无人机110进行控制。The flight control system 160 may include a flight controller 161 and a sensing system 162. The sensing system 162 is used to measure the attitude information of the drone, that is, the position information and status information of the drone 110 in space, such as three-dimensional position, three-dimensional angle, three-dimensional velocity, three-dimensional acceleration, and three-dimensional angular velocity. The sensing system 162 may include, for example, at least one of a gyroscope, an ultrasonic sensor, an electronic compass, an Inertial Measurement Unit (IMU), a vision sensor, a global navigation satellite system, and a barometer. For example, the global navigation satellite system may be a Global Positioning System (Global Positioning System, GPS). The flight controller 161 is used to control the flight of the drone 110. For example, the flight controller 161 may control the flight of the drone 110 according to the attitude information measured by the sensing system 162. It should be understood that the flight controller 161 may control the drone 110 according to a pre-programmed program instruction, and may also control the drone 110 by responding to one or more control instructions from the control terminal 140.
云台120可以包括电机122。云台用于携带拍摄装置123或麦克风(图中未示出)。飞行控制器161可以通过电机122控制云台120的运动。可选地,作为另一实施例,云台 120还可以包括控制器,用于通过控制电机122来控制云台120的运动。应理解,云台120可以独立于无人机110,也可以为无人机110的一部分。应理解,电机122可以是直流电机,也可以是交流电机。另外,电机122可以是无刷电机,也可以是有刷电机。还应理解,云台可以位于无人机的顶部,也可以位于无人机的底部。The gimbal 120 may include a motor 122. The pan / tilt is used to carry a photographing device 123 or a microphone (not shown in the figure). The flight controller 161 may control the movement of the gimbal 120 through the motor 122. Optionally, as another embodiment, the PTZ 120 may further include a controller for controlling the movement of the PTZ 120 by controlling the motor 122. It should be understood that the gimbal 120 may be independent of the drone 110 or may be a part of the drone 110. It should be understood that the motor 122 may be a DC motor or an AC motor. In addition, the motor 122 may be a brushless motor or a brushed motor. It should also be understood that the gimbal can be located on the top of the drone or on the bottom of the drone.
拍摄装置123例如可以是照相机或摄像机等用于捕获图像的设备,拍摄装置123可以与飞行控制器通信,并在飞行控制器的控制下进行拍摄。本实施例的拍摄装置123至少包括感光元件,该感光元件例如为互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)传感器或电荷耦合元件(Charge-coupled Device,CCD)传感器。可以理解,拍摄装置123也可直接固定于无人机110上,从而云台120可以省略。The photographing device 123 may be, for example, a device for capturing an image, such as a camera or a video camera. The photographing device 123 may communicate with the flight controller and perform shooting under the control of the flight controller. The photographing device 123 of this embodiment includes at least a photosensitive element. The photosensitive element is, for example, a complementary metal oxide semiconductor (CMOS) sensor or a charge-coupled device (CCD) sensor. It can be understood that the shooting device 123 can also be directly fixed on the drone 110, so that the PTZ 120 can be omitted.
显示设备130位于无人飞行系统100的地面端,可以通过无线方式与无人机110进行通信,并且可以用于显示无人机110的姿态信息。另外,还可以在显示设备130上显示成像装置拍摄的图像。应理解,显示设备130可以是独立的设备,也可以集成在控制终端140中。The display device 130 is located on the ground side of the unmanned flight system 100, can communicate with the drone 110 wirelessly, and can be used to display attitude information of the drone 110. In addition, an image captured by the imaging device may be displayed on the display device 130. It should be understood that the display device 130 may be an independent device, or may be integrated in the control terminal 140.
控制终端140位于无人飞行系统100的地面端,可以通过无线方式与无人机110进行通信,用于对无人机110进行远程操纵。The control terminal 140 is located on the ground side of the unmanned flight system 100 and can communicate with the unmanned aerial vehicle 110 in a wireless manner for remotely controlling the unmanned aerial vehicle 110.
另外,无人机110还可以机载有扬声器(图中未示出),该扬声器用于播放音频文件,扬声器可直接固定于无人机110上,也可搭载在云台120上。In addition, the drone 110 may further include a speaker (not shown) for playing audio files. The speaker may be directly fixed on the drone 110 or may be mounted on the gimbal 120.
应理解,上述对于无人飞行系统各组成部分的命名仅是出于标识的目的,并不应理解为对本发明的实施例的限制。It should be understood that the above-mentioned naming of each component of the unmanned flight system is for identification purposes only, and should not be construed as limiting the embodiments of the present invention.
其中,上述的飞行控制器161中可以包括芯片,该芯片中的DDR控制器可以用于执行如下所述的方案,下述各实施例中提及的数据例如是拍摄装置123拍摄获得的图像数据。The above-mentioned flight controller 161 may include a chip, and the DDR controller in the chip may be used to implement a solution described below. The data mentioned in the following embodiments are, for example, image data obtained by the shooting device 123. .
图2为本发明一实施例提供的令牌管理方法的流程图,如图2所示,本实施例的方法可以应用于芯片(例如系统级芯片,本实施例也不限于此)中,例如芯片的DDR控制器中,本实施例的方法可以包括:FIG. 2 is a flowchart of a token management method according to an embodiment of the present invention. As shown in FIG. 2, the method of this embodiment can be applied to a chip (such as a system-level chip, and this embodiment is not limited to this). For example, In the chip's DDR controller, the method in this embodiment may include:
S201、将接收的指令分割为K个指令片段,并为每个指令片段依次分配令牌。S201. Divide the received instruction into K instruction fragments, and assign tokens to each instruction fragment in turn.
S202、按照分配顺序存储K个令牌,并生成每个令牌的存储信息。S202. Store K tokens in the assigned order, and generate storage information of each token.
S203、对所述K个指令片段重新排序,并发送重新排序后的K个指令片段。S203. Reorder the K instruction fragments, and send the reordered K instruction fragments.
本实施例中,DDR控制器可以通过例如AXI总线接收至少一个指令,针对每个指令,将接收的指令分割为K个指令片段,其中,每个指令分割成的指令片段的个数可以不相同。本实施例还对每个指令片段依次分配令牌,例如将一个指令依次分割为指令片段1、指令片段2和指令片段3,则依次为指令片段1分配令牌、指令片段2分配令牌、指令片段3分配令牌。In this embodiment, the DDR controller may receive at least one instruction through, for example, the AXI bus. For each instruction, the received instruction is divided into K instruction fragments, and the number of instruction fragments into which each instruction is divided may be different. . In this embodiment, tokens are assigned to each instruction segment in sequence. For example, an instruction is divided into instruction segment 1, instruction segment 2, and instruction segment 3 in sequence. Then, instruction segment 1 is assigned a token, instruction segment 2 is assigned a token, Instruction fragment 3 allocates a token.
本实施例再按照令牌的分配顺序存储令牌,即先分配的令牌先存储,后分配的令牌后存储,以保证存储的令牌的顺序与指令片段的分割顺序相同。并且在每存储一个令牌后,生成该令牌的存储信息。其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。其中,需要说明的是,多个不同的指令可能所属同一指令标识。In this embodiment, the tokens are stored according to the order in which the tokens are allocated, that is, the tokens that are allocated first are stored first, and the tokens that are allocated later are stored later, so as to ensure that the stored token order is the same as the order of the instruction fragments. And after each token is stored, the storage information of the token is generated. The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token. It should be noted that multiple different instructions may belong to the same instruction identifier.
在一些实施例中,若所述指令为所属指令标识对应的当前存储的第一个指令,则生成 所述指令标识的令牌读取信息。所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。其中,有关令牌读取信息可以参见S206中的相关描述。In some embodiments, if the instruction is the first instruction currently stored corresponding to the instruction identifier, the token reading information of the instruction identifier is generated. The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs. For information about reading the token, refer to the related description in S206.
本实施例中,在存储指令的所有令牌后,DDR控制器根据当前DDR器件的状态,将这些指令片段重新排序,例如重新排序后的指令片段为:指令片段2、指令片段3、指令片段1,然后将重新排序后的指令片段发送给DDR器件。In this embodiment, after storing all the tokens of the instruction, the DDR controller reorders these instruction fragments according to the current state of the DDR device. For example, the reordered instruction fragments are: instruction fragment 2, instruction fragment 3, instruction fragment 1, then send the reordered instruction fragment to the DDR device.
可选地,本实施例还保存重新排序的指令片段的相对顺序,例如:可以将指示重新排序的指令片段的相对顺序存储在CAM中,在一实施方式中,可以将重新排序的指令片段的令牌按照先入先出的规则依次存储在CAM中。Optionally, the relative order of the reordered instruction fragments is also saved in this embodiment, for example, the relative order of the instruction fragments indicating reordering may be stored in the CAM. In one embodiment, the order of the reordered instruction fragments may be stored. Tokens are stored in the CAM in order according to the first-in, first-out rules.
S204、接收多个指令片段中每个指令片段所读取的数据,所述多个指令片段包括K个指令片段,所述K个指令片段为一个指令的重新排序后的所有指令片段。S204. Receive data read by each of the multiple instruction fragments, where the multiple instruction fragments include K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction.
S205、确定各个指令片段所读取的数据所对应的令牌。S205. Determine a token corresponding to the data read by each instruction segment.
本实施例中,DDR控制器会接收DDR器件根据接收的指令片段的顺序发送的数据。这些数据中可以是多个指令片段所读取的数据,其中,该多个指令片段可以包括至少一个指令的所有指令片段,本实施例以一个指令为例,该指令包括K个指令片段,并且该K个指令片段为该指令的重新排序后的所有指令片段,其它指令类似处理。然后可以确定各个指令片段所读取的数据所对应的令牌。可选地,本实施例还保存有重新排序的指令片段的相对顺序,因此,根据接收数据的相对顺序,可以确定各个数据所对应的指令片段的相对顺序,从而获得各个数据所对应的令牌。例如:可以将重新排序的指令片段的令牌按照先入先出的规则依次存储在CAM中,因此,本实施例可以根据数据的接收顺序从CAM中获取与该数据对应的令牌。In this embodiment, the DDR controller receives data sent by the DDR device according to the order of the received instruction fragments. The data may be data read by multiple instruction fragments, where the multiple instruction fragments may include all instruction fragments of at least one instruction. This embodiment takes one instruction as an example, and the instruction includes K instruction fragments, and The K instruction fragments are all instruction fragments after reordering the instruction, and other instructions are processed similarly. Then the token corresponding to the data read by each instruction fragment can be determined. Optionally, the relative order of the reordered instruction fragments is also stored in this embodiment. Therefore, according to the relative order of the received data, the relative order of the instruction fragments corresponding to each data can be determined, thereby obtaining the token corresponding to each data. . For example, the tokens of the reordered instruction fragments may be sequentially stored in the CAM according to the first-in, first-out rule. Therefore, in this embodiment, the token corresponding to the data may be obtained from the CAM according to the order of receiving data.
S206、根据所述指令所属指令标识的令牌读取信息,将所述令牌读取信息指示的存储地址确定为所述指令的第一个令牌的存储地址,并根据所述第一个令牌的存储地址,获取所述第一个令牌。S206. Determine the storage address indicated by the token reading information as the storage address of the first token of the instruction according to the token reading information identified by the instruction to which the instruction belongs, and according to the first The storage address of the token to obtain the first token.
本实施例中,以其中一个指令为例,根据该指令所属指令标识的令牌读取信息,获取该令牌读取信息指示的存储地址,并将该存储地址确定为该指令的第一个令牌的存储地址,然后根据该存储地址,获取存储在该存储地址的令牌,该令牌即为该指令的第一个令牌。In this embodiment, one of the instructions is taken as an example. According to the token reading information identified by the instruction to which the instruction belongs, the storage address indicated by the token reading information is obtained, and the storage address is determined as the first of the instruction. The storage address of the token, and then obtain the token stored in the storage address according to the storage address, and the token is the first token of the instruction.
S207、根据所述第一个令牌的存储信息,依次获取所述指令的其它K-1个令牌的存储信息;依次根据所述K-1个令牌的存储信息,获取其它K-1个令牌。S207. According to the storage information of the first token, sequentially obtain the storage information of the other K-1 tokens of the instruction; and sequentially obtain the other K-1 according to the storage information of the K-1 tokens. Tokens.
本实施例中,由于在存储每个令牌时,生成了该令牌的存储信息,因此,本实施例可以获取该第一个令牌的存储信息,由于每个令牌的存储信息用于指示:该令牌的下一个令牌的存储地址。因此根据该第一个令牌的存储信息,可以获取第二个令牌的存储信息,并根据该第二个令牌的存储信息,获取第二个令牌;再根据第二个令牌的存储信息,获取第三个令牌的存储信息,并根据第三个令牌的存储信息,获取第三个令牌,以此类推,此处不再赘述。需要说明的是,由于本实施例中,每个令牌的存储信息还用于指示:该令牌是否为所述指令的最后一个令牌。因此,当获取到其中一个令牌的存储信息指示该令牌不是所述指令的最后一个令牌,则继续获取该令牌的下一个令牌的存储信息。当获取到其中一个令牌的存储信息指示该令牌是所述指令的最后一个令牌,则说明该指令下的所有令牌的存储信息都获取完,该令牌即为第K个令牌。In this embodiment, since the storage information of the token is generated when each token is stored, this embodiment can obtain the storage information of the first token. Since the storage information of each token is used for Indication: The storage address of the next token for this token. Therefore, according to the storage information of the first token, the storage information of the second token can be obtained, and according to the storage information of the second token, the second token can be obtained; Store the information, obtain the storage information of the third token, and obtain the third token based on the storage information of the third token, and so on, and will not repeat them here. It should be noted that, in this embodiment, the storage information of each token is also used to indicate whether the token is the last token of the instruction. Therefore, when the obtained storage information of one token indicates that the token is not the last token of the instruction, the storage information of the next token of the token is continuously obtained. When the obtained storage information of one of the tokens indicates that the token is the last token of the instruction, it means that the storage information of all tokens under the instruction has been obtained, and the token is the Kth token. .
另外,每个令牌的存储信息还用于指示:该令牌是否为所述指令所属指令标识的最后一个令牌。若是,则说明该指令标识下的所有令牌均获取完,若否,则说明该指令标识下仍有其它指令的令牌没有获取完。In addition, the storage information of each token is also used to indicate whether the token is the last token identified by the instruction to which the instruction belongs. If yes, it means that all the tokens under the instruction ID have been acquired. If not, it means that there are still tokens for other instructions under the instruction ID that have not been acquired.
S208、根据获取所述指令的K个令牌的顺序,以及各个指令片段所读取的数据所对应的令牌,对所述K个令牌对应的数据进行重组,获得所述指令所读取的数据。S208: Reorganize the data corresponding to the K tokens according to the sequence of acquiring the K tokens of the instruction and the data corresponding to the data read by each instruction fragment to obtain the data read by the instruction. The data.
本实施例中,指令的指令片段的分割顺序决定了该指令的数据的重组顺序。在获取指令的K个令牌后,根据获取该K个令牌的顺序(即该指令的K个令牌的相对分配顺序),以及各个数据所对应的令牌,对该令牌对应的数据按照获取K个令牌的顺序进行重组,获得重组的数据,该重组的数据即为该指令所读取的正确数据。In this embodiment, the division order of the instruction fragment of the instruction determines the reorganization order of the instruction data. After acquiring the K tokens of the instruction, according to the order of acquiring the K tokens (that is, the relative allocation order of the K tokens of the instruction) and the tokens corresponding to each data, the data corresponding to the tokens Reorganize according to the order of obtaining K tokens to obtain reorganized data, and the reorganized data is the correct data read by the instruction.
本实施例中,通过在将指令分割为多个指令片段后,依次分配多个令牌后,并依次存储令牌还生成令牌的存储信息,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。通过该存储信息,可以根据令牌的分配顺序获取到该指令下的所有令牌,从而保证同一指令下的数据不会出错。无需按照令牌的分配顺序以FIFO的形式存储令牌,节省了存储资源,避免资源浪费。In this embodiment, after the instruction is divided into multiple instruction fragments, multiple tokens are allocated in sequence, and the storage information of the token is also generated in turn. The storage information of each token is used to indicate that: Whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the storage address of the next token of the token in the instruction. Through the storage information, all tokens under the instruction can be obtained according to the order in which the tokens are allocated, thereby ensuring that data under the same instruction will not be wrong. There is no need to store tokens in the form of FIFO in accordance with the order in which the tokens are allocated, saving storage resources and avoiding waste of resources.
在一些实施例中,所述每个令牌的存储信息为第一链表结构的存储信息;所述第一链表结构包括:第一存储指示、第二存储指示和第三存储指示;所述第一存储指示用于指示令牌是否为指令的最后一个令牌,所述第二存储指令用于指示令牌是否为所述指令所属指令标识对应的最后一个令牌,所述第三存储指令用于指示下一个令牌的存储地址。In some embodiments, the storage information of each token is storage information of a first linked list structure; the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction; A storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
可选地,所述第一链表结构还包括:第四存储指示,所述第四存储指示用于指示对应的存储资源是否已存储令牌。Optionally, the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
在一些实施例中,上述S202的一种可能的实现方式可以包括如下所示S2021-S2023。In some embodiments, a possible implementation manner of the above S202 may include S2021-S2023 as shown below.
S2021、针对所述K个令牌中任意两个相邻的令牌,将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中,并生成所述第i-1个令牌的存储信息,所述第i-1个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,第一存储指示用于指示所述第i-1个令牌不是所述指令的最后一个令牌,所述第二存储指令用于指示所述第i-1个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于指示下一令牌的存储地址为预设存储地址;其中,i为大于等于2且小于等于K的整数。S2021. For any two adjacent tokens of the K tokens, store the i-1th token of the K tokens in an idle first storage resource, and generate the i-th token Storage information of 1 token, a fourth storage indication in the storage information of the i-1th token is used to indicate that the corresponding storage resource has stored the token, and a first storage indication is used to indicate the i-th 1 token is not the last token of the instruction, the second storage instruction is used to indicate that the i-1th token is the last token corresponding to the instruction identifier of the instruction, and the third storage instruction The storage address used to indicate the next token is a preset storage address; where i is an integer greater than or equal to 2 and less than or equal to K.
S2022、将第i个令牌存储在空闲的第二存储资源中,并生成所述第i个令牌的存储信息,所述第i个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,所述第二存储指令用于指示所述第i个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于下一个令牌的存储地址为预设存储地址,当i等于K时,第一存储指示用于指示所述第i个令牌为所述指令的最后一个令牌,当i不等于K时,第一存储指示用于指示所述第i个令牌不是所述指令的最后一个令牌;S2022. The i-th token is stored in an idle second storage resource, and storage information of the i-th token is generated, and a fourth storage indication in the storage information of the i-th token is used to indicate The corresponding storage resource has stored a token, the second storage instruction is used to indicate that the i-th token is the last token corresponding to the instruction ID to which the instruction belongs, and the third storage instruction is used for the next token. The storage address is a preset storage address. When i is equal to K, the first storage instruction is used to indicate that the i-th token is the last token of the instruction. When i is not equal to K, the first storage instruction is used. Indicating that the i-th token is not the last token of the instruction;
S2023、将所述第i-1个令牌的存储信息中第二存储指示更改为指示所述第i-1个令牌不是指令所属指令标识对应的最后一个令牌,第三存储指示更改为指示下一令牌的存储地址为所述第二存储资源的地址。S2023: Change the second storage instruction in the storage information of the i-1th token to indicate that the i-1th token is not the last token corresponding to the instruction ID of the instruction, and change the third storage instruction to Indicates that the storage address of the next token is the address of the second storage resource.
可选地,空闲的第一存储资源与空闲的第二存储资源为空闲的相邻的存储资源。Optionally, the idle first storage resource and the idle second storage resource are idle adjacent storage resources.
相应地,在获取每个令牌之后,将该令牌的存储信息中的所述第三存储指示更改为预 设存储地址。Accordingly, after acquiring each token, the third storage indication in the storage information of the token is changed to a preset storage address.
可选地,在获取到该令牌之后,若该令牌的存储信息中的所述第一存储指示该令牌为指令的最后一个令牌,则将所述第一存储指令更改为指示该令牌不是指令的最后一个令牌。Optionally, after obtaining the token, if the first storage in the storage information of the token indicates that the token is the last token of the instruction, then change the first storage instruction to indicate the The token is not the last token of the instruction.
可选地,在获取到该令牌之后,若将该令牌的存储信息中的所述第四存储指示由指示已存储令牌更改为指示未存储令牌。Optionally, after acquiring the token, if the fourth storage indication in the storage information of the token is changed from indicating that the token is stored to indicating that the token is not stored.
可选地,在获取到该令牌之后,若该令牌的存储信息中的所述第二存储指示该令牌为指令标识对应的最后一个令牌,则将所述第二存储指令更改为指示该令牌不是指令标识对应的最后一个令牌。Optionally, after the token is obtained, if the second storage in the storage information of the token indicates that the token is the last token corresponding to the instruction identifier, the second storage instruction is changed to Indicates that the token is not the last token corresponding to the instruction ID.
因此,本实施例采用链表的形式来保存令牌的存储信息,可以显著减少现有技术中所需的令牌存储资源。Therefore, this embodiment uses a linked list to save the storage information of the token, which can significantly reduce the token storage resources required in the prior art.
在一些实施例中,所述令牌读取信息为第二链表结构的令牌读取信息,所述第二链表结构包括第一读取指示,所述第一读取指示用于指示所述指令所属指令标识对应的第一个令牌的存储地址。In some embodiments, the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token corresponding to the instruction ID to which the instruction belongs.
可选地,所述第二链表结构还包括:第二读取指示,所述第二读取指示用于指示是否已存储所述指令所属指令标识对应的令牌。Optionally, the second linked list structure further includes: a second read instruction, where the second read instruction is used to indicate whether a token corresponding to an instruction identifier to which the instruction belongs is stored.
可选地,所述生成所述指令的令牌读取信息的一种可能的实现方式为:在存储所述指令的第一个令牌之后,生成所述指令标识的令牌读取信息;其中,所述令牌读取信息中的第二读取指示用于指示已存储所述指令的令牌,所述第一读取指示用于指示所述第一个令牌的存储地址。若该指令为所属指令标识对应的当前存储的第一个指令,在存储该指令的第一令牌之后,还生成上述指令标识的令牌读取信息,而在存储指令的其它令牌后,保持该指令标识的令牌读取信息不变。Optionally, a possible implementation manner of generating the token reading information of the instruction is: after storing the first token of the instruction, generating the token reading information identified by the instruction; The second read instruction in the token read information is used to indicate that the instruction has been stored with the token, and the first read instruction is used to indicate the storage address of the first token. If the instruction is the first currently stored instruction corresponding to the corresponding instruction identifier, after storing the first token of the instruction, the token reading information of the instruction identifier is also generated, and after other tokens of the instruction are stored, Keep the token read information identified by this instruction unchanged.
相应地,在读取K个令牌时,若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示预设存储地址;若所述K个令牌中每个令牌的存储信息中第二存储指示该令牌不是所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示第一存储地址;所述第一存储地址为:与指示令牌为指令的最后一个令牌的第一存储指示属于同一存储信息的第三存储指示,所指示的存储地址。Accordingly, when reading K tokens, if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction ID, The first read instruction is changed to indicate a preset storage address; if the second storage in the storage information of each of the K tokens indicates that the token is not the last token corresponding to the instruction ID, then Changing the first read instruction to indicate a first storage address; the first storage address is: a third storage instruction that belongs to the same storage information as the first storage instruction indicating that the token is the last token of the instruction, The indicated storage address.
可选地,若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第二读取指示更改为指示未存储所述指令的令牌。Optionally, if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction identifier, changing the second reading indication to A token indicating that the instruction was not stored.
因此,本实施例采用链表的形式来保存指令标识的令牌读取信息,可以显著减少现有技术中所需的令牌存储资源。Therefore, in this embodiment, the form of a linked list is used to save the token reading information identified by the instruction, which can significantly reduce the token storage resources required in the prior art.
在一些实施例中,在上述将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中之后,还生成所述指令所属指令标识的令牌写入信息,所述令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第一存储资源的地址。相应地,所述将第i个令牌存储在空闲的第二存储资源中的一种实现方式为:根据所述令牌写入信息,确定空闲的第二存储资源;并将所述第i个令牌存储在空闲的第二存储资源中。In some embodiments, after the i-1th token of the K tokens is stored in an idle first storage resource, token writing information identified by an instruction to which the instruction belongs is further generated, where The token write information is used to indicate that the storage address corresponding to the recently stored token corresponding to the instruction identifier is the address of the first storage resource. Accordingly, an implementation manner of storing the i-th token in the idle second storage resource is: determining the idle second storage resource according to the token write information; and storing the i-th token Tokens are stored in a spare second storage resource.
而且,将第i个令牌存储在空闲的第二存储资源中之后,还更新所述令牌写入信息,更新后的令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第二存储资源的地址。Furthermore, after the i-th token is stored in the idle second storage resource, the token write information is also updated, and the updated token write information is used to indicate that the instruction identifier corresponds to a recently stored token The storage address of is the address of the second storage resource.
可选地,所述令牌写入信息为第三链表结构的令牌写入信息,所述第三链表结构包括写入指示,所述写入指示用于指示所述指令标识对应最近存储的令牌的存储地址。Optionally, the token writing information is token writing information of a third linked list structure, and the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to a recently stored The storage address of the token.
相应地,在读取K个令牌时,若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识的最后一个令牌,则将所述指令标识的令牌写入信息更改为指示所述指令标识对应的最近存储的令牌的存储地址为预设存储地址。Accordingly, when reading K tokens, if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token identified by the instruction, the The token write information of the instruction identifier is changed to indicate that the storage address of the recently stored token corresponding to the instruction identifier is a preset storage address.
因此,本实施例采用链表的形式来保存指令标识的令牌写入信息,可以显著减少现有技术中所需的令牌存储资源。Therefore, in this embodiment, a form of a linked list is used to save the token write information identified by the instruction, which can significantly reduce the token storage resources required in the prior art.
需要说明的是,第一链表结构、第二链表结构、第三链表结构可以保存在同一链表中,也可以保存在不同的链表中。It should be noted that the first linked list structure, the second linked list structure, and the third linked list structure may be stored in the same linked list, or may be stored in different linked lists.
下面举例分别对存储指令的令牌,以及获取指令的令牌的过程进行描述。下面以第一链表结构的令牌的存储信息为令牌存储结构、第二链表结构的指令标识的令牌读取信息为ID读指针存储结构、第三链表结构的指令标识的令牌写入信息为ID写指针存储结构为例进行示意。下面所述的ID表示的是指令所属指令标识。The following describes the token storage instructions and the process of obtaining the tokens of the instructions, respectively. The following uses the storage information of the tokens of the first linked list structure as the token storage structure, and the token reading information of the instruction identifier of the second linked list structure as the ID read pointer storage structure and the token identification of the instruction identifier of the third linked list structure. The information is an ID write pointer storage structure as an example for illustration. The ID described below indicates the instruction ID to which the instruction belongs.
图3为本发明实施例提供的令牌存储结构、ID读指针存储结构、ID写指针存储结构的示意图,如图3所示,在令牌存储结构中,令牌存储结构包括:flag、ind、last、token、next_ptr,其中,flag用于表示同一行中的token是否已存储令牌,例如:flag等于1表示已存储,flag等于0表示未存储。ind表示同一行中的token存储的令牌是否为某个ID的最后一个令牌,例如:ind等于0表示不是,ind等于1表示是。last表示同一行中的token存储的令牌是否为一个指令的最后一个令牌。token用于存储令牌。next_ptr表示相对相同ID的本令牌的下一个令牌的存储位置指针。3 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure according to an embodiment of the present invention. As shown in FIG. 3, in the token storage structure, the token storage structure includes: flag, ind , Last, token, next_ptr, where flag is used to indicate whether the token in the same row has a stored token, for example: flag equal to 1 means stored, and flag equal to 0 means not stored. ind indicates whether the token stored in the same row is the last token of an ID, for example: ind equals 0 means no, and ind equals 1 means yes. last indicates whether the token stored in the token in the same line is the last token of an instruction. token is used to store tokens. next_ptr indicates a pointer to the storage location of the next token of this token relative to the same ID.
在ID读指针存储结构中,以ID作为寻址,即ID=0对应0地址,ID=1对应1地址,ID=2对应2地址,ID=3对应3地址,依次类推。ID读指针存储结构包括:flag、rd_ptr。flag表示本ID之前是否存在有效令牌,flag等于1表示存在,flag等于0表示不存在。rd_ptr用于指向本ID下次要读的令牌的存储地址。In the ID read pointer storage structure, ID is used for addressing, that is, ID = 0 corresponds to 0 address, ID = 1 corresponds to 1 address, ID = 2 corresponds to 2 address, ID = 3 corresponds to 3 address, and so on. The ID read pointer storage structure includes: flag, rd_ptr. flag indicates whether a valid token exists before this ID, flag equals 1 to indicate existence, and flag equals 0 to indicate no existence. rd_ptr is used to point to the storage address of the token to be read next time with this ID.
在ID写指针存储结构中,以ID作为寻址,即ID=0对应0地址,ID=1对应1地址,ID=2对应2地址,ID=3对应3地址,依次类推。ID写指针存储结构包括:wr_ptr。wr_ptr用于指向本ID最新令牌的存储地址。In the ID write pointer storage structure, ID is used for addressing, that is, ID = 0 corresponds to 0 address, ID = 1 corresponds to 1 address, ID = 2 corresponds to 2 address, ID = 3 corresponds to 3 address, and so on. The ID write pointer storage structure includes: wr_ptr. wr_ptr is used to point to the storage address of the latest token of this ID.
需要说明的是,虽然图3中以不同的链表来示出令牌存储结构、ID读指针存储结构、ID写指针存储结构,但本实施例并不限于此。在一些实施例中,令牌存储结构、ID读指针存储结构、ID写指针存储结构中的至少一个可以保存在同一链表中。It should be noted that, although different linked lists are used to illustrate the token storage structure, the ID read pointer storage structure, and the ID write pointer storage structure in FIG. 3, this embodiment is not limited thereto. In some embodiments, at least one of the token storage structure, the ID read pointer storage structure, and the ID write pointer storage structure may be stored in the same linked list.
其中,ID的可能个数是可以根据系统架构和方案预先确定的,但是ID的取值是不可以加以控制的,所以当ID个数为N个,但是其取值不固定是0~N-1,所以可以将N个不同的ID值映射到0~N-1编号上,后续用此编号作为内部ID,在恢复AXI读数据通道的RID信号时,需要将ID编号映射成相应的ID取值。下文提到的ID值都是指0~N-1中的编号信息。Among them, the possible number of IDs can be determined in advance according to the system architecture and scheme, but the value of the ID cannot be controlled, so when the number of IDs is N, but its value is not fixed from 0 to N- 1, so you can map N different ID values to 0 ~ N-1 numbers, and use this number as the internal ID. When recovering the RID signal of the AXI read data channel, you need to map the ID number to the corresponding ID. value. The ID values mentioned below refer to the numbering information in 0 to N-1.
图4为本发明实施例提供的初始化时令牌存储结构、ID读指针存储结构、ID写指针存储结构的示意图,如图4所示,上述的各参数均为0。FIG. 4 is a schematic diagram of a token storage structure, an ID read pointer storage structure, and an ID write pointer storage structure during initialization according to an embodiment of the present invention. As shown in FIG. 4, the foregoing parameters are all 0.
下面基于初始化为图4所示,对令牌的存储过程进行描述。The following describes the storage process of the token based on the initialization as shown in FIG. 4.
S301、接收到5个读指令,分别为指令0-4,对每个指令进行分割。指令0分割为4 个指令片段,对应产生4个令牌,分别为60-63。指令1分割为3个指令片段,对应产生3个令牌,分别为57-59。指令2分割为5个指令片段,对应产生5个令牌,分别为52-56。指令3分割为3个指令片段,对应产生3个令牌,分别为49-51。指令4分割为4个指令片段,对应产生4个令牌,分别为45-48,例如如图5所示。S301. Receive five read instructions, which are instructions 0-4, and divide each instruction. Instruction 0 is divided into 4 instruction fragments, corresponding to the generation of 4 tokens, which are 60-63. Instruction 1 is divided into 3 instruction fragments, corresponding to the generation of 3 tokens, 57-59 respectively. Instruction 2 is divided into 5 instruction fragments, corresponding to the generation of 5 tokens, respectively 52-56. Instruction 3 is divided into three instruction fragments, which correspondingly generate 3 tokens, which are 49-51. Instruction 4 is divided into four instruction fragments, which correspondingly generate 4 tokens, which are 45-48, as shown in FIG. 5 for example.
S302、存储指令0的4个令牌,指令0的ID例如为0。如图6所示,图6为本发明实施例提供的存储指令0的4个令牌的示意图。其中,指令0分割为4个DDR器件指令,所分配的令牌分别为63,62,61,60。S302. The four tokens of instruction 0 are stored, and the ID of instruction 0 is, for example, 0. As shown in FIG. 6, FIG. 6 is a schematic diagram of four tokens of a storage instruction 0 according to an embodiment of the present invention. Among them, instruction 0 is divided into 4 DDR device instructions, and the allocated tokens are 63, 62, 61, 60, respectively.
S3021、存储令牌63:根据令牌存储结构中的flag,找到flag等于0,将令牌63写入这一行的令牌存储结构中的token,并将这行的flag置为1,由于ID为0暂时只写入这一个令牌,该令牌63可以认为是存储的该ID的最后一个令牌,并将该int置为1。并且该令牌63并不是指令的最后一个令牌,所以将last置为0。再根据ID=0所指向的读指针存储结构中flag=0,将该flag置为1,并将这一行的rd_ptr更新为令牌63所存储的指针位置,即是0。由于令牌63的位置指针为0,所以将ID=0所指向的写指针存储结构中的wr_ptr更新为0;执行后示意结果见图6中的步骤A。S3021, Store token 63: According to the flag in the token storage structure, find the flag equal to 0, write the token 63 into the token in the token storage structure of this row, and set the flag of this row to 1, due to the ID If only 0 is written temporarily, the token 63 can be regarded as the last token of the ID stored, and the int is set to 1. And the token 63 is not the last token of the instruction, so last is set to zero. Then according to flag = 0 in the read pointer storage structure pointed to by ID = 0, the flag is set to 1, and the rd_ptr of this line is updated to the pointer position stored by the token 63, which is 0. Since the position pointer of the token 63 is 0, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 0; the schematic result after execution is shown in step A in FIG. 6.
S3022、存储令牌62:找到令牌63的位置指针为0的下一个位置指针(即位置指针为1),并且这个位置指针对应的flag为0,因此,可以找到第二行的令牌存储结构,然后将令牌62写入第二行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第二行中的ind置为1。并且该令牌62并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为0,说明正在存储ID=0对应的令牌,而且第一行中的令牌也是ID=0的令牌,并且第二行中的令牌是ID=0的最新的令牌,所以将第一行中的ind置为0。另外第二行中的令牌是第一行中的令牌的下一个令牌,而且第二行的位置指针为1,所以将第一行中的next_ptr更新为1。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为1,所以ID=0所指向的写指针存储结构中的wr_ptr更新为1,执行后如步骤B。S3022. Store the token 62: find the next position pointer whose position pointer of the token 63 is 0 (that is, the position pointer is 1), and the flag corresponding to this position pointer is 0, so the token storage of the second line can be found Structure, then write the token 62 into the token storage structure of the second line, and set the flag in the token storage structure from 0 to 1, and set the ind in the second line to 1. And the token 62 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 0, indicating that the token corresponding to ID = 0 is being stored, and the token in the first line is also a token with ID = 0, and the command in the second line is The card is the latest token with ID = 0, so set the ind in the first line to zero. In addition, the token in the second line is the next token of the token in the first line, and the position pointer of the second line is 1, so the next_ptr in the first line is updated to 1. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored and the position pointer of the token is 1, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 1. After execution, it is performed as step B.
S3023、存储令牌61:找到令牌62的位置指针为1的下一个位置指针(即位置指针为2),并且这个位置指针对应的flag为0,因此,可以找到第三行的令牌存储结构,然后将令牌61写入第三行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第三行中的ind置为1。并且该令牌61并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为0,说明正在存储ID=0对应的令牌,而且第二行中的令牌也是ID=0的令牌,并且第三行中的令牌是ID=0的最新的令牌,所以将第二行中的ind置为0。另外第三行中的令牌是第二行中的令牌的下一个令牌,而且第三行的指针为2,所以将第二行中的next_ptr更新为2。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为2,所以ID=0所指向的写指针存储结构中的wr_ptr更新为2,执行后如步骤C。S3023. Store the token 61: find the next position pointer whose position pointer of the token 62 is 1 (that is, the position pointer is 2), and the flag corresponding to this position pointer is 0, so the token storage of the third line can be found Structure, and then write the token 61 into the token storage structure of the third line, and set the flag in the token storage structure from 0 to 1, and set the ind in the third line to 1. And the token 61 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 0, indicating that the token corresponding to ID = 0 is being stored, and the token in the second line is also a token with ID = 0, and the command in the third line is The card is the latest token with ID = 0, so set the ind in the second line to zero. In addition, the token in the third line is the next token of the token in the second line, and the pointer in the third line is 2, so the next_ptr in the second line is updated to 2. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored, and the position pointer of the token is 2, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 2. After execution, it is performed as step C.
S3024、存储令牌60:找到令牌61的位置指针为1的下一个位置指针(即位置指针为3),并且这个位置指针对应的flag为0,因此,可以找到第四行的令牌存储结构,然后将令牌60写入第四行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第四行中的ind置为1。并且该令牌60是指令的最后一个令牌,所以将last置为1。 根据ID=0所指向的写指针存储结构中wr_ptr为0,说明正在存储ID=0对应的令牌,而且第三行中的令牌也是ID=0的令牌,并且第四行中的令牌是ID=0的最新的令牌,所以将第三行中的ind置为0。另外第四行中的令牌是第三行中的令牌的下一个令牌,而且第四行的指针为3,所以将第三行中的next_ptr更新为3。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为3,所以ID=0所指向的写指针存储结构中的wr_ptr更新为3,执行后如步骤D。S3024. Store the token 60: find the next position pointer whose position pointer of the token 61 is 1 (that is, the position pointer is 3), and the flag corresponding to this position pointer is 0, so the token storage of the fourth line can be found Structure, and then write the token 60 into the token storage structure of the fourth line, and set the flag in the token storage structure from 0 to 1, and set the ind in the fourth line to 1. And the token 60 is the last token of the instruction, so set last to 1. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 0, indicating that the token corresponding to ID = 0 is being stored, and the token in the third line is also a token with ID = 0, and the command in the fourth line is The card is the latest token with ID = 0, so set ind in the third line to 0. In addition, the token in the fourth line is the next token of the token in the third line, and the pointer in the fourth line is 3, so the next_ptr in the third line is updated to 3. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored and the position pointer of the token is 3, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 3, and then executed as step D.
S303、存储指令1的3个令牌,指令1的ID例如为1。如图7所示,图7为本发明实施例提供的存储指令1的3个令牌的示意图。其中,指令1分割为3个指令片段,所分配的令牌分别为59,58,57。S303. The three tokens of instruction 1 are stored, and the ID of instruction 1 is, for example, 1. As shown in FIG. 7, FIG. 7 is a schematic diagram of three tokens of a storage instruction 1 according to an embodiment of the present invention. Among them, instruction 1 is divided into three instruction fragments, and the allocated tokens are 59, 58, 57 respectively.
S3031、存储令牌59:根据令牌存储结构中的flag,找到空闲的位置指针为4,将令牌59写入这一行的令牌存储结构中的token,并将这行的flag置为1,由于ID为1暂时只写入这一个令牌,该令牌59可以认为是存储的该ID的最后一个令牌,并将该int置为1。并且该令牌59并不是指令的最后一个令牌,所以将last置为0。再根据ID=1所指向的读指针存储结构中flag=0,将该flag置为1,并将这一行的rd_ptr更新为令牌59所存储的指针位置,即是4。将ID=1所指向的写指针存储结构中的wr_ptr更新为4;执行后示意结果见图7中的步骤A。S3031, Store token 59: According to the flag in the token storage structure, find the free position pointer as 4, write the token 59 into the token in the token storage structure of this row, and set the flag of this row to 1. Since only one token is temporarily written with ID 1, the token 59 can be regarded as the last token of the ID stored, and the int is set to 1. And the token 59 is not the last token of the instruction, so last is set to 0. Then according to flag = 0 in the read pointer storage structure pointed to by ID = 1, set the flag to 1, and update the rd_ptr of this line to the pointer position stored by token 59, which is 4. Update wr_ptr in the write pointer storage structure pointed to by ID = 1 to 4; the schematic result after execution is shown in step A in FIG. 7.
S3032、存储令牌58:找到令牌59的位置指针为4的下一个位置指针(即位置指针为5),并且这个位置指针对应的flag为0,因此,可以找到第六行的令牌存储结构,然后将令牌58写入第六行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第六行中的ind置为1。并且该令牌58并不是指令的最后一个令牌,所以将last置为0。根据ID=1所指向的写指针存储结构中wr_ptr为4,说明上一次在位置指针为4的位置写入了令牌,所以将第五行中的ind置为0。另外第六行中的令牌是第五行中的令牌的下一个令牌,而且第六行的位置指针为5,所以将第五行中的next_ptr更新为5。另外,ID=1所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=1的令牌,并且令牌的位置指针为5,所以ID=1所指向的写指针存储结构中的wr_ptr更新为5,执行后如步骤B。S3032. Store token 58: find the next position pointer whose position pointer of token 59 is 4 (that is, the position pointer is 5), and the flag corresponding to this position pointer is 0, so the token storage of the sixth row can be found Structure, and then write the token 58 into the token storage structure of the sixth line, and set the flag in the token storage structure from 0 to 1, and set the ind in the sixth line to 1. And the token 58 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 1, wr_ptr is 4, indicating that the token was written in the position where the position pointer was 4 last time, so the ind in the fifth row is set to 0. In addition, the token in the sixth line is the next token of the token in the fifth line, and the position pointer of the sixth line is 5, so the next_ptr in the fifth line is updated to 5. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 1, the read pointer storage structure is not updated. Since the token with ID = 1 is stored and the position pointer of the token is 5, the wr_ptr in the write pointer storage structure pointed to by ID = 1 is updated to 5, and after execution, it is performed as step B.
S3033、存储令牌57:找到令牌58的位置指针为5的下一个位置指针(即位置指针为6),并且这个位置指针对应的flag为0,因此,可以找到第七行的令牌存储结构,然后将令牌57写入第七行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第七行中的ind置为1。并且该令牌57是指令的最后一个令牌,所以将last置为1。根据ID=1所指向的写指针存储结构中wr_ptr为5,将第六行中的ind置为0。另外第七行中的令牌是第六行中的令牌的下一个令牌,而且第七行的指针为6,所以将第六行中的next_ptr更新为6。另外,ID=1所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=1的令牌,并且令牌的位置指针为6,所以ID=1所指向的写指针存储结构中的wr_ptr更新为6,执行后如步骤C。S3033. Store the token 57: find the next position pointer whose position pointer of the token 58 is 5 (that is, the position pointer is 6), and the flag corresponding to this position pointer is 0, so the token storage of the seventh line can be found Structure, and then write the token 57 into the token storage structure of the seventh line, and set the flag in the token storage structure from 0 to 1, and set the ind in the seventh line to 1. And this token 57 is the last token of the instruction, so set last to 1. According to the write pointer storage structure pointed to by ID = 1, wr_ptr is 5, and the ind in the sixth row is set to 0. In addition, the token in the seventh line is the next token of the token in the sixth line, and the pointer in the seventh line is 6, so the next_ptr in the sixth line is updated to 6. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 1, the read pointer storage structure is not updated. Because the token with ID = 1 is stored, and the position pointer of the token is 6, the wr_ptr in the write pointer storage structure pointed to by ID = 1 is updated to 6, and after execution, it is performed as step C.
S304、存储指令2的5个令牌,指令2的ID例如为0。如图8所示,图8为本发明实施例提供的存储指令2的5个令牌的示意图。其中,指令2分割为5个指令片段,所分配的令牌分别为56,55,54,53,52。S304. The five tokens of instruction 2 are stored, and the ID of instruction 2 is, for example, 0. As shown in FIG. 8, FIG. 8 is a schematic diagram of five tokens of a storage instruction 2 according to an embodiment of the present invention. Among them, instruction 2 is divided into 5 instruction fragments, and the allocated tokens are 56, 55, 54, 53, 52, respectively.
S3041、存储令牌56:根据令牌存储结构中的flag,找到空闲的位置指针为7,将令 牌56写入这一行的令牌存储结构中的token,并将这行的flag置为1,由于ID为1暂时只写入这一个令牌,该令牌56可以认为是存储的该ID的最后一个令牌,并将该int置为1。并且该令牌56并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为3,说明上一次在位置指针为3的位置写入了该ID的令牌,所以将第4行中的ind置为0。另外第八行中的令牌是第四行中的令牌的下一个令牌,而且第八行的位置指针为7,所以将第四行中的next_ptr更新为7。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为7,所以ID=0所指向的写指针存储结构中的wr_ptr更新为7,执行后如步骤A。S3041, Store token 56: According to the flag in the token storage structure, find an idle position pointer as 7, write the token 56 to the token in the token storage structure of this row, and set the flag of this row to 1 Since only one token is temporarily written with ID 1, the token 56 can be considered as the last token of the ID stored, and the int is set to 1. And the token 56 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 3, indicating that the ID token was written in the position pointer of 3 last time, so the ind in the fourth line is set to 0. In addition, the token in the eighth line is the next token of the token in the fourth line, and the position pointer of the eighth line is 7, so the next_ptr in the fourth line is updated to 7. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored and the position pointer of the token is 7, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 7, and after execution, it is performed as step A.
S3042、存储令牌55:找到令牌56的位置指针为7的下一个位置指针(即位置指针为8),并且这个位置指针对应的flag为0,因此,可以找到第九行的令牌存储结构,然后将令牌55写入第九行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第九行中的ind置为1。并且该令牌55并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为7,将第八行中的ind置为0。另外第九行中的令牌是第八行中的令牌的下一个令牌,而且第九行的位置指针为8,所以将第八行中的next_ptr更新为8。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为8,所以ID=0所指向的写指针存储结构中的wr_ptr更新为8,执行后如步骤B。S3042. Store token 55: find the next position pointer whose position pointer of token 56 is 7 (that is, the position pointer is 8), and the flag corresponding to this position pointer is 0, so the token storage of the ninth row can be found Structure, and then write the token 55 into the token storage structure of the ninth line, and set the flag in the token storage structure from 0 to 1, and set the ind in the ninth line to 1. And the token 55 is not the last token of the instruction, so set last to 0. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 7, and ind in the eighth row is set to 0. In addition, the token in the ninth line is the next token of the token in the eighth line, and the position pointer of the ninth line is 8, so the next_ptr in the eighth line is updated to 8. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored, and the position pointer of the token is 8, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 8. After the execution, step B is performed.
S3043、存储令牌54:找到令牌55的位置指针为8的下一个位置指针(即位置指针为9),并且这个位置指针对应的flag为0,因此,可以找到第十行的令牌存储结构,然后将令牌54写入第十行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第十行中的ind置为1。并且该令牌54并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为8,将第九行中的ind置为0。另外第十行中的令牌是第九行中的令牌的下一个令牌,而且第十行的位置指针为9,所以将第九行中的next_ptr更新为9。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为9,所以ID=0所指向的写指针存储结构中的wr_ptr更新为9,执行后如步骤C。S3043. Store the token 54: find the next position pointer whose position pointer of the token 55 is 8 (that is, the position pointer is 9), and the flag corresponding to this position pointer is 0, so the token storage of the tenth row can be found Structure, and then write the token 54 into the token storage structure of the tenth line, and set the flag in the token storage structure from 0 to 1, and set the ind in the tenth line to 1. And the token 54 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 8, and ind in the ninth row is set to 0. In addition, the token in the tenth line is the next token of the token in the ninth line, and the position pointer of the tenth line is 9, so the next_ptr in the ninth line is updated to 9. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored, and the position pointer of the token is 9, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 9, and after execution, it is performed as step C.
S3044、存储令牌53:找到令牌54的位置指针为9的下一个位置指针(即位置指针为10),并且这个位置指针对应的flag为0,因此,可以找到第十一行的令牌存储结构,然后将令牌53写入第十一行的令牌存储结构中,并将该令牌存储结构中的flag由0置为1,并将第十一行中的ind置为1。并且该令牌53并不是指令的最后一个令牌,所以将last置为0。根据ID=0所指向的写指针存储结构中wr_ptr为9,将第十行中的ind置为0。另外第十一行中的令牌是第十行中的令牌的下一个令牌,而且第十一行的位置指针为10,所以将第十行中的next_ptr更新为10。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为10,所以ID=0所指向的写指针存储结构中的wr_ptr更新为10,执行后如步骤D。S3044. Store the token 53: find the next position pointer whose position pointer of the token 54 is 9 (that is, the position pointer is 10), and the flag corresponding to this position pointer is 0, so the token of the eleventh line can be found Storage structure, and then write token 53 into the token storage structure of the eleventh line, and set the flag in the token storage structure from 0 to 1, and set the ind in the eleventh line to 1. And the token 53 is not the last token of the instruction, so last is set to zero. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 9, and ind in the tenth row is set to 0. In addition, the token in the eleventh line is the next token of the token in the tenth line, and the position pointer of the eleventh line is 10, so the next_ptr in the tenth line is updated to 10. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored, and the position pointer of the token is 10, wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 10, and the execution is performed as step D.
S3045、存储令牌52:找到令牌53的位置指针为10的下一个位置指针(即位置指针为11),并且这个位置指针对应的flag为0,因此,可以找到第十二行的令牌存储结构,然后将令牌52写入第十二行的令牌存储结构中,并将该令牌存储结构中的flag由0置为 1,并将第十二行中的ind置为1。并且该令牌52是指令的最后一个令牌,所以将last置为1。根据ID=0所指向的写指针存储结构中wr_ptr为10,将第十一行中的ind置为0。另外第十二行中的令牌是第十一行中的令牌的下一个令牌,而且第十二行的位置指针为11,所以将第十一行中的next_ptr更新为11。另外,ID=0所指向的读指针存储结构中flag=1,则不更新读指针存储结构。由于现在存储的是ID=0的令牌,并且令牌的位置指针为11,所以ID=0所指向的写指针存储结构中的wr_ptr更新为11,执行后如步骤D。S3045. Store the token 52: find the next position pointer whose position pointer of the token 53 is 10 (that is, the position pointer is 11), and the flag corresponding to this position pointer is 0, so the token of the twelfth line can be found Storage structure, and then write the token 52 into the token storage structure of the twelfth line, and set the flag in the token storage structure from 0 to 1, and set the ind in the twelfth line to 1. And the token 52 is the last token of the instruction, so set last to 1. According to the write pointer storage structure pointed to by ID = 0, wr_ptr is 10, and ind in the eleventh row is set to 0. In addition, the token in the twelfth line is the next token of the token in the eleventh line, and the position pointer of the twelfth line is 11, so the next_ptr in the eleventh line is updated to 11. In addition, if flag = 1 in the read pointer storage structure pointed to by ID = 0, the read pointer storage structure is not updated. Because the token with ID = 0 is stored, and the position pointer of the token is 11, the wr_ptr in the write pointer storage structure pointed to by ID = 0 is updated to 11. After execution, it is performed as step D.
其它的指令的令牌存储类似处理,此处不再赘述。The token storage of other instructions is similarly processed, and is not repeated here.
DDR控制器在保存令牌后,对指令进行优化发送给DDR器件,当DDR器件按DDR控制器优化后指令执行顺序返回读数据时,此时令牌顺序同样在DDR控制器内进行了调整,DDR控制器为每个返回数据恢复对应的令牌信息。After the DDR controller saves the token, the instruction is optimized and sent to the DDR device. When the DDR device returns the read data in the order of instruction execution after the DDR controller is optimized, the token order is also adjusted in the DDR controller at this time. The DDR controller recovers the corresponding token information for each returned data.
将返回的读数据先写入Read Reorder Buff中,并将写地址信息使用令牌信息进行保存,供后续读数据使用,并为返回的令牌做好标记信息,例如如图9所示。Write the returned read data into Read Reorder Buff first, and save the write address information with token information for subsequent read data, and make mark information for the returned token, for example, as shown in Figure 9.
下面对DDR控制器在接收上述指令0-2后,分割为指令片段并发送给DDR器件后,再接收DDR器件返回数据的过程进行描述。The following describes the process of the DDR controller after receiving the above instructions 0-2, dividing it into instruction fragments and sending it to the DDR device, and then receiving the data returned by the DDR device.
S401、接收指令0对应的返回数据,如图10所示。S401. Receive the return data corresponding to the instruction 0, as shown in FIG.
由于指令0的ID为0,所以查询读指针存储结构,确定初始读指针为0(即读指针存储结构中第一行中的rd_ptr)。由于ID=0的初始读指针为0,指向令牌存储结构中位置指针=0,即第一行中的令牌存储结构,可以得到相应的令牌为63,DDR控制器判断令牌63相关的令牌(令牌63-60,即属于同一指令的令牌)对应的数据已经返回,然后开始读Read Reorder Buff,根据令牌存储结构以及ID=0的读指针信息为0,以及第四行中的last为1,可以推断出需要读令牌存储结构的位置指针为0,1,2,3,从而读取令牌63,62,61,60,然后将令牌存储结构中位置指针0,1,2,3对应的flag置为0,即将第一、二、三、四行中的flag置为0,释放令牌存储结构,然后再用令牌63,62,61,60查询得到Read Reorder Buff的读地址,从而可以得到正确的指令0的数据。由于令牌63,62,61,60对应的令牌存储结构中int不为1,说明ID=0的令牌还没有释放完,所以ID读指针存储结构中对应ID=0的flag不能清零。当读完令牌63,62,61,60对应的数据后,需要将ID读指针存储结构中对应ID=0的rd_ptr更新为7,用于指向本ID在令牌存储结构中的下次读操作的初始指针位置。Since the ID of the instruction 0 is 0, the read pointer storage structure is queried to determine that the initial read pointer is 0 (ie, rd_ptr in the first row of the read pointer storage structure). Since the initial read pointer of ID = 0 is 0, and the pointer to the position in the token storage structure = 0, that is, the token storage structure in the first line, the corresponding token can be obtained as 63, and the DDR controller judges that the token 63 is related The corresponding data of the token (token 63-60, that is, the token belonging to the same instruction) has been returned, and then starts to read Read Reorder Buff. According to the token storage structure and the read pointer information of ID = 0, it is 0, and the fourth Last in the line is 1, you can infer that the position pointer of the token storage structure needs to be read is 0, 1, 2, 3, so that the token 63, 62, 61, 60 is read, and then the position pointer in the token storage structure is read The flags corresponding to 0, 1, 2, and 3 are set to 0, that is, the flags in the first, second, third, and fourth rows are set to 0, the token storage structure is released, and then the tokens 63, 62, 61, and 60 are queried. Get the read address of the ReadReorder buff, so you can get the correct data for instruction 0. Since the int in the token storage structure corresponding to tokens 63, 62, 61, 60 is not 1, indicating that the token with ID = 0 has not been released, the flag corresponding to ID = 0 in the ID read pointer storage structure cannot be cleared. . After reading the data corresponding to the token 63, 62, 61, 60, the rd_ptr corresponding to ID = 0 in the ID read pointer storage structure needs to be updated to 7 for the next reading of the ID in the token storage structure. The initial pointer position of the operation.
S402、接收指令1对应的返回数据,如图11所示。S402. Receive the return data corresponding to the instruction 1, as shown in FIG. 11.
由于指令1的ID为1,所以查询读指针存储结构,确定初始读指针为4(即读指针存储结构中第二行中的rd_ptr)。由于ID=1的初始读指针为4,指向令牌存储结构中位置指针=4,即第五行中的令牌存储结构,可以得到相应的令牌为59,DDR控制器判断令牌59相关的令牌(令牌59-57,即属于同一指令的令牌)对应的数据已经返回,然后开始读Read Reorder Buff,根据令牌存储结构以及ID=1的读指针信息为4,以及第七行中的last为1,可以推断出需要读令牌存储结构的位置指针为4,5,6,从而读取令牌59,58,57,然后将令牌存储结构中位置指针4,5,6对应的flag置为0,即将第五、六、七行中的flag置为0,释放令牌存储结构,然后再用令牌59,58,57查询得到Read Reorder Buff的读地址,从而可以得到正确的指令1的数据。由于令牌59,58,57对应的令牌存储结构中令牌57对应的int为1,说明ID=1的令牌全部释放完,所以ID读指针存储结构中对应ID=1 的flag需要清零,并将rd_ptr改为0。另外,还要将ID写指针存储结构中ID=1的wr_ptr清零。Since the ID of the instruction 1 is 1, the read pointer storage structure is queried to determine that the initial read pointer is 4 (that is, rd_ptr in the second row of the read pointer storage structure). Since the initial read pointer of ID = 1 is 4, and the pointer to the position in the token storage structure = 4, that is, the token storage structure in the fifth line, the corresponding token can be obtained, and the DDR controller judges that the token 59 is related. The data corresponding to the token (token 59-57, that is, the token belonging to the same instruction) has been returned, and then the read Read Reorder Buff is started. According to the token storage structure and the read pointer information of ID = 1, it is 4, and the seventh line Last in is 1 and it can be inferred that the position pointer of the token storage structure needs to be read is 4, 5, 6 so as to read the token 59, 58, 57 and then the position pointer 4, 5, 6 in the token storage structure The corresponding flag is set to 0, that is, the flags in the fifth, sixth, and seventh rows are set to 0, the token storage structure is released, and then the token 59, 58, 57 is queried to obtain the read address of the Read, Reorder, and Buff. The data of the correct instruction 1. Since the int corresponding to token 57 in the token storage structure corresponding to tokens 59, 58, 57 is 1, indicating that all the tokens with ID = 1 have been released, the flag corresponding to ID = 1 in the ID read pointer storage structure needs to be cleared. Zero and change rd_ptr to 0. In addition, wr_ptr with ID = 1 in the ID write pointer storage structure should also be cleared.
S403、接收指令2对应的返回数据,如图12所示。S403. Receive the return data corresponding to the instruction 2 as shown in FIG.
由于指令2的ID为0,所以查询读指针存储结构,确定初始读指针为7(即读指针存储结构中第八行中的rd_ptr)。由于ID=0的初始读指针为7,指向令牌存储结构中位置指针=7,即第八行中的令牌存储结构,可以得到相应的令牌为56,DDR控制器判断令牌56相关的令牌(令牌56-52,即属于同一指令的令牌)对应的数据已经返回,然后开始读Read Reorder Buff,根据令牌存储结构以及ID=0的读指针信息为7,以及第十二行中的last为1,可以推断出需要读令牌存储结构的位置指针为7,8,9,10,11从而读取令牌56,55,54,53,52,然后将令牌存储结构中位置指针7,8,9,10,11对应的flag置为0,即将第八、九、十、十一、十二行中的flag置为0,释放令牌存储结构,然后再用令牌56,55,54,53,52查询得到Read Reorder Buff的读地址,从而可以得到正确的指令2的数据。由于令牌56,55,54,53,52对应的令牌存储结构中52对应的int为1,说明ID=0的令牌全部释放完,所以ID读指针存储结构中对应ID=0的flag需要清零并将rd_ptr置为0。当读完令牌56,55,54,53,52对应的数据后,需要将ID读指针存储结构中对应ID=0的rd_ptr清零。Since the ID of instruction 2 is 0, the read pointer storage structure is queried to determine that the initial read pointer is 7 (that is, rd_ptr in the eighth row in the read pointer storage structure). Since the initial read pointer of ID = 0 is 7, pointing to the position pointer in the token storage structure = 7, that is, the token storage structure in the eighth line, the corresponding token can be obtained, and the DDR controller judges that the token 56 is related The corresponding data of the token (token 56-52, that is, the token belonging to the same instruction) has been returned, and then read Read Reorder Buff, according to the token storage structure and the read pointer information of ID = 0 is 7, and the tenth Last in the two lines is 1, you can infer that the position pointer that needs to read the token storage structure is 7, 8, 9, 10, 11 to read the token 56, 55, 54, 53, 52, and then store the token The flags corresponding to the position pointers 7, 8, 9, 10, and 11 in the structure are set to 0, that is, the flags in the eighth, nine, ten, eleven, and twelve rows are set to zero. The token storage structure is released, and then used again. The tokens 56, 55, 54, 53, 52 are queried to obtain the read address of Read, Reorder, and Buff, so that the correct command 2 data can be obtained. Since the int corresponding to 52 in the token storage structure corresponding to the tokens 56, 55, 54, 53, and 52 is 1, indicating that all the tokens with ID = 0 have been released, the flag corresponding to ID = 0 in the ID read pointer storage structure is released. Need to be cleared and set rd_ptr to 0. After reading the data corresponding to the tokens 56, 55, 54, 53, 52, the rd_ptr corresponding to ID = 0 in the ID read pointer storage structure needs to be cleared.
可选地,如果发生在令牌读取释放过程又有新的ID或者已有ID有新的令牌需要保存,那么就需要同时修改对应ID的读、写指针信息,并更新指针指向的令牌存储资源中的flag、ind以及next_ptr信息。Optionally, if a new ID or existing ID has a new token to be saved during the token read release process, you need to modify the read and write pointer information of the corresponding ID at the same time, and update the pointer to the command The flag, ind, and next_ptr information in the card storage resource.
通过上述方案,本发明实施例需要用于存储上述令牌存储结构、ID读指针存储结构、ID写指针存储结构的存储资源分别如下所示:With the above solution, the storage resources required to store the token storage structure, ID read pointer storage structure, and ID write pointer storage structure according to the embodiments of the present invention are as follows:
令牌存储资源:2 M*(1+1+1+M+M)bit Token storage resource: 2 M * (1 + 1 + 1 + M + M) bit
ID读指针存储资源:N*M bitID read pointer storage resource: N * M bit
ID写指针存储资源:N*M bitID write pointer storage resource: N * M bit
而采用背景技术中所提成的现有技术需要的存储资源为:N*2 M*M bit。 However, the storage resources required by the existing technology provided in the background technology are: N * 2 M * M bit.
其中,N为上述指令的ID的个数,2 M为DDR器件的指令CAM深度。 Among them, N is the number of IDs of the above instructions, and 2 M is the instruction CAM depth of the DDR device.
下表中数值为本提案相对现有技术节省的存储资源:The values in the following table are the storage resources saved by this proposal compared with the prior art:
N/MN / M 44 55 66 77
44 48bit48bit 184bit184bit 528bit528bit 1352bit1352bit
88 272bit272bit 784bit784bit 2016bit2016bit 4880bit4880bit
1616 720bit720bit 1984bit1984bit 4992bit4992bit 11936bit11936bit
3232 1616bit1616bit 4384bit4384bit 10994bit10994bit 26048bit26048bit
本发明实施例相对于现有技术具有如下改进:多个ID共享令牌存储资源,相对现有技术按ID独自存储令牌,大大减少了逻辑存储资源。Compared with the prior art, the embodiments of the present invention have the following improvements: multiple IDs share token storage resources, and compared with the prior art, tokens are stored by ID alone, which greatly reduces logical storage resources.
图13为本发明一实施例提供的令牌管理装置的结构示意图,如图13所示,本实施例的令牌管理装置1300可以包括:存储器1301和处理器1302。FIG. 13 is a schematic structural diagram of a token management apparatus according to an embodiment of the present invention. As shown in FIG. 13, the token management apparatus 1300 in this embodiment may include a memory 1301 and a processor 1302.
所述存储器1301,用于存储程序代码;The memory 1301 is configured to store program code;
所述处理器1302,用于调用所述存储器1301中存储的所述代码,执行:The processor 1302 is configured to call the code stored in the memory 1301 and execute:
将接收的指令分割为K个指令片段,并为每个指令片段依次分配令牌;Divide the received instruction into K instruction fragments, and allocate tokens for each instruction fragment in turn;
按照分配顺序存储K个令牌,并生成每个令牌的存储信息;Store K tokens in the assigned order and generate storage information for each token;
对所述K个指令片段重新排序,并发送重新排序后的K个指令片段;Reorder the K instruction fragments, and send the reordered K instruction fragments;
其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token.
在一些实施例中,所述处理器1302,还用于:In some embodiments, the processor 1302 is further configured to:
若所述指令为所属指令标识对应的当前存储的第一个指令,则生成所述指令标识的令牌读取信息;If the instruction is the first instruction currently stored corresponding to the corresponding instruction identifier, generating token reading information of the instruction identifier;
所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
在一些实施例中,所述每个令牌的存储信息为第一链表结构的存储信息;所述第一链表结构包括:第一存储指示、第二存储指示和第三存储指示;所述第一存储指示用于指示令牌是否为指令的最后一个令牌,所述第二存储指令用于指示令牌是否为所述指令所属指令标识对应的最后一个令牌,所述第三存储指令用于指示下一个令牌的存储地址。In some embodiments, the storage information of each token is storage information of a first linked list structure; the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction; A storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
在一些实施例中,所述第一链表结构还包括:第四存储指示,所述第四存储指示用于指示对应的存储资源是否已存储令牌。In some embodiments, the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
在一些实施例中,所述处理器1302,具体用于:In some embodiments, the processor 1302 is specifically configured to:
针对所述K个令牌中任意两个相邻的令牌,将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中,并生成所述第i-1个令牌的存储信息,所述第i-1个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,第一存储指示用于指示所述第i-1个令牌不是所述指令的最后一个令牌,所述第二存储指令用于指示所述第i-1个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于指示下一令牌的存储地址为预设存储地址;For any two adjacent tokens of the K tokens, the i-1th token of the K tokens is stored in an idle first storage resource, and the i-1th token is generated The storage information of the token, the fourth storage indication in the storage information of the i-1th token is used to indicate that the corresponding storage resource has stored the token, and the first storage indication is used to indicate the i-1th The token is not the last token of the instruction, the second storage instruction is used to indicate that the i-1th token is the last token corresponding to the instruction ID to which the instruction belongs, and the third storage instruction is used to Indicates that the storage address of the next token is a preset storage address;
将第i个令牌存储在空闲的第二存储资源中,并生成所述第i个令牌的存储信息,所述第i个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,所述第二存储指令用于指示所述第i个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于下一个令牌的存储地址为预设存储地址,当i等于K时,第一存储指示用于指示所述第i个令牌为所述指令的最后一个令牌,当i不等于K时,第一存储指示用于指示所述第i个令牌不是所述指令的最后一个令牌;Storing the i-th token in an idle second storage resource, and generating storage information of the i-th token, and a fourth storage indication in the storage information of the i-th token is used to indicate a corresponding The storage resource has stored a token, the second storage instruction is used to indicate that the i-th token is the last token corresponding to the instruction ID to which the instruction belongs, and the third storage instruction is a storage address for the next token It is a preset storage address. When i is equal to K, the first storage instruction is used to indicate that the i-th token is the last token of the instruction. When i is not equal to K, the first storage instruction is used to indicate The i-th token is not the last token of the instruction;
将所述第i-1个令牌的存储信息中第二存储指示更改为指示所述第i-1个令牌不是指令所属指令标识对应的最后一个令牌,第三存储指示更改为指示下一令牌的存储地址为所述第二存储资源的地址;Changing the second storage instruction in the storage information of the i-1th token to indicate that the i-1th token is not the last token corresponding to the instruction ID to which the instruction belongs, and changing the third storage instruction to the instruction A storage address of a token is an address of the second storage resource;
其中,i为大于等于2且小于等于K的整数。Here, i is an integer of 2 or more and K or less.
在一些实施例中,空闲的第一存储资源与空闲的第二存储资源为空闲的相邻的存储资源。In some embodiments, the idle first storage resource and the idle second storage resource are idle adjacent storage resources.
在一些实施例中,所述令牌读取信息为第二链表结构的令牌读取信息,所述第二链表结构包括第一读取指示,所述第一读取指示用于指示所述指令所属指令标识对应的第一个令牌的存储地址。In some embodiments, the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token corresponding to the instruction ID to which the instruction belongs.
在一些实施例中,所述第二链表结构还包括:第二读取指示,所述第二读取指示用于 指示是否已存储所述指令所属指令标识对应的令牌。In some embodiments, the second linked list structure further includes: a second read instruction, which is used to indicate whether a token corresponding to an instruction identifier to which the instruction belongs is stored.
在一些实施例中,所述处理器1302,具体用于:In some embodiments, the processor 1302 is specifically configured to:
在存储所述指令的第一个令牌之后,生成所述指令标识的令牌读取信息;Generating the token reading information identified by the instruction after storing the first token of the instruction;
其中,所述令牌读取信息中的第二读取指示用于指示已存储所述指令的令牌,所述第一读取指示用于指示所述第一个令牌的存储地址。The second read instruction in the token read information is used to indicate that the instruction has been stored with the token, and the first read instruction is used to indicate the storage address of the first token.
在一些实施例中,所述处理器1302,在将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中之后,还用于:生成所述指令所属指令标识的令牌写入信息,所述令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第一存储资源的地址;In some embodiments, after the processor 1302 stores the (i-1) th token out of the K tokens in an idle first storage resource, it is further configured to: Token write information, where the token write information is used to indicate that a storage address corresponding to a recently stored token corresponding to the instruction identifier is an address of the first storage resource;
所述处理器1302在将第i个令牌存储在空闲的第二存储资源中时,具体用于:根据所述令牌写入信息,确定空闲的第二存储资源;并将所述第i个令牌存储在空闲的第二存储资源中;When the processor 1302 stores the i-th token in an idle second storage resource, the processor 1302 is specifically configured to: determine the idle second storage resource according to the token write information; and store the i-th token Tokens are stored in an idle second storage resource;
所述处理器1302,还用于将第i个令牌存储在空闲的第二存储资源中之后,更新所述令牌写入信息,更新后的令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第二存储资源的地址。The processor 1302 is further configured to update the token write information after storing the i-th token in an idle second storage resource, and the updated token write information is used to indicate the instruction identifier The storage address corresponding to the recently stored token is the address of the second storage resource.
在一些实施例中,所述令牌写入信息为第三链表结构的令牌写入信息,所述第三链表结构包括写入指示,所述写入指示用于指示所述指令标识对应最近存储的令牌的存储地址。In some embodiments, the token writing information is token writing information of a third linked list structure, and the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to the most recent The storage address of the stored token.
本实施例的令牌管理装置,可以用于执行本发明上述方法实施例的有关存储令牌的技术方案,其实现原理和技术效果类似,此处不再赘述。The token management apparatus of this embodiment may be used to execute the technical solution related to storing tokens in the foregoing method embodiments of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
图14为本发明另一实施例提供的令牌管理装置的结构示意图,如图14所示,本实施例的令牌管理装置1400可以包括:存储器1401和处理器1402。FIG. 14 is a schematic structural diagram of a token management apparatus according to another embodiment of the present invention. As shown in FIG. 14, the token management apparatus 1400 of this embodiment may include a memory 1401 and a processor 1402.
所述存储器1401,用于存储程序代码;The memory 1401 is configured to store program code;
所述处理器1402,用于调用所述存储器1401中存储的所述代码,执行:The processor 1402 is configured to call the code stored in the memory 1401, and execute:
接收多个指令片段中每个指令片段所读取的数据,所述多个指令片段包括K个指令片段,所述K个指令片段为一个指令的重新排序后的所有指令片段;Receiving data read by each instruction fragment in a plurality of instruction fragments, the plurality of instruction fragments including K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction;
确定各个指令片段所读取的数据所对应的令牌;Determine the token corresponding to the data read by each instruction fragment;
根据所述指令所属指令标识的令牌读取信息,将所述令牌读取信息指示的存储地址确定为所述指令的第一个令牌的存储地址,并根据所述第一个令牌的存储地址,获取所述第一个令牌;Determine the storage address indicated by the token read information as the storage address of the first token of the instruction according to the token read information identified by the instruction to which the instruction belongs, and according to the first token The storage address of the first token;
根据所述第一个令牌的存储信息,依次获取所述指令的其它K-1个令牌的存储信息;Obtaining the storage information of the other K-1 tokens of the instruction in sequence according to the storage information of the first token;
依次根据所述K-1个令牌的存储信息,获取其它K-1个令牌;Obtaining other K-1 tokens according to the storage information of the K-1 tokens in sequence;
根据获取所述指令的K个令牌的顺序,以及各个指令片段所读取的数据所对应的令牌,对所述K个令牌对应的数据进行重组,获得所述指令所读取的数据;According to the order of obtaining the K tokens of the instruction and the tokens corresponding to the data read by each instruction fragment, the data corresponding to the K tokens is reorganized to obtain the data read by the instruction ;
其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址;The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the next token of the token;
所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
在一些实施例中,所述每个令牌的存储信息为第一链表结构的存储信息;所述第一链表结构包括:第一存储指示、第二存储指示和第三存储指示;所述第一存储指示用于指示 令牌是否为指令的最后一个令牌,所述第二存储指示用于指示令牌是否为所述指令所属指令标识对应的最后一个令牌,所述第三存储指令用于指示下一个令牌的存储地址。In some embodiments, the storage information of each token is storage information of a first linked list structure; the first linked list structure includes: a first storage instruction, a second storage instruction, and a third storage instruction; A storage indication is used to indicate whether the token is the last token of the instruction, and the second storage indication is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the third storage instruction is used Used to indicate the storage address of the next token.
在一些实施例中,所述处理器1402还用于:针对每个令牌的存储信息,在获取到该令牌之后,将该令牌的存储信息中的所述第三存储指示更改为预设存储地址。In some embodiments, the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, change the third storage indication in the storage information of the token to a pre- Set the storage address.
在一些实施例中,所述处理器1402还用于:针对每个令牌的存储信息,在获取到该令牌之后,若该令牌的存储信息中的所述第一存储指示该令牌为指令的最后一个令牌,则将所述第一存储指令更改为指示该令牌不是指令的最后一个令牌。In some embodiments, the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, if the first storage in the storage information of the token indicates the token Is the last token of the instruction, the first storage instruction is changed to indicate that the token is not the last token of the instruction.
在一些实施例中,所述第一链表结构还包括:第四存储指示,所述第四存储指示用于指示对应的存储资源是否已存储令牌。In some embodiments, the first linked list structure further includes: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
在一些实施例中,所述处理器1402还用于:针对每个令牌的存储信息,在获取到该令牌之后,若将该令牌的存储信息中的所述第四存储指示由指示已存储令牌更改为指示未存储令牌。In some embodiments, the processor 1402 is further configured to: for the storage information of each token, after acquiring the token, if the fourth storage indication in the storage information of the token is indicated by The stored token changed to indicate that the token was not stored.
在一些实施例中,所述处理器1402还用于:针对每个令牌的存储信息,在获取到该令牌之后,若该令牌的存储信息中的所述第二存储指示该令牌为指令标识对应的最后一个令牌,则将所述第二存储指令更改为指示该令牌不是指令标识对应的最后一个令牌。In some embodiments, the processor 1402 is further configured to: for the storage information of each token, after obtaining the token, if the second storage in the storage information of the token indicates the token For the last token corresponding to the instruction identifier, the second storage instruction is changed to indicate that the token is not the last token corresponding to the instruction identifier.
在一些实施例中,所述令牌读取信息为第二链表结构的令牌读取信息,所述第二链表结构包括第一读取指示,所述第一读取指示用于指示所述指令的第一个令牌的存储地址。In some embodiments, the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading instruction is used to indicate the reading The storage address of the first token of the instruction.
在一些实施例中,所述处理器1402还用于:In some embodiments, the processor 1402 is further configured to:
若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示预设存储地址;If the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction ID, changing the first reading indication to indicate a preset storage address;
若所述K个令牌中每个令牌的存储信息中第二存储指示该令牌不是所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示第一存储地址;所述第一存储地址为:与指示令牌为指令的最后一个令牌的第一存储指示属于同一存储信息的第三存储指示,所指示的存储地址。If the second storage in the storage information of each of the K tokens indicates that the token is not the last token corresponding to the instruction identifier, changing the first read instruction to indicate the first storage An address; the first storage address is a storage address indicated by a third storage instruction that belongs to the same storage information as the first storage instruction indicating that the token is the last token of the instruction.
在一些实施例中,所述第二链表结构还包括:第二读取指示,所述第二读取指示用于指示是否已存储所述指令的令牌。In some embodiments, the second linked list structure further includes a second read instruction, where the second read instruction is used to indicate whether a token of the instruction has been stored.
在一些实施例中,所述处理器1402还用于:若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第二读取指示更改为指示未存储所述指令的令牌。In some embodiments, the processor 1402 is further configured to: if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction identifier, Then changing the second read instruction to a token indicating that the instruction is not stored.
在一些实施例中,所述处理器1402还用于:若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识的最后一个令牌,则将所述指令标识的令牌写入信息更改为指示所述指令标识对应的最近存储的令牌的存储地址为预设存储地址。In some embodiments, the processor 1402 is further configured to: if the second storage indication in the storage information of one of the K tokens indicates that the token is the last token identified by the instruction, then Changing the token write information of the instruction identifier to indicate that the storage address of the most recently stored token corresponding to the instruction identifier is a preset storage address.
在一些实施例中,所述令牌写入信息为第三链表结构的令牌写入信息,所述第三链表结构包括写入指示,所述写入指示用于指示所述指令标识对应的最近存储的令牌的存储地址。In some embodiments, the token writing information is token writing information of a third linked list structure, and the third linked list structure includes a writing instruction, where the writing instruction is used to indicate that the instruction identifier corresponds to The storage address of the most recently stored token.
本实施例的令牌管理装置,可以用于执行本发明上述方法实施例的有关读取令牌的技术方案,其实现原理和技术效果类似,此处不再赘述。The token management apparatus of this embodiment may be used to execute the technical solution related to reading tokens in the foregoing method embodiment of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
图15为本发明一实施例提供的芯片的结构示意图,如图15所示,本实施例的芯片1500可以包括:DDR控制器1501和DDR器件1502。FIG. 15 is a schematic structural diagram of a chip according to an embodiment of the present invention. As shown in FIG. 15, the chip 1500 in this embodiment may include a DDR controller 1501 and a DDR device 1502.
其中,所述DDR控制器1501,用于执行上述各方法实施例中的令牌管理方法;The DDR controller 1501 is configured to execute the token management method in the foregoing method embodiments;
其中,所述DDR器件1502,用于接收所述DDR器件发送的重新排序后的多个指令片段,并向所述DDR控制器发送每个指令片段所读取的数据。The DDR device 1502 is configured to receive the reordered multiple instruction fragments sent by the DDR device, and send data read by each instruction fragment to the DDR controller.
本实施例的芯片,可以用于执行本发明上述各方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The chip in this embodiment may be used to implement the technical solutions of the foregoing method embodiments of the present invention. The implementation principles and technical effects are similar, and are not described herein again.
图16为本发明一实施例提供的可移动平台的结构示意图,如图16所示,本实施例的可移动平台1600可以包括:机身1601、云台1602以及成像装置1603,所述成像装置1603通过所述云台1602与所述机身1601连接。FIG. 16 is a schematic structural diagram of a movable platform according to an embodiment of the present invention. As shown in FIG. 16, the movable platform 1600 in this embodiment may include a fuselage 1601, a pan-tilt 1602, and an imaging device 1603. The imaging device 1603 is connected to the body 1601 through the pan / tilt 1602.
其中,所述机身1601内包括芯片1604,其中,芯片可以采用图15所示实施例的结构,对应可执行本发明上述各方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The fuselage 1601 includes a chip 1604. The chip may adopt the structure of the embodiment shown in FIG. 15 and correspond to the technical solutions that can implement the foregoing method embodiments of the present invention. The implementation principles and technical effects are similar. Here, No longer.
其中,所述芯片1604还与所述成像装置1603连接,所述芯片1604还用于处理所述成像装置1603采集的图像数据。The chip 1604 is also connected to the imaging device 1603, and the chip 1604 is further configured to process image data collected by the imaging device 1603.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:只读内存(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art may understand that all or part of the steps of the foregoing method embodiments may be completed by a program instructing related hardware. The foregoing program may be stored in a computer-readable storage medium. When the program is executed, the program is executed. Including the steps of the above method embodiment; and the foregoing storage medium includes: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The medium.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features can be equivalently replaced; and these modifications or replacements do not depart from the essence of the corresponding technical solutions of the technical solutions of the embodiments of the present invention. range.

Claims (27)

  1. 一种令牌管理方法,其特征在于,包括:A token management method, comprising:
    将接收的指令分割为K个指令片段,并为每个指令片段依次分配令牌;Divide the received instruction into K instruction fragments, and allocate tokens for each instruction fragment in turn;
    按照分配顺序存储K个令牌,并生成每个令牌的存储信息;Store K tokens in the assigned order and generate storage information for each token;
    对所述K个指令片段重新排序,并发送重新排序后的K个指令片段;Reorder the K instruction fragments, and send the reordered K instruction fragments;
    其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址。The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the token's next token.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    若所述指令为所属指令标识对应的当前存储的第一个指令,则生成所述指令标识的令牌读取信息;If the instruction is the first instruction currently stored corresponding to the corresponding instruction identifier, generating token reading information of the instruction identifier;
    所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
  3. 根据权利要求1或2所述的方法,其特征在于,所述每个令牌的存储信息为第一链表结构的存储信息;所述第一链表结构包括:第一存储指示、第二存储指示和第三存储指示;所述第一存储指示用于指示令牌是否为指令的最后一个令牌,所述第二存储指令用于指示令牌是否为所述指令所属指令标识对应的最后一个令牌,所述第三存储指令用于指示下一个令牌的存储地址。The method according to claim 1 or 2, wherein the storage information of each token is storage information of a first linked list structure; and the first linked list structure comprises: a first storage instruction and a second storage instruction And a third storage instruction; the first storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last instruction corresponding to the instruction identifier to which the instruction belongs The third storage instruction is used to indicate a storage address of a next token.
  4. 根据权利要求3所述的方法,其特征在于,所述第一链表结构还包括:第四存储指示,所述第四存储指示用于指示对应的存储资源是否已存储令牌。The method according to claim 3, wherein the first linked list structure further comprises: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token.
  5. 根据权利要求4所述的方法,其特征在于,所述按照分配顺序存储K个令牌,并生成每个令牌的存储信息,包括:The method according to claim 4, wherein said storing K tokens in an allocation order and generating storage information of each token comprises:
    针对所述K个令牌中任意两个相邻的令牌,将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中,并生成所述第i-1个令牌的存储信息,所述第i-1个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,第一存储指示用于指示所述第i-1个令牌不是所述指令的最后一个令牌,所述第二存储指令用于指示所述第i-1个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于指示下一令牌的存储地址为预设存储地址;For any two adjacent tokens of the K tokens, the i-1th token of the K tokens is stored in an idle first storage resource, and the i-1th token is generated The storage information of the token, the fourth storage indication in the storage information of the i-1th token is used to indicate that the corresponding storage resource has stored the token, and the first storage indication is used to indicate the i-1th The token is not the last token of the instruction, the second storage instruction is used to indicate that the i-1th token is the last token corresponding to the instruction ID to which the instruction belongs, and the third storage instruction is used to Indicates that the storage address of the next token is a preset storage address;
    将第i个令牌存储在空闲的第二存储资源中,并生成所述第i个令牌的存储信息,所述第i个令牌的存储信息中的第四存储指示用于指示对应的存储资源已存储令牌,所述第二存储指令用于指示所述第i个令牌为指令所属指令标识对应的最后一个令牌,所述第三存储指示用于下一个令牌的存储地址为预设存储地址,当i等于K时,第一存储指示用于指示所述第i个令牌为所述指令的最后一个令牌,当i不等于K时,第一存储指示用于指示所述第i个令牌不是所述指令的最后一个令牌;Storing the i-th token in an idle second storage resource, and generating storage information of the i-th token, and a fourth storage indication in the storage information of the i-th token is used to indicate a corresponding The storage resource has stored a token, the second storage instruction is used to indicate that the i-th token is the last token corresponding to the instruction ID to which the instruction belongs, and the third storage instruction is a storage address for the next token It is a preset storage address. When i is equal to K, the first storage instruction is used to indicate that the i-th token is the last token of the instruction. When i is not equal to K, the first storage instruction is used to indicate The i-th token is not the last token of the instruction;
    将所述第i-1个令牌的存储信息中第二存储指示更改为指示所述第i-1个令牌不是指令所属指令标识对应的最后一个令牌,第三存储指示更改为指示下一令牌的存储地址为所述第二存储资源的地址;Changing the second storage instruction in the storage information of the i-1th token to indicate that the i-1th token is not the last token corresponding to the instruction ID to which the instruction belongs, and changing the third storage instruction to the instruction A storage address of a token is an address of the second storage resource;
    其中,i为大于等于2且小于等于K的整数。Here, i is an integer of 2 or more and K or less.
  6. 根据权利要求5所述的方法,其特征在于,空闲的第一存储资源与空闲的第二存 储资源为空闲的相邻的存储资源。The method according to claim 5, wherein the idle first storage resource and the idle second storage resource are idle adjacent storage resources.
  7. 根据权利要求2所述的方法,其特征在于,所述令牌读取信息为第二链表结构的令牌读取信息,所述第二链表结构包括第一读取指示,所述第一读取指示用于指示所述指令所属指令标识对应的第一个令牌的存储地址。The method according to claim 2, wherein the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, and the first reading The fetch instruction is used to indicate a storage address of a first token corresponding to an instruction identifier to which the instruction belongs.
  8. 根据权利要求7所述的方法,其特征在于,所述第二链表结构还包括:第二读取指示,所述第二读取指示用于指示是否已存储所述指令所属指令标识对应的令牌。The method according to claim 7, wherein the second linked list structure further comprises: a second read instruction, the second read instruction is used to indicate whether a command corresponding to an instruction identifier to which the instruction belongs is stored brand.
  9. 根据权利要求8所述的方法,其特征在于,生成所述指令标识的令牌读取信息,包括:The method according to claim 8, wherein generating the token reading information identified by the instruction comprises:
    在存储所述指令的第一个令牌之后,生成所述指令标识的令牌读取信息;Generating the token reading information identified by the instruction after storing the first token of the instruction;
    其中,所述令牌读取信息中的第二读取指示用于指示已存储所述指令的令牌,所述第一读取指示用于指示所述第一个令牌的存储地址。The second read instruction in the token read information is used to indicate that the instruction has been stored with the token, and the first read instruction is used to indicate the storage address of the first token.
  10. 根据权利要求6所述的方法,其特征在于,所述将K个令牌中的第i-1个令牌存储在空闲的第一存储资源中之后,还包括:The method according to claim 6, wherein after storing the (i-1) th token out of the K tokens in an idle first storage resource, the method further comprises:
    生成所述指令所属指令标识的令牌写入信息,所述令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第一存储资源的地址;Generating token writing information of an instruction identifier to which the instruction belongs, where the token writing information is used to indicate that a storage address corresponding to the recently stored token corresponding to the instruction identifier is an address of the first storage resource;
    所述将第i个令牌存储在空闲的第二存储资源中,包括:根据所述令牌写入信息,确定空闲的第二存储资源;并将所述第i个令牌存储在空闲的第二存储资源中;The storing the i-th token in an idle second storage resource includes: determining an idle second storage resource according to the token write information; and storing the i-th token in an idle second storage resource. In the second storage resource;
    所述将第i个令牌存储在空闲的第二存储资源中之后,还包括:更新所述令牌写入信息,更新后的令牌写入信息用于指示所述指令标识对应最近存储的令牌的存储地址为所述第二存储资源的地址。After the i-th token is stored in the idle second storage resource, the method further includes: updating the token writing information, and the updated token writing information is used to indicate that the instruction identifier corresponds to a recently stored The storage address of the token is an address of the second storage resource.
  11. 根据权利要求10所述的方法,其特征在于,所述令牌写入信息为第三链表结构的令牌写入信息,所述第三链表结构包括写入指示,所述写入指示用于指示所述指令标识对应最近存储的令牌的存储地址。The method according to claim 10, wherein the token write information is token write information of a third linked list structure, and the third linked list structure includes a write instruction, and the write instruction is used for Instruct the instruction identifier to correspond to a storage address of a recently stored token.
  12. 一种令牌管理方法,其特征在于,包括:A token management method, comprising:
    接收多个指令片段中每个指令片段所读取的数据,所述多个指令片段包括K个指令片段,所述K个指令片段为一个指令的重新排序后的所有指令片段;Receiving data read by each instruction fragment in a plurality of instruction fragments, the plurality of instruction fragments including K instruction fragments, and the K instruction fragments are all instruction fragments of a reordered instruction;
    确定各个指令片段所读取的数据所对应的令牌;Determine the token corresponding to the data read by each instruction fragment;
    根据所述指令所属指令标识的令牌读取信息,将所述令牌读取信息指示的存储地址确定为所述指令的第一个令牌的存储地址,并根据所述第一个令牌的存储地址,获取所述第一个令牌;Determine the storage address indicated by the token read information as the storage address of the first token of the instruction according to the token read information identified by the instruction to which the instruction belongs, and according to the first token The storage address of the first token;
    根据所述第一个令牌的存储信息,依次获取所述指令的其它K-1个令牌的存储信息;Obtaining the storage information of the other K-1 tokens of the instruction in sequence according to the storage information of the first token;
    依次根据所述K-1个令牌的存储信息,获取其它K-1个令牌;Obtaining other K-1 tokens according to the storage information of the K-1 tokens in sequence;
    根据获取所述指令的K个令牌的顺序,以及各个指令片段所读取的数据所对应的令牌,对所述K个令牌对应的数据进行重组,获得所述指令所读取的数据;According to the order of obtaining the K tokens of the instruction and the tokens corresponding to the data read by each instruction fragment, the data corresponding to the K tokens is reorganized to obtain the data read by the instruction ;
    其中,每个令牌的存储信息用于指示:该令牌是否为所述指令的最后一个令牌、该令牌是否为所述指令所属指令标识对应的最后一个令牌以及所述指令中该令牌的下一个令牌的存储地址;The storage information of each token is used to indicate whether the token is the last token of the instruction, whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, and the instruction in the instruction. The storage address of the next token of the token;
    所述令牌读取信息用于指示所述指令所属指令标识对应的当前存储的第一个令牌的存储地址。The token reading information is used to indicate a storage address of a first token currently stored corresponding to an instruction identifier to which the instruction belongs.
  13. 根据权利要求12所述的方法,其特征在于,所述每个令牌的存储信息为第一链表结构的存储信息;所述第一链表结构包括:第一存储指示、第二存储指示和第三存储指示;所述第一存储指示用于指示令牌是否为指令的最后一个令牌,所述第二存储指示用于指示令牌是否为所述指令所属指令标识对应的最后一个令牌,所述第三存储指令用于指示下一个令牌的存储地址。The method according to claim 12, wherein the storage information of each token is storage information of a first linked list structure; the first linked list structure comprises: a first storage instruction, a second storage instruction, and a first Three storage instructions; the first storage instruction is used to indicate whether the token is the last token of the instruction, and the second storage instruction is used to indicate whether the token is the last token corresponding to the instruction identifier to which the instruction belongs, The third storage instruction is used to indicate a storage address of a next token.
  14. 根据权利要求13所述的方法,其特征在于,还包括:The method according to claim 13, further comprising:
    针对每个令牌的存储信息,在获取到该令牌之后,将该令牌的存储信息中的所述第三存储指示更改为预设存储地址。For the storage information of each token, after acquiring the token, the third storage indication in the storage information of the token is changed to a preset storage address.
  15. 根据权利要求13或14所述的方法,其特征在于,还包括:The method according to claim 13 or 14, further comprising:
    针对每个令牌的存储信息,在获取到该令牌之后,若该令牌的存储信息中的所述第一存储指示该令牌为指令的最后一个令牌,则将所述第一存储指令更改为指示该令牌不是指令的最后一个令牌。For the storage information of each token, after obtaining the token, if the first storage in the storage information of the token indicates that the token is the last token of the instruction, the first storage is stored. The instruction changes to indicate that the token is not the last token of the instruction.
  16. 根据权利要求13-15任一项所述的方法,其特征在于,所述第一链表结构还包括:第四存储指示,所述第四存储指示用于指示对应的存储资源是否已存储令牌。The method according to any one of claims 13-15, wherein the first linked list structure further comprises: a fourth storage indication, where the fourth storage indication is used to indicate whether a corresponding storage resource has stored a token .
  17. 根据权利要求16所述的方法,其特征在于,还包括:The method according to claim 16, further comprising:
    针对每个令牌的存储信息,在获取到该令牌之后,若将该令牌的存储信息中的所述第四存储指示由指示已存储令牌更改为指示未存储令牌。For the storage information of each token, after obtaining the token, if the fourth storage indication in the storage information of the token is changed from indicating that the token is stored to indicating that the token is not stored.
  18. 根据权利要求13-17任一项所述的方法,其特征在于,还包括:The method according to any one of claims 13-17, further comprising:
    针对每个令牌的存储信息,在获取到该令牌之后,若该令牌的存储信息中的所述第二存储指示该令牌为指令标识对应的最后一个令牌,则将所述第二存储指令更改为指示该令牌不是指令标识对应的最后一个令牌。For the storage information of each token, after obtaining the token, if the second storage in the storage information of the token indicates that the token is the last token corresponding to the instruction ID, the The second storage instruction is changed to indicate that the token is not the last token corresponding to the instruction ID.
  19. 根据权利要求13-18任一项所述的方法,其特征在于,所述令牌读取信息为第二链表结构的令牌读取信息,所述第二链表结构包括第一读取指示,所述第一读取指示用于指示所述指令的第一个令牌的存储地址。The method according to any one of claims 13 to 18, wherein the token reading information is token reading information of a second linked list structure, and the second linked list structure includes a first reading instruction, The first read instruction is used to indicate a storage address of a first token of the instruction.
  20. 根据权利要求19所述的方法,其特征在于,还包括:The method according to claim 19, further comprising:
    若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示预设存储地址;If the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction ID, changing the first reading indication to indicate a preset storage address;
    若所述K个令牌中每个令牌的存储信息中第二存储指示该令牌不是所述指令标识对应的最后一个令牌,则将所述第一读取指示更改为指示第一存储地址;所述第一存储地址为:与指示令牌为指令的最后一个令牌的第一存储指示属于同一存储信息的第三存储指示,所指示的存储地址。If the second storage in the storage information of each of the K tokens indicates that the token is not the last token corresponding to the instruction identifier, changing the first read instruction to indicate the first storage An address; the first storage address is a storage address indicated by a third storage instruction that belongs to the same storage information as the first storage instruction indicating that the token is the last token of the instruction.
  21. 根据权利要求19或20所述的方法,其特征在于,所述第二链表结构还包括:第二读取指示,所述第二读取指示用于指示是否已存储所述指令的令牌。The method according to claim 19 or 20, wherein the second linked list structure further comprises: a second read instruction, the second read instruction is used to indicate whether a token of the instruction has been stored.
  22. 根据权利要求21所述的方法,其特征在于,还包括:The method according to claim 21, further comprising:
    若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识对应的最后一个令牌,则将所述第二读取指示更改为指示未存储所述指令的令牌。If the second storage indication in the storage information of one of the K tokens indicates that the token is the last token corresponding to the instruction ID, changing the second read indication to indicate that no The token of the instruction.
  23. 根据权利要求13-22任一项所述的方法,其特征在于,还包括:The method according to any one of claims 13 to 22, further comprising:
    若所述K个令牌中一个令牌的存储信息中第二存储指示指示该令牌为所述指令标识的最后一个令牌,则将所述指令标识的令牌写入信息更改为指示所述指令标识对应的最近 存储的令牌的存储地址为预设存储地址。If the second storage indication in the storage information of one of the K tokens indicates that the token is the last token identified by the instruction, change the token writing information identified by the instruction to the indicated The storage address of the recently stored token corresponding to the instruction identifier is a preset storage address.
  24. 根据权利要求23所述的方法,其特征在于,所述令牌写入信息为第三链表结构的令牌写入信息,所述第三链表结构包括写入指示,所述写入指示用于指示所述指令标识对应的最近存储的令牌的存储地址。The method according to claim 23, wherein the token writing information is token writing information of a third linked list structure, and the third linked list structure includes a writing instruction, and the writing instruction is used for The storage address of the recently stored token corresponding to the instruction identifier is indicated.
  25. 一种令牌管理装置,其特征在于,包括:存储器和处理器;A token management device, comprising: a memory and a processor;
    所述存储器,用于存储程序代码;The memory is used to store program code;
    所述处理器,用于调用所述存储器中存储的所述代码,执行如权利要求1-11任一项所述的令牌管理方法,或者,如权利要求12-24任一项所述的令牌管理方法。The processor is configured to call the code stored in the memory and execute the token management method according to any one of claims 1-11, or the token management method according to any one of claims 12-24 Token management method.
  26. 一种芯片,其特征在于,包括:双倍数据速率DDR控制器和DDR器件;A chip characterized by comprising: a double data rate DDR controller and a DDR device;
    所述DDR控制器,用于执行如权利要求1-11任一项所述的令牌管理方法,以及,如权利要求12-24任一项所述的令牌管理方法;The DDR controller is configured to execute the token management method according to any one of claims 1-11, and the token management method according to any one of claims 12-24;
    所述DDR器件,用于接收所述DDR器件发送的重新排序后的多个指令片段,并向所述DDR控制器发送每个指令片段所读取的数据。The DDR device is configured to receive the reordered multiple instruction fragments sent by the DDR device, and send data read by each instruction fragment to the DDR controller.
  27. 一种可移动平台,其特征在于,机身、云台以及成像装置,所述成像装置通过所述云台与所述机身连接,所述机身内包括如权利要求26所述的芯片;A movable platform, characterized by a fuselage, a gimbal and an imaging device, wherein the imaging device is connected to the fuselage through the gimbal, and the fuselage includes the chip according to claim 26;
    所述芯片还与所述成像装置连接,所述芯片还用于处理所述成像装置采集的图像数据。The chip is also connected to the imaging device, and the chip is further configured to process image data collected by the imaging device.
PCT/CN2018/109206 2018-09-30 2018-09-30 Token management method and apparatus, chip, and mobile platform WO2020062297A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880042195.2A CN110799938A (en) 2018-09-30 2018-09-30 Token management method, device, chip and movable platform
PCT/CN2018/109206 WO2020062297A1 (en) 2018-09-30 2018-09-30 Token management method and apparatus, chip, and mobile platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/109206 WO2020062297A1 (en) 2018-09-30 2018-09-30 Token management method and apparatus, chip, and mobile platform

Publications (1)

Publication Number Publication Date
WO2020062297A1 true WO2020062297A1 (en) 2020-04-02

Family

ID=69438541

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/109206 WO2020062297A1 (en) 2018-09-30 2018-09-30 Token management method and apparatus, chip, and mobile platform

Country Status (2)

Country Link
CN (1) CN110799938A (en)
WO (1) WO2020062297A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060098594A1 (en) * 2004-10-27 2006-05-11 Honeywell International Inc. Machine architecture for event management in a wireless sensor network
CN106843170A (en) * 2016-11-30 2017-06-13 浙江中控软件技术有限公司 Method for scheduling task based on token
CN107276827A (en) * 2017-07-25 2017-10-20 郑州云海信息技术有限公司 Qos implementation method and device in a kind of distributed memory system
CN107450888A (en) * 2016-05-30 2017-12-08 世意法(北京)半导体研发有限责任公司 Zero-overhead loop in embedded dsp

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9251201B2 (en) * 2012-12-14 2016-02-02 Microsoft Technology Licensing, Llc Compatibly extending offload token size
US10133578B2 (en) * 2013-09-06 2018-11-20 Huawei Technologies Co., Ltd. System and method for an asynchronous processor with heterogeneous processors
EP2858323A1 (en) * 2013-10-01 2015-04-08 Enyx SA A method and a device for decoding data streams in reconfigurable platforms
WO2016029444A1 (en) * 2014-08-29 2016-03-03 华为技术有限公司 Instruction execution method and processor
CN106375270B (en) * 2015-07-24 2020-12-08 华为技术有限公司 Token generation and authentication method and authentication server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060098594A1 (en) * 2004-10-27 2006-05-11 Honeywell International Inc. Machine architecture for event management in a wireless sensor network
CN107450888A (en) * 2016-05-30 2017-12-08 世意法(北京)半导体研发有限责任公司 Zero-overhead loop in embedded dsp
CN106843170A (en) * 2016-11-30 2017-06-13 浙江中控软件技术有限公司 Method for scheduling task based on token
CN107276827A (en) * 2017-07-25 2017-10-20 郑州云海信息技术有限公司 Qos implementation method and device in a kind of distributed memory system

Also Published As

Publication number Publication date
CN110799938A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
CN107223244B (en) Localization method and device
CN107864694B (en) System and method for managing data flow of processing nodes in an unmanned vehicle
US9959208B2 (en) Parallel caching architecture and methods for block-based data processing
WO2020192199A1 (en) Aerial survey method and apparatus with redundant aerial photograph elimination function
WO2018120350A1 (en) Method and device for positioning unmanned aerial vehicle
WO2018120351A1 (en) Method and device for positioning unmanned aerial vehicle
WO2020237471A1 (en) Flight route generation method, terminal and unmanned aerial vehicle
WO2019113885A1 (en) Inter-core communication method, processor and multi-processor communication system
WO2019144286A1 (en) Obstacle detection method, mobile platform, and computer readable storage medium
WO2020133197A1 (en) Inter-process communication method and system
US20200059435A1 (en) Data flow scheduling between processors
EP4075272A1 (en) Signal processing device, and vehicle display device comprising same
CN111712687B (en) Aerial survey method, aircraft and storage medium
US20150212795A1 (en) Interfacing with a buffer manager via queues
WO2020062297A1 (en) Token management method and apparatus, chip, and mobile platform
US20210235044A1 (en) Image processing device, camera device, mobile body, image processing method, and program
JP6818982B2 (en) How to store files
WO2020037542A1 (en) Data command processing method, storage chip, storage system and mobile platform
WO2020238966A1 (en) Method and apparatus for transmitting reference navigation point data, and unmanned aerial vehicle
CN112154480B (en) Positioning method and device for movable platform, movable platform and storage medium
JP2019191428A (en) Control device, imaging device, moving body, control method and program
WO2020042186A1 (en) Control method for movable platform, movable platform, terminal device and system
US20200334192A1 (en) Communication method, device, and system
WO2022120818A1 (en) Control apparatus for sensor, method, mobile platform, and storage medium
WO2021081806A1 (en) Method, apparatus and system for time synchronization, and removable platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18934780

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18934780

Country of ref document: EP

Kind code of ref document: A1