Emulating a processor
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Emulating a processor
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
luiguo
Guest





Posted: Mon Nov 28, 2005 9:15 am    Post subject: Re: Emulating a processor Reply with quote

Chris Hills wrote:
Quote:
In article <1132639105.148321.60240@o13g2000cwo.googlegroups.com>,
Gromer <osIndgy@gmail.com> writes

Hi all,

I'm interested to understand the processor architecture in depth. So i
decided on emulating the processor itself (as my project). The best one
to start would be 386.



Why a 386?
May be We fomilar with x86 architecture.

You mean simulation. emulation id a hardware system (see Lauterbach,
Ashling, Nohau, Hitex, isystem, Signum etc etc


So i wud require some documents which explains on how to emulate any
processor or devices. ( Apart from the Intel Architecture documents
available).


If you have to ask here don't start..... You are out of your depth.


How to emulate a 386 processor. I want to kno how usually this is done.
I wonder how bochs has been developed so elegantly...the resource
they've used.

It wud be appreciable if someone can guide me on any documents or
reference books avaliable on Emulating processors and devices.

.
Wht are the resources I should have in hand to start up up this
project.


Degree in electronics specialising in MCU's
several years experience.
Knowledge of some (if not most) of the tools out there now.

I suguest to find the "PCE"--IBM PC hardware emulator. It's simple
enough to learn. It emulates most hardware of an IBM PC. and enable boot
a DOS system
Back to top
David Schwartz
Guest





Posted: Tue Nov 29, 2005 8:01 am    Post subject: Re: Emulating a processor Reply with quote

"Gromer" <osIndgy@gmail.com> wrote in message
news:1132834446.991153.106000@z14g2000cwz.googlegroups.com...

Quote:
I have one basic doubt on how MEM WR/RD# cycles are emulated.. (i.e
memory read & write cycles emulated in software).. i mean how are the
rd/wr (ASSERT/DE-ASSERT) signals sychronised for a memory access in
software...( eg: var = *(someMEM))..

The same way you emulate the CPU's power consumption of the physical
space it occupies. Software can't tell about these things, so there's no
need to emulate it. When we talk about emulating a CPU, we're always talking
about emulating only specific aspects of the CPU. We don't emulate its mass
or each electron that moves through it.

DS
Back to top
Del Cecchi
Guest





Posted: Tue Nov 29, 2005 8:43 am    Post subject: Re: Emulating a processor Reply with quote

"David Schwartz" <davids@webmaster.com> wrote in message
news:dmgcpt$c0d$1@nntp.webmaster.com...
Quote:

"Gromer" <osIndgy@gmail.com> wrote in message
news:1132834446.991153.106000@z14g2000cwz.googlegroups.com...

I have one basic doubt on how MEM WR/RD# cycles are emulated.. (i.e
memory read & write cycles emulated in software).. i mean how are the
rd/wr (ASSERT/DE-ASSERT) signals sychronised for a memory access in
software...( eg: var = *(someMEM))..

The same way you emulate the CPU's power consumption of the physical
space it occupies. Software can't tell about these things, so there's
no need to emulate it. When we talk about emulating a CPU, we're always
talking about emulating only specific aspects of the CPU. We don't
emulate its mass or each electron that moves through it.

DS

Maybe the OP needs to clarify their understanding of the difference

between emulation and simulation.
Back to top
David Schwartz
Guest





Posted: Tue Nov 29, 2005 9:15 am    Post subject: Re: Emulating a processor Reply with quote

"Del Cecchi" <delcecchiofthenorth@gmail.com> wrote in message
news:3v1ti7F1357sfU1@individual.net...

Quote:
Maybe the OP needs to clarify their understanding of the difference
between emulation and simulation.

Probably, but even in a simulation, there are things you simulate and
things you don't. Otherwise, a simulation would have to be identical to the
thing simulated, at which point it would cease to be a simulation.

DS
Back to top
Del Cecchi
Guest





Posted: Tue Nov 29, 2005 5:16 pm    Post subject: Re: Emulating a processor Reply with quote

David Schwartz wrote:
Quote:
"Del Cecchi" <delcecchiofthenorth@gmail.com> wrote in message
news:3v1ti7F1357sfU1@individual.net...


Maybe the OP needs to clarify their understanding of the difference
between emulation and simulation.


Probably, but even in a simulation, there are things you simulate and
things you don't. Otherwise, a simulation would have to be identical to the
thing simulated, at which point it would cease to be a simulation.

DS


Right. But at some point in a processor simulation the memory interface

functionality and timing will have to be verified.

--
Del Cecchi
"This post is my own and doesn’t necessarily represent IBM’s positions,
strategies or opinions.”
Back to top
Bill Davidsen
Guest





Posted: Tue Nov 29, 2005 11:33 pm    Post subject: Re: Emulating a processor Reply with quote

Simon Felix wrote:
Quote:
basically you have two choices:

full emulation: you read a byte from (emulated) ram and
interpret/execute it (use a huge switch-statement). then advance to the
next byte and interpret/execute it, ...

Not if you want to finish the run in your lifetime... For a simple byte
code, like 8080, you use an array of pointers to functions, so you can
just branch without doing any compares. For a machine with prefix codes,
like x86, when you decode the prefix you add another level of
indirection, and jump through a pointer to array of pointer to function.
That pointer sort of converts the emulation to a state machine.

Note that if you just want to run the program and get the right results,
this is relatively simple, although you need emulated hardware to go
with the i/o instructions, or with more effort and per-byte flags memory
mapped i/o.

If you want to handle timing, cache, etc, it's a BIG project!

--
bill davidsen
SBC/Prodigy Yorktown Heights NY data center
http://newsgroups.news.prodigy.com
Back to top
oldfogie
Guest





Posted: Thu Dec 01, 2005 9:15 am    Post subject: Re: Emulating a processor Reply with quote

"Gromer" <osIndgy@gmail.com> wrote in message
news:1132639105.148321.60240@o13g2000cwo.googlegroups.com...
Quote:
Hi all,

I'm interested to understand the processor architecture in depth. So i
decided on emulating the processor itself (as my project). The best one
to start would be 386.

So i wud require some documents which explains on how to emulate any
processor or devices. ( Apart from the Intel Architecture documents
available).
How to emulate a 386 processor. I want to kno how usually this is done.
I wonder how bochs has been developed so elegantly...the resource
they've used.

It wud be appreciable if someone can guide me on any documents or
reference books avaliable on Emulating processors and devices.

.
Wht are the resources I should have in hand to start up up this
project.

It was a long time ago, but I wrote an 80186 emulator in C (with some
assembly) that ran on an IBM-PC (or clone). It was good enough
to access screen, hard drive, keyboard, floppy, etc., and do so in
such a way that the emulated processor crashing (destroying
interrupt vectors, etc) did not affect the "real" processor it was running
on (virtual memory for the emulated processor).

It was also capable of emulating itself emulating running itself.

If you want to check it out, go to www.datapackrat.com/source/source.html

Bill
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB