]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/bfin/sim-main.h
sim: split sim-signal.h include out
[thirdparty/binutils-gdb.git] / sim / bfin / sim-main.h
CommitLineData
ef016f83
MF
1/* Simulator for Analog Devices Blackfin processors.
2
3666a048 3 Copyright (C) 2005-2021 Free Software Foundation, Inc.
ef016f83
MF
4 Contributed by Analog Devices, Inc.
5
6 This file is part of simulators.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21#ifndef _BFIN_MAIN_SIM_H_
22#define _BFIN_MAIN_SIM_H_
23
24#include "sim-basics.h"
474a2d9f
MF
25#include "arch.h"
26#include "sim-base.h"
ef016f83
MF
27
28#include "bfin-sim.h"
29
30#include "machs.h"
31
ef016f83
MF
32struct _sim_cpu {
33 /* ... simulator specific members ... */
34 struct bfin_cpu_state state;
35 sim_cpu_base base;
36};
37#define BFIN_CPU_STATE ((cpu)->state)
38
85d93de3 39#define STATE_BOARD_DATA(sd) ((struct bfin_board_data *) STATE_ARCH_DATA (sd))
ef016f83
MF
40
41#include "sim-config.h"
42#include "sim-types.h"
43#include "sim-engine.h"
44#include "sim-options.h"
ef016f83
MF
45#include "dv-bfin_trace.h"
46
ef016f83 47#undef CLAMP
bc273e17 48#define CLAMP(a, b, c) min (max (a, b), c)
ef016f83 49
bb11f3ed
MF
50/* TODO: Move all this trace logic to the common code. */
51#define BFIN_TRACE_CORE(cpu, addr, size, map, val) \
ef016f83 52 do { \
bb11f3ed
MF
53 TRACE_CORE (cpu, "%cBUS %s %i bytes @ 0x%08x: 0x%0*x", \
54 map == exec_map ? 'I' : 'D', \
55 map == write_map ? "STORE" : "FETCH", \
56 size, addr, size * 2, val); \
ef016f83
MF
57 PROFILE_COUNT_CORE (cpu, addr, size, map); \
58 } while (0)
bb11f3ed 59#define BFIN_TRACE_BRANCH(cpu, oldpc, newpc, hwloop, fmt, ...) \
ef016f83 60 do { \
bb11f3ed 61 TRACE_BRANCH (cpu, fmt " to %#x", ## __VA_ARGS__, newpc); \
ef016f83
MF
62 if (STATE_ENVIRONMENT (CPU_STATE (cpu)) == OPERATING_ENVIRONMENT) \
63 bfin_trace_queue (cpu, oldpc, newpc, hwloop); \
64 } while (0)
65
ef016f83
MF
66/* Default memory size. */
67#define BFIN_DEFAULT_MEM_SIZE (128 * 1024 * 1024)
68
69#endif