<@U0172QZ342D> Did you get the `mprj_io` to toggle...
# caravel
t
@User Did you get the
mprj_io
to toggle in the test bench ?
m
If I stimulate mprj_io directly I can get inputs to work. I've still not seen a way of stimulating the gpio pads to propogate a signal to an input.
t
😕
t
But did you get outputs to work ?
m
Yes
t
Ok, so far I didn't get that yet.
I just do
reg_mprj_io_21 = GPIO_MODE_USER_STD_OUTPUT;
in the test bench and then control it from my block.
Should I be doing more ?
m
Wait for Xfer?
t
Doh ..
I hadn't looked at that I was just taking example code from someone else (not from original example) and it didn't do xfer.
Yup that at least made outputs works. Now looking at inputs.
Ok, so input work. The only weird thing is I couldn't create a loopback directly in the test bench. Like
Copy code
assign mprj_io[16] = mprj_io[15];
would prevent the test bench from working at all ... (even output would stop working) I had to :
Copy code
reg midi_del;
always #10 midi_del <= mprj_io[15];
assign mprj_io[16] = midi_del;
m
Have you tried from a pad? Not mprj internal signals?
t
What do you mean ... it's
.mprj_io
port on the
caravel
module, that's the pad right ?
m
What I have not seen is a signal going from caravel pad to user project.
I can get a signal out to the caravel gpio pad but not in
t
yeah, I'm applying a signal to
mprj_io[16]
which is a port on the
caravel
module and I get it all the way up to my
io_in
port on the wrapper/custom logic.
m
I can do that
I'd be interested if you can go from a gpio pad into the user project
t
isn't
mprj_io
what's connected to the balls of the BGA ?
m
I dont think so. It all gets wired to the gpio modules that have quite a lot going on inside for slew, io etc
t
Huh ... where do you see that.
AFAICT
mprj_io
is the output/pad of the gpio module.
there is no other signal ...
m
What do you think uut.gpio_control_in.pad_gpio_in is?
I thought that would be the one connected to the ball
t
the
mprj_io
port signals from the caravel eventually connect to the
PAD
port of
sky130_ef_io__gpiov2_pad_wrapped
what's connected to the pad has to be a top level signal, not some random internal signal ...
AFAICT the signal you mention is what comes from the physical io block
sky130_ef_io__gpiov2_pad_wrapped
(which is mostly foundry provided) to the small bit of muxing / control logic made by Tim to share io between mgmt and user logic.
m
Ok good to know. I've been worrying about that all last week!
t
What I haven't tested yet is dynamic input / output control.
m
Yeah I dont see how that can work without coordination from the cpu
t
well toggling the
io_iob
should do it AFAIU.
I had to come up with a custom
reg_mprj_io_xx
because by default you only get Input / Output (and input disables the output path and output disables the input path)
m
Aha
t
Ok, seems to work, I can see input data and output data on the sam epin.
👍 1