From 1854d0ec377d6032617c09d2bd31fa0866764744 Mon Sep 17 00:00:00 2001 From: drdani Date: Mon, 7 Feb 2000 08:07:02 +0000 Subject: [PATCH] ucsim-0.2.37-pre3 into cvs git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@79 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- sim/ucsim/cmd.src/(c).1 | 25 + sim/ucsim/cmd.src/Makefile.in | 117 ++++ sim/ucsim/cmd.src/bp.cc | 119 ++++ sim/ucsim/cmd.src/clean.mk | 23 + sim/ucsim/cmd.src/cmdset.cc | 467 ++++++++++++++ sim/ucsim/cmd.src/cmdsetcl.h | 340 ++++++++++ sim/ucsim/cmd.src/cmdutil.cc | 286 ++++++++ sim/ucsim/cmd.src/cmdutil.h | 50 ++ sim/ucsim/cmd.src/conf.mk | 10 + sim/ucsim/cmd.src/get.cc | 79 +++ sim/ucsim/cmd.src/info.cc | 156 +++++ sim/ucsim/cmd.src/infocl.h | 73 +++ sim/ucsim/cmd.src/newcmd.cc | 1112 ++++++++++++++++++++++++++++++++ sim/ucsim/cmd.src/newcmdcl.h | 229 +++++++ sim/ucsim/cmd.src/set.cc | 73 +++ sim/ucsim/cmd.src/syntax.cc | 31 + sim/ucsim/cmd.src/syntaxcl.h | 33 + sim/ucsim/cmd.src/timer.cc | 266 ++++++++ sim/ucsim/doc/Makefile.in | 79 +++ sim/ucsim/doc/UCsim.jpg | Bin 0 -> 5540 bytes sim/ucsim/doc/analyzer.html | 35 + sim/ucsim/doc/burst.gif | Bin 0 -> 235 bytes sim/ucsim/doc/clean.mk | 22 + sim/ucsim/doc/cmd.html | 90 +++ sim/ucsim/doc/cmd_bp.html | 206 ++++++ sim/ucsim/doc/cmd_dump.html | 390 +++++++++++ sim/ucsim/doc/cmd_exec.html | 227 +++++++ sim/ucsim/doc/cmd_general.html | 659 +++++++++++++++++++ sim/ucsim/doc/cmd_set.html | 203 ++++++ sim/ucsim/doc/commref.html | 83 +++ sim/ucsim/doc/conf.mk | 10 + sim/ucsim/doc/cpu.gif | Bin 0 -> 12757 bytes sim/ucsim/doc/cpu.html | 59 ++ sim/ucsim/doc/cpu_types.html | 184 ++++++ sim/ucsim/doc/index.html | 156 +++++ sim/ucsim/doc/interrupt.gif | Bin 0 -> 12432 bytes sim/ucsim/doc/interrupt.html | 27 + sim/ucsim/doc/invoke.html | 124 ++++ sim/ucsim/doc/mulcons.html | 115 ++++ sim/ucsim/doc/new.gif | Bin 0 -> 161 bytes sim/ucsim/doc/obsolete.html | 25 + sim/ucsim/doc/post.jpg | Bin 0 -> 1016 bytes sim/ucsim/doc/serial.html | 135 ++++ sim/ucsim/doc/serial1.fig | 53 ++ sim/ucsim/doc/serial1.gif | Bin 0 -> 3078 bytes sim/ucsim/doc/serial2.fig | 97 +++ sim/ucsim/doc/serial2.gif | Bin 0 -> 6260 bytes sim/ucsim/doc/term_cpuopt.gif | Bin 0 -> 9601 bytes sim/ucsim/doc/term_cpuopt.html | 27 + sim/ucsim/doc/timers.gif | Bin 0 -> 13166 bytes sim/ucsim/doc/timers.html | 22 + sim/ucsim/doc/wins.gif | Bin 0 -> 18016 bytes sim/ucsim/doc/wins.html | 21 + sim/ucsim/gui.src/(c).1 | 25 + sim/ucsim/gui.src/Makefile.in | 141 ++++ sim/ucsim/gui.src/a.cc | 87 +++ sim/ucsim/gui.src/app.cc | 171 +++++ sim/ucsim/gui.src/appcl.h | 54 ++ sim/ucsim/gui.src/bg.cc | 63 ++ sim/ucsim/gui.src/bgcl.h | 47 ++ sim/ucsim/gui.src/clean.mk | 45 ++ sim/ucsim/gui.src/conf.mk | 12 + sim/ucsim/gui.src/desk.cc | 58 ++ sim/ucsim/gui.src/deskcl.h | 42 ++ sim/ucsim/gui.src/event.cc | 126 ++++ sim/ucsim/gui.src/eventcl.h | 96 +++ sim/ucsim/gui.src/frame.cc | 76 +++ sim/ucsim/gui.src/framecl.h | 48 ++ sim/ucsim/gui.src/group.cc | 393 +++++++++++ sim/ucsim/gui.src/groupcl.h | 70 ++ sim/ucsim/gui.src/label.cc | 74 +++ sim/ucsim/gui.src/labelcl.h | 50 ++ sim/ucsim/gui.src/palette.h | 44 ++ sim/ucsim/gui.src/view.cc | 356 ++++++++++ sim/ucsim/gui.src/viewcl.h | 118 ++++ sim/ucsim/gui.src/win.cc | 111 ++++ sim/ucsim/gui.src/wincl.h | 55 ++ 77 files changed, 8900 insertions(+) create mode 100644 sim/ucsim/cmd.src/(c).1 create mode 100644 sim/ucsim/cmd.src/Makefile.in create mode 100644 sim/ucsim/cmd.src/bp.cc create mode 100644 sim/ucsim/cmd.src/clean.mk create mode 100644 sim/ucsim/cmd.src/cmdset.cc create mode 100644 sim/ucsim/cmd.src/cmdsetcl.h create mode 100644 sim/ucsim/cmd.src/cmdutil.cc create mode 100644 sim/ucsim/cmd.src/cmdutil.h create mode 100644 sim/ucsim/cmd.src/conf.mk create mode 100644 sim/ucsim/cmd.src/get.cc create mode 100644 sim/ucsim/cmd.src/info.cc create mode 100644 sim/ucsim/cmd.src/infocl.h create mode 100644 sim/ucsim/cmd.src/newcmd.cc create mode 100644 sim/ucsim/cmd.src/newcmdcl.h create mode 100644 sim/ucsim/cmd.src/set.cc create mode 100644 sim/ucsim/cmd.src/syntax.cc create mode 100644 sim/ucsim/cmd.src/syntaxcl.h create mode 100644 sim/ucsim/cmd.src/timer.cc create mode 100644 sim/ucsim/doc/Makefile.in create mode 100644 sim/ucsim/doc/UCsim.jpg create mode 100644 sim/ucsim/doc/analyzer.html create mode 100644 sim/ucsim/doc/burst.gif create mode 100644 sim/ucsim/doc/clean.mk create mode 100644 sim/ucsim/doc/cmd.html create mode 100644 sim/ucsim/doc/cmd_bp.html create mode 100644 sim/ucsim/doc/cmd_dump.html create mode 100644 sim/ucsim/doc/cmd_exec.html create mode 100644 sim/ucsim/doc/cmd_general.html create mode 100644 sim/ucsim/doc/cmd_set.html create mode 100644 sim/ucsim/doc/commref.html create mode 100644 sim/ucsim/doc/conf.mk create mode 100644 sim/ucsim/doc/cpu.gif create mode 100644 sim/ucsim/doc/cpu.html create mode 100644 sim/ucsim/doc/cpu_types.html create mode 100644 sim/ucsim/doc/index.html create mode 100644 sim/ucsim/doc/interrupt.gif create mode 100644 sim/ucsim/doc/interrupt.html create mode 100644 sim/ucsim/doc/invoke.html create mode 100644 sim/ucsim/doc/mulcons.html create mode 100644 sim/ucsim/doc/new.gif create mode 100644 sim/ucsim/doc/obsolete.html create mode 100644 sim/ucsim/doc/post.jpg create mode 100644 sim/ucsim/doc/serial.html create mode 100644 sim/ucsim/doc/serial1.fig create mode 100644 sim/ucsim/doc/serial1.gif create mode 100644 sim/ucsim/doc/serial2.fig create mode 100644 sim/ucsim/doc/serial2.gif create mode 100644 sim/ucsim/doc/term_cpuopt.gif create mode 100644 sim/ucsim/doc/term_cpuopt.html create mode 100644 sim/ucsim/doc/timers.gif create mode 100644 sim/ucsim/doc/timers.html create mode 100644 sim/ucsim/doc/wins.gif create mode 100644 sim/ucsim/doc/wins.html create mode 100644 sim/ucsim/gui.src/(c).1 create mode 100644 sim/ucsim/gui.src/Makefile.in create mode 100644 sim/ucsim/gui.src/a.cc create mode 100644 sim/ucsim/gui.src/app.cc create mode 100644 sim/ucsim/gui.src/appcl.h create mode 100644 sim/ucsim/gui.src/bg.cc create mode 100644 sim/ucsim/gui.src/bgcl.h create mode 100644 sim/ucsim/gui.src/clean.mk create mode 100644 sim/ucsim/gui.src/conf.mk create mode 100644 sim/ucsim/gui.src/desk.cc create mode 100644 sim/ucsim/gui.src/deskcl.h create mode 100644 sim/ucsim/gui.src/event.cc create mode 100644 sim/ucsim/gui.src/eventcl.h create mode 100644 sim/ucsim/gui.src/frame.cc create mode 100644 sim/ucsim/gui.src/framecl.h create mode 100644 sim/ucsim/gui.src/group.cc create mode 100644 sim/ucsim/gui.src/groupcl.h create mode 100644 sim/ucsim/gui.src/label.cc create mode 100644 sim/ucsim/gui.src/labelcl.h create mode 100644 sim/ucsim/gui.src/palette.h create mode 100644 sim/ucsim/gui.src/view.cc create mode 100644 sim/ucsim/gui.src/viewcl.h create mode 100644 sim/ucsim/gui.src/win.cc create mode 100644 sim/ucsim/gui.src/wincl.h diff --git a/sim/ucsim/cmd.src/(c).1 b/sim/ucsim/cmd.src/(c).1 new file mode 100644 index 00000000..d673f9fd --- /dev/null +++ b/sim/ucsim/cmd.src/(c).1 @@ -0,0 +1,25 @@ +/* + * Simulator of microcontrollers (@@F@@) + * + * Copyright (C) @@S@@,@@Y@@ Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ diff --git a/sim/ucsim/cmd.src/Makefile.in b/sim/ucsim/cmd.src/Makefile.in new file mode 100644 index 00000000..09344f23 --- /dev/null +++ b/sim/ucsim/cmd.src/Makefile.in @@ -0,0 +1,117 @@ +# +# S51 mcs51/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1997 +# + +STARTYEAR = 1997 + +SHELL = /bin/sh +CXX = @CXX@ +CPP = @CPP@ +CXXCPP = @CXXCPP@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ + +PRJDIR = .. + +DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) +CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \ + -I$(PRJDIR)/sim.src +CFLAGS = @CFLAGS@ -Wall +CXXFLAGS = @CXXFLAGS@ -Wall +M_OR_MM = @M_OR_MM@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ + +OBJECTS = newcmd.o cmdutil.o cmdset.o syntax.o \ + get.o set.o timer.o bp.o info.o + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: checkconf cmdlib + +cmd.src: all + + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + + +# Deleting all the installed files +# -------------------------------- +uninstall: + + +# Performing self-test +# -------------------- +check: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + + +# Creating dependencies +# --------------------- +dep: Makefile.dep + +Makefile.dep: *.cc *.h + $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep + +include Makefile.dep +include clean.mk + +#parser.cc: parser.y + +#plex.cc: plex.l + +# My rules +# -------- + +cmdlib: $(PRJDIR)/libcmd.a + +$(PRJDIR)/libcmd.a: $(OBJECTS) + ar -rcu $*.a $(OBJECTS) + $(RANLIB) $*.a + +.cc.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ + +.y.cc: + rm -f $*.cc $*.h + $(YACC) -d $< + mv y.tab.c $*.cc + mv y.tab.h $*.h + +.l.cc: + rm -f $*.cc + $(LEX) -t $< >$*.cc + + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(PRJDIR)/devel ]; then\ + $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\ + fi + +# End of mcs51/Makefile.in diff --git a/sim/ucsim/cmd.src/bp.cc b/sim/ucsim/cmd.src/bp.cc new file mode 100644 index 00000000..e2d6fd13 --- /dev/null +++ b/sim/ucsim/cmd.src/bp.cc @@ -0,0 +1,119 @@ +/* + * Simulator of microcontrollers (bp.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include "stdlib.h" + +// sim +#include "brkcl.h" +#include "argcl.h" +#include "simcl.h" + +// cmd +#include "cmdsetcl.h" + + +/* + * BREAK command + */ + +int +cl_break_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + long addr; + int hit= 1; + class cl_cmd_arg *params[2]= { cmdline->param(0), + cmdline->param(1) }; + + if (params[0] == 0) + { + con->printf("Address is missing.\n"); + return(FALSE); + } + addr= (params[0])->get_address(); + if (params[1]) + hit= (params[1])->get_ivalue(); + if (hit > 99999) + { + con->printf("Hit value %d is too big.\n", hit); + return(0); + } + if (sim->uc->fbrk->bp_at(addr)) + con->printf("Breakpoint at 0x%06x is already set.\n", addr); + else + { + class cl_brk *b= new cl_fetch_brk(sim->uc->fbrk->make_new_nr(), + addr, perm, hit); + b->init(); + sim->uc->fbrk->add_bp(b); + char *s= sim->uc->disass(addr, NULL); + con->printf("Breakpoint %d at 0x%06x: %s\n", b->nr, addr, s); + free(s); + } + return(0); +} + + +/* + * CLEAR address + */ + +int +cl_clear_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + uint addr; + int idx; + class cl_brk *brk= sim->uc->fbrk->get_bp(sim->uc->PC, &idx); + + if (cmdline->param(0) == 0) + { + if (!brk) + { + con->printf("No breakpoint at this address.\n"); + return(0); + } + sim->uc->fbrk->del_bp(sim->uc->PC); + return(0); + } + + int i= 0; + class cl_cmd_arg *param; + while ((param= cmdline->param(i++))) + { + addr= param->get_ivalue(); + if (sim->uc->fbrk->bp_at(addr) == 0) + sim->cmd->printf("No breakpoint at 0x%06x\n", addr); + else + sim->uc->fbrk->del_bp(addr); + } + + return(0); +} + + +/* End of bp.cc */ diff --git a/sim/ucsim/cmd.src/clean.mk b/sim/ucsim/cmd.src/clean.mk new file mode 100644 index 00000000..68b48723 --- /dev/null +++ b/sim/ucsim/cmd.src/clean.mk @@ -0,0 +1,23 @@ +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] + rm -f .[a-z]*~ + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f config.cache config.log config.status + rm -f Makefile *.dep + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean diff --git a/sim/ucsim/cmd.src/cmdset.cc b/sim/ucsim/cmd.src/cmdset.cc new file mode 100644 index 00000000..8a659f68 --- /dev/null +++ b/sim/ucsim/cmd.src/cmdset.cc @@ -0,0 +1,467 @@ +/* + * Simulator of microcontrollers (cmdset.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include "i_string.h" + +#include "globals.h" +#include "utils.h" + +// sim +#include "simcl.h" + +// local +#include "cmdsetcl.h" + + +/* + * Command: conf + *---------------------------------------------------------------------------- + */ + +int +cl_conf_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + int i; + + con->printf("ucsim version %s\n", VERSIONSTR); + con->printf("Type of microcontroller: %s\n", sim->uc->id_string()); + con->printf("Controller has %d hardware element(s).\n", + sim->uc->hws->count); + for (i= 0; i < sim->uc->hws->count; i++) + { + class cl_hw *hw= (class cl_hw *)(sim->uc->hws->at(i)); + con->printf(" %s[%d]\n", hw->id_string, hw->id); + } + con->printf("Memories:\n"); + for (i= MEM_ROM; i < MEM_TYPES; i++) + { + class cl_mem *mem= (class cl_mem *)(sim->uc->mems->at(i)); + if (mem) + con->printf(" %s size= 0x%06x %d\n", + mem->id_string(), mem->size, mem->size); + } + return(0); +} + + +/* + * Command: state + *---------------------------------------------------------------------------- + */ + +int +cl_state_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + //con->printf("sim state= %d\n", sim->state); + con->printf("CPU state= %s PC= 0x%06x XTAL= %g\n", + get_id_string(cpu_states, sim->uc->state), + sim->uc->PC, + sim->uc->xtal); + con->printf("Total time since last reset= %g sec (%lu clks)\n", + sim->uc->get_rtime(), sim->uc->ticks->ticks); + con->printf("Time in isr = %g sec (%lu clks) %3.2g%%\n", + sim->uc->isr_ticks->get_rtime(sim->uc->xtal), + sim->uc->isr_ticks->ticks, + (sim->uc->ticks->ticks == 0)?0.0: + (100.0*((double)(sim->uc->isr_ticks->ticks)/ + (double)(sim->uc->ticks->ticks)))); + con->printf("Time in idle= %g sec (%lu clks) %3.2g%%\n", + sim->uc->idle_ticks->get_rtime(sim->uc->xtal), + sim->uc->idle_ticks->ticks, + (sim->uc->ticks->ticks == 0)?0.0: + (100.0*((double)(sim->uc->idle_ticks->ticks)/ + (double)(sim->uc->ticks->ticks)))); + con->printf("Max value of stack pointer= 0x%06x, avg= 0x%06x\n", + sim->uc->sp_max, sim->uc->sp_avg); + return(0); +} + + +/* + * Command: file + *---------------------------------------------------------------------------- + */ + +int +cl_file_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + char *fname; + long l; + + if ((cmdline->param(0) == 0) || + ((fname= cmdline->param(0)->get_svalue()) == NULL)) + { + con->printf("File name is missing.\n"); + return(0); + } + if ((l= sim->uc->read_hex_file(fname)) >= 0) + con->printf("%ld words read from %s\n", l, fname); + + return(0); +} + + +/* + * Command: download + *---------------------------------------------------------------------------- + */ + +int +cl_dl_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + long l; + + if ((l= sim->uc->read_hex_file(NULL)) >= 0) + con->printf("%ld words loaded\n", l); + + return(0); +} + + +/* + * Command: get + *---------------------------------------------------------------------------- + */ + +int +cl_get_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + char *s; + + if (cmdline->param(0) == 0) + { + con->printf("Get what?\n"); + return(0); + } + if ((s= cmdline->param(0)->get_svalue())) + { + if (strstr(s, "t") == s) + return(timer(cmdline, con)); + else + con->printf("Unknow keyword of get command\n"); + } + return(0); +} + + +/* + * Command: set + *---------------------------------------------------------------------------- + */ + + +int +cl_set_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + char *s; + + if (cmdline->param(0) == 0) + { + con->printf("Set what?\n"); + return(0); + } + if ((s= cmdline->param(0)->get_svalue())) + { + if (strstr(s, "t") == s) + return(timer(cmdline, con)); + else + con->printf("Unknow keyword of set command\n"); + } + return(0); +} + + +/* + * Command: run + *---------------------------------------------------------------------------- + */ + + +int +cl_run_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + sim->start(con); + return(0); +} + + +/* + * Command: step + *---------------------------------------------------------------------------- + */ + + +int +cl_step_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + sim->uc->do_inst(1); + sim->uc->print_regs(con); + return(0); +} + + +/* + * Command: reset + *---------------------------------------------------------------------------- + */ + + +int +cl_reset_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + sim->uc->reset(); + return(0); +} + + +/* + * Command: dump + *---------------------------------------------------------------------------- + */ + +int +cl_dump_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_mem *mem; + char *s; + long l, start= -1, end= 10*8-1, bpl= 8; + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + + if (params[0] == 0) + { + con->printf("Memory type missing\n"); + return(0); + } + if ((s= params[0]->get_svalue())) + { + if (strstr(s, "i") == s) + mem= sim->uc->mem(MEM_IRAM); + else if (strstr(s, "x") == s) + mem= sim->uc->mem(MEM_XRAM); + else if (strstr(s, "r") == s) + mem= sim->uc->mem(MEM_ROM); + else if (strstr(s, "s") == s) + mem= sim->uc->mem(MEM_SFR); + else + { + con->printf("Unknown memory type\n"); + return(0); + } + if (!mem) + { + con->printf("No such memory\n"); + return(0); + } + } + else + { + con->printf("Wrong memory type\n"); + return(0); + } + + if (params[1]) + { + if ((start= params[1]->get_address()) >= 0) + { + end+= start; + if (params[2]) + { + if ((l= params[2]->get_address()) >= 0) + end= l; + else + { + con->printf("End address is wrong\n"); + return(0); + } + } + } + else + { + con->printf("Start address is wrong\n"); + return(0); + } + } + if (params[3] && + (l= params[3]->get_address()) >= 0) + bpl= l; + mem->dump(start, end, bpl, con); + return(0); +} + + +/* + * Command: di + *---------------------------------------------------------------------------- + */ + +int +cl_di_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + cmdline->insert_param(0, new cl_cmd_sym_arg("i")); + cl_dump_cmd::do_work(cmdline, con); + return(0); +} + + +/* + * Command: dx + *---------------------------------------------------------------------------- + */ + +int +cl_dx_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + cmdline->insert_param(0, new cl_cmd_sym_arg("x")); + cl_dump_cmd::do_work(cmdline, con); + return(0); +} + + +/* + * Command: dch + *---------------------------------------------------------------------------- + */ + +int +cl_dch_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + cmdline->insert_param(0, new cl_cmd_sym_arg("r")); + cl_dump_cmd::do_work(cmdline, con); + return(0); +} + + +/* + * Command: ds + *---------------------------------------------------------------------------- + */ + +int +cl_ds_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + cmdline->insert_param(0, new cl_cmd_sym_arg("s")); + cl_dump_cmd::do_work(cmdline, con); + return(0); +} + + +/* + * Command: dc + *---------------------------------------------------------------------------- + */ + +int +cl_dc_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + long i, l, start= last, end= -1; + class cl_cmd_arg *params[2]= { cmdline->param(0), + cmdline->param(1) }; + + if (params[0]) + { + if ((start= params[0]->get_address()) >= 0) + { + if (params[1]) + { + if ((l= params[1]->get_address()) >= 0) + end= l; + else + { + con->printf("End address is wrong\n"); + return(0); + } + } + } + else + { + con->printf("Start address is wrong\n"); + return(0); + } + } + i= 0; + for (l= start; + (end < 0 && i < 20) || l <= end; + l+= sim->uc->inst_length(sim->uc->get_mem(MEM_ROM, l)), i++) + sim->uc->print_disass(l, con); + last= l; + return(0); +} + + +/* + * Command: help + *---------------------------------------------------------------------------- + */ + +int +cl_help_cmd::do_work(class cl_cmdline */*cmdline*/, class cl_console *con) +{ + class cl_cmd *c; + int i; + + for (i= 0; i < sim->cmdset->count; i++) + { + c= (class cl_cmd *)(sim->cmdset->at(i)); + if (c->short_help) + con->printf("%s\n", c->short_help); + else + con->printf("%s\n", (char*)(c->names->at(0))); + } + return(0); +} + + +/* + * Command: quit + *---------------------------------------------------------------------------- + */ + +int +cl_quit_cmd::do_work(class cl_cmdline */*cmdline*/, class cl_console */*con*/) +{ + return(1); +} + +/* + * Command: kill + *---------------------------------------------------------------------------- + */ + +int +cl_kill_cmd::do_work(class cl_cmdline */*cmdline*/, class cl_console */*con*/) +{ + sim->state|= SIM_QUIT; + return(1); +} + + +/* End of cmdset.cc */ diff --git a/sim/ucsim/cmd.src/cmdsetcl.h b/sim/ucsim/cmd.src/cmdsetcl.h new file mode 100644 index 00000000..b6202693 --- /dev/null +++ b/sim/ucsim/cmd.src/cmdsetcl.h @@ -0,0 +1,340 @@ +/* + * Simulator of microcontrollers (cmdsetcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef CMDSETCL_HEADER +#define CMDSETCL_HEADER + +#include "newcmdcl.h" + + +// CONF +class cl_conf_cmd: public cl_cmd +{ +public: + cl_conf_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// STATE +class cl_state_cmd: public cl_cmd +{ +public: + cl_state_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// FILE +class cl_file_cmd: public cl_cmd +{ +public: + cl_file_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DOWNLOAD +class cl_dl_cmd: public cl_cmd +{ +public: + cl_dl_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// GET +class cl_get_cmd: public cl_cmd +{ +public: + cl_get_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); + virtual int timer(class cl_cmdline *cmdline, class cl_console *con); +}; + +// SET +class cl_set_cmd: public cl_cmd +{ +public: + cl_set_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); + virtual int timer(class cl_cmdline *cmdline, class cl_console *con); +}; + +// TIMER +class cl_timer_cmd: public cl_cmd +{ +public: + class cl_ticker *ticker; + int what; + char *name; + + cl_timer_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); + void set_ticker(class cl_cmd_arg *param); + virtual int add(class cl_cmdline *cmdline, class cl_console *con); + virtual int del(class cl_cmdline *cmdline, class cl_console *con); + virtual int get(class cl_cmdline *cmdline, class cl_console *con); + virtual int run(class cl_cmdline *cmdline, class cl_console *con); + virtual int stop(class cl_cmdline *cmdline, class cl_console *con); + virtual int val(class cl_cmdline *cmdline, class cl_console *con); +}; + +// RUN +class cl_run_cmd: public cl_cmd +{ +public: + cl_run_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// STEP +class cl_step_cmd: public cl_cmd +{ +public: + cl_step_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// RESET +class cl_reset_cmd: public cl_cmd +{ +public: + cl_reset_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DUMP +class cl_dump_cmd: public cl_cmd +{ +public: + cl_dump_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + //cl_dump_cmd(class cl_sim *asim): cl_cmd(asim) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DI +class cl_di_cmd: public cl_dump_cmd +{ +public: + cl_di_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_dump_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DX +class cl_dx_cmd: public cl_dump_cmd +{ +public: + cl_dx_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_dump_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DCH +class cl_dch_cmd: public cl_dump_cmd +{ +public: + cl_dch_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_dump_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DS +class cl_ds_cmd: public cl_dump_cmd +{ +public: + cl_ds_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_dump_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// DC +class cl_dc_cmd: public cl_cmd +{ +public: + int last; +public: + cl_dc_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {last=0;} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// BREAK +class cl_break_cmd: public cl_cmd +{ +public: + enum brk_perm perm; +public: + cl_break_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) { perm= brkFIX; } + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// TBREAK +class cl_tbreak_cmd: public cl_break_cmd +{ +public: + cl_tbreak_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_break_cmd(asim, aname, can_rep, short_hlp, long_hlp) {perm=brkDYNAMIC;} +}; + +// CLEAR +class cl_clear_cmd: public cl_cmd +{ +public: + cl_clear_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// HELP +class cl_help_cmd: public cl_cmd +{ +public: + cl_help_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// QUIT +class cl_quit_cmd: public cl_cmd +{ +public: + cl_quit_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// KILL +class cl_kill_cmd: public cl_cmd +{ +public: + cl_kill_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + + +#endif + +/* End of cmdsetcl.h */ diff --git a/sim/ucsim/cmd.src/cmdutil.cc b/sim/ucsim/cmd.src/cmdutil.cc new file mode 100644 index 00000000..083b8456 --- /dev/null +++ b/sim/ucsim/cmd.src/cmdutil.cc @@ -0,0 +1,286 @@ +/* + * Simulator of microcontrollers (cmdutil.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include +#include +#include +#ifdef HAVE_SYS_SOCKET_H +# include +# include +# include +#endif +#include "i_string.h" + +#include "stypes.h" +#include "globals.h" +#include "uccl.h" + + +/* + * Making a socket which can be used to listen for a specified port + */ + +#ifdef SOCKET_AVAIL +int +make_server_socket(unsigned short int port) +{ + int sock, i; + struct sockaddr_in name; + + /* Create the socket. */ + sock= socket(PF_INET, SOCK_STREAM, 0); + if (sock < 0) + { + perror("socket"); + return(0); + } + + /* Give the socket a name. */ + i= 1; + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&i, sizeof(i)) < 0) + { + perror("setsockopt"); + } + name.sin_family = AF_INET; + name.sin_port = htons(port); + name.sin_addr.s_addr= htonl(INADDR_ANY); + if (bind(sock, (struct sockaddr *)&name, sizeof(name)) < 0) + { + perror("bind"); + return(0); + } + + return(sock); +} +#endif + + +/* + * Printing out an integer in binary format + */ + +void +print_bin(long data, int bits, FILE *f) +{ + long mask= 1; + + mask= mask << ((bits >= 1)?(bits-1):0); + while (bits--) + { + fprintf(f, "%c", (data&mask)?'1':'0'); + mask>>= 1; + } +} + + +/* + * Searching for a name in the specified table + */ + +struct name_entry * +get_name_entry(struct name_entry tabl[], char *name, class cl_uc *uc) +{ + int i= 0; + char *p; + + for (p= name; *p; *p= toupper(*p), p++); + while (tabl[i].name && + (!(tabl[i].cpu_type & uc->type) || + (strcmp(tabl[i].name, name) != 0))) + i++; + if (tabl[i].name != NULL) + return(&tabl[i]); + else + return(NULL); +} + + +/* + * Interpreting a bitname + */ + +bool +interpret_bitname(char *name, class cl_uc *uc, + uchar **cell, uchar *celladdr, + uchar *bitaddr, uchar *bitmask, + char **symname) +{ + char *dot, *p; + char *sym, bitnumstr[2]; + struct name_entry *ne; + int bitnum, i; + + if ((dot= strchr(name, '.')) != NULL) + { + *dot++= '\0'; + if ((ne= get_name_entry(uc->sfr_tbl(), name, uc)) == NULL) + { + *celladdr= strtol(name, &p, 0); + if (p && *p) + { + dot--; + *dot= '.'; + return(FALSE); + } + } + else + *celladdr= ne->addr; + if ((*celladdr < 0x20) || + ((*celladdr > 0x2f) && (*celladdr < 0x80)) || + ((*celladdr > 0x7f) && (*celladdr & 0x07))) + return(FALSE); + bitnum= strtol(dot, &p, 0); + if ((p && *p) || + (bitnum < 0) || + (bitnum > 7)) + return(FALSE); + if (*celladdr > 0x7f) + *bitaddr= *celladdr + bitnum; + else + *bitaddr= (*celladdr - 0x20)*8 + bitnum; + dot--; + *dot= '.'; + } + else + { + if ((ne= get_name_entry(uc->bit_tbl(), name, uc)) == NULL) + { + *bitaddr= strtol(name, &p, 0); + if ((p && *p) || + (*bitaddr > 0xff)) + return(FALSE); + } + else + *bitaddr= ne->addr; + if (*bitaddr > 0x7f) + *celladdr= *bitaddr & 0xf8; + else + *celladdr= (*bitaddr >> 3) + 0x20; + } + // *bitaddr, *celladdr now OK + *cell= uc->get_bit/*FIXME*/(*bitaddr); + *bitmask= BIT_MASK(*bitaddr); + // making symbolic name + if (!symname) + return(TRUE); + i= 0; + while (uc->bit_tbl()[i].name && + (uc->bit_tbl()[i].addr != *bitaddr)) + i++; + if (uc->bit_tbl()[i].name) + { + sym= strdup(uc->bit_tbl()[i].name); + *symname= sym; + return(TRUE); + } + i= 0; + while (uc->sfr_tbl()[i].name && + (uc->sfr_tbl()[i].addr != *celladdr)) + i++; + if (uc->sfr_tbl()[i].name) + sym= strdup(uc->sfr_tbl()[i].name); + else + { + sym= (char *)malloc(3); + sprintf(sym, "%02x", *celladdr); + } + sym= (char *)realloc(sym, strlen(sym)+2); + strcat(sym, "."); + sprintf(bitnumstr, "%1d", *bitaddr & 0x07); + strcat(sym, bitnumstr); + *symname= sym; + return(TRUE); +} + + +/* + * Processing escape sequencies in a string + */ + +char * +proc_escape(char *string, int *len) +{ + char spec_chars[]= "fnrtvab"; + char spec[]= "\f\n\r\t\v\a\b"; + char *s, *str, *p; + + s = string; + str= (char *)malloc(strlen(string)+1); + p = str; + while (*s) + { + char *spec_c; + + if (*s == '\\' && + *(s+1)) + { + s++; + if (*s == '0') + { + if (!isdigit(*(s+1))) + { + *p++= '\0'; + s++; + } + else + { + char *octal, *chk, data; + int i, j; + i= strspn(s, "01234567"); + octal= (char *)malloc(i+1); + j= 0; + while (*s && + (j < i)) + octal[j++]= *s++; + octal[j]= '\0'; + data= strtol(octal, &chk, 8); + if (!chk || !(*chk)) + *p++= data; + } + } + else + if ((spec_c= strchr(spec_chars, *s)) != NULL) + { + *p++= spec[spec_c-spec_chars]; + s++; + } + else + *p++= *s++; + } + else + *p++= *s++; + } + *p= '\0'; + *len= p-str; + return(str); +} + + +/* End of cmdutil.cc */ diff --git a/sim/ucsim/cmd.src/cmdutil.h b/sim/ucsim/cmd.src/cmdutil.h new file mode 100644 index 00000000..8bc02d2a --- /dev/null +++ b/sim/ucsim/cmd.src/cmdutil.h @@ -0,0 +1,50 @@ +/* + * Simulator of microcontrollers (cmdutil.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef CMDUTIL_HEADER +#define CMDUTIL_HEADER + +#include "ddconfig.h" + +#include "uccl.h" + + +extern int make_server_socket(unsigned short int port); +extern void print_bin(long data, int bits, FILE *f); +extern struct name_entry *get_name_entry(struct name_entry tabl[], + char *name, + class cl_uc *uc); +extern bool interpret_bitname(char *name, class cl_uc *uc, + uchar **cell, uchar *celladdr, + uchar *bitaddr, uchar *bitmask, + char **symname); +extern char *proc_escape(char *string, int *len); + + +#endif + +/* End of cmdutil.h */ diff --git a/sim/ucsim/cmd.src/conf.mk b/sim/ucsim/cmd.src/conf.mk new file mode 100644 index 00000000..879e9bc8 --- /dev/null +++ b/sim/ucsim/cmd.src/conf.mk @@ -0,0 +1,10 @@ +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in + cd $(PRJDIR) && $(SHELL) ./config.status + +# End of conf.mk diff --git a/sim/ucsim/cmd.src/get.cc b/sim/ucsim/cmd.src/get.cc new file mode 100644 index 00000000..ab2888bc --- /dev/null +++ b/sim/ucsim/cmd.src/get.cc @@ -0,0 +1,79 @@ +/* + * Simulator of microcontrollers (get.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +// sim +#include "simcl.h" + +// local +#include "cmdsetcl.h" + + +/* + * GET TIMER + */ + +int +cl_get_cmd::timer(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + int what; + class cl_ticker *ticker; + + if (params[1] != 0) + { + what= (params[1])->get_ivalue(); + if ((ticker= sim->uc->get_counter(what)) == 0) + { + con->printf("Timer %d does not exist\n", what); + return(0); + } + con->printf("timer #%d: %g sec (%lu clks)\n", what, + ticker->get_rtime(sim->uc->xtal), ticker->ticks); + } + else + { + con->printf("time: %g sec (%lu clks)\n", + sim->uc->get_rtime(), sim->uc->ticks->ticks); + for (what= 0; what < sim->uc->counters->count; what++) + { + ticker= sim->uc->get_counter(what); + if (ticker) + con->printf("timer #%d: %g sec (%lu clks)\n", what, + ticker->get_rtime(sim->uc->xtal), ticker->ticks); + } + } + + return(0); +} + + +/* End of get.cc */ diff --git a/sim/ucsim/cmd.src/info.cc b/sim/ucsim/cmd.src/info.cc new file mode 100644 index 00000000..f53f8701 --- /dev/null +++ b/sim/ucsim/cmd.src/info.cc @@ -0,0 +1,156 @@ +/* + * Simulator of microcontrollers (info.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include +#include "i_string.h" + +// sim.src +#include "simcl.h" + +// local +#include "infocl.h" + + +/* + * INFO BREAKPOINTS command + */ + +int +cl_info_bp_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + int i; + char *s; + + con->printf("Num Type Disp Hit Cnt Address What\n"); + for (i= 0; i < sim->uc->fbrk->count; i++) + { + class cl_brk *fb= (class cl_brk *)(sim->uc->fbrk->at(i)); + s= sim->uc->disass(fb->addr, NULL); + con->printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", fb->nr, + "fetch", (fb->perm==brkFIX)?"keep":"del ", + fb->hit, fb->cnt, + fb->addr, s); + free(s); + } + for (i= 0; i < sim->uc->ebrk->count; i++) + { + class cl_ev_brk *eb= (class cl_ev_brk *)(sim->uc->ebrk->at(i)); + con->printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", eb->nr, + "event", (eb->perm==brkFIX)?"keep":"del ", + eb->hit, eb->cnt, + eb->addr, eb->id); + } + /*t_addr a; + class cl_rom *r= (class cl_rom *)(sim->uc->mem(MEM_ROM)); + for (a= 0; a < sim->uc->get_mem_size(MEM_ROM); a++) + { + if (r->bp_map->get(a)) + con->printf("0x%06x\n", a); + }*/ + return(0); +} + + +/* + * INFO REGISTERS command + */ + +int +cl_info_reg_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + sim->uc->print_regs(con); + return(0); +} + + +/* + * INFO HW command + */ + +int +cl_info_hw_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + char *p0; + enum hw_cath cath; + class cl_hw *hw; + int i= 0; + + if (params[0] == 0) + { + con->printf("Cathegory missing\n"); + return(0); + } + p0= (params[0])->get_svalue(); + if (strstr(p0, "t") == p0) + cath= HW_TIMER; + else if (strstr(p0, "u") == p0) + cath= HW_UART; + else if (strstr(p0, "po") == p0) + cath= HW_PORT; + else if (strstr(p0, "pc") == p0) + cath= HW_PCA; + else if (strstr(p0, "i") == p0) + cath= HW_INTERRUPT; + else if (strstr(p0, "w") == p0) + cath= HW_WDT; + else + { + con->printf("Unknown cathegory\n"); + return(0); + } + if (params[1] == 0) + { + // no ID + hw= sim->uc->get_hw(cath, &i); + while (hw) + { + hw->print_info(con); + i++; + hw= sim->uc->get_hw(cath, &i); + } + } + else + { + // ID given + int id= (params[1])->get_ivalue(); + hw= sim->uc->get_hw(cath, id, &i); + while (hw) + { + hw->print_info(con); + i++; + hw= sim->uc->get_hw(cath, id, &i); + } + } + return(0); +} + + +/* End of info.cc */ diff --git a/sim/ucsim/cmd.src/infocl.h b/sim/ucsim/cmd.src/infocl.h new file mode 100644 index 00000000..5b3af267 --- /dev/null +++ b/sim/ucsim/cmd.src/infocl.h @@ -0,0 +1,73 @@ +/* + * Simulator of microcontrollers (infocl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef INFOCL_HEADER +#define INFOCL_HEADER + +#include "newcmdcl.h" + + +class cl_info_bp_cmd: public cl_cmd +{ +public: + cl_info_bp_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +class cl_info_reg_cmd: public cl_cmd +{ +public: + cl_info_reg_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +class cl_info_hw_cmd: public cl_cmd +{ +public: + cl_info_hw_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) {} + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + + +#endif + +/* End of infocl.h */ diff --git a/sim/ucsim/cmd.src/newcmd.cc b/sim/ucsim/cmd.src/newcmd.cc new file mode 100644 index 00000000..90e4b028 --- /dev/null +++ b/sim/ucsim/cmd.src/newcmd.cc @@ -0,0 +1,1112 @@ +/* + * Simulator of microcontrollers (newcmd.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_SOCKET_H +# include +# include +# include +# include +#endif +#include +#if FD_HEADER_OK +# include HEADER_FD +#endif +#include +#include "i_string.h" + +// prj +#include "globals.h" + +// sim +#include "simcl.h" +#include "argcl.h" + +// local +#include "newcmdcl.h" +#include "cmdutil.h" + + +extern "C" int vasprintf(); +extern "C" int vsnprintf(); + +static int +cmd_do_print(FILE *f, char *format, va_list ap) +{ + int ret; +#ifdef HAVE_VASPRINTF + char *msg= NULL; + vasprintf(&msg, format, ap); + ret= fprintf(f, "%s", msg); + free(msg); +#else +# ifdef HAVE_VSNPRINTF + char msg[80*25]; + vsnprintf(msg, 80*25, format, ap); + ret= fprintf(f, "%s", msg); +# else +# ifdef HAVE_VPRINTF + char msg[80*25]; + vsprintf(msg, format, ap); /* Dangerous */ + ret= fprintf(f, "%s", msg); +# else +# ifdef HAVE_DOPRNT + /* ??? */ + /*strcpy(msg, "Unimplemented printf has called.\n");*/ +# else + /*strcpy(msg, "printf can not be implemented, upgrade your libc.\n");*/ +# endif +# endif +# endif +#endif + fflush(f); + return(ret); +} + + +/* + * Command line + *____________________________________________________________________________ + */ + +cl_cmdline::cl_cmdline(char *acmd) +{ + cmd= strdup(acmd); + params= new cl_list(2, 2); + tokens= new cl_ustrings(2, 2); + name= 0; +} + +cl_cmdline::~cl_cmdline(void) +{ + if (cmd) + free(cmd); + if (name) + free(name); + delete params; + delete tokens; +} + +int +cl_cmdline::init(void) +{ + split(); + return(0); +} + +char * +cl_cmdline::skip_delims(char *start) +{ + while (*start && + strchr(" \t\v\r,", *start)) + start++; + return(start); +} + +int +cl_cmdline::split(void) +{ + char *start= cmd; + int i; + + name= 0; + if (!cmd || + !*cmd) + return(0); + start+= strspn(start, " \t\v\r,"); + if (start && + *start == '\n') + { + name= (char*)malloc(2); + strcpy(name, "\n"); + return(0); + } + if (!*start) + return(0); + i= strcspn(start, " \t\v\r,"); + if (i) + { + name= (char*)malloc(i+1); + strncpy(name, start, i); + name[i]= '\0'; + } + start+= i; + start= skip_delims(start); + // skip delimiters + while (*start) + { + char *end, *param_str; + if (*start == '"') + { + // string + start++; + end= start; + while (*end && + *end != '"') + end++; + if (*end == '"') + end--; + else + simulator->cmd->printf("Unterminated string\n"); + param_str= (char *)malloc(end-start+2); + strncpy(param_str, start, 1+end-start); + param_str[1+end-start]= '\0'; + tokens->add(strdup(param_str)); + params->add(simulator->mk_cmd_str_arg(param_str)); + free(param_str); + if (*end) + end++; + if (*end == '"') + end++; + } + else + { + char *dot; + i= strcspn(start, " \t\v\r,"); + end= start+i; + param_str= (char *)malloc(i+1); + strncpy(param_str, start, i); + param_str[i]= '\0'; + tokens->add(strdup(param_str)); + if ((dot= strchr(param_str, '.')) != NULL) + { + // bit + class cl_cmd_arg *sfr, *bit; + *dot= '\0'; + dot++; + if (strchr("0123456789", *param_str) != NULL) + sfr= simulator->mk_cmd_int_arg((long long) + strtol(param_str, 0, 0)); + else + sfr= simulator->mk_cmd_sym_arg(param_str); + if (*dot == '\0') + { + bit= 0; + simulator->cmd->printf("Uncomplete bit address\n"); + } + else + { + if (strchr("0123456789", *dot) != NULL) + bit= simulator->mk_cmd_int_arg((long long) + strtol(dot, 0, 0)); + else + bit= simulator->mk_cmd_sym_arg(dot); + } + params->add(simulator->mk_cmd_bit_arg(sfr, bit)); + } + else if (strchr("0123456789", *param_str) != NULL) + { + // number + params->add(simulator->mk_cmd_int_arg((long long) + strtol(param_str, 0, 0))); + } + else + { + // symbol + params->add(simulator->mk_cmd_sym_arg(param_str)); + } + free(param_str); + } + start= end; + start= skip_delims(start); + } + return(0); +} + +int +cl_cmdline::shift(void) +{ + char *s= skip_delims(cmd); + + free(name); + name= NULL; + if (s && *s) + { + while (*s && + strchr(" \t\v\r,", *s) == NULL) + s++; + s= skip_delims(s); + char *p= strdup(s); + free(cmd); + cmd= p; + delete params; + params= new cl_list(2, 2); + split(); + } + return(name && *name); +} + +int +cl_cmdline::repeat(void) +{ + return(name && + *name == '\n'); +} + +class cl_cmd_arg * +cl_cmdline::param(int num) +{ + if (num >= params->count) + return(0); + return((class cl_cmd_arg *)(params->at(num))); +} + +void +cl_cmdline::insert_param(int pos, class cl_cmd_arg *param) +{ + if (pos >= params->count) + params->add(param); + else + params->add_at(pos, param); +} + + +/* + * Command + *____________________________________________________________________________ + */ + +cl_cmd::cl_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp): + cl_base() +{ + sim= asim; + names= new cl_strings(1, 1); + names->add(aname?strdup(aname):strdup("unknown")); + can_repeat= can_rep; + short_help= short_hlp?strdup(short_hlp):NULL; + long_help= long_hlp?strdup(long_hlp):NULL; +} + +/*cl_cmd::cl_cmd(class cl_sim *asim): + cl_base() +{ + sim= asim; + name= short_help= long_help= 0; + can_repeat= 0; +}*/ + +cl_cmd::~cl_cmd(void) +{ + delete names; + if (short_help) + free(short_help); + if (long_help) + free(long_help); +} + +void +cl_cmd::add_name(char *name) +{ + if (name) + names->add(strdup(name)); +} + +int +cl_cmd::name_match(char *aname, int strict) +{ + int i; + + if (names->count == 0 && + !aname) + return(1); + if (!aname) + return(0); + if (strict) + { + for (i= 0; i < names->count; i++) + { + char *n= (char*)(names->at(i)); + if (strcmp(aname, n) == 0) + return(1); + } + } + else + { + for (i= 0; i < names->count; i++) + { + char *n= (char*)(names->at(i)); + if (strstr(n, aname) == n) + return(1); + } + } + return(0); +} + +int +cl_cmd::name_match(class cl_cmdline *cmdline, int strict) +{ + return(name_match(cmdline->name, strict)); +} + +int +cl_cmd::syntax_ok(class cl_cmdline *cmdline) +{ + return(1); +} + +int +cl_cmd::work(class cl_cmdline *cmdline, class cl_console *con) +{ + if (!syntax_ok(cmdline)) + return(0); + return(do_work(cmdline, con)); +} + +int +cl_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + con->printf("Command \"%s\" does nothing.\n", (char*)(names->at(0))); + return(0); +} + + +/* + * Set of commands + *____________________________________________________________________________ + */ + +cl_cmdset::cl_cmdset(class cl_sim *asim): + cl_list(5, 5) +{ + sim= asim; + last_command= 0; +} + +class cl_cmd * +cl_cmdset::get_cmd(class cl_cmdline *cmdline) +{ + int i; + + if (cmdline->repeat()) + { + if (last_command) + return(last_command); + else + return(0); + } + // exact match + for (i= 0; i < count; i++) + { + class cl_cmd *c= (class cl_cmd *)at(i); + if (c->name_match(cmdline, 1)) + return(c); + } + // not exact match + class cl_cmd *c_matched= 0; + for (i= 0; i < count; i++) + { + class cl_cmd *c= (class cl_cmd *)at(i); + if (c->name_match(cmdline, 0)) + { + if (!c_matched) + c_matched= c; + else + return(0); + } + } + return(c_matched); + //return(0); +} + +void +cl_cmdset::del(char *name) +{ + int i; + + if (!name) + return; + for (i= 0; i < count; i++) + { + class cl_cmd *cmd= (class cl_cmd *)(at(i)); + if (cmd->name_match(name, 1)) + free_at(i); + } +} + +void +cl_cmdset::replace(char *name, class cl_cmd *cmd) +{ + int i; + + if (!name) + return; + for (i= 0; i < count; i++) + { + class cl_cmd *c= (class cl_cmd *)(at(i)); + if (c->name_match(name, 1)) + { + delete c; + put_at(i, cmd); + } + } +} + + +/* + * Composed command: subset of commands + *____________________________________________________________________________ + */ + +cl_super_cmd::cl_super_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp, + class cl_cmdset *acommands): + cl_cmd(asim, aname, can_rep, short_hlp, long_hlp) +{ + commands= acommands; +} + +cl_super_cmd::~cl_super_cmd(void) +{ + if (commands) + delete commands; +} + +int +cl_super_cmd::work(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd *cmd; + + if (!commands) + return(0); + + if (!cmdline->shift()) + { + int i; + con->printf("\"%s\" must be followed by the name of a subcommand\n" + "List of subcommands:\n", (char*)(names->at(0))); + for (i= 0; i < commands->count; i++) + { + cmd= (class cl_cmd *)(commands->at(i)); + con->printf("%s\n", cmd->short_help); + } + return(0); + } + if ((cmd= commands->get_cmd(cmdline)) == NULL) + { + con->printf("Undefined subcommand: \"%s\". Try \"help %s\".\n", + cmdline->name, (char*)(names->at(0))); + return(0); + } + return(cmd->work(cmdline, con)); +} + + +/* + * Command console + *____________________________________________________________________________ + */ + +cl_console::cl_console(char *fin, char *fout, class cl_sim *asim): + cl_base() +{ + FILE *f; + + last_command= NULL; + sim= asim; + in= stdin; + if (fin) + if (f= fopen(fin, "r+"), in= f?f:stdin, !f) + fprintf(stderr, "Can't open `%s': %s\n", fin, strerror(errno)); + out= stdout; + if (fout) + if (f= fopen(fout, "w+"), out= f?f:stdout, !f) + fprintf(stderr, "Can't open `%s': %s\n", fout, strerror(errno)); + prompt= 0; +} + +cl_console::cl_console(FILE *fin, FILE *fout, class cl_sim *asim): + cl_base() +{ + last_command= NULL; + sim= asim; + in = fin; + out= fout; +} + +/* + * use the port number supplied to connect to localhost for + * (by Sandeep) + */ + +#ifdef SOCKET_AVAIL +static int +connect_to_port(int portnum) +{ + int sock= socket(AF_INET,SOCK_STREAM,0); + struct sockaddr_in sin; + + sin.sin_family = AF_INET; + sin.sin_port = htons(portnum); + sin.sin_addr.s_addr = inet_addr("127.0.0.1"); + + if (connect(sock, (struct sockaddr *)&sin, sizeof(sin))) { + fprintf(stderr, "Connect to port %d: %s\n", portnum, strerror(errno)); + return -1; + } + return sock; +} + +cl_console::cl_console(int portnumber, class cl_sim *asim) +{ + int sock= connect_to_port(portnumber); + + last_command= NULL; + sim= asim; + if (!(in= fdopen(sock, "r+"))) + fprintf(stderr, "cannot open port for input\n"); + if (!(out= fdopen(sock, "w+"))) + fprintf(stderr, "cannot open port for output\n"); + //fprintf(stderr, "init socket done\n"); +} +#endif + +int +cl_console::init(void) +{ + cl_base::init(); + welcome(); + flags&= ~CONS_PROMPT; + print_prompt(); + return(0); +} + +cl_console::~cl_console(void) +{ + if (in) + fclose(in); + if (out) + { + fprintf(out, "\n"); + fflush(out); + fclose(out); + } +#ifdef SOCKET_AVAIL + /* if (sock) + { + shutdown(sock, 2); + close(sock); + }*/ +#endif +} + + +/* + * Output functions + */ + +void +cl_console::welcome(void) +{ + fprintf(out, + "ucsim %s, Copyright (C) 1997 Daniel Drotos, Talker Bt.\n" + "ucsim comes with ABSOLUTELY NO WARRANTY; for details type " + "`show w'.\n" + "This is free software, and you are welcome to redistribute it\n" + "under certain conditions; type `show c' for details.\n", + VERSIONSTR); + fflush(out); +} + +void +cl_console::print_prompt(void) +{ + char *p; + + if (flags & (CONS_PROMPT|CONS_FROZEN)) + return; + flags|= CONS_PROMPT; + if (sim->arg_avail('P')) + putc('\0', out); + else + fprintf(out, "%s", prompt?prompt: + ((p= sim->get_sarg(0, "prompt"))?p:"> ")); + fflush(out); +} + +int +cl_console::printf(char *format, ...) +{ + va_list ap; + int ret= 0; + + if (out) + { + va_start(ap, format); + ret= cmd_do_print(out, format, ap); + va_end(ap); + } + return(ret); +} + +void +cl_console::print_bin(long data, int bits) +{ + long mask= 1; + + if (!out) + return; + mask= mask << ((bits >= 1)?(bits-1):0); + while (bits--) + { + fprintf(out, "%c", (data&mask)?'1':'0'); + mask>>= 1; + } +} + +/* + * Input functions + */ + +int +cl_console::match(int fdnum) +{ + if (in && + fileno(in) == fdnum) + return(1); + return(0); +} + +int +cl_console::get_in_fd(void) +{ + return(in?fileno(in):-1); +} + +int +cl_console::input_avail(void) +{ + struct timeval tv; + int i; + + if ((i= get_in_fd()) < 0) + return(0); + fd_set s; + FD_ZERO(&s); + FD_SET(i, &s); + tv.tv_sec= tv.tv_usec= 0; + i= select(i+1, &s, NULL, NULL, &tv); + return(i); +} + +char * +cl_console::read_line(void) +{ + char *s= NULL; + +#ifdef HAVE_GETLINE + if (getline(&s, 0, in) < 0) + return(0); +#else + +# ifdef HAVE_GETDELIM + size_t n= 30; + s= (char *)malloc(n); + if (getdelim(&s, &n, '\n', in) < 0) + { + free(s); + return(0); + } +# else + +# ifdef HAVE_FGETS + s= (char *)malloc(300); + if (fgets(s, 300, in) == NULL) + { + free(s); + return(0); + } +# endif +# endif +#endif + s[strlen(s)-1]= '\0'; + if (s[strlen(s)-1] == '\r') + s[strlen(s)-1]= '\0'; + flags&= ~CONS_PROMPT; + return(s); +} + +int +cl_console::proc_input(void) +{ + int retval; + + if (feof(in)) + { + fprintf(out, "End\n"); + return(1); + } + char *cmd= read_line(); + if (!cmd) + return(1); + if (flags & CONS_FROZEN) + { + sim->stop(resUSER); + flags&= ~CONS_FROZEN; + retval= 0; + } + else + retval= sim->do_cmd(cmd, this); + if (!retval) + print_prompt(); + free(cmd); + return(retval); +} + +/* + * Old version, sim->do_cmd() falls into this if it doesn't find a new + * command object which can handle enetered command + */ + +int +cl_console::interpret(char *cmd) +{ + fprintf(out, "New interpreter does not known this command\n"); + return(0); +} + + +/* + * This console listen on a socket and can accept connection requests + */ +#ifdef SOCKET_AVAIL + +cl_listen_console::cl_listen_console(int serverport, class cl_sim *asim) +{ + last_command= NULL; + sim= asim; + if ((sock= make_server_socket(serverport)) >= 0) + { + if (listen(sock, 10) < 0) + fprintf(stderr, "Listen on port %d: %s\n", + serverport, strerror(errno)); + } + in= out= 0; +} + +int +cl_listen_console::match(int fdnum) +{ + return(sock == fdnum); +} + +int +cl_listen_console::get_in_fd(void) +{ + return(sock); +} + +int +cl_listen_console::proc_input(void) +{ + int newsock; + uint size; + struct sockaddr_in sock_addr; + + size= sizeof(struct sockaddr); + newsock= accept(sock, (struct sockaddr*)&sock_addr, &size); + if (newsock < 0) + { + perror("accept"); + return(0); + } + if (!(in= fdopen(newsock, "r+"))) + fprintf(stderr, "cannot open port for input\n"); + if (!(out= fdopen(newsock, "w+"))) + fprintf(stderr, "cannot open port for output\n"); + sim->cmd->add_console(sim->cmd->mk_console(in, out, sim)); + in= out= 0; + return(0); +} + +#endif /* SOCKET_AVAIL */ + + +/* + * Command interpreter + *____________________________________________________________________________ + */ + +cl_commander::cl_commander(class cl_sim *asim): + cl_base() +{ + cons= new cl_list(1, 1); + actual_console= frozen_console= 0; + sim= asim; +} + +int +cl_commander::init(void) +{ + cl_base::init(); + if (!sim) + return(1); + if (sim->arg_avail('c')) + { + add_console(mk_console(sim->get_sarg('c', 0), + sim->get_sarg('c', 0), sim)); + } +#ifdef SOCKET_AVAIL + if (sim->arg_avail('Z')) + { + add_console(mk_console(sim->get_iarg(0, "Zport"), sim)); + } + if (sim->arg_avail('r')) + { + add_console(mk_console(sim->get_iarg('r', 0), sim)); + } +#endif + if (cons->get_count() == 0) + { + add_console(mk_console(stdin, stdout, sim)); + } + return(0); +} + +cl_commander::~cl_commander(void) +{ + delete cons; +} + +class cl_console * +cl_commander::mk_console(char *fin, char *fout, class cl_sim *asim) +{ + return(new cl_console(fin, fout, asim)); +} + +class cl_console * +cl_commander::mk_console(FILE *fin, FILE *fout, class cl_sim *asim) +{ + return(new cl_console(fin, fout, asim)); +} + +#ifdef SOCKET_AVAIL +class cl_console * +cl_commander::mk_console(int portnumber, class cl_sim *asim) +{ + return(new cl_listen_console(portnumber, asim)); +} +#endif + +void +cl_commander::add_console(class cl_console *console) +{ + console->init(); + cons->add(console); + set_fd_set(); +} + +void +cl_commander::del_console(class cl_console *console) +{ + cons->disconn(console); + set_fd_set(); +} + +void +cl_commander::set_fd_set(void) +{ + int i; + + FD_ZERO(&read_set); + fd_num= 0; + for (i= 0; i < cons->count; i++) + { + int fd; + class cl_console *c= (class cl_console*)(cons->at(i)); + if ((fd= c->get_in_fd()) >= 0) + { + if (fd > fd_num) + fd_num= fd; + FD_SET(fd, &read_set); + } + } + fd_num++; +} + + +/* + * Printing to all consoles + */ + +int +cl_commander::all_printf(char *format, ...) +{ + va_list ap; + int i, ret= 0; + + for (i= 0; i < cons->count; i++) + { + class cl_console *c= (class cl_console*)(cons->at(i)); + if (c->out) + { + va_start(ap, format); + ret= cmd_do_print(c->out, format, ap); + va_end(ap); + } + } + return(ret); +} + +/* + * Printing to actual_console + */ + +int +cl_commander::printf(char *format, ...) +{ + va_list ap; + int ret= 0; + + if (actual_console && + actual_console->out) + { + va_start(ap, format); + ret= cmd_do_print(actual_console->out, format, ap); + va_end(ap); + } + return(ret); +} + +/* + * Printing to consoles which have CONS_DEBUG flag set + */ + +int +cl_commander::debug(char *format, ...) +{ + va_list ap; + int i, ret= 0; + + for (i= 0; i < cons->count; i++) + { + class cl_console *c= (class cl_console*)(cons->at(i)); + if (c->out && + c->flags & CONS_DEBUG) + { + va_start(ap, format); + ret= cmd_do_print(c->out, format, ap); + va_end(ap); + } + } + return(ret); +} + +int +cl_commander::flag_printf(int iflags, char *format, ...) +{ + va_list ap; + int i, ret= 0; + + for (i= 0; i < cons->count; i++) + { + class cl_console *c= (class cl_console*)(cons->at(i)); + if (c->out && + (c->flags & iflags) == iflags) + { + va_start(ap, format); + ret= cmd_do_print(c->out, format, ap); + va_end(ap); + } + } + return(ret); +} + +int +cl_commander::input_avail(void) +{ + struct timeval tv; + int i; + + tv.tv_sec= tv.tv_usec= 0; + active_set= read_set; + i= select(fd_num/*FD_SETSIZE*/, &active_set, NULL, NULL, &tv); + return(i); +} + +int +cl_commander::input_avail_on_frozen(void) +{ + if (!frozen_console) + return(0); + return(frozen_console->input_avail()); +} + +int +cl_commander::wait_input(void) +{ + int i; + + active_set= read_set; + i= select(fd_num/*FD_SETSIZE*/, &active_set, NULL, NULL, NULL); + return(i); +} + +int +cl_commander::proc_input(void) +{ + int i; + + for (i= 0; i < fd_num/*FD_SETSIZE*/; i++) + if (FD_ISSET(i, &active_set)) + { + class cl_console *c; + int j; + for (j= 0; j < cons->count; j++) + { + c= (class cl_console*)(cons->at(j)); + if (c->match(i)) + { + actual_console= c; + int retval= c->proc_input(); + if (retval) + { + del_console(c); + delete c; + } + actual_console= 0; + return(cons->count == 0); + } + } + } + return(0); +} + + +/* End of newcmd.cc */ diff --git a/sim/ucsim/cmd.src/newcmdcl.h b/sim/ucsim/cmd.src/newcmdcl.h new file mode 100644 index 00000000..d384e7fe --- /dev/null +++ b/sim/ucsim/cmd.src/newcmdcl.h @@ -0,0 +1,229 @@ +/* + * Simulator of microcontrollers (cmdcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef CMDCL_HEADER +#define CMDCL_HEADER + + +#include "ddconfig.h" + +#include +#if FD_HEADER_OK +# include HEADER_FD +#endif + +#include "pobjcl.h" + + +/* + * Command line with parameters + */ + +class cl_cmdline: cl_base +{ +public: + char *cmd; + char *name; + class cl_list *params; + class cl_ustrings *tokens; + +public: + cl_cmdline(char *cmd); + virtual ~cl_cmdline(void); + virtual int init(void); + + virtual int split(void); + virtual int shift(void); + virtual int repeat(void); + virtual class cl_cmd_arg *param(int num); + virtual void insert_param(int pos, class cl_cmd_arg *param); +private: + char *skip_delims(char *start); +}; + + +/* + * Command and container + */ + +// simple command +class cl_cmd: public cl_base +{ +public: + class cl_sim *sim; + class cl_strings *names; + int can_repeat; + char *short_help; + char *long_help; + +public: + cl_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp); + ~cl_cmd(void); + + virtual void add_name(char *name); + virtual int name_match(char *aname, int strict); + virtual int name_match(class cl_cmdline *cmdline, int strict); + virtual int syntax_ok(class cl_cmdline *cmdline); + virtual int work(class cl_cmdline *cmdline, class cl_console *con); + virtual int do_work(class cl_cmdline *cmdline, class cl_console *con); +}; + +// Command set is list of cl_cmd objects +class cl_cmdset: public cl_list +{ +public: + class cl_sim *sim; + class cl_cmd *last_command; + +public: + cl_cmdset(class cl_sim *asim); + + virtual class cl_cmd *get_cmd(class cl_cmdline *cmdline); + virtual void del(char *name); + virtual void replace(char *name, class cl_cmd *cmd); +}; + +// subset of commands +class cl_super_cmd: public cl_cmd +{ +public: + class cl_cmdset *commands; + +public: + cl_super_cmd(class cl_sim *asim, + char *aname, + int can_rep, + char *short_hlp, + char *long_hlp, + class cl_cmdset *acommands); + ~cl_super_cmd(void); + + virtual int work(class cl_cmdline *cmdline, class cl_console *con); +}; + + +/* + * Command console + */ + +class cl_console: public cl_base +{ +public: + class cl_sim *sim; + FILE *in, *out; + char *last_command; + int flags; // See CONS_XXXX + char *prompt; + +public: + cl_console(): cl_base() {} + cl_console(char *fin, char *fout, class cl_sim *asim); + cl_console(FILE *fin, FILE *fout, class cl_sim *asim); +#ifdef SOCKET_AVAIL + cl_console(int portnumber, class cl_sim *asim); +#endif + ~cl_console(void); + virtual int init(void); + + virtual void welcome(void); + virtual void print_prompt(void); + virtual int printf(char *format, ...); + virtual void print_bin(long data, int bits); + virtual int match(int fdnum); + virtual int get_in_fd(void); + virtual int input_avail(void); + virtual char *read_line(void); + virtual int proc_input(void); + virtual bool interpret(char *cmd); + virtual bool old_command(class cl_cmdline *cmdline) { return(FALSE); } +}; + +#ifdef SOCKET_AVAIL +class cl_listen_console: public cl_console +{ +public: + int sock; +public: + cl_listen_console(int serverport, class cl_sim *asim); + + virtual void welcome(void) {} + virtual void prompt(void) {} + + virtual int match(int fdnum); + virtual int get_in_fd(void); + virtual int proc_input(void); +}; +#endif + + +/* + * Command interpreter + */ + +class cl_commander: public cl_base +{ +public: + class cl_list *cons; + fd_set read_set, active_set; + int fd_num; + class cl_sim *sim; + class cl_console *actual_console, *frozen_console; + +public: + cl_commander(class cl_sim *asim); + ~cl_commander(void); + virtual int init(void); + + virtual class cl_console *mk_console(char *fin, char *fout, + class cl_sim *asim); + virtual class cl_console *mk_console(FILE *fin, FILE *fout, + class cl_sim *asim); +#ifdef SOCKET_AVAIL + virtual class cl_console *mk_console(int portnumber, class cl_sim *asim); +#endif + void add_console(class cl_console *console); + void del_console(class cl_console *console); + void set_fd_set(void); + + int all_printf(char *format, ...); // print to all consoles + int printf(char *format, ...); // print to actual_console + int debug(char *format, ...); // print consoles with debug flag set + int flag_printf(int iflags, char *format, ...); + int input_avail(void); + int input_avail_on_frozen(void); + int wait_input(void); + int proc_input(void); +}; + + +#endif + +/* End of cmdcl.h */ diff --git a/sim/ucsim/cmd.src/set.cc b/sim/ucsim/cmd.src/set.cc new file mode 100644 index 00000000..26ed424b --- /dev/null +++ b/sim/ucsim/cmd.src/set.cc @@ -0,0 +1,73 @@ +/* + * Simulator of microcontrollers (set.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +// sim +#include "simcl.h" + +// local +#include "cmdsetcl.h" + + +/* + * SET TIMER + */ + +int +cl_set_cmd::timer(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + int what, dir; + class cl_ticker *ticker; + + if (params[1] == 0) + { + con->printf("Timer number is missing\n"); + return(0); + } + what= (params[1])->get_ivalue(); + if ((ticker= sim->uc->get_counter(what)) != 0) + { + con->printf("Timer %d already exists\n", what); + return(0); + } + if (params[2] != 0) + dir= (params[2])->get_ivalue(); + else + dir= 1; + ticker= new cl_ticker(dir, 0, 0); + sim->uc->add_counter(ticker, what); + + return(0); +} + + +/* End of set.cc */ diff --git a/sim/ucsim/cmd.src/syntax.cc b/sim/ucsim/cmd.src/syntax.cc new file mode 100644 index 00000000..76841e25 --- /dev/null +++ b/sim/ucsim/cmd.src/syntax.cc @@ -0,0 +1,31 @@ +/* + * Simulator of microcontrollers (syntax.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +// local +#include "syntaxcl.h" + +/* End of syntax.cc */ diff --git a/sim/ucsim/cmd.src/syntaxcl.h b/sim/ucsim/cmd.src/syntaxcl.h new file mode 100644 index 00000000..57a2e015 --- /dev/null +++ b/sim/ucsim/cmd.src/syntaxcl.h @@ -0,0 +1,33 @@ +/* + * Simulator of microcontrollers (syntaxcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef SYNTAXCL_HEADER +#define SYNTAXCL_HEADER + +#endif + +/* End of syntaxcl.h */ diff --git a/sim/ucsim/cmd.src/timer.cc b/sim/ucsim/cmd.src/timer.cc new file mode 100644 index 00000000..51f88748 --- /dev/null +++ b/sim/ucsim/cmd.src/timer.cc @@ -0,0 +1,266 @@ +/* + * Simulator of microcontrollers (timer.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include "stdio.h" +#include "i_string.h" + +// sim +#include "simcl.h" + +// local +#include "cmdsetcl.h" +#include "newcmdcl.h" + + +/* + * Command: timer + *---------------------------------------------------------------------------- + */ + +int +cl_timer_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con) +{ + char *s; + + if (cmdline->param(0) == 0) + { + if (long_help) + con->printf("%s\n", long_help); + else + con->printf("What to do?\n"); + return(0); + } + if ((s= cmdline->param(0)->get_svalue())) + { + if (cmdline->param(1) == 0) + { + con->printf("Timer number is missing\n"); + return(0); + } + set_ticker(cmdline->param(1)); + if (strstr(s, "c") == s || + strstr(s, "m") == s || + strstr(s, "a") == s) + return(add(cmdline, con)); + else if (strstr(s, "d") == s) + return(del(cmdline, con)); + else if (strstr(s, "g") == s) + return(get(cmdline, con)); + else if (strstr(s, "r") == s) + return(run(cmdline, con)); + else if (strstr(s, "s") == s) + return(stop(cmdline, con)); + else if (strstr(s, "v") == s) + return(val(cmdline, con)); + else + con->printf("Undefined timer command: \"%s\". Try \"help timer\"\n", + s); + } + return(0); +} + +void +cl_timer_cmd::set_ticker(class cl_cmd_arg *param) +{ + if ((name= param->get_svalue()) == 0) + what= param->get_ivalue(); + if (name) + ticker= sim->uc->get_counter(name); + else + ticker= sim->uc->get_counter(what); +} + +/* + * Add a new timer to the list + */ + +int +cl_timer_cmd::add(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + int dir= +1, in_isr= 0; + + if (!name && + what < 1) + { + con->printf("Timer id must be greater then zero or a string\n"); + return(0); + } + if (ticker) + { + if (name) + con->printf("Timer \"%s\" already exists\n", name); + else + con->printf("Timer %d already exists\n", what); + return(0); + } + if (params[2] != 0) + dir= (params[2])->get_ivalue(); + if (params[3] != 0) + in_isr= (params[3])->get_ivalue(); + + if (name) + { + ticker= new cl_ticker(dir, in_isr, name); + sim->uc->add_counter(ticker, name); + } + else + { + ticker= new cl_ticker(dir, in_isr, 0); + sim->uc->add_counter(ticker, what); + } + + return(0); +} + +/* + * Delete a timer from the list + */ + +int +cl_timer_cmd::del(class cl_cmdline *cmdline, class cl_console *con) +{ + if (!ticker) + { + if (name) + con->printf("Timer \"%s\" does not exist\n", name); + else + con->printf("Timer %d does not exist\n", what); + return(0); + } + if (name) + sim->uc->del_counter(name); + else + sim->uc->del_counter(what); + + return(0); +} + +/* + * Get the value of just one timer or all of them + */ + +int +cl_timer_cmd::get(class cl_cmdline *cmdline, class cl_console *con) +{ + if (ticker) + ticker->dump(what, sim->uc->xtal, con); + else + { + sim->uc->ticks->dump(0, sim->uc->xtal, con); + sim->uc->isr_ticks->dump(0, sim->uc->xtal, con); + sim->uc->idle_ticks->dump(0, sim->uc->xtal, con); + for (what= 0; what < sim->uc->counters->count; what++) + { + ticker= sim->uc->get_counter(what); + if (ticker) + ticker->dump(what, sim->uc->xtal, con); + } + } + + return(0); +} + +/* + * Allow a timer to run + */ + +int +cl_timer_cmd::run(class cl_cmdline *cmdline, class cl_console *con) +{ + if (!ticker) + { + if (name) + con->printf("Timer %d does not exist\n", name); + else + con->printf("Timer %d does not exist\n", what); + return(0); + } + ticker->options|= TICK_RUN; + + return(0); +} + +/* + * Stop a timer + */ + +int +cl_timer_cmd::stop(class cl_cmdline *cmdline, class cl_console *con) +{ + if (!ticker) + { + if (name) + con->printf("Timer %d does not exist\n", name); + else + con->printf("Timer %d does not exist\n", what); + return(0); + } + ticker->options&= ~TICK_RUN; + + return(0); +} + + +/* + * Set a timer to a specified value + */ + +int +cl_timer_cmd::val(class cl_cmdline *cmdline, class cl_console *con) +{ + class cl_cmd_arg *params[4]= { cmdline->param(0), + cmdline->param(1), + cmdline->param(2), + cmdline->param(3) }; + + if (!ticker) + { + if (name) + con->printf("Timer %d does not exist\n", name); + else + con->printf("Timer %d does not exist\n", what); + return(0); + } + if (params[2] == 0) + { + con->printf("Value is missing\n"); + return(0); + } + long val= (params[2])->get_ivalue(); + ticker->ticks= val; + + return(0); +} + + +/* End of timer.cc */ diff --git a/sim/ucsim/doc/Makefile.in b/sim/ucsim/doc/Makefile.in new file mode 100644 index 00000000..37486cb5 --- /dev/null +++ b/sim/ucsim/doc/Makefile.in @@ -0,0 +1,79 @@ +# +# uCsim doc/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1997 +# + +STARTYEAR = 1997 + +SHELL = /bin/sh +INSTALL = @INSTALL@ + +PRJDIR = .. + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ +docdir = $(prefix)/doc/ucsim + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: doc + +doc: checkconf + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + cp *.html $(docdir) + cp *.gif $(docdir) + cp *.jpg $(docdir) + cp *.fig $(docdir) + + +# Deleting all the installed files +# -------------------------------- +uninstall: + rm -f $(docdir)/* + + +# Performing self-test +# -------------------- +check: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + test -d $(docdir) || $(INSTALL) -d $(docdir) + + +# Creating dependencies +# --------------------- +include clean.mk + +# My rules +# -------- + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(PRJDIR)/devel ]; then\ + $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\ + fi + +# End of s51.src/Makefile.in diff --git a/sim/ucsim/doc/UCsim.jpg b/sim/ucsim/doc/UCsim.jpg new file mode 100644 index 0000000000000000000000000000000000000000..57ee188eefb850026a1aa5f83bf27f200b8f5db7 GIT binary patch literal 5540 zcmbW4XHXMdm&X%YATZJ)AWeD+z4sZ$9Gj?^u$Zi{tOOgcp@9~guVWy>jZIWY zjE{}YD9G`NdtexwBAc`%l+D=7$0yLu-P`rf7Xja*0qOu^A|enGAu$L9A|W9LlhJ_5 zNJ+^UsHn+lm>F4Fm>HRv*f@oF*w~>QOiaAed{7Zl2?+^S9$7^hF$E!U39)~Q07*zl z$VkZ`U@%1N0n-Dq|Fdqp0hGi5Gr%A|kR5XpDg4q3N#Nx7wi8<8jduZX) z2b|(g{_!MWI(i5LBNsOhFCV{zq?ELbtepBo4NWa=9bID+Q!{f5ODlx4%VSqJcaMO; zpx}_uu<)k|iAl-No~LBzynL0L_d36zt!=%1{R4wT!y}_J zvvczci%ZKZ7%XmMb8Gv@&hFvS@yY4g`Nf~hf4G1E{C{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P9HhSnFZF^55^xo zoGeoM#<~eh)=1&zaM(_NDMi9UFC1U6G+4#3@`oe+loLsKOr!iN9hY)0UrlH=Vn0TR zeUPMeHw;;oF>>lr+$WM}HPYze=*1k^WPlsAhKCi*T`J8~f ze%_K;k&n~wTH4GE#cU{tR6->^?z^NrfU0SX@x5i}9X>RvF!Gk-O@L8V6(>`h6Q-Zz zoJqNfw24yq;yk8<^KSX C&s~)O literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/analyzer.html b/sim/ucsim/doc/analyzer.html new file mode 100644 index 00000000..08c91d97 --- /dev/null +++ b/sim/ucsim/doc/analyzer.html @@ -0,0 +1,35 @@ + + +UCSIM: Code Analyzer + + + + +

Code analyzer

+ +This feature is included into both DOS and UNIX versions. Code +analyzer analyzes the code of the simulated program and tries to +figure out which address contains valid instruction. Analyzer starts +analyzing of the code with address 0 which always must contain an +instruction because reset of the device sets zero into program +counter. So, analyzer marks address 0 that it contains an +instruction. Then it marks the address of the next instruction and so +on. If the analyzer finds a jump instruction it continues with +destination address of the jump instruction. If it finds a +call instruction, it recursively analyzes destination address +as well as next instruction follows the call one. Analyzator +stops if it finds an address which is already marked or if it finds a +return instruction or an indirect jump which is +impossible to follow. All these mean that it is impossible to discover +all instructions of the program. + +

This problem is solved in very simple way in UNIX version. If the +execution reaches an umarked address, the analyzer is called to +analyze the code starting at actual address pointed by the PC. This +method is not included into DOS version but this re-analyzation can be +requested by pressing Ctrl-F7 at any time. + +


+ + + diff --git a/sim/ucsim/doc/burst.gif b/sim/ucsim/doc/burst.gif new file mode 100644 index 0000000000000000000000000000000000000000..fbdcf575f78a5ebbd3eeac5bbd9f963962ab664f GIT binary patch literal 235 zcmZ?wbhEHb6k!l!IK;s49|+DEpZWiPW*S3UTAH!3F#{MV{__jT$ShV!EGkg|Qki)Q zB^jv-1*J(jnaK(%`MHUid3p-osbxS3kJ9vv)M6clY!ENQAvLo^FF8L~MXn zDYZz!(9+VBLGdRGBLf2ygAT}iknIf2aT>es{4+SUl4tW3o}3LYCJ5%-`ZlvqY)y_i zON{zvlk8Qc_r#nUUz;+oS7*8wAfNp1ThKa>J&QI6cbF|deBP(?&CiC}j@vi=I#{!y ctx@66$5l65-@mTg36FLd3o%#&030@6>Hq)$ literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/clean.mk b/sim/ucsim/doc/clean.mk new file mode 100644 index 00000000..74b12cbe --- /dev/null +++ b/sim/ucsim/doc/clean.mk @@ -0,0 +1,22 @@ +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] + rm -f .[a-z]*~ + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f Makefile *.dep + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean diff --git a/sim/ucsim/doc/cmd.html b/sim/ucsim/doc/cmd.html new file mode 100644 index 00000000..84e7ec23 --- /dev/null +++ b/sim/ucsim/doc/cmd.html @@ -0,0 +1,90 @@ + + +Commands of s51 + + + + +

Command reference of ucsim

+ +
General commands and information + + + +Execution + + + +Breakpoints + + + +Dump commands + + + +Set commands + + + +
+ + + diff --git a/sim/ucsim/doc/cmd_bp.html b/sim/ucsim/doc/cmd_bp.html new file mode 100644 index 00000000..ca7cefec --- /dev/null +++ b/sim/ucsim/doc/cmd_bp.html @@ -0,0 +1,206 @@ + + +Breakpoints commands of uCsim + + + + + + +

Commands of uCsim to manage breakpoints

+ +Two kind of breakpoints can be used: fetch and event +breakpoint. Fetch breakpoints are classical breakpoints. They +can be placed at any instruction in the code memory. Breakpoint will +be hit if CPU fetches instruction code from the memory location +specified by the breakpoint. Only fetching of first byte of the +instruction hits the breakpoint. If the execution reaches a breakpoint +it stops before the instruction at location specified by the +breakpoint would be executed. + +

Event breakpoints are special onces. They cause stop of +execution if event specified by the breakpoint occures. Events are: + +

wi
writing into internal RAM at specified location; + +
ri
reading from internal RAM at specified address; + +
wx
writing into external RAM at specified location +(MOVX instruction); + +
rx
reading from external RAM at specified address (MOVX +instruction); + +
ws
writing into SFR area at specified location; + +
rs
reading from SFR area at specified address; + +
rc
reading from code memory at specified location (MOVC +instruction).
+ +Event breakpoint stops execution after specified event occured. + +

Every breakpoint can be fix (permanent) or dynamic +(temporary). Dynamic breakpoints are automatically removed when they +reached. Some commands place dynamic fetch breakpoints into the code, +for example go or next. + +

A hit number can be associated to any breakpoint. This hit +number specifies how many times the breakpoint must be hit before it +causes the execution to stop. This hit number is 1 by default. + + +

break addr [hit]

+

tbreak addr [hit]

+ +Set fetch breakpoint. The command specifies if the breakpoint will be +fix (break) or dynamic (temporary) (tbreak). First +parameter specifies address where the breakpoint must be placed to. It +should be address of an instruction. + +

Second parameter is optional and it specifies the hit number. It is +1 by default. + +

+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> dc 0 0x10
+   000000 02 01 60 LJMP  0160
+ * 000003 02 00 3c LJMP  003c
+ * 000006 ff       MOV   R7,A
+ * 000007 ff       MOV   R7,A
+ * 000008 ff       MOV   R7,A
+ * 000009 ff       MOV   R7,A
+ * 00000a ff       MOV   R7,A
+ * 00000b 02 3b e0 LJMP  3be0
+ * 00000e ff       MOV   R7,A
+ * 00000f ff       MOV   R7,A
+ * 000010 ff       MOV   R7,A
+> break 0x160
+Breakpoint 1 at 0x000160: CLR   P1.0
+> tbreak 8 2
+Breakpoint 2 at 0x000008: MOV   R7,A
+> g
+Simulation started, PC=0x000000
+Stop at 000160: (4) Breakpoint
+F 000160
+> 
+ + +

bse wi|ri|wx|rx|ws|rs|rc f|d addr [hit]

+ +Set event breakpoint. First parameter specifies type of event. See general description of event breakpoints above +about meaning of event identifiers. Second parameter specify if the +breakpoint will be fix (f) or dynamic (d). Third +parameter specifies address. Remember that this is not an instruction +address, it is address of the memory cell where specified event should +occur. + +

Forth parameter is optional and it specifies the hit number. It is +1 by default. + +

+$ s51 remoansi.hex
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> dis
+   00d47e 22       RET
+   000000 02 01 60 LJMP  0160
+   000160 c2 90    CLR   P1.0
+   000162 c2 97    CLR   P1.7
+   000164 d2 b5    SETB  P3.5
+   000166 d2 b4    SETB  P3.4
+   000168 75 81 22 MOV   SP,#22
+   00016b 75 d0 00 MOV   PSW,#00
+   00016e 7e 00    MOV   R6,#00
+   000170 7f 00    MOV   R7,#00
+   000172 79 04    MOV   R1,#04
+   000174 12 0d b8 LCALL 0db8
+   000177 0f       INC   R7
+   000178 d9 fa    DJNZ  R1,0174
+   00017a 75 0b 00 MOV   0b,#00
+   00017d 75 0c 00 MOV   0c,#00
+   000180 02 02 2a LJMP  022a
+   000183 78 22    MOV   R0,#22
+   000185 76 00    MOV   @R0,#00
+   000187 d8 fc    DJNZ  R0,0185
+> bse wi f 6
+> g
+4
+   000170 7f 00    MOV   R7,#00
+> 
+ + +

clear [addr...]

+ +Delete fetch breakpoint. Parameter specifies address of breakpoint. If +there is no breakpoint specified at given address this command prints +out a warning message. + +

If parameter is not given then breakpoint at current PC will be +deleted if it exists. If more than one address is specified then all +breakpoints at specified addresses will be deleted. + +

+> i b
+Num Type       Disp Hit   Cnt   Address  What
+1   fetch      keep 1     1     0x000160 CLR   P1.0
+2   fetch      del  1     1     0x000180 LJMP  022a
+1   event      keep 1     1     0x000006 wi
+> clear 160
+No breakpoint at 0000a0
+> clear 0x160
+> i b
+Num Type       Disp Hit   Cnt   Address  What
+2   fetch      del  1     1     0x000180 LJMP  022a
+1   event      keep 1     1     0x000006 wi
+> 
+ + +

bde wi|ri|wx|rx|ws|rs|rc addr

+ +Delete event breakpoint. First parameter must be given to specify type +of event. Second parameter is address of memory cell which the +breakpoint is associated to. Continuing example given above: + +
+> bl
+D 2(2) 000180 02 LJMP  022a
+F 1(1) 000006 wi
+> bde ri 6
+No ri breakpoint at 000006
+> bde wi 6
+> bl
+D 2(2) 000180 02 LJMP  022a
+> 
+ + +

ba

+ +Delete all breakpoints. This command deletes all fetch as well as +event breakpoints. Be carefull because it does not ask you to confirm +your intention. + +
+> bl
+F 1(1) 000160 c2 CLR   P1.0
+D 2(2) 000180 02 LJMP  022a
+F 1(1) 000006 wi
+> ba
+> bl
+> 
+ + +
+ + + diff --git a/sim/ucsim/doc/cmd_dump.html b/sim/ucsim/doc/cmd_dump.html new file mode 100644 index 00000000..3859e1e2 --- /dev/null +++ b/sim/ucsim/doc/cmd_dump.html @@ -0,0 +1,390 @@ + + +Dump commands of uCsim + + + + + + +

Dump commands of uCsim

+ +

[Repeatable] dis +[start [offset [lines]]]

+ +Disassemble code. This command can be used to list disassembled +instructions which discovered by the code analyzer. First two +parameters specify the address where the list starts. First parameter +is address where the command starts to search an instruction. This +search goes forward. When the first instruction marked by code +analyzer found the simulator skips as many instructions as you specify +in second parameter. If offset is negative the simulator goes +backward and skips specified number of instructions. Default value of +start parameter is last address which was listed by previous +dis command and default value of offset is -1. It means +you can make continuous list repeating parameterless dis +command. + +

In third parameter you can specify how many instructions you want +to list. Default value is 20. + +

+$ s51 remoansi.hex
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> dis
+   00d47e 22       RET
+   000000 02 01 60 LJMP  0160
+   000160 c2 90    CLR   P1.0
+   000162 c2 97    CLR   P1.7
+   000164 d2 b5    SETB  P3.5
+   000166 d2 b4    SETB  P3.4
+   000168 75 81 22 MOV   SP,#22
+   00016b 75 d0 00 MOV   PSW,#00
+   00016e 7e 00    MOV   R6,#00
+   000170 7f 00    MOV   R7,#00
+   000172 79 04    MOV   R1,#04
+   000174 12 0d b8 LCALL 0db8
+   000177 0f       INC   R7
+   000178 d9 fa    DJNZ  R1,0174
+   00017a 75 0b 00 MOV   0b,#00
+   00017d 75 0c 00 MOV   0c,#00
+   000180 02 02 2a LJMP  022a
+   000183 78 22    MOV   R0,#22
+   000185 76 00    MOV   @R0,#00
+   000187 d8 fc    DJNZ  R0,0185
+> bs f 0x180
+> bs d 0x189
+> dis 0x180 -3 10
+   000178 d9 fa    DJNZ  R1,0174
+   00017a 75 0b 00 MOV   0b,#00
+   00017d 75 0c 00 MOV   0c,#00
+F  000180 02 02 2a LJMP  022a
+   000183 78 22    MOV   R0,#22
+   000185 76 00    MOV   @R0,#00
+   000187 d8 fc    DJNZ  R0,0185
+D  000189 22       RET
+   00018a 90 09 ec MOV   DPTR,#09ec
+   00018d ae 83    MOV   R6,DPH
+> 
+ +If there is an F or D character at the beginning of the +line, it means that there is a fix or dynamic fetch breakpoint at +listed address. Next element on the list can be an asterix (*) +which means that the listed address is not marked by the code +analyzer. dis lists marked instructions only so asterix never +appears in the list. Next element of the list is address displayed as +six digit hexadecimal number. Address is followed by hexadecimal dump +of instruction's code. Last element of the list is disassembled +instruction. Every number appeared on the list is hexadecimal number. + + +

[Repeatable] dc +[start [stop]]

+ +Disassembled dump of code memory area. This command simply produces +disassambled list of memory area specified by the parameters. Default +value of start parameter is last address listed by previous +dc command. If stop parameter is not given 20 lines are +listed. + +
+$ s51 remoansi.hex 
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> dc
+   000000 02 01 60 LJMP  0160
+ * 000003 02 00 3c LJMP  003c
+ * 000006 ff       MOV   R7,A
+ * 000007 ff       MOV   R7,A
+ * 000008 ff       MOV   R7,A
+ * 000009 ff       MOV   R7,A
+ * 00000a ff       MOV   R7,A
+ * 00000b 02 3b e0 LJMP  3be0
+ * 00000e ff       MOV   R7,A
+ * 00000f ff       MOV   R7,A
+ * 000010 ff       MOV   R7,A
+ * 000011 ff       MOV   R7,A
+ * 000012 ff       MOV   R7,A
+ * 000013 02 00 ac LJMP  00ac
+ * 000016 ff       MOV   R7,A
+ * 000017 ff       MOV   R7,A
+ * 000018 ff       MOV   R7,A
+ * 000019 ff       MOV   R7,A
+ * 00001a ff       MOV   R7,A
+ * 00001b ff       MOV   R7,A
+ * 00001c ff       MOV   R7,A
+> 
+ + +

[Repeatable] dch +[start [stop]]

+ +Hexadecimal dump of code memory area from address start to +address stop. Default value of start address is address of +following memory cell which was dumped by previous dch +command. If stop parameter is not given dch command +lists 10 lines 8 bytes per line. + +
+$ s51 remo.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> wc remo
+0013da 52 65 6d 6f             Remo
+> dch 0x13da
+0013da 52 65 6d 6f 20 00 56 65 Remo .Ve
+0013e2 72 73 69 6f 6e 20 31 2e rsion 1.
+0013ea 30 20 00 43 6f 70 79 72 0 .Copyr
+0013f2 69 67 68 74 20 28 63 29 ight (c)
+0013fa 20 00 31 39 39 34 2c 39  .1994,9
+001402 35 20 00 54 61 6c 6b 65 5 .Talke
+00140a 72 20 42 74 2e 00 53 75 r Bt..Su
+001412 6e 64 61 79 2e 00 4d 6f nday..Mo
+00141a 6e 64 61 79 2e 00 54 68 nday..Th
+001422 75 65 73 64 61 79 2e 00 uesday..
+> 
+ +First element in every lines is address of first byte dumped out in +the line. Next elements are hexadecimal values of bytes followed by +ASCII charactes of bytes dumped out in the line. If value of the +memory cell is not printable than a dot is dumped out. + + +

[Repeatable] di +[start [stop]]

+ +Hexadecimal dump of internal RAM area from address start to +address stop. Default value of start address is address of +following memory cell which was dumped by previous di +command. If stop parameter is not given di command +lists 10 lines 8 bytes per line. + +
+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> sopt stopit 1
+> g
+Simulation started, PC=0x000000
+Stop at 000023: (5) Interrupt
+F 000023
+> di
+000000 18 02 16 ba 00 02 00 0a ........
+000008 00 00 00 00 00 00 00 00 ........
+000010 00 00 00 00 00 00 00 00 ........
+000018 4a 00 00 00 00 00 00 00 J.......
+000020 bc 27 06 2d 02 ee 35 8f .'.-..5.
+000028 31 e7 42 01 0e 01 0b 00 1.B.....
+000030 ec 0b 7f 10 7f a9 7e 08 ......~.
+000038 fe 03 09 00 00 00 af 08 ........
+000040 af 08 00 00 00 00 00 00 ........
+000048 00 00 00 00 00 00 00 00 ........
+> 
+ + +

[Repeatable] dx +[start [stop]]

+ +Hexadecimal dump of external RAM area from address start to +address stop. Default value of start address is address of +following memory cell which was dumped by previous dx +command. If stop parameter is not given dx command +lists 10 lines 8 bytes per line. + +
+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> sopt stopit 1
+> g
+Simulation started, PC=0x000000
+Stop at 000023: (5) Interrupt
+F 000023
+> dx 0x100
+000100 00 00 00 00 00 00 00 00 ........
+000108 00 00 00 00 00 00 00 00 ........
+000110 00 00 00 00 00 00 00 00 ........
+000118 00 00 00 00 00 00 00 00 ........
+000120 00 00 00 00 00 00 00 00 ........
+000128 00 00 00 00 00 00 00 44 .......D
+000130 61 6e 69 00 00 00 02 02 ani.....
+000138 07 00 00 ff 00 00 07 cb ........
+000140 08 0c 32 00 07 cb 06 05 ..2.....
+000148 02 00 24 00 00 00 00 00 ..$.....
+> 
+ + +

dp

+ +Dump out ports. This command shows actual value of ports. + +
+$ s51 remoansi.hex 
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> sopt stopit 1
+> g
+5
+ * 000023 02 01 1c LJMP  011c
+> dp
+P0    11111111 0xff 255 .    P1    11111110 0xfe 254 .
+Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
+Port0 11111111 0xff 255 .    Port1 11111110 0xfe 254 .
+
+P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
+Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
+Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
+> 
+ +First lines on the list (labeled with Px) are value of SFRs which are +internal latch registers. Second lines (labeled with Pinx) are outputs +of external devices connected to port pins of the +microcontroller. These values can be set by you using sp command. Third lines (labeled with Portx) +show actual values can be measured on pins of the device. These values +are calculated with following pseudo formula: + +

Portx= Px AND Pinx + +

All three values are displayed in binary, hexadecimal, decimal form +and then the ASCII character of the value is shown. + + +

ds [addr...]

+ +Print out SFR. This command can be used to get value of all or some +SFRs. If you do not specify any parameter the ds command simply +dumps out full SFR area 16 bytes per line. + +
+$ s51 remoansi.hex 
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> sopt stopit 1
+> g
+5
+ * 000023 02 01 1c LJMP  011c
+> ds
+000080 ff 2a ba 16 00 00 00 00 55 a1 d7 fe 50 fd 00 00 .*......U...P...
+000090 fe 00 00 00 00 00 00 00 7e 00 00 00 00 00 00 00 ........~.......
+0000a0 ff 00 00 00 00 00 00 00 97 00 00 00 00 00 00 00 ................
+0000b0 ff 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 ................
+0000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+0000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+0000e0 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+0000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+> ds p1 0x87
+    P1 fe 254 .
+000087 00   0 .
+> ds p2 ip scon
+    P2 ff 255 .
+    IP 15  21 .
+  SCON 7e 126 ~
+> 
+ +If you specify one or more parameter the ds command prints out +value of registers specified by parameters. Parameter can be an +address or a symbolic name of the register. Note that the simulator +implements a register at all address in the address space which is not +true in real microcontroller where reading of an unimplemented +register gets undefined value. Value of the registers printed out in +hexadecimal, decimal, and ASCII form. + +

Note that different type of controllers can implement different +registers: + +

+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> ds rcap2l
+> q
+$ s51 -t 52
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> ds rcap2l
+RCAP2L 00   0 .
+> 
+ + +

[Repeatable] db +addr...

+ +Dump bits. This command can be used to get value of bits. At least one +parameter must be given. Bit address can be specified in three +forms. First of all name of the bit can be used if it has any. Direct +bit address is accepted too and it can be specified by address of IRAM +or SFR which contains the bit and bit number within the byte separated +by a dot. If the requested bit is in an SFR the address of the +register can be specified by its name. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> db it1 0x20.3 0x43 p2.5
+000088    IT1 0
+000020   20.3 0
+000028   28.3 0
+0000a0   P2.5 1
+> 
+ +Value of bits are printed out one per line. The list starts direct +address of the bit followed by bit name or address of the memory cell +or SFR which contains the displayed bit and bit number within the byte +separated by a dot. At last the value of the bit is shown. Displaying +a port bit you get value of SFR latch: + +
+> sp 1 0x0f
+> ss p1 0x55
+000090 55                                              U
+> dp
+P0    11111111 0xff 255 .    P1    01010101 0x55  85 U
+Pin0  11111111 0xff 255 .    Pin1  00001111 0x0f  15 .
+Port0 11111111 0xff 255 .    Port1 00000101 0x05   5 .
+
+P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
+Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
+Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
+> db p1.2 p1.3 p1.4 p1.5 p1.6
+000090   P1.2 1
+000090   P1.3 0
+000090   P1.4 1
+000090   P1.5 0
+000090   P1.6 1
+> 
+ + +
+ + + diff --git a/sim/ucsim/doc/cmd_exec.html b/sim/ucsim/doc/cmd_exec.html new file mode 100644 index 00000000..624daa46 --- /dev/null +++ b/sim/ucsim/doc/cmd_exec.html @@ -0,0 +1,227 @@ + + +Execution commands of uCsim + + + + + +

Execution commands of uCsim

+ + +

g [start [stop]]

+ +Go, start execution. Parameters are optional. First parameter +specifies start address of the execution. By default execution starts +at address specified by actual value of the PC. This can be overridden +by first parameter. If second parameter is specified it places a +dynamic breakpoint at specified address which stops the execution. If +stop address is not given the simulator stops if it reaches a +breakpoint, or the CPU accepts an interrupt and stopit option +is TRUE, or fatal error occures or stop command is +used. Note that first instruction is executed without effect of +breakpoints. It means that if there is a breakpoint at start address +then it will not be hit. + +
+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+55755 bytes read from remoansi.hex
+> b 0x187
+> sopt stopit y
+> g
+Simulation started, PC=0x000000
+Stop at 000187: (4) Breakpoint
+F 000187
+> 
+ +After execution is started the Simulaton started message +appears with value of PC where the execution started and the simulator +is ready to accept other commands while the simulation is running in +background. + + + + +

stop

+ +This command stops the simulation, it freezes the CPU and all the +peripherials. + +
+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> g
+Simulation started
+> dr
+000000 00 01 00 14 00 00 5a 47 ......ZG
+000000 00 .  ACC= 0x47  71 G  B= 0x01   DPTR= 0x001c @DPTR= 0x47  71 G
+000001 01 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   006f02 90 00 1e MOV   DPTR,#001e
+> stop
+   006ac5 24 a5    ADD   A,#a5
+> 
+
+ +Simulated program is executed in background and the simulator accepts +commands. If it stopped by the stop command the instruction pointed by +PC is dissassembled, see the dis command for +description of disassembled form. + + +

[Repeatable] s +[step]

+ +Step command. It executes one instruction without effect of +breakpoints. Optional parameter can specify number of requested +steps. + +
+$ s51 remoansi.hex
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> s
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000160 c2 90    CLR   P1.0
+> s 2
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000162 c2 97    CLR   P1.7
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000164 d2 b5    SETB  P3.5
+> 
+ +After execution of actual instruction pointed by PC the step +command executes dr command. + + +

[Repeatable] n +[step]

+ +Execute until next instruction is reached. This command is similar to +step command described above but if actual +instruction to execute is a subroutine call the next command +places a dynamic breakpoint after the call instruction and starts to +execute the subroutine. If the subroutine is infinite the breakpoint +set by next will never reached. It can be a dangerous situation +because the executeion started by the next command can not be +stopped interactively. But it can be stopped by other breakpoints. + +
+$ s51 remoansi.hex
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> g 0 0x172
+4
+   000172 79 04    MOV   R1,#04
+> dis 0x172 0 5
+   000170 7f 00    MOV   R7,#00
+   000172 79 04    MOV   R1,#04
+   000174 12 0d b8 LCALL 0db8
+   000177 0f       INC   R7
+   000178 d9 fa    DJNZ  R1,0174
+   00017a 75 0b 00 MOV   0b,#00
+> n 3
+000000 00 04 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000174 12 0d b8 LCALL 0db8
+000000 00 04 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0167 @DPTR= 0x00   0 .
+000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000177 0f       INC   R7
+000000 00 04 00 00 00 00 00 01 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0167 @DPTR= 0x00   0 .
+000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000178 d9 fa    DJNZ  R1,0174
+> 
+ + +

pc [address]

+ +Using this command without any parameter it simply dumps out +instruction pointed by the PC. Specify address if you want to set the +PC. + +
+$ s51
+S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+S51 comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> pc
+ * 000000 ff       MOV   R7,A
+> pc 123
+ * 00007b ff       MOV   R7,A
+> sopt debug t  
+> pc 32
+Warning: maybe not instruction at 000020
+ * 000020 ff       MOV   R7,A
+> 
+ + +

run

+ +This command starts the execution of the simulated program. + + +
+ + + diff --git a/sim/ucsim/doc/cmd_general.html b/sim/ucsim/doc/cmd_general.html new file mode 100644 index 00000000..b7031cc7 --- /dev/null +++ b/sim/ucsim/doc/cmd_general.html @@ -0,0 +1,659 @@ + + +General commands of uCsim + + + + +

General commands of uCsim

+ + + +Some commands can be repeated by entering an empty command (just +pressing ENTER if command console is interactive). This repeats the +full command entered previously precisely including parameters +of the command. Repeatable commands are signed with [Repeatable] icon. + +

Some commands accept parameters which in most cases can be +numbers. Numbers can be entered in C-style form. If the number begins +whith 0x or 0X it is interpreted as a +hexadecimal number. If it begins with 0 followed by +digits it is interpreted as octal number. In other cases it is +interpreted as decimal number. + +

Every command which changes content of ROM area such as l, dl or sc deletes result of code analyzer and causes to +re-analyze the code. + + +

show c|w

+ +This command can be used to list licensing information. If c +option has given, the license is listed. It is first 10 point of the +version 2 of GNU Genral Public License. Using w parameter the +command prints out last 2 point of the license ("NO WARRANTY" +message). If you do not accept GPL simply do not use the program. + + +

download,dl

+ +Download command. It is same as load above but it +reads information from command console which is standard input by +default. This command stops read records when it detects an "END" +record which is normaly the last record. This command has two +equivalent forms download and dl. + +
+$ s51 -V
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> do
+:03000000020003F8
+:1000030075812078207600D8FC900000AE83AF8203
+:100013009000001200416005E4F0A380F690009F79
+:1000230012004A9000A312004A9000A712006890A1
+:1000330000AD12006875D0001200B50200B3EF6581
+:10004300827003EE658322E493F8740193F97402DA
+:1000530093FE740393F5828E83E869700122E4931F
+:10006300F6A30880F4E493FC740193FD740293FEF9
+:10007300740393FF740493F8740593F582888312D1
+:100083000041700122E493A3A883A9828C838D820B
+:10009300F0A3AC83AD828883898280E3212100B5FC
+:1000A300212100B5000000B500B5000000B500B582
+:0200B30080FECD
+:1000B5007520117501AA850120750102850120228F
+:00000001FF
+197 bytes loaded
+> 
+ + +

quit

+ +Quit. This command terminates actual console, it does not ask you to +confirm your intention. Simulator always reads commands from a file so +end of file condition finishes too. If command console is on standard +input/output, pressing the CTRL-D will quit just like the quit +command. + +

Note that if -Z option was used at +invokation then the quit command does not terminate the simulator +program. In this case kill command can be used to +terminate the simulator. See for more information about using multiple consoles. + +

$ s51
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> q
+$ 
+ + +

kill

+ +This kommand terminates the simulator. It does not ask for +confirmation. It doesn't matter how many consoles are used and what +commands are running on them. + + +

help,?

+ +Help command. It prints out short description of the commands. + + +

reset

+ +Reset command. It resets the microcontroller. It has same effect as +active signal on the RST pin. + +
+$ s51 -V remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> dr
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000000 02 01 60 LJMP  0160
+> s 2
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000160 c2 90    CLR   P1.0
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000162 c2 97    CLR   P1.7
+> res
+> dr
+000000 00 00 00 00 00 00 00 00 ........
+000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
+000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+   000000 02 01 60 LJMP  0160
+> 
+ + +

wi,Wi string

+ +Searching for specified string in internal RAM area. String is +interpreted from first non-space sharacter until end of the command +including spaces. wi command makes case insensitive search and +Wi can be used to make case sensitive search. Result is a hexa +dump of memory areas that match with specified string. Most of C-style +escape sequences can be used in the string: \f, \n, +\r, \t, \v, \a, \b, +\0, and \0xxx where xxx is an octadecimal +number of the code of the character. + +
+$ s51 remoansi.hex
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> g
+Simulation started, PC=0x000000
+
+Stop at 00019c: (7) User stopped
+F 00019c
+> si 20 Dani DAni
+000014 44 61 6e 69 44 41 6e 69                         DaniDAni
+> wi dani
+000014 44 61 6e 69             Dani
+000018 44 41 6e 69             DAni
+> Wi Dani
+000014 44 61 6e 69             Dani
+> wi dani\0
+000018 44 41 6e 69 00          DAni.
+> 
+ + +

wx,Wx string

+ +Search commands. These commands are similar to wi, +Wi commands the only difference is that wx,Wx are used +to search for a string in external memory. + + +

wc,Wc string

+ +Search commands. These commands are similar to wi, +Wi commands the only difference is that wx,Wx are used +to search for a string in code memory area. + + +

gopt [opt]

+ +Get actual value of option(s). Some options can be set by sopt to modify behavior of the +simulator. Using gopt you can get actual value of these +options. If you use this command without parameter you get list of all +options known by the program. In this way you can figure out which +options can be used. + +
+$ s51 -V
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> gopt
+verbose TRUE Verbose flag.
+stopit FALSE Stop if interrupt accepted.
+debug FALSE Debug flag.
+> gopt stopit
+stopit FALSE Stop if interrupt accepted.
+> 
+ +This version of the simulator knows about three options. First element +of the list is name of the option (verbose, debug and +stopit). This name can be used to identify the option in +gopt and sopt command. Second +element of the list is the value of the option. In this case type of +both options is boolean, their value can be TRUE or FALSE. Third +element is a short description of the option. + +
verbose
? + +
debug
Debug flag can be set by -V option of the +program to TRUE otherwise its default value is FALSE. If it is TRUE, +the simulator prints out short messages about important events. + +
stopit
Setting this option to TRUE (default value is +FALSE) forces execution to stop every time when CPU accepts an +interrupt. You do not have to use breakpoints to inspect interrupts. + +
+ + +

sopt opt value

+ +Set option value. Options described at previous command (gopt) can be set using this command. First +parameter must be an option name and second the new +value. Interpretation of the value depends on type of the +option. Value for a boolean type of option interpreted as follows: if +first character of the value is one of 1, t, +T, y, Y then value will be TRUE otherwise +it will be FALSE. + +
+$ s51 -V
+ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> gopt
+verbose TRUE Verbose flag.
+stopit FALSE Stop if interrupt accepted.
+debug FALSE Debug messages appears on this console.
+> sopt debug t
+> gopt
+verbose TRUE Verbose flag.
+stopit FALSE Stop if interrupt accepted.
+debug TRUE Debug messages appears on this console.
+> 
+ + +

conf

+ +This command prints out configuration of the simulator: + +
+> conf
+ucsim version 0.2.37
+Type of microcontroller: 51 CMOS
+Controller has 8 hardware element(s).
+  timer0[0]
+  timer1[1]
+  uart[0]
+  port[0]
+  port[1]
+  port[2]
+  port[3]
+  irq[0]
+Memories:
+  ROM  size= 0x010000 65536
+  XRAM size= 0x010000 65536
+  IRAM size= 0x000100 256
+  SFR  size= 0x000100 256
+> 
+
+ +First line contains version number of the program. Second line informs +about type of the simulated microcontroller. Third line prints out how +many hardware elements are simulated. Following lines contain +information about memories. Note that size of the simulated memory +segment can be bigger than size of addressable part of the memory as +you see above SFR type of the memory has bigger simulated than +addressable size. + + +

state

+ +State of the simulator and the simulated microcontroller: + +
+> state
+CPU state= OK PC= 0x004349 XTAL= 1.10592e+07
+Total time since last reset= 0.614873 sec (6800004 clks)
+Time in isr = 0.0144227 sec (159504 clks) 2.3%
+Time in idle= 0 sec (0 clks)   0%
+Max value of stack pointer= 0x000049, avg= 0x000026
+> 
+
+ +The "CPU state" in the first line is an internal information. PC is +value of the program counter. First line shows XTAL frequency too. + +

Following lines contain information about simulated time. First, +full simulated time (elapsed from last reset) is printed out in +seconds and number of clock periods then same data is printed out +about time spent in interrupt service routines as well as in idle +mode. Last data in lines of ISR and IDLE time shows ratio of ISRs, +Idle times and main program. + +

Last line infroms about maximum value of the stack pointer and a +"not very well" calculated average value of it. + + +

file,load "FILE"

+ +Loads file named FILE into the simulated code memory. File must +contain data in Intel HEX format. + +
+> file "../../remo.hex"
+55470 words read from ../../remo.hex
+> 
+
+ +Don't forget to enclose file name in quotes to make the parameter to +be a string. + + +

info

+ +This command prints out information about different things which must +be specified as paramater to the command. Following subcommands are +known: + +

info breakpoints +
info registers +
info hardware + + +

info breakpoints

+ +This subcommand prints out information about breakpoints: + +
+> b 12
+Breakpoint 1 at 0x00000c: MOV   R7,A
+> tb 43
+Breakpoint 2 at 0x00002b: MOV   R7,A
+> bse ws f 0x80
+> i b
+Num Type       Disp Hit   Cnt   Address  What
+1   fetch      keep 1     1     0x00000c MOV   R7,A
+2   fetch      del  1     1     0x00002b MOV   R7,A
+1   event      keep 1     1     0x000080 ws
+> 
+
+ +As you see above, the command can be shortened to "i b". The list of +breakpoints contains 7 columns: + +
Num
Number of the breakpoint. Normal and event +breakpoints are numbered separately. + +
Type
This column shows type of the breakpoint. It can +be fetch for normal breakpoints or event for event +breakpoints. First the normal breakpoints are listed and then the +event breakpoints. + +
Disp
This shows if the breakpoint is temporary +(del) or not (keep). + +
Hit
How many times the breakpoint must be hit before it +really stops the program. + +
Cnt
Counter of breakpint hits. This counter decrements +and the breakpoint is activated if it reaches zero. + +
Address
Address where the breakpoint is set. + +
What
For normal breakpoints this field contains +disassembled instruction where the breakpoint is set. For event +breakpoints it contains type of event. + +
+ +

info registers

+ +This subcommand prints out full register set of the CPU. Output of +this command depends of type of CPU. + +
Registers of MCS51 family
+ +
+$ s51 remoansi.hex 
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+58659 bytes read from remoansi.hex
+> sopt stopit 1
+> g
+5
+ * 000023 02 01 1c LJMP  011c
+> i r
+000000 18 02 16 ba 00 02 00 0a ........
+000018 4a J  ACC= 0x0a  10 .  B= 0x00   DPTR= 0x16ba @DPTR= 0x00   0 .
+000002 16 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
+ * 000023 02 01 1c LJMP  011c
+> 
+ +In first line the actual register bank is dumped out. Register banks +reside in internal RAM, address at the begining of the line shows +start address of actual register bank selected by RS0 and RS1 bits of +PSW register. + +

Next two lines begin with value of indirectly addressed internal +RAM cells. Second line shows IRAM cell pointed by R0 while third line +shows IRAM addressed by R1. + +

Second line displays some important registers. First one is the +accumulator. Its value dumped out in hexadecimal, decimal form and +then the ASCII character of its value. It is followed by value of the +B register which is dumped out in hexadecimal form only. Next is DPTR +register in hexadecimal and then external RAM cell which is addressed +by DPTR. This is dumped out in hexadecimal, decimal and ASCII too. + +

In third line you find program status word in hexadecimal and then +some flag bits of PSW register. Last line is disassembled instruction +at PC. + +

Registers of AVR family
+ +
+$ savr test_arith.hex
+ucsim 0.2.37, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> 83 words read from test_arith.hex
+83 words read from test_arith.hex
+> run
+
+Stop at 0x000047: (105) User stopped
+F 0x000047
+> i r
+000000 00 2c 21 23 20 35 19 14 03 00 00 00 00 00 00 00 .,!# 5..........
+000010 00 01 1e 89 01 00 10 e2 14 00 01 10 00 00 00 00 ................
+ITHSVNZC  SREG= 0x03   3 .
+00000011  SP  = 0x000000
+X= 0x1001 [X]= 0x00   0 .  Y= 0x0000 [Y]= 0x00   0 .  Z= 0x0000 [Z]= 0x00   0 .
+ * 000047 940c 0047 jmp   0x000047
+> 
+
+ +First two lines show first 32 bytes of internal RAM which is the +register set of AVR controllers. + +

At the beginning of next two lines bits of status register are +printed. These lines present hexadecimal, decimal and ASCII values of +the status register too, and value of the stack pointer. + +

Following line shows indirect addressing registers X, Y, and Z as +well as pointed memory values. + +

Last line is disassembled instruction ap PC. + +

info hardware|hw cathegory [id]

+ +This subcommand prints out information about a unit of the +controller. Cathegory can be: + +
  • timer +
  • uart +
  • port +
  • pca +
  • interrupt +
  • wdt +
+ +Ouput format of this command depends on CPU family and type of the CPU +too because requested unit can be different in different type of +controller even in the same CPU family. + +
+$ s51 -t 51
+ucsim 0.2.36, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> i h t
+timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
+timer1[1] 0x0000 13 bit timer OFF irq=0 dis prio=0
+> 
+
+ +Timer #2 differs a little bit from other timers of MCS51: + +
+$ s51 -t 52
+ucsim 0.2.36, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> i h t
+timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
+timer1[1] 0x0000 13 bit timer OFF irq=0 dis prio=0
+timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0
+> 
+
+ +

If the controller contains more than one unit of a cathegory, then +optional id parameter can be used to select a specific one. If +id is not used then information is printed about all units +belonging to specified cathegory. + +

+> i h t 1
+timer1[1] 0x0000 13 bit timer OFF irq=0 dis prio=0
+> 
+
+ +It is possible that there is no unit belonging to some cathegory. It +is also possible that the specific unit exists but information command +of that unit is not implemented, in this case you have to check SFRs +of the unit... + +
+> i h pca
+> 
+
+ +Information you can get about units of MCS51 controllers: + +
+$ s51 -t 251 
+ucsim 0.2.37, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> g
+Simulation started, PC=0x000000
+
+Stop at 0x000023: (105) User stopped
+F 0x000023
+> i h t
+timer0[0] 0xaa8d 16 bit timer ON irq=0 en prio=0
+timer1[1] 0xfdff 8 bit autoreload timer ON irq=1 dis prio=0
+timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0
+> i h u
+uart[0] 8 bit UART timer clocked MultiProc=none irq=en prio=1
+Receiver ON RB8=1 irq=0
+Transmitter TB8=1 irq=1
+> i h po
+port[0]
+P0    11111111 0xff 255 . (Value in SFR register)
+Pin0  11111111 0xff 255 . (Output of outside circuits)
+Port0 11111111 0xff 255 . (Value on the port pins)
+port[1]
+P1    11111111 0xff 255 . (Value in SFR register)
+Pin1  11111111 0xff 255 . (Output of outside circuits)
+Port1 11111111 0xff 255 . (Value on the port pins)
+port[2]
+P2    11111111 0xff 255 . (Value in SFR register)
+Pin2  11111111 0xff 255 . (Output of outside circuits)
+Port2 11111111 0xff 255 . (Value on the port pins)
+port[3]
+P3    11111111 0xff 255 . (Value in SFR register)
+Pin3  11111111 0xff 255 . (Output of outside circuits)
+Port3 11111111 0xff 255 . (Value on the port pins)
+> i h i
+Interrupts are enabled. Interrupt sources:
+  Handler  En  Pr Req Act Name
+  0x000003 en   1 no  act external #0
+  0x00000b en   0 no  act timer #0
+  0x000013 en   1 no  act external #1
+  0x00001b dis  0 YES act timer #1
+  0x000033 dis  0 no  act PCA counter
+  0x000033 dis  0 no  act PCA module #0
+  0x000033 dis  0 no  act PCA module #1
+  0x000033 dis  0 no  act PCA module #2
+  0x000033 dis  0 no  act PCA module #3
+  0x000033 dis  0 no  act PCA module #4
+  0x000023 en   1 YES act serial transmit
+  0x000023 en   1 no  act serial receive
+  0x00002b dis  0 no  act timer #2 TF2
+  0x00002b dis  0 no  act timer #2 EXF2
+Active interrupt service(s):
+  Pr Handler  PC       Source
+   1 0x000023 0x003672 serial transmit
+>
+
+ + +

timer a|d|g|r|s|v id [value]

+ +Handling of timers. First parameter of timer command determines the +operation which can be + +
add (or simply a)
to create a new timer. New timers +are turned ON by default and initialized to value 0. + +
del (or simply d)
to remove a timer if you don't need +it any more. + +
get (or simply g)
to get value of timers. See comment +below. + +
run (or simply r)
to turn a timer ON. + +
stop (or simply s)
to turn a timer OFF. It still exist +but doesn't count xtal periods. + +
value (or simply v)
to set value of the timer (number +of xtal periods). `param' is the new value. + +
+ +id can be a number or a string. Timers are numbered from 1. You +can use any number greater than 0 to identify a timer. Or you can use +a simbolic name, in this case simulator uses the first unused number +to allocate a new timer: + +
+> tim a 3
+> tim g 0
+timer #0("time") ON: 0.463255 sec (5123232 clks)
+timer #0("isr") ON: 0.0051888 sec (57384 clks)
+timer #3("unnamed") ON: 0 sec (0 clks)
+> tim a "a"
+> tim g 0
+timer #0("time") ON: 0.463255 sec (5123232 clks)
+timer #0("isr") ON: 0.0051888 sec (57384 clks)
+timer #1("a") ON: 0 sec (0 clks)
+timer #3("unnamed") ON: 0 sec (0 clks)
+> 
+
+ +If you use 0 as timer id in "get" operation, simulator prints out +value of all timers including predefined ones. + +
+ + + diff --git a/sim/ucsim/doc/cmd_set.html b/sim/ucsim/doc/cmd_set.html new file mode 100644 index 00000000..e062d772 --- /dev/null +++ b/sim/ucsim/doc/cmd_set.html @@ -0,0 +1,203 @@ + + +Set commands of uCsim + + + + + + +

Set commands

+ +Set commands can be used to set value of memory cells, bits, or port +pins. Those commands that set value of memory interpret their command +lines a litle bit different than other commands. First parameter is +always the start address of the memory area which is being set. This +parameter is followed by a list of data parameters. Data can be +specified by a number. Numbers must begin with a digit. Each number +specifies one byte of data. If the parameter begins with a non-digit +character, it is interpreted as string of characters and this kind of +parameter specifies as many bytes as many characters the string +has. Strings can contain escape sequencies (see description of wi command where escape +sequencies are discussed) but they can not contain spaces because +space characters (space, tabulator and vertical tabulator) separates +parameters. Spaces can be specified as escape sequences or separated +number parameters if needed. Only space characters separate data +parameters while normaly comma (,) and semicolon (;) +are interpreted as separator characters too. + +

si addr data...

+ +Write data into internal RAM area. First parameter specifies start +address of memory area to set and other parameters are data to set. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> si 10 dani\040hej-ho
+00000a 64 61 6e 69 20 68 65 6a 2d 68 6f                dani hej-ho
+> 
+ +Result of the command is a memory dump of area which has been modified +by the command. If there is syntax error in a data parameter then +remaining parameters are dropped out. + +
+> si 20 1 2 0xi 3 4
+Bad data 0xi
+000014 01 02                                           ..
+> 
+ + +

sx addr data...

+ +This command is similar to si command +described above but it is used to modify external RAM. + + +

sc addr data...

+ +This command is similar to si command +described above but it is used to modify code memory area (ROM). + + +

ss addr data...

+ +This command is similar to si command +described above but it is used to modify SFR. Other difference is that +first parameter (start address) can be specified by name of SFR +not by address only. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> ss p1 0
+000090 00                                              .
+> 
+ + +

sb addr data...

+ +Modify bit(s). First parameter is address of first bit to modify. See +description of db command how bit address can +be specified. If first character of data parameter is 0 it +means zero otherwise it means one. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> sb 0x23.5 1
+> db 0x23.5
+000023   23.5 1
+> sb p3.3 0
+> dp
+P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
+Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
+Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .
+
+P2    11111111 0xff 255 .    P3    11110111 0xf7 247 .
+Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
+Port2 11111111 0xff 255 .    Port3 11110111 0xf7 247 .
+> sb tr1 0
+> db tr1
+000088    TR1 0
+> sb tr1 1
+> db tr1
+000088    TR1 1
+> 
+ + +

sp port data

+ +This command can be used to sep up output values of external circuits +connected to port pins. If a port bit is used as output to drive +external circuits, do not set corresponding pin bit to zero because +read back value of the port can be false. First parameter must be +number of the port between 0 and 3. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> dp
+P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
+Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
+Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .
+
+P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
+Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
+Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
+> ss p1 0x55
+000090 55                                              U
+> sp 1 0x0f
+> dp
+P0    11111111 0xff 255 .    P1    01010101 0x55  85 U
+Pin0  11111111 0xff 255 .    Pin1  00001111 0x0f  15 .
+Port0 11111111 0xff 255 .    Port1 00000101 0x05   5 .
+
+P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
+Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
+Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
+> 
+ + +

fi start stop data

+ +Fill command. It can be used to fill up an area of internal RAM with a +specified data. + +
+$ s51
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> fi 11 0x34 44
+> di
+000000 00 00 00 00 00 00 00 00 ........
+000008 00 00 00 2c 2c 2c 2c 2c ...,,,,,
+000010 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
+000018 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
+000020 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
+000028 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
+000030 2c 2c 2c 2c 2c 00 00 00 ,,,,,...
+000038 00 00 00 00 00 00 00 00 ........
+000040 00 00 00 00 00 00 00 00 ........
+000048 00 00 00 00 00 00 00 00 ........
+> 
+ + +

fx start stop data

+ +Fill command. It works similar to fi but it +puts data into external RAM instead of internal RAM. + + +

fs start stop data

+ +Fill command. It works similar to fi but it +puts data into SFR instead of internal RAM. + + +

fc start stop data

+ +Fill command. It works similar to fi but it +puts data into code memory (ROM) instead of internal RAM. + + +
+ + + diff --git a/sim/ucsim/doc/commref.html b/sim/ucsim/doc/commref.html new file mode 100644 index 00000000..f50252cc --- /dev/null +++ b/sim/ucsim/doc/commref.html @@ -0,0 +1,83 @@ + + +UCSIM: Command Reference + + + + +

Command reference

+ + +

The simulator can be controlled with a simple monitor program which +uses the command console to read commands and print out results. After +starting the program you see a prompt on the command console and you +can write in commands after the prompt: + +

+g [start [stop]]   Go
+stop               Stop
+pc [address]       Get/set content of PC
+s [step]           Step
+n [step]           Next
+bse wi|ri|wx|rx|ws|rs|rc f|d addr [hit]
+                   Set EVENT Breakpoint
+bde wi|ri|wx|rx|ws|rs|rc addr
+                   Delete EVENT Breakpoint
+ba                 Delete all breakpoints
+dis [start [offset [lines]]]
+                   Disassemble code
+dp                 Dump ports
+ds [addr...]       Dump SFR
+db addr...         Dump bit
+si addr data...    Set Internal RAM
+sx addr data...    Set External RAM
+sc addr data...    Set code (ROM)
+ss addr data...    Set SFR area
+sb addr data...    Set bit
+sp port data       Set port pins
+fi start stop data Fill IRAM area with `data'
+fx start stop data Fill XRAM area with `data'
+fs start stop data Fill SFR area with `data'
+fc start stop data Fill ROM area with `data'
+wi,Wi string       Search for `string' in IRAM (Wi case sensitive)
+wx,Wx string       Search for `string' in XRAM (Wx case sensitive)
+wc,Wc string       Search for `string' in ROM (Wc case sensitive)
+sopt opt value     Set value of option
+gopt [opt]         Get value of option(s)
+show c|w           Show licensing information
+----
+Set of new commands:
+conf               Configuration
+state              State of simulator
+file,load "FILE"   Load FILE into ROM
+download,dl        Download (intel hex) data
+info               Information
+get                Get
+set                Set
+timer a|d|g|r|s|v id [value]
+                   Timer add|del|get|run|stop|value
+run                Go
+step               Step
+reset              Reset
+dump i|x|r|s [start [stop]]
+                   Dump memory
+di [start [stop]]  Dump Internal RAM
+dx [start [stop]]  Dump External RAM
+dch [start [stop]] Dump code in hex form
+dc [start [stop]]  Dump code in disass form
+break addr [hit]   Set fix breakpoint
+tbreak addr [hit]  Set temporary breakpoint
+clear [addr...]    Clear fix breakpoint
+help,?             Help about commands
+quit               Quit
+kill               Shut down the simulator
+
+ +In command reference you can find more +information about breakpoints and execution of the simulated program. + + +
+ + + diff --git a/sim/ucsim/doc/conf.mk b/sim/ucsim/doc/conf.mk new file mode 100644 index 00000000..879e9bc8 --- /dev/null +++ b/sim/ucsim/doc/conf.mk @@ -0,0 +1,10 @@ +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in + cd $(PRJDIR) && $(SHELL) ./config.status + +# End of conf.mk diff --git a/sim/ucsim/doc/cpu.gif b/sim/ucsim/doc/cpu.gif new file mode 100644 index 0000000000000000000000000000000000000000..a14fbb66f6425fd2ee295069ca78feca2e1ef97a GIT binary patch literal 12757 zcmV;`F)GeSNk%v~VSoZI0rLO=0001h0001h0001h0DyqNz`%fjfB^ge`26?)00000 z00000000000000000000EC2ui0DuB60RRO45XecZy*TU5yZ>M)j$~<`XsWJk>%MR- z&st&Mc&_h!@BhG{aL5xFkI1BQ$wU&L(5Q4uty-_xtai)odYj;|c--{z0_b!ACt**r zXj|N!WvbC+@mc+Qn{#PYZGU?=b2fuOeqM8jJQRdhiHVU>kT;hF7C8W%nV6kVO%!>h zrbk3~Yfz1=h@o^?t)6vu0Y-SIN#XPj8FTLxb3% z*^kAO-OWEt5=P@k0J`YA)`!E~aI3ysO}V-0M!fLt#)RzpvDQEOO#vq>Ul4)-iET<) z?U%NPuOfP)lnT}-A>z&nD7R6gy>$Kn8-ZFzv7wM>nyO{;)??l+0eH&EBn1YaoK>GH zNc7eT;SPaq{47jal4sFqCzIh^q;sTEP*77Dd_~e?PoL5*P_?>}X;7;YiS~hL3|vW~ z5V7jWsKkP~32!@k{3w+VE4xwuZF_<;>|T~dY^5QmaVFuKg$l&kn=;~GvQi2y-HFsM z*~ejr^in(wFy_Xf0c*ZPd0*(t40|@leDyR`p^&d#G#c$}YsN!HaXgH~Fz?+U*TFMw z`C^d1pwVt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mEje@Ii`@Y1^@qp19D9~&dz zfUE>NrsxlW;iDaaxRk;vO$2?Zvxy8TXuzC6FF+XNo%V9KK|*-#exJ)ABeKLjy(uSg zNn9LOSSF?4I1f4q)F1ZZq^2iU?L!cxq7t7c#+^AZW!Cdb<@^R8oRO_?LyVWpjCKY& znr}OF6k;4En2$TY(Ofyi8XW#OiZ%(-c!VfqA29}uMKZFHj(j8}BPq#AQnHekyd)+w bsmV=pvXh?tBq&2E%2ATCl%^DA1ONa# + +Simulator for MCS51 + + + + +

Software simulator for MCS51

+ +This screeshot demonstrates CPU window of the simulator. The CPU +window contains five different panes. Active pane can be changed by +pressing TAB and Shift-TAB keys. First pane contains disassembled code +of the program. Instructions found by the code analyzer appear on the +list only. Some of instructions can be highlighted in different +ways. First highlighted instruction on the list (instruction at +0x4386) is highlighted because there is a breakpoint specified at that +address. Second highlighted instruction (at 0x438A) shows a dynamic +breakpoint. Third highlighted line contains the cursor which can be +moved by pressing up and down arrow keys. Because the pane lists +analyzed instructions only, the list can be scrolled backward as well +as forward. + +

+ +

Second pane which is under disass pane is a memory dump pane which +shows content of internal RAM. Activating this pane the cursor appears +in the pane and the memory content can be changed simply by entering +new value at requested location. Cursor can be moved by cursor keys. + +

Next pane shows content of registers: accumulators, program status +word, general purpose registers, indirectly addressed memory +locations, data pointer, and stack pointer, program counter. Note that +changing content of PC can be dangerous. If you set new value to PC +and this address is not found by code analyzer as instruction, +disassembled list disappears from disass pane and an error message `PC +is at invalid address' appears. If you are sure that PC is at an +instruction (remember that code analyzer is unable to locate every +instructions of the program) you can "validate" actual address by +pressing Ctrl-F7 keys. + +

Next pane shows values of ports. P0 and P2 is disabled if simulated +microcontroller is a 8X31 which needs P0 and P2 for multiplexed +address/data bus. + +

Last pane is a passive pane, it can not be activated. It shows time +elapsed since last reset. First line contains number of number of +cycles (in hex) and second line the cycles that the CPU spent in +interrupt routines. Last line is calculated dependent of specified +XTAL frequency and it shows `real time' (symulated time) elapsed since +reset (in microseconds). + +

At right side of menu bar there is an indicator which shows status +of the simulation (CPU Stopped, Symulation Running). The screenshot +shows some menus as well. + +


+ + + diff --git a/sim/ucsim/doc/cpu_types.html b/sim/ucsim/doc/cpu_types.html new file mode 100644 index 00000000..d546f37f --- /dev/null +++ b/sim/ucsim/doc/cpu_types.html @@ -0,0 +1,184 @@ + + +UCSIM: CPU types + + + + +

Select type of CPU

+ +The simulator supports following type of microprocessors from MCS51 +family: + +

8051/8031 + +
8052/8032 + +
8051R + +
89C51R + +
80251 + + +

8051/8031

+ +You can select this type of microcontroller using one of the following +parameter for -t option: + +
  • 51 (HMOS type) + +
  • 8051 (HMOS type) + +
  • 8751 (HMOS type) + +
  • C51 (CMOS type) + +
  • 80C51 (CMOS type) + +
  • 87C51 (CMOS type) + +
  • 31 (HMOS type) + +
  • 8031 (HMOS type) + +
  • C31 (CMOS type) + +
  • 80C31 (CMOS type) + +
+ +It includes core 51 features: + +
  • 64k external RAM + +
  • 64k ROM + +
  • 128 byte internal RAM + +
  • 2 timers (timer #0, timer #1) + +
  • Serial interface + +
  • 4 8-bit quazi bi-directional ports + +
+ +CMOS types also include: + +
  • Idle mode + +
  • Power down mode + +
+ + +

8052/8032

+ +You can select this type of microcontroller using one of the following +parameter for -t option: + +
  • 52 (HMOS type) + +
  • 8052 (HMOS type) + +
  • 8752 (HMOS type) + +
  • C52 (CMOS type) + +
  • 80C52 (CMOS type) + +
  • 87C52 (CMOS type) + +
  • 32 (HMOS type) + +
  • 8032 (HMOS type) + +
  • C32 (CMOS type) + +
  • 80C32 (CMOS type) + +
+ +It includes same features as 8051/8031 +microcontrollers and additionaly: + +
  • 3 timers (timer #0, timer #1, timer #2) + +
  • 256 bytes of internal RAM + +
+ + +

8051R

+ +You can select this type of microcontroller using one of the following +parameter for -t option (all are CMOS types): + +
  • 51R + +
  • 51RA + +
  • 51RB + +
  • 51RC + +
  • C51RA + +
  • C51RB + +
  • C51RC + +
+ +It includes all features that 8052/8032 does and +additionaly: + +
  • Extended interrupt priority system (4 priority levels) + +
  • Extended serial line interface (automatic address recognition) + +
  • Watchdog timer + +
+ + +

89C51R

+ +You can select this type of microcontroller using 89C51R +parameter for -t option (this CPU is always CMOS). This is a Philips +clone, excluding duplicated DPTR it is similar to 8051XR from Intel. + +

It includes all features that 8051R does and +additionaly: + +

  • PCA (Programmable Counter Array): 5 16-bit counter, one of +them can act as watchdog timer. + +
  • Duplicated DPTR. + +
+ + +

80251

+ +You can select this type of microcontroller using one of the following +parameter for -t option (all are CMOS types): + +
  • 251 + +
  • C251 + +
+ +

It includes all features that 89C51R does +and additionaly: + +

  • Nothing implemented yet. + +
+ +
+ + + diff --git a/sim/ucsim/doc/index.html b/sim/ucsim/doc/index.html new file mode 100644 index 00000000..61ffb9c5 --- /dev/null +++ b/sim/ucsim/doc/index.html @@ -0,0 +1,156 @@ + + +Mikrocontroller Simulator + + + + +[ Download ] + +[ Installation ] + +[ Usage ] + +[ Mail to +developer ] + +

+ +

Software simulator for microcontrollers

+ +uCsim can be used to simulate microcontrollers. It +supports MCS51 family. AVR and Z80 support is under development. + +

Download

+ +Simulator is available for two platforms: DOS and UNIX but DOS version +is not supported any more. DOS version is not finished so I call it +demo version and it is available in binary only. Limitations of DOS +version are: + +
  • There is no built in help available; + +
  • Some of the utilities are not working, for example calculator, bit +simulator; + +
  • Serial line works in mode 1 independently of mode bits.
+ +I used this simulator to verify my applications and I never used +missing feautres mentioned above, so I think that this "demo" version +can be usefull anyway. + +

Download +now + + + + +

How to install

+ +DOS version + +

Get the ZIP file and unzip it. ZIP file contains three files: +s51.exe the executable itself, dpmi16bi.ovl and +rtm.exe. Last two files are required because s51.exe is +a DOS protected mode program. Put these files in a directory which is +in the PATH or keep them together with the s51.exe. + +

UNIX version + +

UNIX version is distributed in source. + +

  1. Get archive file, uncompress and untar it. These steps will +produce a directory ucsim-X.Y.Z where X.Y.Z is the version +number. + +
  2. Go to the directory and configure the package. Issue +configure command. It will determine your system and +make Makefile. Installation directory can be specified with +--prefix=dir option to the +configure. Default directory is +/usr/local. Executable file will be placed in bin +subdirectory. + +
  3. Compile the package with make command. + +
  4. Install executable s51 to any directory you want. It can be +done with make install command which will place files +in installation directory specified with --prefix=dir option of +configure. Note that you may have to have special +privilege to do this if installation directory is not writable by you. + +
+ + + + +

How to use

+ +

DOS version

+ +S51 for DOS has been written in Borland Pascal using Turbo Vision to +produce menu driven, multiwindow user interface which is very easy to +use. The program can be started using following command: + +

C:\> s51 [input file] + +

Parameter is optional. If it specified it must be the name of an +Intel hex file. Some screenshots of the program and short descriptions +of them: + +

+ + +

UNIX version

+ +Invokation.
Starting the simulator +program. + +

Features of the simulator + +

    + +
  • Code analyzer.
    The simulator tries +to figure out places of valid instructions in code area. This feature +included in both DOS and UNIX versions. + +
  • Processor types.
    The simulator can +simulate different type of microcontrollers. + +
  • Multiple consoles.
    The simulator can +handle more than one command consoles and accepts command from +multiple sources. It also can be driven by other programs such as +debugger interfaces. + +
  • Serial interfaces.
    The simulator can +virtually connect a terminal to serial interface of the simulated CPU. + +
  • Command reference. (Now updated up to +0.2.37)
    The simulator can be controlled via a command line +interface. It accepts simple commands. + +
+ +
+ + + + + +
© 1997,99 Dániel Drótos, Talker Bt.
drdani@mazsola.iit.uni-miskolc.hu
+ + + diff --git a/sim/ucsim/doc/interrupt.gif b/sim/ucsim/doc/interrupt.gif new file mode 100644 index 0000000000000000000000000000000000000000..4e146f5dcc0380b921d27dbb2b4678fd5c763410 GIT binary patch literal 12432 zcmV;BFmKOCNk%v~VSoZI0rLO=0001h0001h004l1z`($OfPet}0Qmd>`26?)00000 z00000000000000000000EC2ui0DuB60RRO45XecZy*TU5yZ>M)j$~<`XsWJk>%MR- z&l+Lhc&_h!@BhG{a7Zi~kI1BQ$!t2G(5Q4utquj)tai)odcWYWRTn6m12{=~@+{lj z>+u;*o&VV5n^~#OlhJR0Hhn;Nb%1m{6n=aFH-wBui;sqnijD*ql$b?c7Ga>FqC|6o zq==@FgPcroiJ7d2fmUv>I;vH*riz!5ICP1)J;H6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&U#r)k7?}s`;%jRiYnAQQtVkPg;;&s;qFP^YF>v29 zbF=d^7MvngFPr|XwDF=gS|cXVjkl-eIC*B~PEg4t(o#A4w>bDvWccdHSF)89F|CqD?D^2v)v1e+~+}lPn=OXc8wUyC<3@K;>VEi9)%O7svJrs@;-g* zCaDw>AN5GWgm==Dqnq{??gPlLqsN{X6ABfo?4m)1jPT3~x{%L9k0C8mt!h>2(pwsn zLd3`wp`4NC#F9;E_T@@(?Kss`3reS3n=^5~wRCN$&!<1LX?;piAE3MiyY>a@X3bt| z8v`K&yI5+{tCA;Ij2aPQF~U=kesy88B-e+lN7AcG1z_#lK4 zN@!ke6Iys7h8b%3;DQ@^_#ucPikMP`Bbs<3iYboPp^7cK_#%wslo%t8HQERvi#O`H zBaacz*dvfZ3W*kxLmGJ`l9wd8B$GUTb|92dN;xH!Ra$u^mfkhFC6`@#`6ZZPia92k zWtw>=nrW)JCYx=#`6irk$~h;Ub=r9+o_XrIC!c-#`6r-(3OXpEF$NI83x^(R)}jP7 z{@Nc2qaaw0qLr$E=qYW@;M!=FDtc+6mTp>Cp{1I7qNtZ*dcvwSH2Nr{El4U!r + +Simulator for MCS51 + + + + +

Software simulator for MCS51

+ +This screenshot demonstrates window which displays interrupt system of +the microcontroller. Interrupt enable register and priority register +as well as interrupt request bits are displayed in this window. Note +that if you set some request bit during simulation and interrupt is +enabled, the CPU will accept the interrupt and responding to it by +starting the service routine. + +

+ +

The `Interrupt/program rate' pane shows ratio of execution time of +main program and interrupt service routines. Content of this pane is +not saved if you close tha window which means that measure of the +ratio is restarted every time you reopen the window. + +


+ + + diff --git a/sim/ucsim/doc/invoke.html b/sim/ucsim/doc/invoke.html new file mode 100644 index 00000000..ff6cceb9 --- /dev/null +++ b/sim/ucsim/doc/invoke.html @@ -0,0 +1,124 @@ + + +UCSIM: Invokation + + + + +

Starting the simulator

+ +There are separate programs to simulate different microcontroller +families: + +

MCS51 family is simulated by s51 +
AVR family is simulated by savr +
Z80 processor is simulated by sz80 + +

You can select + +

The simulator can be started in the following way: + +

$ s51 [-hHVvP] [-p prompt] [-t CPU] +[-X freq[k|M]] [-c file] [-s file] [-S optionlist] [-Z portnum] +[files...] + +

Specified files must be names of Intel hex files. Simulator loads +them in specified order into the ROM of the simulated system. + +

Options: + +

-t CPU + +
Type of CPU. Recognized types are: 51, 8051, 8751, C51, 80C51, +87C51, 31, 8031, C31, 80C31, 52, 8052, 8752, C52, 80C52, 87C52, 32, +8032, C32, 80C32, 51R, 51RA, 51RB, 51RC, C51R, C51RA, C51RB, C51RC, +89C51R, 251, C251. Note that recongition of a CPU type as option does +not mean that the simulator can simulate that kind of CPU. Default +type is C51. + +
See how to select CPU type. + +
-X freq[k|M] + +
XTAL frequency is freq Hertz. k or M can be +used to specify frequency in kHZ or MHz. Space is not allowed between +the number and the k or M. Default value is 11059200 Hz. + +
-c file + +
Open command console on file. Command consoles are on +standard input and output by default. Using this option the console +can be opened on any file for example on the serial interface of the +computer. + +
-Z portnum + +
Listen for incoming connections on port portnum. Using this +option uCsim can serve multiple consoles. You can get a console +by simply telnet into machine running uCsim to port +portnumber. This option is not available on platforms which +doesn't support BSD networking. + +
See how to use multiple consoles. + +
-s file + +
Connect serial interface of the simulated microcontroller to the +file. Nothing is used by default which means that characters +transmitted by serial interface of the simulated microcontroller go to +nowhere and it will never receive anything. If you are going to +communicate with serial interface interactively the best idea is to +specify a teminal with -s option. + +
-S in=file,out=file + +
Using this option you can specify different files for input and +output streams that uCsim uses to simulate microprocessor's +serial interface. + +
See more about serial interface +simulation. + +
-p prompt + +
Using this option you can specify any string to be the prompt of +command interpreter, for example: + +
$ s51 -p "s51> "
+ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+s51> 
+ +
-P + +
Prompt will be a null ('\0') character. This feature can be +useful for programs which controlls simulator through a pipe. + +
-V + +
Verbose mode. The simulator notifies you about some kind of +internal actions for example interrupts. Messages are printed on +command console. + +
-v + +
Print out version number and stop. + +
-H + +
Print out types of known CPUs. Names printed out by this option +can be used to determine CPU type using -t option. + +
-h + +
Print out a short help about the options and stop. + +
+ + +
+ + + diff --git a/sim/ucsim/doc/mulcons.html b/sim/ucsim/doc/mulcons.html new file mode 100644 index 00000000..771c47c5 --- /dev/null +++ b/sim/ucsim/doc/mulcons.html @@ -0,0 +1,115 @@ + + +UCSIM: Multiple Consoles + + + + +

Using multiple consoles

+ +

Why?

+ +Using more than one console can be useful if you want to issue a +command during the simulated program is executed. + + +

How?

+ +

To get multiple consoles you have to execute the simulator in the +background like daemons run in UNIX systems. The simulator +then will listen and wait for network connection requests and provide +console functions for network connections. + +

To run uCsim in the background you have to use -Z option for the simulator: + +

+pigmy$ s51 -Z 5555 foo.hex
+
+ +In this case s51 runs in forground in your command interpreters point +of view. Of course you can run the program really in the background: + +
+pigmy$ s51 -Z 5555 foo.hex &
+
+ +The parameter of the -Z option is a +port number. This can be number of any unused port of your machine. If +the specified port is already occupied then following message appears: + +
+pigmy$ s51 -Z 5555
+bind: Address already in use
+
+ +In this case you have to use an other number. + +

Let's suppose you have found a free port number and the simulator +listens on it. Now go to somewhere else, at least to an other window +and connect to the simulator: + +

+other_machine$ telnet pigmy 5555
+
+ +First parameter to the telnet command is the name of the machine where +the simulator is running on. It can be localhost if you are +on the same machine or the fully qualified host name if you are at the +other end of the world. Second parameter is the number of the port +where the simulator is listening. It must be the same number which was +specified as parameter of the -Z +option when the simulator was started (see above). + +

Connecting to the simulator you get a command console: + +

+pigmy$ telnet pigmy 5555
+Trying 127.0.0.1...
+Connected to pigmy.talker.bt.
+Escape character is '^]'.
+ucsim 0.2.21, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+>
+ 
+
+ + +

What to do with it?

+ +Obviously you can telnet into the simulator as many times as many +command consoles you want. You can start the execution using one +console and while the program is executed you can, for example, modify +ports on the other console. + + +

Stop

+ +Using quit (q) command you can not stop the +simulator. It just stops the actual console and the simulator +continues to listen for incoming network connections. + +

To stop the simulator completely you have to use kill command. Note that if you stop the +simulator then all the active network connections (all other consoles) +will stop. + + +

Tricks

+ +You can get a console on the terminal where you started the +simulator. To do this you must explicitly ask the simulator to open a +console on the standard input/output. You can do this using -c option and specify the actual +terminal as parameter for it: + +
+pigmy$ s51 -Z 5555 foo.hex -c /dev/tty
+
+ +
+ + + diff --git a/sim/ucsim/doc/new.gif b/sim/ucsim/doc/new.gif new file mode 100644 index 0000000000000000000000000000000000000000..892616ff04edbf6190f44fbf4b5e3f6fa25f0978 GIT binary patch literal 161 zcmZ?wbhEHblw%NKSjfO|;J|_Z{~3NP)d&pyt@x9LkpT#FKm~nr37EGF@w~v*&A`CBJ2Iyz}1up-gXg!e>F|Us>B! zHFh!yZTEY(ZK|@-e4nRZgYG<=GnHGZwt4ot!{J=n+wPk$n((YyJarQ5RMCj(O9~&j NZ94JdMg#+cH2{9PL*xJe literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/obsolete.html b/sim/ucsim/doc/obsolete.html new file mode 100644 index 00000000..2afd2280 --- /dev/null +++ b/sim/ucsim/doc/obsolete.html @@ -0,0 +1,25 @@ +

bl

+ +List breakpoints. This command prints out information about every +fetch and then event breakpoints. + +
+> bl
+F 1(1) 000160 c2 CLR   P1.0
+D 2(2) 000180 02 LJMP  022a
+F 1(1) 000006 wi
+> 
+ +First character on the list shows permanency of the +breakpoint. F means fix and D means dynamic. Second item +on the list is the hit number associated to breakpoint. After that +between the parentheses there is the actual value of the hit +counter. If hit counter reaches zero, breakpoint is activated and hit +counter is preset with value of hit number. Next item is the +address. Next items are different for fetch and event breakpoints. + +

Fetch breakpoints list hexadecimal code of instruction at +breakpoint's address and then dissassembled instruction. + +

Event breakpoints list identification of the event's type. + diff --git a/sim/ucsim/doc/post.jpg b/sim/ucsim/doc/post.jpg new file mode 100644 index 0000000000000000000000000000000000000000..acd6eba59f7cd46f21fd025cb6c66f5a153d3519 GIT binary patch literal 1016 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<1W=16jCP7AKLB{__803NOWMu>c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!(;m`U-bo}m%dwG{CBCg(Brp38zWBszAf@D z^yD$8R%Yg&WI?Xvzz<(?OPAi^GD^*T676#^McKN%v9(6v29HFMBlE&jvz|m`7{s_W zoVXqE@TR}>m6eh&j}`aT^WAsxNVyj@kHm0!})1O z4NM_D8*KO@R(jqwepP7EW6P!0vS?dWWa;az->(XP{7Lea5z zmD2yNxViC}TeX4Qg4TpnOH1Z!)SS#-esJZBg6MPc`KKPNV?4*d;^q05*SD6&$$nIu z|FD|%($=$vrS<%pMr+p|$uxFUxcm8-{L|;^+7rKbN?7vWc(tGX{o1_Q{{(N(Hrtf0 zvmws<*abd=g@^XfuzIW@z;H5e%USIQci&!pwY}rrnrkOzjH7Q_@0?RSHC=1AbxMQh z$zzw#7Oyy`cjDI_H)Eakt$X&_g={O|_4)QkEBhZIaY9$>FKwO6b^LAqe+Hd3-qDA- dzPSp%x!?EhaIuj8DYHdW?_Z2%KPmtJCIF3Dl?ea< literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/serial.html b/sim/ucsim/doc/serial.html new file mode 100644 index 00000000..7707d7cb --- /dev/null +++ b/sim/ucsim/doc/serial.html @@ -0,0 +1,135 @@ + + +UCSIM: Serial Interafces + + + + +

Using serial interfaces

+ +

Connecting a terminal

+ +You can easily connect a terminal to the serial interface of the +simulated microcontroller. This terminal is just a file so it can be +anything which is represented as a file. It can be a real serial line +of the computer: + +
+$ s51 -s/dev/ttyS1
+
+ +Of course you must use the actual device name of your operating +system. Device name ttyS1 above is used in Linux +systems. Your system can use other names. + +

You can use a terminal of your system. It can be a virtual console +if your system provides such as Linux does for example. On X Windows +you can use xterm windows as terminals, one for running the +simulator and one as a terminal on CPU's serial line. Here is a sample +how to do this: + +

  1. Prepare the terminal window which will be connected to the +serial line: + +

    • Check the device name which represents the terminal: + +
      +$ tty
      +/dev/ttyp1
      +
      + +
    • Disconnect the shell from the terminal. Usualy I use the +tail command and any existing text file: + +
      +$ tail -f $HOME/.profile
      +
      + +
    + +
  2. Run the simulator in the other window: + +
    +$ s51 -s/dev/ttyp1 program.hex
    +
    + +Use the output of the tty command above as the parameter of the +-s option. + +
+ +Every character sent out by the simulated program +appears in the "terminal" window and every charater you type in there +will be received by the simulated controller's serial line. + + +

Connecting two instances of simulator

+ +Executing two instances of the simulator, serial lines of two +simulators (micros) can be connected together so they can talk to +each other over their serial interface. It is because you can specify +separate files for serial input and output. For example you run two +simulators "1" and "2", here is the sample how to connect them: + +

+ +

  1. Make two FIFOs to represent physical wires in serial cable +connecting two micros: + +
    +$ mkfifo 1-2 2-1 # 1-2: 1->2  and 2-1: 2->1
    +
    + +
  2. Start two simulators and specify the FIFOs as input and output of +serial interface: + +
    +term1 $ # start sim "1"
    +term1 $ s51 -Sin=2-1,out=1-2 program_1_.hex
    +term2 $ # start sim "2"
    +term2 $ s51 -Sout=2-1,in=1-2 program_2_.hex
    +
    + +Because opening a pipe blocks the program until other direction is +opened, the order of arguments above is important! + +

    + +

  3. Debug programs as usual. + +
+ +Using the most usefull unix commands cat and tee and +just some more FIFOs you can monitor serial communication, here is a +sample: + +

+ +

  1. Make some FIFOs to use between simulators and tee "monitors": + +
    +$ mkfifo 1_tee tee_2 2_tee tee_2
    +
    + +
  2. Run monitoring programs (in two xterms for example): + +
    +xterm1 $ cat 1_tee|tee /dev/tty >tee_2 # monitor 1->2
    +xterm2 $ cat 2_tee|tee /dev/tty >tee_1 # monitor 2->1
    +
    + +
  3. Now you can start simulators (on two other terminals:) + +
    +xterm3 $ s51 -Sin=tee_1,out=1_tee program_1_.hex
    +xterm4 $ s51 -Sin=tee_2,out=2_tee program_2_.hex
    +
    + +
  4. Start your apps and listen what they are talking about. + +
+ +
+ + + diff --git a/sim/ucsim/doc/serial1.fig b/sim/ucsim/doc/serial1.fig new file mode 100644 index 00000000..ad24a87f --- /dev/null +++ b/sim/ucsim/doc/serial1.fig @@ -0,0 +1,53 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 3750 2250 5175 2550 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 4912.500 2400.000 5025 2250 5100 2400 5025 2550 +1 2 0 1 0 0 0 0 20 0.000 1 0.0000 3825 2400 75 150 3750 2400 3900 2400 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 2250 5025 2250 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 2550 5025 2550 +-6 +6 3900 5625 5325 5925 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 5062.500 5775.000 5175 5625 5250 5775 5175 5925 +1 2 0 1 0 0 0 0 20 0.000 1 0.0000 3975 5775 75 150 3900 5775 4050 5775 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3975 5625 5175 5625 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3975 5925 5175 5925 +-6 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 2250 3450 3675 2475 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 6300 3675 5250 2475 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 6975 3975 5400 5775 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 3675 3825 5775 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 825 3225 3900 3225 3900 2925 825 2925 825 3225 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 825 3225 3900 3225 3900 4875 825 4875 825 3225 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4800 3600 7875 3600 7875 5250 4800 5250 4800 3600 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4800 3600 7875 3600 7875 3300 4800 3300 4800 3600 +4 1 0 0 0 16 12 0.0000 4 135 330 4425 2175 2-1\001 +4 1 0 0 0 16 12 0.0000 4 135 330 4575 5550 1-2\001 +4 1 9 0 0 18 12 0.0000 4 135 525 6375 3525 term2\001 +4 1 9 0 0 18 12 0.0000 4 135 525 2325 3150 term1\001 +4 0 1 0 0 12 12 0.0000 4 150 2520 900 3600 $ s51 -Sin=2-1,out=1-2 \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 900 3810 program_1_.hex\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 4950 4125 program_2_.hex\001 +4 0 1 0 0 12 12 0.0000 4 150 2520 4950 3900 $ s51 -Sout=2-1,in=1-2 \\\001 diff --git a/sim/ucsim/doc/serial1.gif b/sim/ucsim/doc/serial1.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc8a0c0f651cc3acad439c206ba4379787eea2bd GIT binary patch literal 3078 zcmV+h4Egg%Nk%v~VF&^x0m1+P000000IvZ50RI30|Ns900RI3000000EC2ui00;sl z0RRL3NV?qqFv>}*y*TU5yZ>M)j$~<`XsWJk>%MR-&vb3yc&_h!@BhG{a7Zi~kI1BQ z$!t2G(5Q4uty-_xtai)odcWYXcuX#v&*-#z&2GEj@VIDva>d>53#hl zx+g(+7 z?(gvL=krVIR@U_SJM8!R{y_Zt{TrCWoj`&JX&9`6FQLN|3mHC~*dij8h7>b)usHq& zqsEUII7;ydvg8DjQAnCx=>R1Zl`LcW3Mf&gO$sibz`R*9XOo>g9}Z~N?qE=v1BSL- zXEcJ+qY0lbwO4aOQmIh$B|Vw0sf4Rp^mr7&W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yD!Gy@*^(~V1PK5DI|I%F(EtDd literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/serial2.fig b/sim/ucsim/doc/serial2.fig new file mode 100644 index 00000000..81beaef7 --- /dev/null +++ b/sim/ucsim/doc/serial2.fig @@ -0,0 +1,97 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 7125 2325 7425 3825 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7275.000 3563.000 7425 3675 7275 3750 7125 3675 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 7275 2475 75 150 7275 2400 7275 2550 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7125 2475 7125 3675 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7425 2475 7425 3675 +-6 +6 2475 2400 2775 3900 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 2625.000 3638.000 2775 3750 2625 3825 2475 3750 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 2625 2550 75 150 2625 2475 2625 2625 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2550 2475 3750 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2775 2550 2775 3750 +-6 +6 5175 6750 6675 7050 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 5437.000 6900.000 5325 7050 5250 6900 5325 6750 +1 2 0 1 0 0 0 0 20 0.000 1 3.1416 6525 6900 75 150 6600 6900 6450 6900 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 6750 5325 6750 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 7050 5325 7050 +-6 +6 4200 5700 4500 7200 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 4350.000 6938.000 4500 7050 4350 7125 4200 7050 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 4350 5850 75 150 4350 5775 4350 5925 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4200 5850 4200 7050 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 5850 4500 7050 +-6 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 4275 1725 2700 2400 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 4350 5700 2550 5025 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4875 4950 7950 4950 7950 6600 4875 6600 4875 4950 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4875 4950 7950 4950 7950 4650 4875 4650 4875 4950 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3450 4725 2625 3900 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3450 1350 6525 1350 6525 1050 3450 1050 3450 1350 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 3450 1350 6525 1350 6525 3000 3450 3000 3450 1350 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 2775 8325 5850 8325 5850 8025 2775 8025 2775 8325 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 2775 8325 5850 8325 5850 9975 2775 9975 2775 8325 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 900 4575 3975 4575 3975 4275 900 4275 900 4575 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 900 4575 3975 4575 3975 6225 900 6225 900 4575 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 5550 1875 7200 2325 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 7275 3825 6375 5100 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 4575 8700 4350 7275 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 6675 6900 7500 5325 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3675 8475 5175 6900 +4 1 9 0 0 18 12 0.0000 4 135 630 6450 4875 xterm4\001 +4 0 1 0 0 12 12 0.0000 4 180 2940 975 4950 $ s51 -Sin=tee_1,out=1_tee \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 975 5160 program_1_.hex\001 +4 1 9 0 0 18 12 0.0000 4 135 630 4950 1275 xterm1\001 +4 1 9 0 0 18 12 0.0000 4 135 630 4275 8250 xterm2\001 +4 1 9 0 0 18 12 0.0000 4 135 630 2400 4500 xterm3\001 +4 0 1 0 0 12 12 0.0000 4 180 2940 4950 5250 $ s51 -Sin=tee_2,out=2_tee \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 4950 5475 program_2_.hex\001 +4 0 1 0 0 12 12 0.0000 4 180 1365 3525 1650 $ cat 1_tee|\\\001 +4 0 1 0 0 12 12 0.0000 4 180 1995 3525 1875 tee /dev/tty >tee_2\001 +4 0 1 0 0 12 12 0.0000 4 180 1365 2850 8625 $ cat 2_tee|\\\001 +4 0 1 0 0 12 12 0.0000 4 180 1995 2850 8850 tee /dev/tty >tee_1\001 +4 0 0 0 0 16 12 0.0000 4 165 465 2850 3600 1_tee\001 +4 0 0 0 0 16 12 0.0000 4 165 465 6600 3525 tee_2\001 +4 0 0 0 0 16 12 0.0000 4 165 465 3675 6825 tee_1\001 +4 0 0 0 0 16 12 0.0000 4 165 465 5700 7275 2_tee\001 diff --git a/sim/ucsim/doc/serial2.gif b/sim/ucsim/doc/serial2.gif new file mode 100644 index 0000000000000000000000000000000000000000..6fbb1db144341e210e6363d446fdad46966bc055 GIT binary patch literal 6260 zcmV-)7>nmeNk%v~VF&__0>S_Q000000IvZ50RI30|Ns900RI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7X)Pv2} zWZhPPEmwJcScts}e63bF#aDe@S4GWHe!W#B@K=Mq*mu>~Uv1cey?|;>Sdh)whGkn; zW{p^veOZZM)oDdoZ$;UQ^-BnB-*LEdUj`h}S?NCIO)0`#Rfwfdx rg;}VLTB)UqqMcf+y;`iT&~eRLuI<{~U>dLrTd^HmvMpO|i2wjQ#se8< literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/term_cpuopt.html b/sim/ucsim/doc/term_cpuopt.html new file mode 100644 index 00000000..feadb152 --- /dev/null +++ b/sim/ucsim/doc/term_cpuopt.html @@ -0,0 +1,27 @@ + + +Simulator for MCS51 + + + + +

Software simulator for MCS51

+ +This screenshot demonstrates one of option dialog boxes and the +terminal window. Terminal window simulates a terminal which is +connected to the serial interface of the simulated +microcontroller. Every character sent by the CPU is printed out in the +terminal window (it does not matter if it is opened or not) and every +time when you press a key in the terminal window the character will be +received by the serial interface of the CPU (when the simulation is +running obviously). During receiving of the character the cursor +disappears from the terminal window and reappears when receive is +completed. Echo is turned off in the terminal window which means that +only simulated program can "write" into the window. + +

+ +


+ + + diff --git a/sim/ucsim/doc/timers.gif b/sim/ucsim/doc/timers.gif new file mode 100644 index 0000000000000000000000000000000000000000..7fc3931710c27922d3d193c7b8dc549002028057 GIT binary patch literal 13166 zcmV-!Gm*?kNk%v~VSoZI0rLO=0001h0001h0001h0DyqNz`%fjfB^ge`1}C){P+L> z00000000000000000000EC2ui0DuB60RRO45XecZy*TU5yZ>M)j$~<`XsWJk>%MR- z&s$;Nc&_h!@BhG{a7Zi~kI1BQ$!t2G(5Q4utquj)tai)odcR;Vz^V(F&jFl7J$agK zZ#Eenr_z6I^6ji#>&t0yfi`|Xd3J$yJQRO@V}y^5MvOOORA`xdazb+iaV^eX}7qGu8no8zdgB8w1&fyL2aGN$dJ&o($cwp){n(N zpI8!F0HfgG$yLG6PRGvZQ|da|Qo*q~?#?*yN%KwYzVt;G{LS*P35<4aOtEVO$Mx7I zpc}Vu;Ua=jxGqtvgQ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K2_lyxa3WW$n84f~yfVuz-Juz;sR377D_NCO zK`vpr%U9|WVvbWKGK2V$V(yZc8F1zbW?4(4-7*o1k)|`Jnf@{7;gXlNoaQ&78KJKw zvz$F_1~!S=%oK!k0@{2U`%L-FY|>Jgy)>CT*-1}k*3+Hu>|#F6DbNt2)0^T9CqMf+ z&wu9Ybd5mPFQvK8d-BhC5%uOo{aH_j-Ux8(1K&VHdccBeG@}Y_CNnwutm^UPmkR}_ zID7QE|A4dv!8BBRKc(tt{Ip4jsm&5o9drk2#7 zIYp|%p0qsP1+}ZeBk4)28rF=avtMqbDN~WEQlHAra+dffObTku#BDWqUcGDHz^cun zsx4F($V*~&IJE_M$yZ`_I literal 0 HcmV?d00001 diff --git a/sim/ucsim/doc/timers.html b/sim/ucsim/doc/timers.html new file mode 100644 index 00000000..48753754 --- /dev/null +++ b/sim/ucsim/doc/timers.html @@ -0,0 +1,22 @@ + + +Simulator for MCS51 + + + + +

Software simulator for MCS51

+ +This screenshot demonstrates timer/counter window. The window displays +value of the timer and control bits related to the timer/counter +unit. Different windows can be opened to display information about +different timers. Note that Timer2 of 8X52 is not implemented. Value +of the timer or control bits can be changed using these windows or SFR +window. + +

+ +


+ + + diff --git a/sim/ucsim/doc/wins.gif b/sim/ucsim/doc/wins.gif new file mode 100644 index 0000000000000000000000000000000000000000..086b54fadf0ea15f1c4229f33f56165d30d56094 GIT binary patch literal 18016 zcmV)8K*qmENk%v~VSoZI0rLO=0001h0001h0Dyo1004jhfPlcjz<_{&0Q>;>`~dg> z`1t(z000000000000000EC2ui0DuB60RRO45XecZy*TU5yZ>M)j$~<`XsWJk>%MR- z&zfQ1c&_h!@BhG{a7Zi~kI1BQ$!t2G(5Q4utquj)tai)odcWYWRTn6m12{=~@+{lj z>+u;*o&VV5n^~#OlhJR0Hhn;Nb%1m{6n=aFH-wBui#d*KkduRk1{FqM6k(vDq5?#7 zf~AP3keO|%l$BO+iBfK}I;&N+r;3WOkp^^$xIM$IfkDN;cWRo-g_W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iuXQ3RuO^-2n7Sg~WtmNk18 zZCbT!*|v527Oq$<=hOQgf81kx!a^wI+ z{1S6a{>_>)bKZOrrf1QhJCpuAGV?9PLm5YQ{Tg=cxkObL9vtJ-cxrxpd3f>TQ#JQ=*Ys%Ar&F?DslGk@ z_vz`cmmj)*$@9gxmL>lmzyQZE@4V}(%Wk^_5nNC=1sh~AIt=#v&MW~fyb!|-HQbQH z4n6!ZzyJc!LPQbKFwp=MyWl2_gV-n$#w3iMi7M@l1L1F zlyOEZlKcWi6;}iR3n*!nGRifYOw!3Gfuiz@Al0~1$t6|HGK-vYDiX~!)l?2lB;Dlx zV$2!I)WXYHxIAOb6nC6*OEKy^5lcOtymCo8O<5DsL>1+!%`n3}@`^$C>{7}~sjTr# z0}eH#$u}wOb4we6gfi1II(5`hND8eY)Jt*H)Y3&|ot4%w8jV!ULIs_4&KqB~!o`FB zv=!1`%VZT+P^07$Q#^~!HAOvtBsJM)lfBm3TD9F)RvinKvXe4-6BqUKlSxoVb3*HSAh@a_t=QhmA7GW z3g!Y|QDen+;eS2;*usFp9XDWKtE~1;g(s#M&V~wgcVlv89=7G02fo);j$vEg8RVXQ z2Cz|Y9|faibGyMe-%LxTSlmf5j``K3F + +Simulator for MCS51 + + + + +

Software simulator for MCS51

+ +This screenshot demonstrates some kind of windows that can be opened +using commands in View menu. Every windows including CPU window +can be resized and moved on the desktop area. Every windows are active +which means that value of displayed data can be changed at any time +including execution of the simulated program. + +

+ +


+ + + diff --git a/sim/ucsim/gui.src/(c).1 b/sim/ucsim/gui.src/(c).1 new file mode 100644 index 00000000..d673f9fd --- /dev/null +++ b/sim/ucsim/gui.src/(c).1 @@ -0,0 +1,25 @@ +/* + * Simulator of microcontrollers (@@F@@) + * + * Copyright (C) @@S@@,@@Y@@ Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ diff --git a/sim/ucsim/gui.src/Makefile.in b/sim/ucsim/gui.src/Makefile.in new file mode 100644 index 00000000..69f892f4 --- /dev/null +++ b/sim/ucsim/gui.src/Makefile.in @@ -0,0 +1,141 @@ +# +# uCsim gui.src/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1999 +# + +SHELL = /bin/sh +CXX = @CXX@ +CPP = @CPP@ +CXXCPP = @CXXCPP@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ + +PRJDIR = .. + +DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) +CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) +CFLAGS = @CFLAGS@ -Wall +CXXFLAGS = @CXXFLAGS@ -Wall +M_OR_MM = @M_OR_MM@ + +LIBS = @LIBS@ -L$(PRJDIR) -lutil -lsim -lcmd + +curses_ok = @curses_ok@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ + +PKGS = serio.src portmon.src + +LOBJECTS = event.o \ + view.o frame.o bg.o label.o \ + group.o win.o desk.o app.o + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: gui.src + +libs: guilib + +ifeq ($(curses_ok),yes) +gui.src: checkconf guilib a +else +gui.src: checkconf guilib +endif + @for pkg in $(PKGS); do\ + $(MAKE) -C $$pkg $$pkg ;\ + done + +a: a.o + $(CXX) $(LDFLAGS) $(LIBS) a.o -o $@ + + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) install ; cd ..;\ + done + + +# Deleting all the installed files +# -------------------------------- +uninstall: + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) uninstall ; cd ..;\ + done + + +# Performing self-test +# -------------------- +check: + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) check ; cd ..;\ + done + + +# Performing installation test +# ---------------------------- +installcheck: + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) installcheck ; cd ..;\ + done + + +# Creating installation directories +# --------------------------------- +installdirs: + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) installdirs ; cd ..;\ + done + + +# Creating dependencies +# --------------------- +dep: Makefile.dep + +Makefile.dep: *.cc *.h + $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep + +include Makefile.dep +include clean.mk + +#parser.cc: parser.y + +#plex.cc: plex.l + +# My rules +# -------- +ifeq ($(curses_ok),yes) +guilib: libgui.a +else +guilib: +endif + +libgui.a: $(LOBJECTS) + ar -rcu $*.a $(LOBJECTS) + $(RANLIB) $*.a + +.cc.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(PRJDIR)/devel ]; then\ + $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\ + fi + +# End of gui.src/Makefile diff --git a/sim/ucsim/gui.src/a.cc b/sim/ucsim/gui.src/a.cc new file mode 100644 index 00000000..81d62c3f --- /dev/null +++ b/sim/ucsim/gui.src/a.cc @@ -0,0 +1,87 @@ +#include +#include + +int sfr[4]; +int port[4]; + +void +init_panel(PANEL *p) +{ + int mask, x, y; + int na, ha; + int cursor= 2; + WINDOW *w= panel_window(p); + + if (has_colors()) + { + na= COLOR_PAIR(1); + ha= COLOR_PAIR(2); + } + else + { + na= A_NORMAL; + ha= A_STANDOUT; + } + //wattron(w, COLOR_PAIR); + x= 0; + for (mask= 1, y= 0; mask < 0x100; mask<<= 1,y++) + { + wattrset(w, (y==cursor)?ha:na); + mvwprintw(w, y,x, "%s", (sfr[0]&mask)?"High":" Low"); + } +} + +wchar_t +wait_input(PANEL *p) +{ + WINDOW *w= panel_window(p); + wchar_t c; + + c= wgetch(w); + printw("%d 0x%x\n",c,c); + return(c); +} + +int +main(int argc, char *argv[]) +{ + wchar_t c; + + initscr(); /* initialize the curses library */ + keypad(stdscr, TRUE); /* enable keyboard mapping */ + nonl(); /* tell curses not to do NL->CR/NL on output */ + cbreak(); /* take input chars one at a time, no wait for \n */ + noecho(); /* don't echo input */ + if (has_colors()) + { + start_color(); + printw("has %d colors and %d pairs\n", COLORS, COLOR_PAIRS); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_WHITE, COLOR_RED); + } + if (has_key(KEY_UP)) + printw("has UP KEY_UP=0x%x\n",KEY_UP); + else + printf("has no UP\n"); + c= getch(); + printw("got %d %x\n",c,c); + + WINDOW *w= newwin(10,10, 3,3); + keypad(w, TRUE); + PANEL *p= new_panel(w); + + sfr[0]= 0x5a; + init_panel(p); + update_panels(); + doupdate(); + c= wait_input(p); + //c= getch(); + + endwin(); + if (c==KEY_UP) + printf("got UP\n"); + else if (c==KEY_DOWN) + printf("got DOWN\n"); + else + printf("got \"%d\"\n", c); +} diff --git a/sim/ucsim/gui.src/app.cc b/sim/ucsim/gui.src/app.cc new file mode 100644 index 00000000..309497b9 --- /dev/null +++ b/sim/ucsim/gui.src/app.cc @@ -0,0 +1,171 @@ +/* + * Simulator of microcontrollers (app.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include + +#include "appcl.h" +#include "deskcl.h" + + +cl_app::cl_app(char *iname): + cl_group(iname, this) +{ + drawn= 0; +} + +cl_app::~cl_app(void) +{ + endwin(); +} + +int +cl_app::init(void) +{ + initscr(); + keypad(stdscr, TRUE); + nonl(); + cbreak(); + noecho(); + + pos= new cl_box(0,0, COLS, LINES); + cl_view::init(); + state|= SF_SELECTED;//select(); + class cl_box b(*pos); + //b.move_rel(0,1); + //b.grow(0,-2); + if ((desk= mk_desk(&b))) + insert(desk); + desk->select(); + mk_views(desk); + + //update(); + update_panels(); + doupdate(); + return(0); +} + +class cl_gin * +cl_app::mk_input(void) +{ + class cl_gin *i= new cl_gin(); + i->init(); + i->add_input(stdin, 0); + return(i); +} + +int * +cl_app::mk_palette(void) +{ + int *p, i; + int colors; + + colors= 64; + p= (int*)malloc(colors * sizeof(int)); + if (has_colors()) + { + start_color(); + + init_pair(i= C_WIN+C_WIN_NORMAL, COLOR_YELLOW, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + for (i= 1; i < colors; i++) + p[i]= p[C_WIN+C_WIN_NORMAL]; + // desktop + init_pair(i= C_DSK_BG, COLOR_BLACK, COLOR_WHITE); + p[i]= COLOR_PAIR(i); + // menus and status bar + init_pair(i= C_DSK_NORMAL, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + init_pair(i= C_DSK_DISABLED, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i); + // window + init_pair(i= C_WIN+C_WIN_FPASSIVE, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i); + init_pair(i= C_WIN+C_WIN_FACTIVE, COLOR_WHITE, COLOR_BLUE); + p[i]= COLOR_PAIR(i)|A_BOLD; + init_pair(i= C_WIN+C_WIN_SELECTED, COLOR_YELLOW, COLOR_RED); + p[i]= COLOR_PAIR(i)|A_BOLD; + } + else + { + for (i= 0; i < colors; i++) + p[i]= A_NORMAL; + p[C_WIN+C_WIN_FACTIVE]|= A_BOLD; + p[C_WIN+C_WIN_SELECTED]|= A_REVERSE; + } + return(p); +} + +class cl_group * +cl_app::mk_desk(class cl_box *ipos) +{ + class cl_group *d= new cl_desk(ipos, "desktop", this); + d->init(); + return(d); +} + + +int +cl_app::handle_event(struct t_event *event) +{ + if (!cl_group::handle_event(event)) + { + if (event->what == EV_KEY) + switch (event->event.key) + { + case KEY_BREAK: case KEY_EXIT: + event->what= EV_COMMAND; + event->event.msg.cmd= CMD_QUIT; + break; + } + } + return(0); +} + +int +cl_app::run(void) +{ + struct t_event event; + + drawn= 0; + while (get_event(&event)) + { + if (!handle_event(&event)) + { + if (event.what == EV_COMMAND && + event.event.msg.cmd == CMD_QUIT) + return(0); + unhandled(&event); + } + if (drawn) + update(); + drawn= 0; + } + return(0); +} + + +/* End of gui.src/app.cc */ diff --git a/sim/ucsim/gui.src/appcl.h b/sim/ucsim/gui.src/appcl.h new file mode 100644 index 00000000..92a80c9d --- /dev/null +++ b/sim/ucsim/gui.src/appcl.h @@ -0,0 +1,54 @@ +/* + * Simulator of microcontrollers (appcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef APPCL_HEADER +#define APPCL_HEADER + +#include "groupcl.h" + + +class cl_app: public cl_group +{ +public: + class cl_group *desk; + int drawn; +public: + cl_app(char *iname); + ~cl_app(void); + virtual int init(void); + virtual class cl_gin *mk_input(void); + virtual int *mk_palette(void); + virtual class cl_group *mk_desk(class cl_box *ipos); + + virtual int handle_event(struct t_event *event); + virtual int run(void); +}; + + +#endif + +/* End of gui.src/appcl.h */ diff --git a/sim/ucsim/gui.src/bg.cc b/sim/ucsim/gui.src/bg.cc new file mode 100644 index 00000000..d854d307 --- /dev/null +++ b/sim/ucsim/gui.src/bg.cc @@ -0,0 +1,63 @@ +/* + * Simulator of microcontrollers (bg.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include + +#include "bgcl.h" + + +cl_bg::cl_bg(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + options&= ~OF_SELECTABLE; +} + +int * +cl_bg::mk_palette(void) +{ + int *p; + + p= (int*)malloc(1*sizeof(int)); + p[0]= C_DSK_BG; + return(p); +} + +int +cl_bg::draw(void) +{ + int x, y, color= get_color(0); + + wmove(window, 0, 0); + wattrset(window, color); + for (y= 0; y < pos->h; y++) + for (x= 0; x < pos->w; x++) + waddch(window, ACS_CKBOARD); + return(0); +} + + +/* End of gui.src/bg.cc */ diff --git a/sim/ucsim/gui.src/bgcl.h b/sim/ucsim/gui.src/bgcl.h new file mode 100644 index 00000000..968ed819 --- /dev/null +++ b/sim/ucsim/gui.src/bgcl.h @@ -0,0 +1,47 @@ +/* + * Simulator of microcontrollers (bgcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef BGCL_HEADER +#define BGCL_HEADER + + +#include "viewcl.h" +#include "appcl.h" + + +class cl_bg: public cl_view +{ +public: + cl_bg(class cl_box *ipos, char *iname, class cl_app *iapp); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/bgcl.h */ diff --git a/sim/ucsim/gui.src/clean.mk b/sim/ucsim/gui.src/clean.mk new file mode 100644 index 00000000..bd548323 --- /dev/null +++ b/sim/ucsim/gui.src/clean.mk @@ -0,0 +1,45 @@ +# uCsim gui.src/clean.mk + +PKGS = serio.src portmon.src + +# Deleting all files created by building the program +# -------------------------------------------------- +clean_local: + rm -f *core *[%~] *.[oa] a + rm -f .[a-z]*~ + +clean: clean_local + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) -f clean.mk clean; cd ..;\ + done + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean_local: clean_local + rm -f config.cache config.log config.status + rm -f Makefile *.dep + +distclean: distclean_local + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) -f clean.mk distclean; cd ..;\ + done + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean_local + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) -f clean.mk mostlyclean; cd ..;\ + done + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean_local + @for pkg in $(PKGS); do\ + cd $$pkg && $(MAKE) -f clean.mk realclean; cd ..;\ + done + +# End of gui.src/clean.mk diff --git a/sim/ucsim/gui.src/conf.mk b/sim/ucsim/gui.src/conf.mk new file mode 100644 index 00000000..5c33eb3d --- /dev/null +++ b/sim/ucsim/gui.src/conf.mk @@ -0,0 +1,12 @@ +# uCsim gui.src/conf.mk + +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in + cd $(PRJDIR) && $(SHELL) ./config.status + +# End of gui.src/conf.mk diff --git a/sim/ucsim/gui.src/desk.cc b/sim/ucsim/gui.src/desk.cc new file mode 100644 index 00000000..6808cd7c --- /dev/null +++ b/sim/ucsim/gui.src/desk.cc @@ -0,0 +1,58 @@ +/* + * Simulator of microcontrollers (desk.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "deskcl.h" +#include "bgcl.h" + + +int +cl_desk::handle_event(struct t_event *event) +{ + if (cl_group::handle_event(event)) + return(1); + if (event->what == EV_KEY && + event->event.key == KEY_F(6)) + { + select_next(); + return(1); + } + return(0); +} + +int +cl_desk::mk_views(class cl_group *ins_to) +{ + class cl_box b(*pos); + + b.move_rel(0,1); + b.grow(0,-2); + insert(new cl_bg(&b, "background", app)); + return(0); +} + + +/* End of gui.src/desk.cc */ diff --git a/sim/ucsim/gui.src/deskcl.h b/sim/ucsim/gui.src/deskcl.h new file mode 100644 index 00000000..b3346b72 --- /dev/null +++ b/sim/ucsim/gui.src/deskcl.h @@ -0,0 +1,42 @@ +/* + * Simulator of microcontrollers (deskcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "groupcl.h" + + +class cl_desk: public cl_group +{ +public: + cl_desk(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_group(ipos, iname, iapp) {} + virtual int mk_views(class cl_group *ins_to); + + virtual int handle_event(struct t_event *event); +}; + + +/* End of gui.src/deskcl.h */ diff --git a/sim/ucsim/gui.src/event.cc b/sim/ucsim/gui.src/event.cc new file mode 100644 index 00000000..32075897 --- /dev/null +++ b/sim/ucsim/gui.src/event.cc @@ -0,0 +1,126 @@ +/* + * Simulator of microcontrollers (event.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include + +//#include + +#include "eventcl.h" + + +cl_input_src::cl_input_src(FILE *ifile, class cl_view *iview) +{ + file= ifile; + view= iview; +} + + +cl_gin::cl_gin(void) +{ + FD_ZERO(&in_set); + max_fdes= 0; + inputs= new cl_list(1, 1); +} + +cl_gin::~cl_gin(void) +{ + delete inputs; +} + + +int +cl_gin::add_input(FILE *ifile, class cl_view *iview) +{ + int d= fileno(ifile); + + inputs->add(new cl_input_src(ifile, iview)); + if (d > max_fdes) + max_fdes= d; + FD_SET(d, &in_set); + return(0); +} + +class cl_input_src * +cl_gin::get_input_src(int fdes) +{ + int i; + + for (i= 0; i < inputs->count; i++) + { + class cl_input_src *s= (class cl_input_src *)(inputs->at(i)); + if (fileno(s->file) == fdes) + return(s); + } + return(0); +} + +int +cl_gin::get_event(struct t_event *event) +{ + fd_set set; + //static struct timeval timeout= {0,0}; + wchar_t c; + + //FD_ZERO(&set); + set= in_set; + //FD_SET(fileno(stdin), &set); + if(::select(/*fileno(stdin)*/max_fdes+1, + &set, NULL, NULL, + NULL/*&timeout*/) > 0) + { + int i; + for (i= 0; i < inputs->count; i++) + { + class cl_input_src *s= (class cl_input_src *)(inputs->at(i)); + if (!s->file || + !(FD_ISSET(fileno(s->file), &set))) + continue; + if (s->view) + { + if (s->file) + { + c= fgetc(s->file); + return(s->view->mk_event(event, s->file, c)); + } + } + else + if ((c= getch()) > 0) + { + event->what= EV_KEY; + event->event.key= c; + return(1); + } + } + } + + return(0); +} + + +/* End of gui.src/event.cc */ diff --git a/sim/ucsim/gui.src/eventcl.h b/sim/ucsim/gui.src/eventcl.h new file mode 100644 index 00000000..4077a72f --- /dev/null +++ b/sim/ucsim/gui.src/eventcl.h @@ -0,0 +1,96 @@ +/* + * Simulator of microcontrollers (eventcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef EVENTCL_HEADER +#define EVENTCL_HEADER + +#include "ddconfig.h" + +#if FD_HEADER_OK +# include HEADER_FD +#endif + +#include "pobjcl.h" + +#include "viewcl.h" + + +#define EV_NOTHING 0x0000 +#define EV_MOUSE_DOWN 0x0001 +#define EV_MOUSE_UP 0x0002 +#define EV_MOUSE_MOVE 0x0004 +#define EV_MOUSE_AUTO 0x0008 +#define EV_KEY 0x0010 +#define EV_COMMAND 0x0100 +#define EV_BROADCAST 0x0200 + +// cathegories +#define EV_MOUSE (EV_MOUSE_DOWN|EV_MOUSE_UP|EV_MOUSE_MOVE|EV_MOUSE_AUTO) +#define EV_KEYBOARD EV_KEY +#define EV_MESSAGE 0xff00 + +#define CMD_QUIT 0 + +struct t_event { + int what; + union { + wchar_t key; + struct { + int cmd; + long param; + } msg; + } event; +}; + + +class cl_input_src: public cl_base +{ +public: + FILE *file; + class cl_view *view; + cl_input_src(FILE *ifile, class cl_view *iview); +}; + +class cl_gin: public cl_base +{ +public: + fd_set in_set; + int max_fdes; + cl_list *inputs; +public: + cl_gin(void); + ~cl_gin(void); + + virtual int add_input(FILE *ifile, class cl_view *iview); + virtual class cl_input_src *get_input_src(int fdes); + virtual int get_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/eventcl.h */ diff --git a/sim/ucsim/gui.src/frame.cc b/sim/ucsim/gui.src/frame.cc new file mode 100644 index 00000000..b6b00e8d --- /dev/null +++ b/sim/ucsim/gui.src/frame.cc @@ -0,0 +1,76 @@ +/* + * Simulator of microcontrollers (frame.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include "i_string.h" + +#include "framecl.h" +#include "wincl.h" + + +cl_frame::cl_frame(class cl_box *ipos, class cl_view *iwindow, char *iname, + class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + win= iwindow; + options&= ~OF_SELECTABLE; +} + +int * +cl_frame::mk_palette(void) +{ + int *p; + + p= (int*)malloc(2*sizeof(int)); + p[0]= C_WIN_FPASSIVE; + p[1]= C_WIN_FACTIVE; + return(p); +} + +int +cl_frame::draw(void) +{ + char *t; + int color; + + color= get_color((win && (win->state&SF_SELECTED))?1:0); + wattrset(window, color); + box(window, ACS_VLINE, ACS_HLINE); + if (!(t= strdup(((class cl_win *)win)->get_title()))) + return(0); + if ((signed)strlen(t) > (pos->w)-4) + t[(pos->w)-4]= '\0'; + mvwprintw(window, 0,((pos->w)-strlen(t))/2, "[%s]", t); + free(t); + app->drawn++; + return(0); +} + + +/* End of gui.src/frame.cc */ diff --git a/sim/ucsim/gui.src/framecl.h b/sim/ucsim/gui.src/framecl.h new file mode 100644 index 00000000..6a3c06a1 --- /dev/null +++ b/sim/ucsim/gui.src/framecl.h @@ -0,0 +1,48 @@ +/* + * Simulator of microcontrollers (framecl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef FRAMELCL_HEADER +#define FRAMELCL_HEADER + +#include "viewcl.h" +#include "appcl.h" + + +class cl_frame: public cl_view +{ + class cl_view *win; +public: + cl_frame(class cl_box *ipos, class cl_view *iwindow, char *iname, + class cl_app *iapp); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/framecl.h */ diff --git a/sim/ucsim/gui.src/group.cc b/sim/ucsim/gui.src/group.cc new file mode 100644 index 00000000..45bb0e4f --- /dev/null +++ b/sim/ucsim/gui.src/group.cc @@ -0,0 +1,393 @@ +/* + * Simulator of microcontrollers (group.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "groupcl.h" +#include "appcl.h" + + +cl_group::cl_group(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + current= 0; +} + +cl_group::cl_group(char *iname, class cl_app *iapp): + cl_view(iname, iapp) +{ + current= 0; +} + +cl_group::~cl_group(void) +{} + +int +cl_group::init(void) +{ + cl_view::init(); + mk_views(this); + return(0); +} + +int +cl_group::mk_views(class cl_group *ins_to) +{ + return(0); +} + + +/* + * Make output by drawing all subviews + */ + +static void do_draw_view(class cl_view *view) +{ + view->draw(); +} + +int +cl_group::draw(void) +{ + /*int i; + + for (i= 0; i < views->count; i++) + { + class cl_view *v= (class cl_view *)(views->at(i)); + v->draw(); + app->drawn++; + }*/ + for_each(do_draw_view); + return(0); +} + +/*int +cl_group::update(void) +{ + draw(); + update_panels(); + doupdate(); +}*/ + + +int +cl_group::handle_event(struct t_event *event) +{ + int handled= 0; + + if (event->what & (EV_KEY|EV_COMMAND)) + { + if (current) + handled= current->handle_event(event); + } + else if (event->what & EV_MESSAGE) + { + class cl_view *v= last; + do + { + handled= v->handle_event(event); + v= v->next; + } + while (! handled && + v != last); + } + return(handled); +} + + +/* + * Managing views + */ + +//class cl_view * +void +cl_group::insert(class cl_view *view) +{ + /*if (view && + view->ok()) + { + views->add_at(0, view); + view->parent= this; + view->select(); + //view->draw(); + return(view); + } + return(0);*/ + insert_before(view, first()); + if (view->options & OF_SELECTABLE) + view->select(); + draw(); +} + +void +cl_group::insert_before(class cl_view *view, class cl_view *target) +{ + unsigned int ss; + + if (view && + !(view->parent) && + (!target || + target->parent == this)) + { + ss= view->state; + //view->hide(); + insert_view(view, target); + /*if (ss & SF_VISIBLE) + view->show();*/ + if (state & SF_ACTIVE) + view->change_state(SF_ACTIVE, 1); + } +} + +void +cl_group::insert_view(class cl_view *view, class cl_view *target) +{ + view->parent= this; + if (target) + { + target= target->prev(); + view->next= target->next; + target->next= view; + } + else + { + if (!last) + view->next= view; + else + { + view->next= last->next; + last->next= view; + } + last= view; + } +} + +class cl_view * +cl_group::first(void) +{ + if (!last) + return(0); + return(last->next); +} + + +/*class cl_view * +cl_group::get_by_state(unsigned int what, int enabled) +{ + int i; + + for (i= 0; i < views->count; i++) + { + class cl_view *v= (class cl_view *)(views->at(i)); + if ((enabled && + (state&what)) + || + (!enabled && + ((~state)&what)) + ) + return(v); + } + return(0); +}*/ + +/*int +cl_group::select(void) +{ +}*/ + +/*int +cl_group::unselect(void) +{ +}*/ + +int +cl_group::select_next() +{ + /* int start, i; + class cl_view *v; + + if (views->count <= 1) + return(1); + if (current) + start= views->index_of(current); + else + if ((v= get_by_state(SF_SELECTED, 1))) + start= views->index_of(v); + else + if ((v= get_by_state(SF_FOCUSED, 1))) + start= views->index_of(v); + else + start= 0; + i= (start+1)%(views->count); + while (i != start) + { + v= (class cl_view *)(views->at(i)); + if ((v->options & OF_SELECTABLE) && + v->select()) + { + //update(); + return(1); + } + i= (i+1)%(views->count); + }*/ + return(0); +} + +int +cl_group::select_prev() +{ + /* int start, i; + class cl_view *v; + + if (views->count <= 1) + return(1); + if (current) + start= views->index_of(current); + else + if ((v= get_by_state(SF_SELECTED, 1))) + start= views->index_of(v); + else + if ((v= get_by_state(SF_FOCUSED, 1))) + start= views->index_of(v); + else + start= 0; + i= start-1; if (i < 0) i= views->count-1; + while (i != start) + { + v= (class cl_view *)(views->at(i)); + if ((v->options & OF_SELECTABLE) && + v->select()) + { + //update(); + return(1); + } + i= start-1; if (i < 0) i= views->count-1; + }*/ + return(0); +} + +class cl_view * +cl_group::current_sub_view(void) +{ + return(current); +} + +void +cl_group::for_each(void (*func)(class cl_view *view)) +{ + class cl_view *v; + + if (!last) + return; + v= last->next; + do + { + func(v); + v= v->next; + } + while (v != last); +} + +void +cl_group::set_current(class cl_view *view) +{ + //current= view; + if (current == view) + return; + //lock(); + /*focus_view(view, 0);*/ + if ((state & SF_FOCUSED) && + (current != 0)) + current->change_state(SF_FOCUSED, 0); + //if (mode!=ENTER_SELECT) select_view(current, 0); + if (current) + current->change_state(SF_SELECTED, 0); + //if (mode!=LEAVE_SELECT) select_view(view, 1); + if (view) + view->change_state(SF_SELECTED, 1); + //focuse_view(view, 1); + if ((state & SF_FOCUSED) && + (view != 0)) + view->change_state(SF_SELECTED, 1); + current= view; + //unlock(); +} + +/*int +cl_group::terminal_view(void) +{ + return(views->count == 0); +}*/ + +static unsigned int grp_what, grp_en; + +static void +do_set_state(class cl_view *v) +{ + v->change_state(grp_what, grp_en); +} + +void +cl_group::change_state(unsigned int what, int enable) +{ + cl_view::change_state(what, enable); + /*if (enable && + (what & SF_SELECTED)) + { + class cl_view *v= get_by_state(SF_SELECTED, 1); + if (v) + { + current= v; + current->change_state(SF_FOCUSED, 1); + current->change_state(SF_SELECTED, 1); + } + else + { + if ((v= get_by_state(SF_FOCUSED, 1))) + { + current= v; + current->change_state(SF_SELECTED, 1); + } + } + }*/ + switch (what) + { + case SF_ACTIVE: + //lock(); + grp_what= what; + grp_en= enable; + for_each(do_set_state); + //unlock(); + break; + case SF_FOCUSED: + if (current) + current->change_state(SF_FOCUSED, enable); + break; + } + draw(); +} + + +/* End of gui.src/group.cc */ diff --git a/sim/ucsim/gui.src/groupcl.h b/sim/ucsim/gui.src/groupcl.h new file mode 100644 index 00000000..87f0ba88 --- /dev/null +++ b/sim/ucsim/gui.src/groupcl.h @@ -0,0 +1,70 @@ +/* + * Simulator of microcontrollers (groupcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef GROUPCL_HEADER +#define GROUPCL_HEADER + +#include "viewcl.h" + +class cl_group: public cl_view +{ +public: + class cl_view *current; + +public: + cl_group(class cl_box *ipos, char *iname, class cl_app *iapp); + cl_group(char *iname, class cl_app *iapp); + ~cl_group(void); + virtual int init(void); + virtual int mk_views(class cl_group *ins_to); + virtual int is_group(void) {return(1);} + + virtual int draw(void); + //virtual int update(void); + + virtual int handle_event(struct t_event *event); + + virtual /*class cl_view **/void insert(class cl_view *view); + virtual void insert_before(class cl_view *view, class cl_view *target); + virtual void insert_view(class cl_view *view, class cl_view *target); + virtual class cl_view *first(void); + virtual void for_each(void (*func)(class cl_view *view)); + //virtual class cl_view *get_by_state(unsigned int what, int enabled); + //virtual int select(void); + //virtual int unselect(void); + virtual int select_next(); + virtual int select_prev(); + virtual class cl_view *current_sub_view(void); + virtual void set_current(class cl_view *view); + //virtual int terminal_view(void); + virtual void change_state(unsigned int what, int enable); +}; + + +#endif + +/* End of gui.src/groupcl.h */ diff --git a/sim/ucsim/gui.src/label.cc b/sim/ucsim/gui.src/label.cc new file mode 100644 index 00000000..90c54a36 --- /dev/null +++ b/sim/ucsim/gui.src/label.cc @@ -0,0 +1,74 @@ +/* + * Simulator of microcontrollers (label.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include "i_string.h" + +#include "labelcl.h" + + +cl_label::cl_label(class cl_box *ipos, class cl_app *iapp, char *ilabel): + cl_view(ipos, "label", iapp) +{ + options&= ~OF_SELECTABLE; + if (!ilabel || + !(*ilabel)) + label= strdup(""); + else + label= strdup(ilabel); +} + +cl_label::~cl_label(void) +{ + free(label); +} + +int * +cl_label::mk_palette(void) +{ + int *p; + + p= (int*)malloc(1*sizeof(int)); + p[0]= C_WIN_NORMAL; + return(p); +} + +int +cl_label::draw(void) +{ + int color= get_color(0); + + cl_view::draw(); + wattrset(window, color); + mvwprintw(window, 0,0, "%s", label); + return(0); +} + + +/* End of gui.src/label.cc */ diff --git a/sim/ucsim/gui.src/labelcl.h b/sim/ucsim/gui.src/labelcl.h new file mode 100644 index 00000000..79d62886 --- /dev/null +++ b/sim/ucsim/gui.src/labelcl.h @@ -0,0 +1,50 @@ +/* + * Simulator of microcontrollers (labelcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef LABELCL_HEADER +#define LABELCL_HEADER + + +#include "viewcl.h" +#include "appcl.h" + + +class cl_label: public cl_view +{ +public: + char *label; +public: + cl_label(class cl_box *ipos, class cl_app *iapp, char *ilabel); + ~cl_label(void); + virtual int *mk_palette(void); + virtual int draw(void); +}; + + +#endif + +/* End of gui.src/labelcl.h */ diff --git a/sim/ucsim/gui.src/palette.h b/sim/ucsim/gui.src/palette.h new file mode 100644 index 00000000..6f9d383f --- /dev/null +++ b/sim/ucsim/gui.src/palette.h @@ -0,0 +1,44 @@ +/* + * Simulator of microcontrollers (palette.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef PALETTE_HEADER +#define PALETTE_HEADER + + +#define C_DSK_BG 1 +#define C_DSK_NORMAL 2 +#define C_DSK_DISABLED 3 + +#define C_WIN 8 +#define C_WIN_FPASSIVE 0 +#define C_WIN_FACTIVE 1 +#define C_WIN_NORMAL 5 +#define C_WIN_SELECTED 6 + +#endif + +/* End of gui.src/palette.h */ diff --git a/sim/ucsim/gui.src/view.cc b/sim/ucsim/gui.src/view.cc new file mode 100644 index 00000000..9ead6f48 --- /dev/null +++ b/sim/ucsim/gui.src/view.cc @@ -0,0 +1,356 @@ +/* + * Simulator of microcontrollers (view.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include "i_string.h" + +#include "appcl.h" + + +/* + * Box + */ + +cl_box::cl_box(int ix, int iy, int iw, int ih): + cl_base() +{ + x= ix; + y= iy; + w= iw; + h= ih; +} + +void +cl_box::set(int ix, int iy, int iw, int ih) +{ + x= ix; + y= iy; + w= iw; + h= ih; +} + +void +cl_box::move_rel(int dx, int dy) +{ + x+= dx; + y+= dy; +} + +void +cl_box::grow(int dw, int dh) +{ + w+= dw; + h+= dh; +} + + +/* + * Astbract of a viewer + ****************************************************************************** + */ + +cl_view::cl_view(class cl_box *ipos, char *iname, class cl_app *iapp): + cl_base() +{ + pos= new cl_box(ipos->x,ipos->y, ipos->w,ipos->h); + if ((window= newwin(pos->h,pos->w, pos->y,pos->x))) + { + leaveok(window, TRUE); + panel= new_panel(window); + } + else + { + panel= 0; + delwin(window); + window= 0; + } + parent= 0; + next= last= 0; + app= iapp; + state= SF_NOTHING; + options= OF_SELECTABLE; + if (!iname || + !(*iname)) + { + name= (char*)malloc(100); + sprintf(name, "view%p", this); + } + else + name= strdup(iname); +} + +cl_view::cl_view(char *iname, class cl_app *iapp): + cl_base() +{ + window= 0; + panel= 0; + parent= 0; + next= last= 0; + app= iapp; + state= SF_NOTHING; + options= OF_SELECTABLE; + if (!iname || + !(*iname)) + { + name= (char*)malloc(100); + sprintf(name, "view%p", this); + } + else + name= strdup(iname); +} + +cl_view::~cl_view(void) +{ + if (panel) + del_panel(panel); + if (window) + delwin(window); + if (palette) + free(palette); + if (name) + free(name); +} + +int +cl_view::init(void) +{ + input= mk_input(); + palette= mk_palette(); + //draw(); + return(0); +} + +class cl_gin * +cl_view::mk_input(void) +{ + return(0); +} + +int * +cl_view::mk_palette(void) +{ + return(0); +} + +int +cl_view::ok(void) +{ + return(window && panel); +} + + +/* + * Make output into the view + */ + +int +cl_view::draw(void) +{ + int color, x, y; + + color= get_color(palette?0:C_WIN_NORMAL); + + wattrset(window, color); + for (y= 0; y < pos->h; y++) + for (x= 0; x < pos->w; x++) + mvwaddch(window, y,x, ' '); + app->drawn++; + + return(0); +} + +int +cl_view::update(void) +{ + draw(); + update_panels(); + doupdate(); + return(0); +} + +int +cl_view::get_color(int color) +{ + int *p; + class cl_view *v; + + v= this; + while (v) + { + p= v->get_palette(); + if (p) + color= p[color]; + v= v->parent; + } + return(color); +} + +int * +cl_view::get_palette(void) +{ + return(palette); +} + + +/* + * Event handling + */ + +int +cl_view::get_event(struct t_event *event) +{ + if (parent) + return(parent->get_event(event)); + if (input) + return(input->get_event(event)); + return(0); +} + +int +cl_view::handle_event(struct t_event *event) +{ + return(0); +} + +int +cl_view::unhandled(struct t_event *event) +{ + return(0); +} + +int +cl_view::mk_event(struct t_event *event, FILE *f, int key) +{ + event->what= EV_KEY; + event->event.key= key; + return(1); +} + + +class cl_view * +cl_view::prev(void) +{ + class cl_view *v; + + v= next; + while (v != this) + v= v->next; + return(v); +} + +class cl_view * +cl_view::prev_view(void) +{ + if (parent && + parent->first() == this) + return(0); + else + return(prev()); +} + + +int +cl_view::select(void) +{ + /* class cl_view *v; + + if (!(options & OF_SELECTABLE)) + return(0); + if (state & SF_SELECTED) + return(1); + if (parent && + !(parent->select())) + return(0); + if (parent) + { + v= parent->current_sub_view(); + if (v && + v != this) + v->unselect(); + parent->set_current(this); + } + change_state(SF_FOCUSED, 1); + change_state(SF_SELECTED, 1); + draw(); + return(1);*/ + if (options & OF_SELECTABLE) + if (parent) + parent->set_current(this); + return(1); +} + +int +cl_view::unselect(void) +{ + class cl_view *csv= current_sub_view(); + if (csv && + !(csv->unselect())) + return(0); + if (!terminal_view()) + change_state(SF_FOCUSED, 0); + change_state(SF_SELECTED, 0); + draw(); + return(1); +} + +class cl_view * +cl_view::current_sub_view(void) +{ + return(0); +} + +int +cl_view::terminal_view(void) +{ + return(1); +} + +void +cl_view::change_state(unsigned int what, int enable) +{ + if (enable) + state|= what; + else + state&= ~what; + if (parent) + { + switch (what) + { + case SF_FOCUSED: + //reset_cursor(); + /*message(parent, EV_BROADCAST, + (enable)?CM_RECEIVED_FOCUS:CM_RELEASED_FOCUS, this);*/ + break; + } + } + draw(); +} + + +/* End of gui.src/view.cc */ diff --git a/sim/ucsim/gui.src/viewcl.h b/sim/ucsim/gui.src/viewcl.h new file mode 100644 index 00000000..668fee16 --- /dev/null +++ b/sim/ucsim/gui.src/viewcl.h @@ -0,0 +1,118 @@ +/* + * Simulator of microcontrollers (viewcl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef VIEWCL_HEADER +#define VIEWCL_HEADER + +#include +#include + +#include "pobjcl.h" + +#include "palette.h" +#include "eventcl.h" + + +// Status flags +#define SF_NOTHING 0x0000 +#define SF_SELECTED 0x0001 +#define SF_FOCUSED 0x0002 +#define SF_ACTIVE 0x0004 + +// Option flags +#define OF_NOTHING 0x0000 +#define OF_SELECTABLE 0x0001 + + +class cl_box: public cl_base +{ +public: + int x, y; + int w, h; +public: + cl_box(int ix, int iy, int iw, int ih); + void set(int ix, int iy, int iw, int ih); + void move_rel(int dx, int dy); + void grow(int dw, int dh); +}; + + +class cl_app; +class cl_group; + +class cl_view: public cl_base +{ +public: + char *name; + WINDOW *window; + PANEL *panel; + class cl_group *parent; + class cl_view *next, *last; + class cl_app *app; + class cl_gin *input; + class cl_box *pos; + int *palette; + unsigned int state; // See SF_XXXX + unsigned int options; // See OF_XXXX +public: + cl_view(class cl_box *ipos, char *iname, class cl_app *iapp); + cl_view(char *name, class cl_app *iapp); + ~cl_view(void); + virtual int init(void); + virtual class cl_gin *mk_input(void); + virtual int *mk_palette(void); + virtual int is_group(void) {return(0);} + + virtual int ok(void); + virtual int draw(void); + virtual int update(void); + virtual int get_color(int color); + virtual int *get_palette(void); + + virtual int get_event(struct t_event *event); + virtual int handle_event(struct t_event *event); + virtual int unhandled(struct t_event *event); + virtual int mk_event(struct t_event *event, FILE *f, int key); + + virtual class cl_view *prev(void); + virtual class cl_view *prev_view(void); + + virtual int select(void); + virtual int unselect(void); + virtual class cl_view *get_by_state(unsigned int what, int enabled) + {return(0);} + virtual int select_next() {return(0);} + virtual class cl_view *current_sub_view(void); + virtual void set_current(class cl_view *view) {} + virtual int terminal_view(void); + virtual void change_state(unsigned int what, int enable); +}; + + +#endif + +/* End of gui.src/viewcl.h */ diff --git a/sim/ucsim/gui.src/win.cc b/sim/ucsim/gui.src/win.cc new file mode 100644 index 00000000..b5a9a927 --- /dev/null +++ b/sim/ucsim/gui.src/win.cc @@ -0,0 +1,111 @@ +/* + * Simulator of microcontrollers (win.cc) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include +#include "i_string.h" + +#include "wincl.h" + + +cl_win::cl_win(class cl_box *ipos, char *ititle, class cl_app *iapp): + cl_group(ipos, 0, iapp) +{ + title= strdup(ititle); + free(name); + if (!ititle || + !(*ititle)) + { + name= (char*)malloc(100); + sprintf(name, "win%p", this); + } + else + name= strdup(ititle); +} + +cl_win::~cl_win(void) +{ + if (frame) + delete frame; + if (title) + free(title); +} + +int +cl_win::init(void) +{ + cl_group::init(); + if ((frame= mk_frame(pos))) + insert(frame); + class cl_box *b= new cl_box(pos->x,pos->y, pos->w,pos->h); + b->move_rel(1,1); + b->grow(-2,-2); + if ((intern= mk_intern(b))) + insert(intern); + //draw(); + delete b; + return(0); +} + +int * +cl_win::mk_palette(void) +{ + int *p= (int*)malloc(8*sizeof(int)), i; + for (i= 0; i < 8; i++) + p[i]= i+C_WIN; + return(p); +} + +class cl_frame * +cl_win::mk_frame(class cl_box *ipos) +{ + char n[100]= ""; + + sprintf(n, "frameof_\"%s\"", name); + class cl_frame *f= new cl_frame(ipos, this, n, app); + f->init(); + return(f); +} + +class cl_view * +cl_win::mk_intern(class cl_box *ipos) +{ + class cl_view *v= new cl_view(ipos, 0, app); + v->init(); + v->options&= ~OF_SELECTABLE; + return(v); +} + +char * +cl_win::get_title(void) +{ + return(title); +} + + +/* End of gui.src/win.cc */ diff --git a/sim/ucsim/gui.src/wincl.h b/sim/ucsim/gui.src/wincl.h new file mode 100644 index 00000000..ddbd0a9e --- /dev/null +++ b/sim/ucsim/gui.src/wincl.h @@ -0,0 +1,55 @@ +/* + * Simulator of microcontrollers (wincl.h) + * + * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. + * + * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef WINCL_HEADER +#define WINCL_HEADER + +#include "groupcl.h" +#include "framecl.h" + + +class cl_win: public cl_group +{ +public: + class cl_view *frame; + class cl_view *intern; + char *title; +public: + cl_win(class cl_box *ipos, char *ititle, class cl_app *iapp); + ~cl_win(void); + virtual int init(void); + virtual int *mk_palette(void); + virtual class cl_frame *mk_frame(class cl_box *ipos); + virtual class cl_view *mk_intern(class cl_box *ipos); + + virtual char *get_title(void); +}; + + +#endif + +/* End of gui.src/wincl.h */ -- 2.30.2