Skip to content

Commit

Permalink
Insert '_' to delimit clusters and register arrays
Browse files Browse the repository at this point in the history
The 1170 chip family has a different CCM design than anything in the
10xx family. It has a CLOCK_ROOT cluster of size 79. Within that cluster
is an array of CLOCK_ROOT_SETPOINT registers, size 16.

imxrtral.py doesn't emit structs for clusters or arrays for register
arrays. Instead, it appends the cluster number and the register number
to the end of the symbol. For instance, the 13th setpoint register in
the first cluster is called CLOCK_ROOT_SETPOINT131.

However, the first setpoint register in the 31st cluster is also called
CLOCK_ROOT_SETPOINT131. This confuses the compiler (and humans); a build
with this CCM peripheral fails due to duplicate members in the register
block, duplicate modules, etc. This only happens when you have cluster
and register array dimensions that happen to overlap.

This commit changes the naming of registers derived from clusters. It
emits a '_' before the cluster number. In the example above, this means
that the symbols become CLOCK_ROOT_SETPOINT13_1 and
CLOCK_ROOT_SETPOINT1_31, which are unique and discernable. It's a
breaking change, and a workaround to explore 1170 support in the RAL.
  • Loading branch information
mciantyre committed Jul 31, 2022
1 parent 1695a13 commit 0fccac5
Show file tree
Hide file tree
Showing 23 changed files with 20,209 additions and 20,195 deletions.
2 changes: 1 addition & 1 deletion imxrtral.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ def expand_cluster(node):
nodes = []
for register in node.findall('register'):
addr = cluster_addr + get_int(register, 'addressOffset')
name = get_string(register, 'name') + str(cluster_idx)
name = get_string(register, 'name') + "_" + str(cluster_idx)
clusr = copy.deepcopy(register)
clusr.find('addressOffset').text = "0x{:08x}".format(addr)
clusr.find('name').text = name
Expand Down
Loading

0 comments on commit 0fccac5

Please sign in to comment.