aboutsummaryrefslogtreecommitdiffstats
path: root/templates/headers.h.tmpl
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@leaflabs.com>2014-02-26 19:42:51 -0500
committerbryan newbold <bnewbold@leaflabs.com>2014-02-26 19:42:51 -0500
commit6cc0f5ff9e4de203572ef6a66df82aca97bb6544 (patch)
tree398f13f7a2d3a35af8a91f497c6dc96f88b7adcd /templates/headers.h.tmpl
parent37e46745e248b0136b16aa40bed9ea20df16769d (diff)
downloadaxi-lite-gen-6cc0f5ff9e4de203572ef6a66df82aca97bb6544.tar.gz
axi-lite-gen-6cc0f5ff9e4de203572ef6a66df82aca97bb6544.zip
commit day's work
Diffstat (limited to 'templates/headers.h.tmpl')
-rw-r--r--templates/headers.h.tmpl20
1 files changed, 20 insertions, 0 deletions
diff --git a/templates/headers.h.tmpl b/templates/headers.h.tmpl
new file mode 100644
index 0000000..ad6a0f7
--- /dev/null
+++ b/templates/headers.h.tmpl
@@ -0,0 +1,20 @@
+#ifndef {{ name.upper() }}_MAP_H
+#define {{ name.upper() }}_MAP_H
+
+/* {{ name }} Memory Map Structs */
+
+/* WARNING: Currently assumes perfect packing */
+
+{% for sec_name, values in sections.iteritems() %}
+typedef struct {
+{% for val in values %}
+ {{ val.ctype() }} {{ val.slug }};
+{% endfor %}
+} {{ name }}_{{ sec_name }}_map;
+#define {{ name }}_{{ sec_name }}_offset {{ values[0].addr_pp() }}
+/* Usage (?)
+ * void *uint32_t {{ name }}_{{ sec_name }}_map...
+ */
+{% endfor %}
+
+#endif