gem5
v21.0.1.0
arch
riscv
bare_metal
fs_workload.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 TU Dresden
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
#ifndef __ARCH_RISCV_BARE_METAL_SYSTEM_HH__
30
#define __ARCH_RISCV_BARE_METAL_SYSTEM_HH__
31
32
#include "params/RiscvBareMetal.hh"
33
#include "
sim/workload.hh
"
34
35
namespace
RiscvISA
36
{
37
38
class
BareMetal
:
public
Workload
39
{
40
protected
:
41
// checker for bare metal application
42
bool
_isBareMetal
;
43
// entry point for simulation
44
Addr
_resetVect
;
45
Loader::ObjectFile
*
bootloader
;
46
Loader::SymbolTable
bootloaderSymtab
;
47
48
public
:
49
PARAMS
(RiscvBareMetal);
50
BareMetal
(
const
Params
&
p
);
51
~BareMetal
();
52
53
void
initState
()
override
;
54
55
Loader::Arch
getArch
()
const override
{
return
bootloader
->
getArch
(); }
56
const
Loader::SymbolTable
&
57
symtab
(
ThreadContext
*tc)
override
58
{
59
return
bootloaderSymtab
;
60
}
61
62
bool
63
insertSymbol
(
const
Loader::Symbol
&symbol)
override
64
{
65
return
bootloaderSymtab
.
insert
(symbol);
66
}
67
68
// return reset vector
69
Addr
resetVect
()
const
{
return
_resetVect
; }
70
71
// return bare metal checker
72
bool
isBareMetal
()
const
{
return
_isBareMetal
; }
73
74
Addr
getEntry
()
const override
{
return
_resetVect
; }
75
};
76
77
}
// namespace RiscvISA
78
79
#endif // __ARCH_RISCV_BARE_METAL_FS_WORKLOAD_HH__
RiscvISA::BareMetal::_isBareMetal
bool _isBareMetal
Definition:
fs_workload.hh:42
RiscvISA::BareMetal::~BareMetal
~BareMetal()
Definition:
fs_workload.cc:49
SimObject::Params
SimObjectParams Params
Definition:
sim_object.hh:162
RiscvISA::BareMetal::PARAMS
PARAMS(RiscvBareMetal)
RiscvISA::BareMetal::getEntry
Addr getEntry() const override
Definition:
fs_workload.hh:74
Workload
Definition:
workload.hh:40
RiscvISA::BareMetal::_resetVect
Addr _resetVect
Definition:
fs_workload.hh:44
Loader::SymbolTable
Definition:
symtab.hh:58
RiscvISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
workload.hh
RiscvISA::BareMetal::symtab
const Loader::SymbolTable & symtab(ThreadContext *tc) override
Definition:
fs_workload.hh:57
RiscvISA
Definition:
fs_workload.cc:37
Loader::ObjectFile
Definition:
object_file.hh:74
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition:
thread_context.hh:88
RiscvISA::BareMetal::resetVect
Addr resetVect() const
Definition:
fs_workload.hh:69
RiscvISA::BareMetal::getArch
Loader::Arch getArch() const override
Definition:
fs_workload.hh:55
RiscvISA::BareMetal::insertSymbol
bool insertSymbol(const Loader::Symbol &symbol) override
Definition:
fs_workload.hh:63
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:148
RiscvISA::BareMetal::bootloader
Loader::ObjectFile * bootloader
Definition:
fs_workload.hh:45
RiscvISA::BareMetal
Definition:
fs_workload.hh:38
RiscvISA::BareMetal::BareMetal
BareMetal(const Params &p)
Definition:
fs_workload.cc:40
Loader::Arch
Arch
Definition:
object_file.hh:44
Loader::ObjectFile::getArch
Arch getArch() const
Definition:
object_file.hh:103
Loader::Symbol
Definition:
symtab.hh:45
RiscvISA::BareMetal::isBareMetal
bool isBareMetal() const
Definition:
fs_workload.hh:72
RiscvISA::BareMetal::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition:
fs_workload.cc:55
RiscvISA::BareMetal::bootloaderSymtab
Loader::SymbolTable bootloaderSymtab
Definition:
fs_workload.hh:46
Loader::SymbolTable::insert
bool insert(const Symbol &symbol)
Definition:
symtab.cc:51
Generated on Tue Jun 22 2021 15:28:20 for gem5 by
doxygen
1.8.17