gem5  v21.0.1.0
se_workload.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Google Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef __SIM_SE_WORKLOAD_HH__
29 #define __SIM_SE_WORKLOAD_HH__
30 
31 #include "params/SEWorkload.hh"
32 #include "sim/workload.hh"
33 
34 class SEWorkload : public Workload
35 {
36  public:
37  using Params = SEWorkloadParams;
38 
39  SEWorkload(const Params &p);
40 
41  Addr
42  getEntry() const override
43  {
44  // This object represents the OS, not the individual processes running
45  // within it.
46  panic("No workload entry point for syscall emulation mode.");
47  }
48 
50  getArch() const override
51  {
52  // ISA specific subclasses should implement this method.
53  // This implemenetation is just to avoid having to implement those for
54  // now, and will be removed in the future.
55  panic("SEWorkload::getArch() not implemented.");
56  }
57 
58  const Loader::SymbolTable &
59  symtab(ThreadContext *) override
60  {
61  // This object represents the OS, not the individual processes running
62  // within it.
63  panic("No workload symbol table for syscall emulation mode.");
64  }
65 
66  bool
67  insertSymbol(const Loader::Symbol &symbol) override
68  {
69  // This object represents the OS, not the individual processes running
70  // within it.
71  panic("No workload symbol table for syscall emulation mode.");
72  }
73 
74  void syscall(ThreadContext *tc) override;
75 
76  // For now, assume the only type of events are system calls.
77  void event(ThreadContext *tc) override { syscall(tc); }
78 };
79 
80 #endif // __SIM_SE_WORKLOAD_HH__
SEWorkload
Definition: se_workload.hh:34
SEWorkload::SEWorkload
SEWorkload(const Params &p)
Definition: se_workload.cc:34
SEWorkload::symtab
const Loader::SymbolTable & symtab(ThreadContext *) override
Definition: se_workload.hh:59
SEWorkload::Params
SEWorkloadParams Params
Definition: se_workload.hh:37
Workload
Definition: workload.hh:40
SEWorkload::getArch
Loader::Arch getArch() const override
Definition: se_workload.hh:50
SEWorkload::event
void event(ThreadContext *tc) override
Definition: se_workload.hh:77
SEWorkload::getEntry
Addr getEntry() const override
Definition: se_workload.hh:42
Loader::SymbolTable
Definition: symtab.hh:58
workload.hh
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
Loader::Arch
Arch
Definition: object_file.hh:44
Loader::Symbol
Definition: symtab.hh:45
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
SEWorkload::insertSymbol
bool insertSymbol(const Loader::Symbol &symbol) override
Definition: se_workload.hh:67
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
SEWorkload::syscall
void syscall(ThreadContext *tc) override
Definition: se_workload.cc:38

Generated on Tue Jun 22 2021 15:28:20 for gem5 by doxygen 1.8.17