OpenCores
no use no use 1/1 no use no use
Running Linux on RTL simulator
by meltem on Jun 11, 2014
meltem
Posts: 9
Joined: May 7, 2014
Last seen: May 1, 2018
Hi all,

I am trying to run linux on the mor1kx-generic core using icarus simulator and fusesoc tool.
I was able to run bare metal applications but when I try to load vmlinux with --elf-load=vmlinux option, it can only execute 10 instructions and hangs.

I was wondering if anyone here has any suggestions.

Thanks.
RE: Running Linux on RTL simulator
by meltem on Jun 13, 2014
meltem
Posts: 9
Joined: May 7, 2014
Last seen: May 1, 2018
I am changing my question to "if anybody was able to simulate de0_nano system using icarus simulator and fusesoc with orpsocv3 cores?"

It complains about modules that are generated using altera megafunctions (altpll, altsyncram, sld_virtual_jtag) and to get rid of the megafunctions when I add the line `define SIM to orpsoc-defines.v file, it gives me bunch of errors with "Unable to bind wire/reg/memory ..." message.

Thanks for the help.
RE: Running Linux on RTL simulator
by olof on Jun 17, 2014
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
I am changing my question to "if anybody was able to simulate de0_nano system using icarus simulator and fusesoc with orpsocv3 cores?"

It complains about modules that are generated using altera megafunctions (altpll, altsyncram, sld_virtual_jtag) and to get rid of the megafunctions when I add the line `define SIM to orpsoc-defines.v file, it gives me bunch of errors with "Unable to bind wire/reg/memory ..." message.

Thanks for the help.


yes and no. :)

Short answer. It's not realistic do to that. I have managed to boot the kernel less than halfway in ~24h on a core i7 with some tricks, but that was on the mor1kx-generic system that uses wb_ram for memory. On the de0_nano with the mt48... memory model it will probably be 100-1000 times slower.

Long answer:
There are several things that has to be done to fix this. The first issue is that the registers are uninitialized when mor1kx starts up. This isn't a problem on an FPGA as the memories will be all zero, but Icarus won't handle that. Adding

integer i;
initial for(i=0;i<OPTION_RF_WORDS;i=i+1) ram = 0;

to mor1kx_rf_ram.v and

integer i;
initial for(i=0 ; i<(1<<ADDR_WIDTH);i=i+1) mem = 0;

to mor1kx_true_dpram.v will get you around that issue.

Next thing is that de0_nano uses Altera primitives that are defined in verilog libraries in your Quartus installation. I have some patches to fix that as well, but they need to be cleaned up before I will apply them.

There might be other issues as well, so I would not recommend you to do this. For running linux in a simulation, the only feasible option right now is to use mor1kx-generic with verilator. That should boot it in ~10 minutes on a fast machine

Regards,
Olof

RE: Running Linux on RTL simulator
by meltem on Jun 23, 2014
meltem
Posts: 9
Joined: May 7, 2014
Last seen: May 1, 2018
Thanks for the reply Olof,

I was able to run bare-metal programs on mor1kx-generic system with verilator, but Linux didn't boot. It goes into "bus_fault_handler" code, then into the "die" function. The same vmlinux (Linux version 3.13.0-rc2-or1ksim) file works fine when I use it with the or32-sim and on the FPGA.

Do you have any idea on how to debug this issue?

Thanks.
RE: Running Linux on RTL simulator
by fjullien on Jun 24, 2014
fjullien
Posts: 5
Joined: Mar 12, 2014
Last seen: Jan 23, 2018
Hi,

You may have an access to a missing peripheral.
mor1kx-generic has only an UART. You should remove others peripherals from your device tree.

Franck.
RE: Running Linux on RTL simulator
by meltem on Jul 23, 2014
meltem
Posts: 9
Joined: May 7, 2014
Last seen: May 1, 2018
Hi,

You may have an access to a missing peripheral.
mor1kx-generic has only an UART. You should remove others peripherals from your device tree.

Franck.


Hi Franck, you were very close.
I figured it out. It is because of the device and linux settings difference. The "mor1kx-generic" system has 8mb of memory in default mode, but device tree expects 32mb for de0_nano. When I edited the wb_intercon.v for the mor1kx-generic system, it booted.

Thank you all very much for the help.
RE: Running Linux on RTL simulator
by rill_zhen on Jul 31, 2014
rill_zhen
Posts: 15
Joined: Aug 18, 2012
Last seen: Mar 10, 2015
Hi all,

I am trying to run linux on the mor1kx-generic core using icarus simulator and fusesoc tool.
I was able to run bare metal applications but when I try to load vmlinux with --elf-load=vmlinux option, it can only execute 10 instructions and hangs.

I was wondering if anyone here has any suggestions.

Thanks.


i have run linux on RTL simulator�modelsim� based ORPSoC.
1,you should modify the ram sim modle.
2,gen vmem file of vmlinux
3,modify the Makefile

the flow and log of running linux on simulator is available at:
http://blog.csdn.net/rill_zhen/article/details/23381949

hope helpful for you.
RE: Running Linux on RTL simulator
by jurand on Sep 26, 2014
jurand
Posts: 1
Joined: May 17, 2011
Last seen: Feb 4, 2022
Hi,
I also trying to run Linux on open risc in simulator. I prepared vmlinux.bin and created memory file for memory initialization in simulation using bin2vmem. When i run simulation i can see that procesor starts reading from memory from 0x100 address (reset vector), after reading from 0x118 it jumps to 0x298000 and reading some data from high addresses but after read 0x29813c it jumps to 0xA00 which according to or1200 documentation is "No matching entry in ITLB (ITLB
miss)" exception. Does anyone have an idea what is wrong?
no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.