1/*
2 * Copyright (c) 2012-2014, TU Delft
3 * Copyright (c) 2012-2014, TU Eindhoven
4 * Copyright (c) 2012-2016, TU Kaiserslautern
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * 3. Neither the name of the copyright holder nor the names of its
19 * contributors may be used to endorse or promote products derived from
20 * this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * Authors: Subash Kannoth, Matthias Jung, Eder Zulian
35 *
36 */
37#ifndef MEMBANKWISEPARAMS_H
38#define MEMBANKWISEPARAMS_H
39
40#include <stdint.h>
41#include <vector>
42#include <algorithm>
43#include <numeric>
44
45namespace Data {
46  class MemBankWiseParams {
47    public:
48      // Set of possible PASR modes
49      enum pasrModes{
50        PASR_0,
51        PASR_1,
52        PASR_2,
53        PASR_3,
54        PASR_4,
55        PASR_5,
56        PASR_6,
57        PASR_7
58      };
59      // List of active banks under the specified PASR mode
60      std::vector<unsigned> activeBanks;
61      // ACT Standby power factor
62      int64_t bwPowerFactRho;
63      // Self-Refresh power factor( true : Bankwise mode)
64      int64_t bwPowerFactSigma;
65      // Bankwise or Normal mode
66      bool bwMode;
67      // Wherther PASR is enabled ( true : enabled )
68      bool flgPASR;
69      //Default constructor
70      MemBankWiseParams();
71      MemBankWiseParams(int64_t factRho, int64_t factSigma,
72                        bool hasPASR, int64_t pasrMode,
73                        bool opMode, unsigned nbrofBanks);
74
75      bool isBankActiveInPasr(const unsigned bankIdx) const;
76  };
77}
78
79#endif // MEMBANKWISEPARAMS_H
80