How to use caravel core to perform operations like...
# caravel
a
How to use caravel core to perform operations like addition or multiplication.. Is there any documentation or example related it..? Can you help in this @Tim Edwards
t
I need a bit more context here. . . All such operations can be coded in C; the RISC-V gcc compiler will figure out if the specified architecture supports hardware multiplication or not and generate the appropriate assembly code (I don't think the VexRISC as configured for Caravel has a hardware multiplier, given that
march
is
rv32i
). Does that answer your question?
a
Thanks for replying @Tim Edwards. Can you please elaborate What is
march is rv32i
. Lets say I instantiated SRAM in user project area and and have written some data in SRAM . Now I want core to compute Some addition operation on Data that is already in SRAM and I want to store that result in SRAM. Now How to capture result from CPU core.
t
-march
is a compiler option to gcc, telling the compiler what the target architecture is;
rv32i
is the designation of a RISC-V architecture.
rv
means RISC-V;
32
means a 32-bit architecture, and the letters after that are processor options.
i
is for integer arithmetic,
m
is for hardware multiplier (and possibly divider),
c
is for compressed instructions, and so on. But I think your question has a different answer. If you have instantiated an additional SRAM in the user project and you want to reach it from the processor, then you will want to create a wishbone interface; that interface would respond to address
0x30000000
which is the address range (to
0x3fffffff
) of the user project memory map. The SRAM address would be the lower bits of the wishbone address. This can be simply an extension of the processor RAM, and you can create a compiler file
sections.lds
that tells the gcc compiler that there is additional memory available at that address. Or you can make specific reads and writes to addresses in that space from a program.
a
Thank you @Tim Edwards for explaining
Is there any example for this...?
t
I don't know which projects access SRAM in that way, but there are a number of projects that instantiate SRAM inside the user project. You would need to look around some of the projects to find some that are similar to what you are looking to do.
a
I found projects incorporating SRAMs. I tried to find projects which interact with cpu but I didn't get any. Do you know any..?