samarth jain
08/13/2024, 3:15 PMAnton Maurovic (efabless support)
08/15/2024, 3:07 AMreg_uart_...
variables (actually they are `#define`s).samarth jain
08/15/2024, 3:09 AMAnton Maurovic (efabless support)
08/15/2024, 3:10 AMAnton Maurovic (efabless support)
08/15/2024, 3:11 AMAnton Maurovic (efabless support)
08/15/2024, 3:12 AMsamarth jain
08/15/2024, 9:58 AMprint("\nWishbone @ "); print_hex(CSR_BASE + 0x5800L, 8); print(": ");
print_hex(read_wishbone(0xF0005800), 8);
print("\n");
and the output sort of made sense, but that cant be the full uart buffer. Anyway, basically the Wishbone read works is the takeaway from this.
But trying the user area address of 0x30000000 or 0x30000004 still yields 0xFFFFFFFF. My guess is that the address must be wrong, because even when I tried with unused wishbone addresses like the gpio and stuff all of the addresses returned 00000000 instead of FFFFFFFF. Is there any way to verify that the address is correct and the memory is actually mapped there?Anton Maurovic (efabless support)
08/16/2024, 8:38 PMwbs_ack_o
signal that is meant to be set to 1 by a peripheral in order to signal when it has finished making data ready (and thus end a read or write transaction). In other words, so long as it is 0 during a Wishbone read or write transaction, the controller (i.e. CPU) will assume it is still processing the request, and insert wait states (pausing execution) until that ACK signal goes high.
2. The Wishbone spec doesn't explicitly define a timeout for this; if ACK never goes high, this would otherwise lead to an indefinite pause (hang). However...
3. Caravel's Wishbone implementation includes a 1,000,000-cycle timeout, after which a Wishbone read returns 0xFFFFFFFF.
Specifically register reads/writes done in the range 0x30000000-0x3FFFFFFF, your firmware will hang and eventually timeout (100ms at 10MHz) if the ACK signal never gets asserted. A timed-out read will see a value of 0xFFFFFFFF.
For other addresses outside this range, and that are not otherwise part of the register map, the behaviour might vary; I suspect there's safety-net logic to do a dummy ACK with a value of 0x00000000.Anton Maurovic (efabless support)
08/16/2024, 8:44 PMAnton Maurovic (efabless support)
08/16/2024, 8:48 PMEmilio Baungarten
11/09/2024, 12:38 AMvoid main()
{
reg_spi_enable = 1;
reg_wb_enable = 1;
reg_mprj_io_31 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_30 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_29 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_28 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_27 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_26 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_25 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_24 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_23 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_22 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_21 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_20 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_19 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_18 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_17 = GPIO_MODE_MGMT_STD_OUTPUT;
reg_mprj_io_16 = GPIO_MODE_MGMT_STD_OUTPUT;
/* Apply configuration */
reg_mprj_xfer = 1;
while (reg_mprj_xfer == 1);
reg_la2_oenb = reg_la2_iena = 0x00000000; // [95:64]
reg_mprj_datal = 0xABCD0000; // Flag start of the test
reg_mprj_datal = reg_mprj_io_31<<8; // Show reg_mprj_io_31 on GPIOs
//Must be 0x1809
reg_mprj_datal = 0xDCBA0000; // 2nd Flag
reg_mprj_slave = reg_mprj_io_31;
reg_mprj_datal = reg_mprj_slave<<8; // Show it on GPIOs
}
Because I am performing physical tests of the SoC I use the GPIOs to see the values written to the memory , my start flag is “ABCD”, then I show the value stored in reg_mprj_io_31(0x260000a0) which corresponds to the definition of “GPIO_MODE_MGMT_STD_OUTPUT” (0x1809), I set a second flag “DCBA”, then I write and read reg_mprj_slave (0x30000000), however what I get back is 0s.
Attached is an image of the signals obtained with the logic analyzer.
Any idea what might be wrong?
Note: I wrote this dummy C code just to try to write/read a value at the whisbone address.Emilio Baungarten
11/09/2024, 12:39 AMAnton Maurovic (efabless support)
11/09/2024, 12:54 AM