(1) Modified the set_user_id.py script to add an option mode "-report"
that returns the user ID in decimal form only. (2) Modified the
Makefile to make use of this to set the random seed for the project,
so that there are no cell collisions between the management SoC and
user project wrapper cell names.
diff --git a/Makefile b/Makefile
index 5b0d272..a57fe1a 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,7 @@
@echo "Generating Caravel GDS (sources are in the 'gds' directory)"
@sleep 1
@echo "\
+ random seed `scripts/set_user_id.py -report`; \
gds readonly true; \
gds rescale false; \
gds read ../gds/user_project_wrapper.gds; \
@@ -70,8 +71,6 @@
@mv -f ./gds/caravel.gds ./gds/caravel.old.gds
mv ./mag/caravel.gds ./gds
-
-
.PHONY: clean
clean:
cd ./verilog/dv/caravel/mgmt_soc/ && \
diff --git a/scripts/set_user_id.py b/scripts/set_user_id.py
index 8633ccb..6596bd0 100755
--- a/scripts/set_user_id.py
+++ b/scripts/set_user_id.py
@@ -102,6 +102,7 @@
arguments = []
debugmode = False
+ reportmode = False
for option in sys.argv[1:]:
if option.find('-', 0) == 0:
@@ -116,6 +117,8 @@
if '-debug' in optionlist:
debugmode = True
+ if '-report' in optionlist:
+ reportmode = True
user_id_value = None
user_project_path = None
@@ -173,6 +176,10 @@
print('Error: No info.yaml file and no user ID argument given.')
sys.exit(1)
+ if reportmode:
+ print(str(user_id_int))
+ sys.exit(0)
+
print('Setting project user ID to: ' + user_id_value)
magpath = user_project_path + '/mag'