From 4a3e2633d2d90d44b0fe7306f35774b865217fa5 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Tue, 8 Oct 2024 11:23:14 +0200 Subject: [PATCH] cpu-o3: Add Matrix OpDesc to the O3 Default FU (#1640) There was a bug exposed by a recent PR [1] where until recently the O3 CPU was executing an instruction even if it did not have the required functional unit in the FU pool. We are adding the matrix descriptors to the Default FU pool in the O3 cpu so that no panic is encountered upon executing of a matrix instruction [1]: https://github.com/gem5/gem5/pull/1516 Change-Id: I04250255a2cbb2ee6f3ef204b62bc2c1ee2d4d2c Reviewed-by: Richard Cooper Signed-off-by: Giacomo Travaglini --- src/cpu/o3/FUPool.py | 3 ++- src/cpu/o3/FuncUnitConfig.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cpu/o3/FUPool.py b/src/cpu/o3/FUPool.py index 67f523787b..b82b450700 100644 --- a/src/cpu/o3/FUPool.py +++ b/src/cpu/o3/FUPool.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 ARM Limited +# Copyright (c) 2017, 2024 Arm Limited # All rights reserved # # The license below extends only to copyright in the software and shall @@ -57,6 +57,7 @@ class DefaultFUPool(FUPool): FP_MultDiv(), ReadPort(), SIMD_Unit(), + Matrix_Unit(), PredALU(), WritePort(), RdWrPort(), diff --git a/src/cpu/o3/FuncUnitConfig.py b/src/cpu/o3/FuncUnitConfig.py index d60990fa3a..5606046f5e 100644 --- a/src/cpu/o3/FuncUnitConfig.py +++ b/src/cpu/o3/FuncUnitConfig.py @@ -121,6 +121,15 @@ class SIMD_Unit(FUDesc): count = 4 +class Matrix_Unit(FUDesc): + opList = [ + OpDesc(opClass="Matrix"), + OpDesc(opClass="MatrixMov"), + OpDesc(opClass="MatrixOP"), + ] + count = 1 + + class PredALU(FUDesc): opList = [OpDesc(opClass="SimdPredAlu")] count = 1