Hai We define two wishbone register and gave data ...
# caravel-board
s
Hai We define two wishbone register and gave data values. Tried to print the values at the register location but we are getting output as 0x0000ffff or 0x00000000 for any inputs. Attaching the c code and screenshot of the output.
t
The only thing I can think of is that the "volatile" specification for the wishbone address is meaningful; the way I normally read from wishbone is to use the volatile definition; your direct addressing with the
ptr1
and
ptr
variables is bypassing that. I suggest just doing
Copy code
uint32_t value;
...
value = reg_wb_in1;
print_hex(value, 8);
or even just
Copy code
print_hex(reg_wb_in1, 8);
s
@Tim Edwards but how can we make sure whether our input reaches the wishbone address location .
t
Well, I can say that the way I discovered that I had been shipped the wrong part from MPW-7 was that when I attempted to read or write what was supposed to be a valid wishbone address, the processor went into a "hung" state, from which there is (apparently) some sort of time-out in the VexRISC; but that does seem to be a valid way to determine if a wishbone address exists or not, because a read or write to an invalid address does not receive an acknowledge signal and therefore stops the processor until the processor decides to time out. This is milliseconds to seconds per instruction, so a sequences of reads or writes makes it easy to tell if the address is valid (or at least the circuit at that address is responding with an acknowledge signal).
s
Copy code
print_hex(reg_wb_in1, 8);
@Tim Edwards by giving this line also we are getting value as 0000ffff . The value given is reg_wb_in1 = 0x0101ffff;and when we change the input to reg_wb_in1 = 0x01010101; the value displayed is 00000000.
image.png