What is the proper way to read data from the the i...
# caravel
a
What is the proper way to read data from the the io_out pins during RTL simulaion? In my sim, I set the desired pin to
USER_STD_OUTPUT
and do
assign mprj_io_22 = mprj_io[22];
in the testbench similar to the provided io_ports example test. While viewing the waveform, that pin is constantly at don't care so not sure if I am missing something. In the mprj_stimulus test, the value of
reg_mprj_data
is changed; do I need to be doing something similar?
t
What values you use for io_oeb in user_project_wrapper
t
@Amogh Lonkar: Thjere isn't a "don't care" status in simulation. The net is either high-impedence or unknown (uninitialized or having multiple drivers). The most likely cause of a high-impedence signal is, as Tayyeb mentioned, not setting the
oeb
line for the GPIO line. The most likely cause of an unknown signal would be accidentally driving the pin from the testbench.
a
All our io_oeb bits are set to 1 except bit 22, which is our designated output pin. Interestingly in the waveform, mprj_io_oeb is all 1's. Is mprj_io_oeb set by the modes from defs.h or is there a way we can set it?
t
No, it is not and mprj_io_oeb is not same as io_oeb.
Which dv pattern you are using?
a
We are running are own test, which is similar to the io_ports test
t
If caravel is involved, modify io_ports.c and tb accordingly.
a
that is how we did it
t
Ok, then are you having only one io?
a
we use multiple input GPIO pins and single output GPIO pin
the input goes through fine, but the output pin is not able to read the data sent by our logic
t
All those should be configured as user io in io_test.c
a
yes
We have done like this
t
LFTM but now look into tb_io_test.v
a
they assign the mprj_io bits [7:0] and then wait to see the counter update
just to confirm, the wait simply does nothing until that particular value seen on those pins, right?
t
Or upload both files, I will have a look
👍 1
thanks
t
You are welcome, I looked into your tb but could not find a problem. Some possibilities are, 1) your simulation is not sufficiently long, 2) you have malfunction in your user project. Solution is to start debuging from inside out, you can post the screen shots here so that we may get some insight.
Or you may upload vcd somewhere, I may look into it.
m
@Amogh Lonkar @Tayyeb Mahmood I believe that the simulation is not waiting long enough until after the gpio_test.c file can actually configure the pins. It waits until after the reset, but then it will take quite a number of cycles until the code actually runs, right? I suggested setting another IO from the management processor to detect in the testbench when the configuration is done.
t
I suspect so @Matthew Guthaus
m
I just confirmed it.
@Amogh Lonkar See the updated test