mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
sim: rx: replace cycle-stats with common profile settings
The common sim-profile option controls whether to keep track of runtime execution (like cycle count), so switch the rx-specific cycle-stats option over to that.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2021-06-12 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* README.txt: Change cycle-stats to sim-profile.
|
||||||
|
* configure.ac: Delete cycle-stats.
|
||||||
|
* mem.c: Change CYCLE_STATS to WITH_PROFILE
|
||||||
|
* rx.c: Likewise.
|
||||||
|
* config.in, configure: Regenerate.
|
||||||
|
|
||||||
2021-06-12 Mike Frysinger <vapier@gentoo.org>
|
2021-06-12 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* aclocal.m4, config.in, configure: Regenerate.
|
* aclocal.m4, config.in, configure: Regenerate.
|
||||||
|
@ -7,8 +7,8 @@ If enabled, the simulator will keep track of how many cycles each
|
|||||||
instruction takes. While not 100% accurate, it is very close,
|
instruction takes. While not 100% accurate, it is very close,
|
||||||
including modelling fetch stalls and register latency.
|
including modelling fetch stalls and register latency.
|
||||||
|
|
||||||
--enable-cycle-stats (default)
|
--enable-sim-profile (default)
|
||||||
--disable-cycle-stats
|
--disable-sim-profile
|
||||||
|
|
||||||
If enabled, specifying "-v" twice on the simulator command line causes
|
If enabled, specifying "-v" twice on the simulator command line causes
|
||||||
the simulator to print statistics on how much time was used by each
|
the simulator to print statistics on how much time was used by each
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
/* --enable-cycle-accurate */
|
/* --enable-cycle-accurate */
|
||||||
#undef CYCLE_ACCURATE
|
#undef CYCLE_ACCURATE
|
||||||
|
|
||||||
/* --enable-cycle-stats */
|
|
||||||
#undef CYCLE_STATS
|
|
||||||
|
|
||||||
/* Define to 1 if translation of program messages to the user's native
|
/* Define to 1 if translation of program messages to the user's native
|
||||||
language is requested. */
|
language is requested. */
|
||||||
#undef ENABLE_NLS
|
#undef ENABLE_NLS
|
||||||
|
26
sim/rx/configure
vendored
26
sim/rx/configure
vendored
@ -769,7 +769,6 @@ enable_libtool_lock
|
|||||||
enable_maintainer_mode
|
enable_maintainer_mode
|
||||||
enable_sim_inline
|
enable_sim_inline
|
||||||
enable_cycle_accurate
|
enable_cycle_accurate
|
||||||
enable_cycle_stats
|
|
||||||
enable_werror
|
enable_werror
|
||||||
enable_build_warnings
|
enable_build_warnings
|
||||||
enable_sim_build_warnings
|
enable_sim_build_warnings
|
||||||
@ -1414,7 +1413,6 @@ Optional Features:
|
|||||||
Specify which functions should be inlined
|
Specify which functions should be inlined
|
||||||
--disable-cycle-accurate
|
--disable-cycle-accurate
|
||||||
Disable cycle accurate simulation (faster runtime)
|
Disable cycle accurate simulation (faster runtime)
|
||||||
--disable-cycle-stats Disable cycle statistics (faster runtime)
|
|
||||||
--enable-werror treat compile warnings as errors
|
--enable-werror treat compile warnings as errors
|
||||||
--enable-build-warnings enable build-time compiler warnings if gcc is used
|
--enable-build-warnings enable build-time compiler warnings if gcc is used
|
||||||
--enable-sim-build-warnings
|
--enable-sim-build-warnings
|
||||||
@ -10746,7 +10744,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 10749 "configure"
|
#line 10747 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -10852,7 +10850,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 10855 "configure"
|
#line 10853 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -11158,32 +11156,12 @@ esac
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-cycle-stats was given.
|
|
||||||
if test "${enable_cycle_stats+set}" = set; then :
|
|
||||||
enableval=$enable_cycle_stats; case "${enableval}" in
|
|
||||||
yes | no) ;;
|
|
||||||
*) as_fn_error $? "bad value ${enableval} given for --enable-cycle-stats option" "$LINENO" 5 ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo enable_cycle_accurate is $enable_cycle_accurate
|
echo enable_cycle_accurate is $enable_cycle_accurate
|
||||||
echo enable_cycle_stats is $enable_cycle_stats
|
|
||||||
|
|
||||||
if test "x${enable_cycle_accurate}" != xno; then
|
if test "x${enable_cycle_accurate}" != xno; then
|
||||||
|
|
||||||
$as_echo "#define CYCLE_ACCURATE 1" >>confdefs.h
|
$as_echo "#define CYCLE_ACCURATE 1" >>confdefs.h
|
||||||
|
|
||||||
|
|
||||||
if test "x${enable_cycle_stats}" != xno; then
|
|
||||||
|
|
||||||
$as_echo "#define CYCLE_STATS 1" >>confdefs.h
|
|
||||||
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if test "x${enable_cycle_stats}" != xno; then
|
|
||||||
as_fn_error $? "cycle-stats not available without cycle-accurate" "$LINENO" 5
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,27 +31,10 @@ yes | no) ;;
|
|||||||
*) AC_MSG_ERROR(bad value ${enableval} given for --enable-cycle-accurate option) ;;
|
*) AC_MSG_ERROR(bad value ${enableval} given for --enable-cycle-accurate option) ;;
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
AC_ARG_ENABLE(cycle-stats,
|
|
||||||
[AS_HELP_STRING([--disable-cycle-stats],
|
|
||||||
[Disable cycle statistics (faster runtime)])],
|
|
||||||
[case "${enableval}" in
|
|
||||||
yes | no) ;;
|
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} given for --enable-cycle-stats option) ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
echo enable_cycle_accurate is $enable_cycle_accurate
|
echo enable_cycle_accurate is $enable_cycle_accurate
|
||||||
echo enable_cycle_stats is $enable_cycle_stats
|
|
||||||
|
|
||||||
if test "x${enable_cycle_accurate}" != xno; then
|
if test "x${enable_cycle_accurate}" != xno; then
|
||||||
AC_DEFINE([CYCLE_ACCURATE], 1, [--enable-cycle-accurate])
|
AC_DEFINE([CYCLE_ACCURATE], 1, [--enable-cycle-accurate])
|
||||||
|
|
||||||
if test "x${enable_cycle_stats}" != xno; then
|
|
||||||
AC_DEFINE([CYCLE_STATS], 1, [--enable-cycle-stats])
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if test "x${enable_cycle_stats}" != xno; then
|
|
||||||
AC_ERROR([cycle-stats not available without cycle-accurate])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SIM_AC_OUTPUT
|
SIM_AC_OUTPUT
|
||||||
|
@ -317,7 +317,7 @@ mem_put_byte (unsigned int address, unsigned char value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
case 0x0008c02b: /* PB.DR */
|
case 0x0008c02b: /* PB.DR */
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
|
32
sim/rx/rx.c
32
sim/rx/rx.c
@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "err.h"
|
#include "err.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
static const char * id_names[] = {
|
static const char * id_names[] = {
|
||||||
"RXO_unknown",
|
"RXO_unknown",
|
||||||
"RXO_mov", /* d = s (signed) */
|
"RXO_mov", /* d = s (signed) */
|
||||||
@ -213,7 +213,7 @@ static int po0;
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
#define STATS(x)
|
#define STATS(x)
|
||||||
#endif /* CYCLE_STATS */
|
#endif /* WITH_PROFILE */
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYCLE_ACCURATE
|
#ifdef CYCLE_ACCURATE
|
||||||
@ -424,7 +424,7 @@ get_op (const RX_Opcode_Decoded *rd, int i)
|
|||||||
if (regs.m2m == M2M_BOTH)
|
if (regs.m2m == M2M_BOTH)
|
||||||
{
|
{
|
||||||
tprintf("src memory stall\n");
|
tprintf("src memory stall\n");
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
memory_stalls ++;
|
memory_stalls ++;
|
||||||
#endif
|
#endif
|
||||||
regs.cycle_count ++;
|
regs.cycle_count ++;
|
||||||
@ -594,7 +594,7 @@ put_op (const RX_Opcode_Decoded *rd, int i, int v)
|
|||||||
{
|
{
|
||||||
tprintf("dst memory stall\n");
|
tprintf("dst memory stall\n");
|
||||||
regs.cycle_count ++;
|
regs.cycle_count ++;
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
memory_stalls ++;
|
memory_stalls ++;
|
||||||
#endif
|
#endif
|
||||||
regs.m2m = 0;
|
regs.m2m = 0;
|
||||||
@ -943,14 +943,14 @@ decode_opcode (void)
|
|||||||
unsigned long opcode_pc;
|
unsigned long opcode_pc;
|
||||||
RX_Data rx_data;
|
RX_Data rx_data;
|
||||||
const RX_Opcode_Decoded *opcode;
|
const RX_Opcode_Decoded *opcode;
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
unsigned long long prev_cycle_count;
|
unsigned long long prev_cycle_count;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CYCLE_ACCURATE
|
#ifdef CYCLE_ACCURATE
|
||||||
unsigned int tx;
|
unsigned int tx;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
prev_cycle_count = regs.cycle_count;
|
prev_cycle_count = regs.cycle_count;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -988,7 +988,7 @@ decode_opcode (void)
|
|||||||
{
|
{
|
||||||
tprintf("1 cycle branch alignment penalty\n");
|
tprintf("1 cycle branch alignment penalty\n");
|
||||||
cycles (branch_alignment_penalty);
|
cycles (branch_alignment_penalty);
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
branch_alignment_stalls ++;
|
branch_alignment_stalls ++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1087,7 +1087,7 @@ decode_opcode (void)
|
|||||||
cycles (3);
|
cycles (3);
|
||||||
branch_alignment_penalty = 1;
|
branch_alignment_penalty = 1;
|
||||||
}
|
}
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
branch_stalls ++;
|
branch_stalls ++;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -1116,7 +1116,7 @@ decode_opcode (void)
|
|||||||
cycles (3);
|
cycles (3);
|
||||||
branch_alignment_penalty = 1;
|
branch_alignment_penalty = 1;
|
||||||
}
|
}
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
branch_stalls ++;
|
branch_stalls ++;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -1754,7 +1754,7 @@ decode_opcode (void)
|
|||||||
/* Note: specs say 5, chip says 3. */
|
/* Note: specs say 5, chip says 3. */
|
||||||
if (regs.fast_return && regs.link_register == regs.r_pc)
|
if (regs.fast_return && regs.link_register == regs.r_pc)
|
||||||
{
|
{
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
fast_returns ++;
|
fast_returns ++;
|
||||||
#endif
|
#endif
|
||||||
tprintf("fast return bonus\n");
|
tprintf("fast return bonus\n");
|
||||||
@ -1796,7 +1796,7 @@ decode_opcode (void)
|
|||||||
if (regs.fast_return && regs.link_register == regs.r_pc)
|
if (regs.fast_return && regs.link_register == regs.r_pc)
|
||||||
{
|
{
|
||||||
tprintf("fast return bonus\n");
|
tprintf("fast return bonus\n");
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
fast_returns ++;
|
fast_returns ++;
|
||||||
#endif
|
#endif
|
||||||
cycles (tx < 3 ? 3 : tx + 1);
|
cycles (tx < 3 ? 3 : tx + 1);
|
||||||
@ -2172,7 +2172,7 @@ decode_opcode (void)
|
|||||||
new_rt = -1;
|
new_rt = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
if (prev_cycle_count == regs.cycle_count)
|
if (prev_cycle_count == regs.cycle_count)
|
||||||
{
|
{
|
||||||
printf("Cycle count not updated! id %s\n", id_names[opcode->id]);
|
printf("Cycle count not updated! id %s\n", id_names[opcode->id]);
|
||||||
@ -2180,7 +2180,7 @@ decode_opcode (void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
if (running_benchmark)
|
if (running_benchmark)
|
||||||
{
|
{
|
||||||
int omap = op_lookup (opcode->op[0].type, opcode->op[1].type, opcode->op[2].type);
|
int omap = op_lookup (opcode->op[0].type, opcode->op[1].type, opcode->op[2].type);
|
||||||
@ -2199,7 +2199,7 @@ decode_opcode (void)
|
|||||||
return RX_MAKE_STEPPED ();
|
return RX_MAKE_STEPPED ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
void
|
void
|
||||||
reset_pipeline_stats (void)
|
reset_pipeline_stats (void)
|
||||||
{
|
{
|
||||||
@ -2227,7 +2227,7 @@ halt_pipeline_stats (void)
|
|||||||
void
|
void
|
||||||
pipeline_stats (void)
|
pipeline_stats (void)
|
||||||
{
|
{
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
int i, o1;
|
int i, o1;
|
||||||
int p, p1;
|
int p, p1;
|
||||||
#endif
|
#endif
|
||||||
@ -2242,7 +2242,7 @@ pipeline_stats (void)
|
|||||||
printf ("cycles: %13s\n", comma (regs.cycle_count));
|
printf ("cycles: %13s\n", comma (regs.cycle_count));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CYCLE_STATS
|
#ifdef WITH_PROFILE
|
||||||
if (benchmark_start_cycle)
|
if (benchmark_start_cycle)
|
||||||
printf ("bmark: %13s\n", comma (benchmark_end_cycle - benchmark_start_cycle));
|
printf ("bmark: %13s\n", comma (benchmark_end_cycle - benchmark_start_cycle));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user