[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] Structure of the source code
From: |
Klaus Rudolph |
Subject: |
Re: [Simulavr-devel] Structure of the source code |
Date: |
Sat, 05 Jan 2008 19:01:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040114 |
Knut Schwichtenberg schrieb:
Hi,
to understand a little bit better about simulavrxx I took a look to the source
directory and would like you to explain a little of the source structure.
I only mention the cpp-File for my grouping.
The first group I think I found is what I call the "Unspecific-AVR" which
consists of:
hwacomp.cpp hweeprom.cpp hwmegaextirq.cpp hwmegatimer.cpp hwspi.cpp
hwstack.cpp hwtimer.cpp hwwado.cpp hwad.cpp hwextirq.cpp
hwmegatimer0123irq.cpp hwport.cpp hwsreg.cpp hwtimer01irq.cpp
hwuart.cpp flash.cpp
The next group I would call the "AVR-Devices" which consists of:
at4433.cpp at8515.cpp atmega128.cpp
Then there is the "GDB-Interface":
gdbserver.cpp mysocket.cpp
gdb
net.cpp
No, net is not gdb or network. Net gives electrical nets to the
simulation. You could connect nets from different avrs or lcd or
keyboard or maybe any other simulated hardware to a net. Nets will be
calculated in a digital fashion or in a very! simlified analog way.
This is also used for connecting serialrx/tx to the pipe.
avr-simulator-> net->serialrx->pipe->file(unix)
trace.cpp
file handler for trace outputs. sometimes traces could be larger than
you expect. For this traces will be splitted in multiple files with
numbered file names.
I think there is a kind of Glue:
helper.cpp main.cpp
And at least there is the "Environment"
kbdgentables.cpp
Helper to produce code for an AT-Keyboard. I simulate an normal pc
keyboard with the scan-codes and so on. So you can use it in
simulations. I have one attatched to a atmega128 and a lcd so I have a
"full" terminal for my applications :-)
keyboard.cpp lcd.cpp pinatport.cpp pin.cpp
pin and pinatport reflect the pins and the assignment from pins to a
port. Yes, sometimes are file names are good :-)
scope.cpp
Not really ready to use. This was the startpoint to have a scope
functionality to display the waveform of menitored pins. But not ready
to use yet.
serialrx.cpp serialtx.cpp
Simulation of serial ports. So you can use a unix pipe to tranfer data
from/to a simulated uart in the avr simulation. Very nice to have it for
giving debug-printf a chance also in simulation. also good for connect
multiple simulators over network if time is really a big problem.
systemclock.cpp
Every "consumer" needs to be registered here. All kind of timing events
could be generated, especialy asynchrous ones!
ui.cpp
Connection to tcl.
Some files left open maybe you could assign them:
decoder.cpp
Decoding the instruction set from binary files to instruction classes.
decoder_trace.cpp
The same, but with trace functionality inside the classes. Means that
ever executed instruction will tell something. A runtime "if" is to
slowing down the simulator a lot, so I decided to decide tracing while
decoding, not later while executing.
avrdevice.cpp
Base class for all avr_####.cpp
avrerror.cpp
code which is directly derived from the old simulavr, simply writing
errors / warnings
Should be removed in the future...
avrmalloc.cpp
Also old code from older simulavr...
will be removed in the future...
hardware.cpp
Base class of all which could be member of simulation loop. Provides the
CpuCycle() method for example.
hwport.cpp
As writen above... simulation for ports. PA0..7/PB0..7 and so on.
ioregs.cpp
Some registers which are not directly asigned to the hardware modules.
These are some "micelinous" registers which are shared by mutiple
hardware modules or have general purpose. The names are the same as in
avr decumentation.
irqsystem.cpp
Logic for handling the interrupts and priorities.
memory.cpp
Logic glue code for memories like flash and ram. Also have helper
functions for getting debugging symbols from elf (and other) source
files for tracing avr code.
pinatport.cpp
Logic glue code for assigning a pin to a port.
printable.cpp
??? not every question will generate an answer ... ??? :-)
Ok, this will hold printable results for later output... not really
knowing why I made this this way. :-)
rwmem.cpp
:-) This is the original comment:
31 /*
32 * All here defined types are used to simulate the
33 * read write address space. This means also registers
34 * io-data space, internal and external sram
35 */
application.cpp
A singleton to have an instance for the application to register all
printable things to print them later... like irq statistic at the end of
simulation. Maybe a bit over-designed :-)
After knowing a little more about the sources I'll go through try to understand
all the rest of the files and what needs to be asked further :-).
Hope this helps!
Bye
Klaus