Hi, I have built Freedom E300 with custom Accelerator (AccumulatorExampleModule) from Rocketchip. I can run demo_gpio on the Arty with this new generated image. Now I would like to test the accelerator and I would like to compile and run it in FreedomStudio. My understanding is that since I am using built in accelerator on ROCC interface so I don’t need to rebuilt the tool. Am I right? From this https://github.com/seldridge/rocket-rocc-examples I get header file rocc.h and accumulator.h. And add the following line in demo_gpio after reset_demo
doWrite(y, addr, data[0]);
As per the repository mention before. But I am getting unhandled trap and program exit with code 03. Is there any thing I am missing? Do I need to make any changes in any *.s file to switch on the accerator?
Hi, I am running the code through FreedomStudio and following Freedom E300 Arty FPGA Dev Kit Getting Started Guide and https://github.com/riscv/riscv-gnu-toolchain/issues/190#issuecomment-264083212. About this write_csr(mstatus, MSTATUS_XS) when I use it in my main program I don’t get the error but nothing happening it’s like accelerator is not working. And as per the Riscv instruction set manual (Privileged Architectures V1.10) page 23 XS[1:0] is read only so I am not sure whether I should write it or not.
Hi, I was able to run it by including write_csr(mstatus, MSTATUS_XS). Did you try it? Are you building the example accumulator accelerator from rocket chip?
Not yet. I was going to try that next. I just need to integrate write_csr somewhere in my program before I call the accelerator? And did you somehow modify the original freedom sourcecodes? Because to me it looks like the Accumulator example is included in the freedom-e300-arty by default.
Okay, this looks more promising than anything I have found on RoCC myself so far. I probably won’t be able to try it before the weekend, I am kinda swamped in work here, but I’ll try it saturday and get back to you if more questions arise.
Thanks a lot
Lukas