logo       

Re: Why not make cpu a plugin?: msg#00089

emulators.bochs.devel

Subject: Re: Why not make cpu a plugin?

I would be very interested in helping to define an interface. I recently released a tool (under the GPL) that uses a modified bochs emulator to serve as a frontend to a detailed CPU performance model. We use this as the basis for our micro-processor research.

In order to serve as a frontend to a research timing simulator, we need the following peices of information:

- full register state access (on a per-inst basis). perhaps we can use the instrumentation hooks for this, but in our simulator we just have access to the bx_cpu.
- the associated memory transactions (loads and stores on a per-inst basis). we are currently using the instrumentation hooks that bochs already provides to do this with some minor bug fixes.
- raw instruction bytes or the decoded instruction (modrm, sib, imm, opcode, etc.). we use the latter so we do not need to repeat the decode step. we currently grab the information that FetchDecode() already places in the bx_inst.

We basically use the following functions as an interface to bochs:

- cpu_loop(int num_insts)
- bochs_init(char* path_to_bochrc_file) (basically main() without the call to cpu_loop())
- bochs_save(char*)
- bochs_restore(char*)
- get_memory_transactions()
- get_state()

The bochs_save() and bochs_restore() is a work in progress... That project was about 80% completed (mostly written, but needs debugging) when Bryce and I stopped working on it last spring. Unfortunately, we have both been caught up with other things.

So if we want to find a well-defined "minimal" interface that will be useful for timing simulations, then there should be a way to get all the information above through either instrumentation hooks other functions.

If anyone is interested in how we use bochs as a frontend, see the following:

- http://www.crhc.uiuc.edu/ACS/tools

--Brian Slechta



fenghaitao wrote:

I want to find a well-defined interface.

so if you replace your libbx_cpu.so,you can use your Bochs for a totally
different function.
for example,dynamic translate ARM to IA-32 to run simulator faster,or pipeling instruction execution to do performance evalution,or implemented by SystemC to specify the hardware design and verify the hardware implementation.

it seems that the class of cpu supports following methods is ok.
void init (BX_MEM_C *addrspace);
BX_SMF void cpu_loop(Bit32s max_instr_count);
BX_SMF void reset(unsigned source);
void cpu_load_state () {}
void cpu_save_state () {}

Now I add a sub-directory in the cpu directory,named arm-unknown-linux-gnu ,a
sub-directory in the bios directory,
named arm-unknown-linux-gnu also and modified Makefile.ins,you can use ./configure --target=arm-linux make
to build the ARM porting,and you need a ARM-Linux disk image to run the ARM-Linux system.I modified some softwares of Russell King to make the disk image and bios image.

it is not pluginise cpu now.

Can you and other bochs-developers kindly give me some suggestion about how an interface can be well-defined?

----- Original Message ----- From: "Robert Millan" <zeratul2@xxxxxxxxxx>
To: "fenghaitao" <fenghaitao@xxxxxxxxxxxxxxx>
Cc: <bochs-developers@xxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, November 14, 2003 7:38 PM
Subject: Re: [Bochs-developers] Why not make cpu a plugin?



On Fri, Nov 14, 2003 at 05:04:10PM +0800, fenghaitao wrote:

I have a question,why not make cpu,memory plugins as io devices?
Thus Bochs can support multi-backends,not only for IA-32.
I have ported Bochs for ARM processor,now my Bochs can run ARM-Linux ,the
Kernel is based on NETWINDER,and version is 2.4.17.
Is there anyone interested in it?

Sounds very interesting. Have you done the former (pluginise cpu) for your
porting work? Could you put your patches in a public place?

--
Robert Millan

"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."

-- J.R.R.T, Ainulindale (Silmarillion)

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÓ†+ó^µéšŠX¬²š'²ŠÞu¼ÿ„è3#„è3#ŠËayö¬·÷š³&§vÇœº·°k+hiDz̨º·(š›­z·ë¢f§Ég›nº0±ê诫zW¬±×¯‰ÇÿXœ’«zÚ¯(­·žþm¦Ïÿÿ
0þ-¢l©s÷(›ûküäƒ7ðýÿÛM7þßàÛiiý6«?ëšoàÛiiþÙ©—ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿn‡!³÷^½éh¥ê왨¥Šx%ŠË[¡ÈlýׯzZ)z»ÿ–+-³û(º·~Šà{ùÞ¶m¦ÏÿþX¬¶Ïì¢êÜyú+?ïçzßåŠËlþX¬¶)ߣöèrÿuëÞ–Š^





-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise