Re: [leon_sparc] Running test program on leon in modelsim
You do not want to simulate a mkprom image in VHDL, trust me.
Even the smallest image will execute ~ 1,000,000 instructions
before entering main() in RAM. This is only ~ 30 ms on real
hardware at 50 MHz, but ~ 10 hours in VHDL (on a fast host).
You can easily see in TSIM how many instructions you will need:
CPU performance (50.0 MHz) : 32.40 MOPS (32.40 MIPS, 0.00 MFLOPS)
Cache hit rate : 98.7 % (100.0 / 80.0)
AHB bandwidth utilisation : 33.7 % ( 0.4 / 33.3)
Simulated time : 27.99 ms
Processor utilisation : 100.00 %
Real-time performance : 11.86 %
Simulator performance : 3843.69 KIPS
Used time (sys + user) : 0.24 s
So even if we created the smallest possible binary using -lsmall
and fastest mkprom loading with -nomsg and -nocomp, you will need
to execute 906,783 instructions to get to RAM, and then maybe an
other 10,000 to get to main(). This is why the test bench in leon3
designs does NOT use mkprom, but a simple assembly reset sequence
and a pre-loaded RAM image...
Jiri.
sacliv wrote:
> Hey guys, I'm trying to load a test c program i wrote on the leon3 in
> the vhdl leon3 code and run it in modelsim to view the waveforms.
>
> I followed the bcc manual and did mkprom on my executable, and then i
> copied the .srec file to the testbench directory, and in the
> testbench.vhd, i changed the filename of the prom.srec to test.srec,
> which is my srec file.
>
> The test program is very simple and just prints out hello world, but
> in the modelsim simulation of the leon3, i'm watching the pc and
> instructions of the leon3 core, but i can't seem to get to my test
> program.
>
> Does anyone know either how long i have to simulate it until before i
> get to main() in my test program? Or if i'm doing it wrong, what's the
> correct procedure? Thanks!
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
Hey guys, I'm trying to load a test c program i wrote on the leon3 in the vhdl leon3 code and run it in modelsim to view the waveforms. I followed the bcc...
You do not want to simulate a mkprom image in VHDL, trust me. Even the smallest image will execute ~ 1,000,000 instructions before entering main() in RAM. This...
See how the test bench is compiled by doing 'make soft' in the template design directory. The final command will be: sparc-elf-gcc -I../../software/leon3 -O2...
So I loaded my sram.srec into the VHDL, but it seems like it still takes a while. The compiled code itself contains a lot of setup code. I used objdump to see...
You can run your code from PROM for fastest run-time. Copy prom.S from software/leon3 to you local template design, and do 'make soft'. Then, add your...
In the VHDL simulation, it starts GRLIB system test starting, and then it seems to test a lot of things, if i disable the multiplier, divider and some other...
Hi, Jiri mentioned 1000,000 instructions in the booting process before it reaches the use's program, is this correct ? One million ? ... BR, S Eldin ... code. ...
I tried that. The weird thing was that the instruction i inserted was not ran when i simulated in modelsim. I can see it in prom.srec, i can see it if i do a...
... The prom.srec you are using for simulation does obviously not contain your new instructions, you can see that from the addresses in the log. Check the...
How do i check that? because when i am in simulation, and i look in the memory debugger in modelsim, when i look into the prom0 of the program, i do see those...
Trace the external memory bus and check that you are not executing from internal AHB ROM. In the later case, you will need to update the AHB ROM image and...
In order to run from the external prom.srec, all i need to do is to disable the ahbrom in the config? I think that might be it, it was probably running from...
The XUP board does not have flash memory, so the test bench does not implement it. Choose a different template design, such as leon3mp or leon3-gr-xc3s-1500. ...
ahhh, thanks a lot. I will need that eventually to load programs. For temporary debugging just the instruction, i have added it to the ahbrom.vhd. And i was...
Here you can find more details: http://www.buttelmann.de/leon/leon3_simulation_guide_0_2.pdf <http://www.buttelmann.de/Leon/leon3_simulation_guide_0_2.pdf> ......
How big is your SW? A simple hello world programm compiled with mkprom should be about 23KB. You disable compression? sparc-elf-mkprom.exe -rmw -nocomp...