OS-less first executable how ?

P

Paul

Guest
Hi

(not really todo with verilog. but someone here must know.)

Someone must know how to do this. Please please help.
I'm testing a new cpu. The CPU fetches PC from 0x00000000 and SP from
0x00000004 upon reset. How to I link a small crt0.s and any ELF a.out
to test the cpu?
(It's a simple program only testing IO.)

void test_fun(int* x) {
int i;for (i=0;i<0x100000;i++) x=i;
}
void main(){
int* x=0x100000;
while (1) test_fun(x);
}

I only have vauge idea that the crt0.s should look like this: (I could
be wrong.)
..section .text
..long _main
..long 0x2000 // SP

And .text needs to be at 0x00000000 (or at least , the first 8 bytes
need to be PC and SP)

How do I link and assemble files?
Please please help.

(I can write a small program for generating BRAM verilog file myself.
I will simply mapped the file starting 0x00000000.)

Can I use gcc -T ? can someone give a simple example. Please help!

Thanks .
 

Welcome to EDABoard.com

Sponsor

Back
Top