Hi, I'm trying to make the example from caravan, a...
# caravan
j
Hi, I'm trying to make the example from caravan, and add a counter to the output on it and read it with wishbone. So far it was not possible for me, paying attention to the wishbone, it is not going forward until 0x30... (user area) like in caravel. Thanks!
t
What part of it appears to not be working?
j
Hi, I added in my mprj_por.c code this: reg_wb_enable=1; In caravel, the wbs_addr_i[31:0] is increased beyond 0x30000000 (user area), and I’m trying to do the same in caravan but enabling the wishbone, because then, I want to read a value from the wishbone on the user area. Device I’m trying to implement: example from caravan (Schmitt trigger) and add to its output a digital counter, and then send that output through wishbone to the RISC-V. Thanks.
t
What wishbone address did you define for the digital counter output?
Typically you want to define your address with a name, like so:
Copy code
#define reg_user_config_0 (*(volatile uint8_t*)0x30000000)
and then read the value from it simply by reading the value at that address:
Copy code
int i;
i = reg_user_config_0;
You can make the value appear on the caravan chip pins by doing:
Copy code
while (1) {
   reg_mprj_datal = reg_user_config_0;
}
although you probably would want to shift it up a bit to avoid the GPIOs being used by housekeeping.
j
I did this configuration but the wishbone address is not increasing until the position 0x30000000. I don't know what can it be... it is still as in the image above, i can't reach the user area. Or maybe am I thinking it wrong and to be in the user area the 0x300000000 address is not needed?
t
"the wishbone address is not increasing until the position 0x30000000": I'm not sure what you mean by this. "it is still as in the image above": If you are referring to the vcd file output in gtkwave you posted, what you are seeing on the wishbone bus is the address of the SPI flash during the first reads when the program starts. There will be a long period in which the processor initialization code runs, and then the GPIOs get configured. Only after that will you see any wishbone activity between the processor and your user project.
j
Hi, I’m still trying to make the wishbone work. Doing the test with caravel from the next example: https://github.com/mattvenn/wishbone_buttons_leds, it works like the first image but with caravan doesn’t work that way unless I change the MPW_TAG = mpw-9f to MPW_TAG = mpw-two-c, if I don’t do this, the wishbone stays as in the second image In this example I changed the amount of LEDs that are used. In the third image you can see caravan working with MPW_TAG = mpw-two-c. How can I make it work with MPW_TAG = mpw-9f or where could I get more information?
t
Make sure you are setting
reg_wb_enable
to
1
in your C code. This is a change that was made after MPW-2 when I discovered that additional signals that were supposed to be protected from being open-circuits in the user project area were not, and fixed it. The result is that a register bit was added that enables/disables the wishbone bus for the user project (I thought you had mentioned this before, but it might have been in a different discussion that happened around the same time).
j
Yes, I did that, now I am seeing the differences between caravel and caravan because in caravel it works but in caravan not. Do you have some idea about that? Thanks.
t
Sorry for the delay in response; I was busy with the Chipalooza challenge thing. There should be no difference between Caravel and Caravan other than the access to the GPIOs along the top. The processors are the same and the interfaces between the processor and user project area (the wishbone bus and logic analyzer) are the same. The repository for the processor itself is the same. Do you have any more details about how it fails in Caravan?
j
Hi, I made it work and now I'm trying to execute this: make user_project_wrapper and I get this error.log. Can you please tell me the steps I should follow to be able to execute that? Thanks!
t
Not sure, but where it says "Macros not found: mprj", "mprj" is the instance name for module
user_proj_example
, which in the digital project repository
caravel_user_project
is the cell directly below
user_project_wrapper
. Apparently the "make" recipe still expects this hierarchy even though that hieararchy is, in my opinion, completely arbitrary.