gem5 v24.0.0.0
Loading...
Searching...
No Matches
vector.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 PLCT Lab
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29
30#ifndef __ARCH_RISCV_REGS_VECTOR_HH__
31#define __ARCH_RISCV_REGS_VECTOR_HH__
32
33#include <cstdint>
34#include <string>
35#include <vector>
36
39#include "arch/riscv/types.hh"
40#include "base/bitunion.hh"
41#include "cpu/reg_class.hh"
42#include "debug/VecRegs.hh"
43
44namespace gem5
45{
46
47namespace RiscvISA
48{
49
52
53
54const int NumVecStandardRegs = 32;
55const int NumVecInternalRegs = 8; // Used by vector uop
57
59 "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
60 "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15",
61 "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
62 "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
63 "vtmp0", "vtmp1", "vtmp2", "vtmp3", "vtmp4", "vtmp5", "vtmp6", "vtmp7"
64};
65
66// vector index
68
70
71inline constexpr RegClass vecRegClass =
73 ops(vecRegClassOps).
74 regType<VecRegContainer>();
75
77 Bitfield<63> vill;
78 Bitfield<7, 0> vtype8;
79 Bitfield<7> vma;
80 Bitfield<6> vta;
81 Bitfield<5, 3> vsew;
82 Bitfield<2, 0> vlmul;
83EndBitUnion(VTYPE)
84
85} // namespace RiscvISA
86} // namespace gem5
87
88#endif // __ARCH_RISCV_REGS_VECTOR_HH__
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition vec_reg.hh:126
STL vector class.
Definition stl.hh:37
#define BitUnion64(name)
Use this to define conveniently sized values overlayed with bitfields.
Definition bitunion.hh:494
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Definition bitunion.hh:428
Bitfield< 7 > vma
Definition vector.hh:79
const int VecMemInternalReg0
Definition vector.hh:67
Bitfield< 40 > vill
Definition types.hh:63
Bitfield< 6 > vta
Definition vector.hh:80
static TypedRegClassOps< RiscvISA::VecRegContainer > vecRegClassOps
Definition vector.hh:69
const int NumVecInternalRegs
Definition vector.hh:55
Bitfield< 5, 3 > vsew
Definition vector.hh:81
gem5::VecRegContainer< MaxVecLenInBytes > VecRegContainer
Definition vector.hh:50
const std::vector< std::string > VecRegNames
Definition vector.hh:58
const int NumVecStandardRegs
Definition vector.hh:54
Bitfield< 2, 0 > vlmul
Definition vector.hh:82
constexpr RegClass vecRegClass
Definition vector.hh:71
const int NumVecRegs
Definition vector.hh:56
Bitfield< 7, 0 > vtype8
Definition vector.hh:78
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
constexpr char VecRegClassName[]
Definition reg_class.hh:77
@ VecRegClass
Vector Register.
Definition reg_class.hh:64
Vector Registers layout specification.

Generated on Tue Jun 18 2024 16:24:00 for gem5 by doxygen 1.11.0