Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program hang if program is long/big #14

Open
Clay-Cui opened this issue May 23, 2022 · 4 comments
Open

Program hang if program is long/big #14

Clay-Cui opened this issue May 23, 2022 · 4 comments

Comments

@Clay-Cui
Copy link

I tried to implement a algorithm in asm based on the lab004 and try to extend it. The program after compile is 8000bytes. The program cannot continue and got stuck. It seems the memory is not enough. However, even if I tried to double the rom, main_ram, sram size, the program still cannot be executed to finish. The program was already simulated in sifive qemu e31 core, so the asm code should not be the problem. Does anyone have some suggestions? A big thank you in advance.

@enjoy-digital
Copy link
Member

Hi @Clay-Cui,

I would encourage you to have a look at the litex_sim tool: https://github.com/enjoy-digital/litex/blob/master/litex/tools/litex_sim.py.
It will allow you to run the SoC directly in simulation (throught Verilator) and with a lot more visibility than on hardware. With it, Instead of loading the binary with litex_term, you can just use --integrated-main-ram-size=0x10000 --ram-init=firmware.bin.

@Clay-Cui
Copy link
Author

Thank you very much for your reply!
Okay, I will try that. But I will have to port the program to a real hardware someday as I will need to measure the power consumption of the fpga. But I will try the litex_sim first, to see what I can obtain.
And by the way, what's the difference between main_ram and sram?

@enjoy-digital
Copy link
Member

Sure, but it's probably better to port the program to hardware when the issue will be understood (which should be easier with the simulation) :).
SRAM in LiteX is generally the small embedded RAM and MAIN_RAM the larger external one (in SDRAM/DRAM, etc...).

@Clay-Cui
Copy link
Author

Thank you for your reply.
But by this how do I get the data that was originally printed to the uart port?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants