|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Fri Feb 18 18:05:56 CET 2005
Subject: [openrisc] [or1ksim #30] Remove `fast sim'
Hi,As agreed, this removes --enable-fsim. ChangeLog: * Remove FAST_SIM, it nolonger provides a speed up.
nog. -------------- next part -------------- --- configure.in 2005-02-09 18:03:30.000000000 +0100 +++ ../or1ksim-ac/configure.in 2005-02-18 17:30:36.000000000 +0100 @@ -105,17 +105,6 @@ ]) AC_MSG_RESULT(${enable_profiling-no}) -fast_sim="0" -AC_MSG_CHECKING(whether to compile fsim) -AC_ARG_ENABLE(fsim, - [ --enable-fsim compiles fsim, based on fast_config.c], [ - case "$enableval" in - no) fast_sim="0" ;; - yes) fast_sim="1" ;; - esac -]) -AC_MSG_RESULT(${enable_fsim-no}) - simple_execution="0" INCLUDES="-I\${top_builddir}/cpu/$CPU_ARCH" AC_MSG_CHECKING(whether to use simple execution) @@ -173,7 +162,6 @@ ]) AC_MSG_RESULT(${enable_arith_flag-no}) -AC_DEFINE_UNQUOTED(FAST_SIM, $fast_sim) AC_DEFINE_UNQUOTED(RAW_RANGE_STATS, $raw_range_stats) AC_DEFINE_UNQUOTED(SET_OV_FLAG, $set_ov_flag) AC_DEFINE_UNQUOTED(ARITH_SET_FLAG, $set_arith_flag) --- sim-config.h 2005-02-12 10:07:40.000000000 +0100 +++ ../or1ksim-ac/sim-config.h 2005-02-18 17:31:10.000000000 +0100 @@ -250,13 +243,7 @@ } cuc; }; -#if FAST_SIM -#include "fast_config.c" -#define IFF(x) if (x) -#else extern struct config config; -#define IFF(x) if (1) -#endif #define PRINTF(x...) fprintf (runtime.sim.fout, x) --- acconfig.h 2002-05-13 14:58:21.000000000 +0200 +++ ../or1ksim-ac/acconfig.h 2005-02-18 17:32:34.000000000 +0100 @@ -9,9 +9,6 @@ /* Whether the compiler supports 'long long'. */ #define CC_HAS_LONG_LONG -/* Whether we are building fsim */ -#define FAST_SIM 0 - /* Whether we have ethernet PHY support */ #define HAVE_ETH_PHY 0 --- cpu/or32/insnset.c 2005-02-12 12:37:05.000000000 +0100 +++ ../or1ksim-ac/cpu/or32/insnset.c 2005-02-18 17:34:49.000000000 +0100 @@ -64,7 +64,7 @@ } INSTRUCTION (l_sw) { int old_cyc = 0; - IFF (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; + if (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; set_mem32(PARAM0, PARAM1, &breakpoint); if (config.cpu.sbuf_len) { int t = runtime.sim.mem_cycles; @@ -74,7 +74,7 @@ } INSTRUCTION (l_sb) { int old_cyc = 0; - IFF (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; + if (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; set_mem8(PARAM0, PARAM1, &breakpoint); if (config.cpu.sbuf_len) { int t = runtime.sim.mem_cycles; @@ -84,7 +84,7 @@ } INSTRUCTION (l_sh) { int old_cyc = 0; - IFF (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; + if (config.cpu.sbuf_len) old_cyc = runtime.sim.mem_cycles; set_mem16(PARAM0, PARAM1, &breakpoint); if (config.cpu.sbuf_len) { int t = runtime.sim.mem_cycles; --- cpu/common/abstract.c 2005-02-12 12:37:05.000000000 +0100 +++ ../or1ksim-ac/cpu/common/abstract.c 2005-02-18 17:36:16.000000000 +0100 @@ -173,17 +173,10 @@ return cur_area; /* When mc is enabled, we must check valid also, otherwise we assume it is nonzero */ - IFF (config.mc.enabled) { - /* Check list of registered devices. */ - for(ptmp = dev_list; ptmp; ptmp = ptmp->next) - if ((addr & ptmp->addr_mask) == (ptmp->addr_compare & ptmp->addr_mask) && ptmp->valid) - return cur_area = ptmp;
- } else {
- /* Check list of registered devices. */
- for(ptmp = dev_list; ptmp; ptmp = ptmp->next)
- if ((addr & ptmp->addr_mask) == (ptmp->addr_compare & ptmp->addr_mask))
- return cur_area = ptmp;
- }
+ /* Check list of registered devices. */
+ for(ptmp = dev_list; ptmp; ptmp = ptmp->next)
+ if ((addr & ptmp->addr_mask) == (ptmp->addr_compare & ptmp->addr_mask) && ptmp->valid)
+ return cur_area = ptmp;
return cur_area = NULL;
}
--- sim-cmd.c 2005-02-12 12:37:05.000000000 +0100
+++ ../or1ksim-ac/sim-cmd.c 2005-02-18 17:48:01.000000000 +0100
@@ -134,13 +134,11 @@
PRINTF("dv <fromaddr> [<toaddr>] [<modname>] - dumps memory as verilog (use redirect)\n");
PRINTF("dh <fromaddr> [<toaddr>] - dumps memory as hex code (use redirect)\n");
PRINTF("<cmd> > <filename> - redirect simulator stdout to <filename> (and not emulated PRINTF)\n");
-#if !FAST_SIM
PRINTF("set <section> <item> = <param> - set configuration. See sim.cfg for more information.\n");
PRINTF("debug - toggles simulator debug mode\n");
mp_help ();
prof_help ();
PRINTF("cuc - enters Custom Unit Compiler command prompt\n");
-#endif
PRINTF("help - available commands (this list)\n");
return 0;
}
@@ -425,7 +432,6 @@
return 0;
}
-#if !FAST_SIM
static int sim_cmd_debug(int argc, char **argv) /* debug mode */
{
config.sim.debug ^= 1;
@@ -455,7 +461,6 @@
set_config_command(argc, argv);
return 0;
}
-#endif /* !FAST_SIM */
static char *strip_space(char *str)
{
@@ -489,13 +494,11 @@
{ "stats", sim_cmd_stats },
{ "info", sim_cmd_info },
{ "run", sim_cmd_run },
-#if !FAST_SIM
{ "debug", sim_cmd_debug },
{ "profile", sim_cmd_profile },
{ "mprofile", sim_cmd_mprofile },
{ "cuc", sim_cmd_cuc },
{ "set", sim_cmd_set },
-#endif
{ NULL, NULL } };
#ifdef HAVE_LIBREADLINE
--- sim-config.c 2005-02-12 12:37:05.000000000 +0100
+++ ../or1ksim-ac/sim-config.c 2005-02-18 17:49:48.000000000 +0100
@@ -52,9 +52,7 @@
#define WARNING(s) fprintf (stderr, "WARNING: config.%s: %s\n", cur_section->name, (s))
#define MERROR(s) {fprintf (stderr, "ERROR: %s\n", s); if (runtime.sim.init) exit (1);}
-#if !FAST_SIM
struct config config;
-#endif
struct runtime runtime;
struct config_section *cur_section;
@@ -65,7 +63,6 @@
{
int i;
-#if !FAST_SIM
memset(&config, 0, sizeof(config));
/* Sim */
config.sim.exe_log = 0;
@@ -152,8 +149,6 @@
config.cuc.enable_bursts = 1;
config.cuc.no_multicycle = 1;
-#endif
-
/* Configure runtime */
memset(&runtime, 0, sizeof(runtime));
@@ -189,7 +184,6 @@
argc--;
argv++;
} else
-#if !FAST_SIM /* Constant cfg */
if (strcmp(*argv, "-f") == 0 || strcmp(*argv, "--file") == 0) {
argv++; argc--;
if (argv[0]) {
@@ -200,7 +194,6 @@
return 1;
}
} else
-#endif
if (strcmp(*argv, "--nosrv") == 0) { /* (CZ) */
config.debug.gdb_enabled = 0;
argv++; argc--;
@@ -224,7 +217,6 @@
version();
exit(0);
} else
-#if !FAST_SIM
if (strcmp(*argv, "--enable-profile") == 0) {
runtime.simcmd.profile = 1;
argv++; argc--;
@@ -233,7 +225,6 @@
runtime.simcmd.mprofile = 1;
argv++; argc--;
} else
-#endif
if (strcmp(*argv, "--output-cfg") == 0) {
runtime.sim.output_cfg = 1;
argv++; argc--;
@@ -285,7 +276,6 @@
}
}
-#if !FAST_SIM
struct config_param {
char *name;
enum param_t type;
@@ -875,7 +866,6 @@
break;
}
}
-#endif /* !FAST_SIM */
/* Outputs C structure of current config to file */
void output_cfg (FILE *f)
--- toplevel.c 2005-02-18 18:02:01.000000000 +0100
+++ ../or1ksim-test/toplevel.c 2005-02-18 17:55:37.000000000 +0100
@@ -254,34 +254,28 @@
}
}
-#if !FAST_SIM /* We assume we have valid configuration with fsim*/
/* Disable gdb debugging, if debug module is not available. */
if (config.debug.gdb_enabled && !config.debug.enabled) {
config.debug.gdb_enabled = 0;
if (config.sim.verbose)
fprintf (stderr, "WARNING: Debug module not enabled, cannot start gdb.\n");
}
-#endif
if (config.debug.gdb_enabled)
gdbcomm_init ();
-#if !FAST_SIM /* We assume we have valid configuration with fsim*/
/* Enable dependency stats, if we want to do history analisis */
if (config.sim.history && !config.cpu.dependstats) {
config.cpu.dependstats = 1;
if (config.sim.verbose)
fprintf (stderr, "WARNING: dependstats stats must be enabled to do history analisis.\n");
}
-#endif
-#if !FAST_SIM /* We assume we have valid configuration with fsim*/
/* Debug forces verbose */
if (config.sim.debug && !config.sim.verbose) {
config.sim.verbose = 1;
fprintf (stderr, "WARNING: verbose turned on.\n");
}
-#endif
/* Start VAPI before device initialization. */
if (config.vapi.enabled) {
@@ -360,11 +354,9 @@
PRINTF(" -i enable interactive command prompt\n");
PRINTF(" --nosrv do not launch JTAG proxy server\n"); /* (CZ) */
PRINTF(" --srv <n> launch JTAG proxy server on port <n>; [random]\n"); /* (CZ) */
-#if !FAST_SIM
PRINTF(" -f or --file load script file [sim.cfg]\n");
PRINTF(" --enable-profile enable profiling.\n");
PRINTF(" --enable-mprofile enable memory profiling.\n");
-#endif
PRINTF(" --output-cfg prints C structure of current\n");
PRINTF(" configuration to standard output\n");
PRINTF("\nor : %s ", argv[0]);
@@ -374,7 +366,6 @@
exit(-1);
}
-#if !FAST_SIM
/* Read configuration file. */
if (!runtime.sim.script_file_specified)
read_script_file ("sim.cfg");
@@ -385,9 +376,6 @@
if (!runtime.sim.script_file_specified && config.sim.verbose)
fprintf (stderr, "WARNING: No config file read, assuming default configuration.\n");
-#else
- PRINTF ("\n\tNOTE: running fast sim with fixed configuration!\n\n");
-#endif
if (runtime.sim.output_cfg) {
output_cfg (stdout);
exit (0);
@@ -411,7 +399,7 @@
/* MM: 'run -1' means endless execution. */
while(runtime.sim.cont_run) {
- IFF (config.debug.enabled) {
+ if (config.debug.enabled) {
du_clock(); // reset watchpoints
if (runtime.cpu.stalled) {
if(config.debug.gdb_enabled) {
@@ -438,7 +426,7 @@
if (config.vapi.enabled && runtime.vapi.enabled) vapi_check();
if (config.debug.gdb_enabled) HandleServerSocket(false); /* block & check_stdin = false */
- IFF(config.debug.enabled)
+ if(config.debug.enabled)
if (testsprbits(SPR_DMR1, SPR_DMR1_ST)) set_stall_state (1);
runtime.sim.cycles += runtime.sim.mem_cycles;
|
 |