* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: dumpconfig.c
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
static void dump_system(system_t
* sp
);
static void dump_domain(domain_t
* dp
);
* Dump the current config and state of the simulator system
void dump_config(FILE * outp
)
sprintf(buf
, "%04d-%02d-%02d %02d:%02d:%02d",
tms
.tm_year
+1900, tms
.tm_mon
+1, tms
.tm_mday
,
tms
.tm_hour
, tms
.tm_min
, tms
.tm_sec
);
/* Wander the systems and dump each one */
// Simulator config/dump file auto-created %s\n\
for (i
=0; i
<target_config
.systems
.count
; i
++)
dump_system(LIST_ENTRY(target_config
.systems
, i
));
void dump_system(system_t
* sysp
)
pi("\t// system %d\n", sysp
->idx
);
pi("system \"%s\" {\n", sysp
->namep
);
for (i
=0; i
<sysp
->domains
.count
; i
++)
dump_domain(LIST_ENTRY(sysp
->domains
,i
));
void dump_domain(domain_t
* dp
)
pi("\t// domain %d\n", dp
->idx
);
pi("sysclkfreq = 0x%llx ;\n", dp
->sysclkfreq
);
for (i
=0; i
<dp
->procs
.count
; i
++) {
procp
= LIST_ENTRY( dp
->procs
, i
);
procp
->proc_typep
->dump_proc(dp
, procp
);
if (devp
!=(config_dev_t
*)0) {
for (i
=0; i
<dp
->device
.count
; i
++) {
/* leave defn dangling for dump routine */
pi("\t// device id %d\n", devp
->device_id
);
/* FIXME: for the moment implied devices get a commented output ... */
/* eventually all output must be squashed of these devices */
ASSERT(devp
->dev_typep
->dump_dev
== NULL
);
pi("device \"%s\" 0x%llx + 0x%llx %s\n",
devp
->dev_typep
->dev_type_namep
,
devp
->addrp
->topaddr
- devp
->addrp
->baseaddr
,
devp
->dev_typep
->dump_dev
? "{" : ";" );
if (devp
->dev_typep
->dump_dev
) {
devp
->dev_typep
->dump_dev(devp
);
for (i
=0; i
<dumpinfo
.indent
; i
++)
fputc('\t', dumpinfo
.outp
);
vfprintf(dumpinfo
.outp
, fmt
, args
);