2 * Simulator of microcontrollers (cmd.src/cmdconf.cc)
4 * Copyright (C) 2001,01 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
36 #include "cmdconfcl.h"
41 *----------------------------------------------------------------------------
45 //cl_conf_cmd::do_work(class cl_sim *sim,
46 // class cl_cmdline *cmdline, class cl_console *con)
47 COMMAND_DO_WORK_UC(cl_conf_cmd)
51 con->dd_printf("ucsim version %s\n", VERSIONSTR);
52 con->dd_printf("Type of microcontroller: %s\n", uc->id_string());
53 con->dd_printf("Controller has %d hardware element(s).\n",
55 for (i= 0; i < uc->hws->count; i++)
57 class cl_hw *hw= (class cl_hw *)(uc->hws->at(i));
58 con->dd_printf(" %s[%d]\n", hw->id_string, hw->id);
60 con->dd_printf("Memories:\n");
61 for (i= MEM_ROM; i < MEM_TYPES; i++)
63 class cl_mem *mem= (class cl_mem *)(uc->mems->at(i));
65 con->dd_printf(" %s size= 0x%06x %6d width= %2d class= \"%s\"\n",
66 mem->id_string(), mem->size, mem->size, mem->width,
67 (mem->class_name)?(mem->class_name):"unknown");
73 * Command: conf addmem
74 *----------------------------------------------------------------------------
78 //cl_conf_addmem_cmd::do_work(class cl_sim *sim,
79 // class cl_cmdline *cmdline, class cl_console *con)
80 COMMAND_DO_WORK_UC(cl_conf_addmem_cmd)
83 class cl_cmd_arg *params[4]= { cmdline->param(0),
89 if (cmdline->syntax_match(uc, STRING)) {
90 mem_class= params[0]->value.string.string;
92 type= (enum mem_class)get_string_id(mem_classes, mem_class, -1);
93 mem= uc->mk_mem(type, mem_class);
96 class cl_mem *m= uc->mem(type);
99 uc->mems->put_at(type, mem);
102 con->dd_printf("Can not make memory \"%s\"\n", mem_class);
108 /* End of cmd.src/cmdconf.cc */