The invention discloses a reconfigurable
tensor calculation unit, which comprises a pipeline controller, a processor and a processor, wherein the pipeline controller is responsible for analyzing an instruction, configuring a calculation mode and scheduling a task; the matrix calculation module is composed of reconfigurable subarrays and is used for executing multi-precision
matrix multiplication and addition operation; the matrix cache module comprises four types of caches; and the AXI
bus access module is used for realizing efficient data interaction with an off-
chip memory through a DMA (
Direct Memory Access) controller. Firstly, a matrix
base address, calculation precision, a
mixed mode mark and a target dimension are configured through a register; and then the DMA carries the matrix data into a corresponding cache through an AXI
bus. The cache carries out dynamic recombination on the data according to the
current mode and then sends the data to the
reconfigurable array for calculation. After calculation is completed, a result is recombined through the D cache and written back to the memory. By using the
tensor accelerator, the defects of an existing
tensor accelerator in the aspects of flexibility, energy efficiency and hardware
resource utilization rate can be overcome. The method can be widely applied to the field of hardware accelerators.