Micah Tseng
08/19/2022, 4:56 PMuser_defines.v
before this mornings meeting so I took a look at it. Could you perhaps explain a little more what user_defines.v
is used for as opposed to mprj_por.c
? I think I’m a little mixed up on Caravel.
Thanks a lot!Tim Edwards
08/19/2022, 6:42 PMuser_defines.v
defines the way each of the GPIO pads is configured when the chip powers up. It is the best way to make sure that your user project comes up and runs immediately on power-up, regardless of what the processor is doing.
Does that sufficiently answer your question?Micah Tseng
08/19/2022, 8:00 PMMicah Tseng
08/25/2022, 1:17 AMcaravel/
directory is another git repo…so to modify user_defines.v
from the caravel
repo is it expected to flatten the caravel/
repo (i.e., remove caravel/.git
)? Or create a fork and rebase as a submodule? Or something else?
Thanks a lot!
MicahMitch Bailey
08/25/2022, 1:45 AMcaravel/verilog/rtl/user_defines.v
to verilog/rtl/user_defines.v
.
From caravel/scripts/gen_gpio_defaults.py
if len(arguments) == 0:
user_project_path = os.getcwd()
else:
user_project_path = arguments[0]
...
vpath = user_project_path + '/verilog'
...
user_defines_path = vpath + '/rtl/user_defines.v'
if not os.path.isfile(user_defines_path):
user_defines_path = caravel_path + '/verilog/rtl/user_defines.v'
The program tries to read from verilog/rtl/user_defines.v
, but if that doesn't exist, it defaults to caravel/verilog/rtl/user_defines.v
In other words, local settings override default caravel settings.Mitch Bailey
08/25/2022, 1:48 AMcaravel
sub-repo.Micah Tseng
08/25/2022, 4:10 AM