# US 2023/0068290 A1 · Implementation method and system of risc_v vector instruction set vsetvli instruction

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0068290 A1
- Document ID: US20230068290A1
- Status: Published application
- Kind: A1
- Application number: 17/981,365
- Filed: 2022-11-04
- Published: 2023-03-02
- Earliest claimed: 2021-03-22
- Assignees: Guangdong StarFive Technology Co., Ltd.
- Applicants: Guangdong StarFive Technology Co., Ltd.
- Inventors: Changlin Li; Chi Zhang
- Web page: https://patentgrep.com/patent/US20230068290A1

## CPC

- G06F 9/3836: {Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30076: {to perform miscellaneous control operations, e.g. NOP}
- G06F 9/384: {Register renaming}
- G06F 9/3856: {Reordering of instructions, e.g. using queues or age tags}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

The invention relates to the technical field of CPUs, in particular to a method and system for implementing a risc_v vector instruction set vsetvli instruction. it allocates vectag[n:0] information in the rename module when the CPU executes out of order, and determines whether the instruction is vsetvli. If the instruction is vsetvli, vectag+1 is added. If it is a non-vsetvli instruction, the vectag remains unchanged; it is sent to the execution unit, and the vsetvli instruction is distributed to the csr module; and the corresponding other vector instructions are distributed to the vpu module. The non-vsetvli{i} Vector instruction execution efficiency of the present invention is high. Data is selected by mask, which reduces power consumption, reduces execution cycle and latency, and has strong market application prospects.

## Claims

### Claim at position 1

1-7. (canceled)

### Claim 8

A method for realizing vsetvli instructions in a risc_v vector instruction set, the method comprising the following steps:
step S1: when a CPU is executed out of order, allocating vectag [n:0] information in a rename module to determine whether an instruction is a vsetvli instruction;
Step S2: if the instruction is vsetvli instruction, performing vectag+1, if the instruction is not vsetvli instructions, keeping vectag unchanged;
Step S3: distributing one or more vsetvli instructions to a csr module, and distributing one or more other vector instructions to a vpu module;
Step S4: when the vectag information of one or more instructions is determined to be consistent with a vectag broadcast by an ROB module, transmitting the one or more instructions from a reserve station to an execution unit; and
Step S5: completing execution of the one or more instructions, in the ROB module, graduating in order, and updating a register vectag when graduating.

### Claim 9 (depends on 8)

The method according to claim 8, wherein each cycle emits 0-5 instructions.

### Claim 10 (depends on 9)

The method according to claim 9, wherein, if the vsetvli instructions are accepted, a cycle only transmits the vsetvli instructions, each cycle allocates one vectag, and other instructions are not transmitted until the next cycle.

### Claim 11 (depends on 8)

The method according to claim 8, wherein:
active element is transmitted to the execution unit, and
unactive element is not transmitted to the execution unit.

### Claim 12 (depends on 8)

The method according to claim 8, further comprising: comparing the vectag information of an instruction in the reserve station with the register vectag, and only if the vectag information is consistent with the register vectag, transmitting the instruction comprising the vectag information to the execution unit.

### Claim 13 (depends on 8)

The method according to claim 8, wherein vectag [n:0] is allocated in the rename module as a condition for other vector instructions to be transmitted to the execution unit, so that a pipeline is not refreshed when the vsetvli instructions are executed.

### Claim 14

A system for realizing risc_v vector instruction set vsetvli instructions, the system comprising a rename module, a dispatch module, a vpu module and an ROB module; wherein the system is used for implementing risc_v vector instruction set vsetvli instructions by performing methods comprising steps of:
step S1: when a CPU is executed out of order, allocating vectag [n:0] information in a rename module to determine whether an instruction is a vsetvli instruction;
Step S2: if the instruction is vsetvli instruction, performing vectag+1, if the instruction is not vsetvli instructions, keeping vectag unchanged;
Step S3: distributing one or more vsetvli instructions to a csr module, and distributing one or more other vector instructions to a vpu module;
Step S4: when the vectag information of one or more instructions is determined to be consistent with a vectag broadcast by an ROB module, transmitting the one or more instructions from a reserve station to an execution unit; and
Step S5: completing execution of the one or more instructions, in the ROB module, graduating in order, and updating a register vectag when graduating.

### Claim 15 (depends on 14)

The system according to claim 14, wherein each cycle emits 0-5 instructions.

### Claim 16 (depends on 15)

The system according to claim 15, wherein, if the vsetvli instructions are accepted, a cycle only transmits the vsetvli instructions, each cycle allocates one vectag, and other instructions are not transmitted until the next cycle.

### Claim 17 (depends on 14)

The system according to claim 14, wherein:
active element is transmitted to the execution unit, and
unactive element is not transmitted to the execution unit.

### Claim 18 (depends on 14)

The system according to claim 14, wherein the steps further comprise:
comparing the vectag information of an instruction in the reserve station with the register vectag, and only if the vectag information is consistent with the register vectag, transmitting the instruction comprising the vectag information to the execution unit.

### Claim 19 (depends on 14)

The system according to claim 14, wherein vectag [n:0] is allocated in the rename module as a condition for other vector instructions to be transmitted to the execution unit, so that a pipeline is not refreshed when the vsetvli instructions are executed.
