Motherboard Forums


Reply
Thread Tools Display Modes

Emulating a processor

 
 
luiguo
Guest
Posts: n/a
 
      11-28-2005, 09:35 PM


Chris Hills wrote:
> In article <(E-Mail Removed). com>,
> Gromer <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a
 
      11-29-2005, 02:01 AM

"Gromer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.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


 
Reply With Quote
 
 
 
 
Del Cecchi
Guest
Posts: n/a
 
      11-29-2005, 02:43 AM

"David Schwartz" <(E-Mail Removed)> wrote in message
news:dmgcpt$c0d$(E-Mail Removed)...
>
> "Gromer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.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.


 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a
 
      11-29-2005, 03:42 AM

"Del Cecchi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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


 
Reply With Quote
 
Del Cecchi
Guest
Posts: n/a
 
      11-29-2005, 05:14 PM
David Schwartz wrote:
> "Del Cecchi" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>
>>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.”
 
Reply With Quote
 
Bill Davidsen
Guest
Posts: n/a
 
      11-29-2005, 05:33 PM
Simon Felix wrote:
> 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
 
Reply With Quote
 
oldfogie
Guest
Posts: n/a
 
      12-01-2005, 03:30 AM
"Gromer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Emulating JTAG with micro for programming PROM scott.manton@gmail.com Embedded 13 05-05-2006 03:00 PM
Emulating a processor Gromer Intel 28 12-01-2005 03:30 AM
Re: Emulating a processor Gromer Intel 2 11-22-2005 02:09 PM
Re: Emulating a processor Gromer Embedded 2 11-22-2005 02:09 PM
Emulating ADDWFC on 16F PIC uCONTROLLER SpaceInvader Embedded 8 12-21-2004 10:02 PM


All times are GMT. The time now is 05:32 AM.


Welcome!
Welcome to Motherboard Point
 

Advertisment