1 # Makefile to generate or copy the latest register definitions
2 # and related datastructures and helpermacros.
3 # The offical place for these files is at:
5 OFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
7 # which is updated on each new release.
9 INCL_FILES = ata_defs.h
10 INCL_FILES += bif_core_defs.h
11 INCL_ASMFILES += bif_core_defs_asm.h
12 INCL_FILES += bif_slave_defs.h
13 #INCL_FILES += bif_slave_ext_defs.h
14 INCL_FILES += config_defs.h
15 INCL_ASMFILES += config_defs_asm.h
16 INCL_FILES += cpu_vect.h
17 #INCL_FILES += cris_defs.h
18 #INCL_FILES += cris_supp_reg.h # In handcrafted supp_reg.h
20 INCL_FILES += dma_defs.h
21 INCL_FILES += eth_defs.h
22 INCL_FILES += extmem_defs.h
23 INCL_FILES += gio_defs.h
24 INCL_ASMFILES += gio_defs_asm.h
25 INCL_FILES += intr_vect.h
26 INCL_FILES += intr_vect_defs.h
27 INCL_ASMFILES += intr_vect_defs_asm.h
28 INCL_FILES += marb_bp_defs.h
29 INCL_FILES += marb_defs.h
30 INCL_ASMFILES += mmu_defs_asm.h
31 #INCL_FILES += mmu_supp_reg.h # In handcrafted supp_reg.h
32 #INCL_FILES += par_defs.h # No useful content
33 INCL_FILES += pinmux_defs.h
34 INCL_FILES += reg_map.h
35 INCL_ASMFILES += reg_map_asm.h
36 INCL_FILES += reg_rdwr.h
37 INCL_FILES += ser_defs.h
38 #INCL_FILES += spec_reg.h # In handcrafted supp_reg.h
39 INCL_FILES += sser_defs.h
40 INCL_FILES += strcop_defs.h
41 #INCL_FILES += strcop.h # Where is this?
42 INCL_FILES += strmux_defs.h
43 #INCL_FILES += supp_reg.h # Handcrafted instead
44 INCL_FILES += timer_defs.h
47 REGDESC += $(BASEDIR)/io/ata/rtl/ata_regs.r
48 REGDESC += $(BASEDIR)/io/bif/rtl/bif_core_regs.r
49 REGDESC += $(BASEDIR)/io/bif/rtl/bif_slave_regs.r
50 #REGDESC += $(BASEDIR)/io/bif/sw/bif_slave_ext_regs.r
51 REGDESC += $(DESIGNDIR)/top/rtl/config_regs.r
52 REGDESC += $(BASEDIR)/mod/dma_common/rtl/dma_regdes.r
53 REGDESC += $(BASEDIR)/io/eth/rtl/eth_regs.r
54 REGDESC += $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
55 REGDESC += $(DESIGNDIR)/gio/rtl/gio_regs.r
56 REGDESC += $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
57 REGDESC += $(BASEDIR)/core/memarb/rtl/guinness/marb_top.r
58 REGDESC += $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
59 #REGDESC += $(BASEDIR)/io/par_port/rtl/par_regs.r
60 REGDESC += $(BASEDIR)/io/pinmux/rtl/guinness/pinmux_regs.r
61 REGDESC += $(BASEDIR)/io/ser/rtl/ser_regs.r
62 REGDESC += $(BASEDIR)/core/strcop/rtl/strcop_regs.r
63 REGDESC += $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
64 REGDESC += $(BASEDIR)/io/timer/rtl/timer_regs.r
65 #REGDESC += $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
68 BASEDIR = /n/asic/design
69 DESIGNDIR = /n/asic/projects/guinness/design
70 RDES2C = /n/asic/bin/rdes2c
71 RDES2C = /n/asic/design/tools/rdesc/rdes2c
72 RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
73 RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
75 ## all - Just print help - you probably want to do 'make gen'
78 # Disable implicit rule that may generate deleted files from RCS/ directory.
87 ## gen - Generate include files
88 gen: $(INCL_FILES) $(INCL_ASMFILES)
90 ata_defs.h: $(BASEDIR)/io/ata/rtl/ata_regs.r
92 config_defs.h: $(DESIGNDIR)/top/rtl/config_regs.r
94 config_defs_asm.h: $(DESIGNDIR)/top/rtl/config_regs.r
96 # Can't generate cpu_vect.h yet
97 #cpu_vect.h: $(DESIGNDIR)/top/rtl/cpu_vect.r # ????
99 cpu_vect.h: $(OFFICIAL_INCDIR)cpu_vect.h
100 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
101 dma_defs.h: $(BASEDIR)/core/dma/rtl/common/dma_regdes.r
103 $(BASEDIR)/core/dma/sw/dma.h:
104 dma.h: $(BASEDIR)/core/dma/sw/dma.h
105 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
106 eth_defs.h: $(BASEDIR)/io/eth/rtl/eth_regs.r
108 extmem_defs.h: $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
110 gio_defs.h: $(DESIGNDIR)/gio/rtl/gio_regs.r
112 intr_vect_defs.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
114 intr_vect_defs_asm.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
116 # Can't generate intr_vect.h yet
117 #intr_vect.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
119 intr_vect.h: $(OFFICIAL_INCDIR)intr_vect.h
120 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
121 mmu_defs_asm.h: $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
123 par_defs.h: $(BASEDIR)/io/par_port/rtl/par_regs.r
126 # From /n/asic/projects/guinness/design/
127 reg_map.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
128 $(RDES2C) -base 0xb0000000 $^
129 reg_map_asm.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
130 $(RDES2C) -base 0xb0000000 -asm -outfile $@ $^
132 reg_rdwr.h: $(DESIGNDIR)/top/sw/include/reg_rdwr.h
133 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
135 ser_defs.h: $(BASEDIR)/io/ser/rtl/ser_regs.r
137 strcop_defs.h: $(BASEDIR)/core/strcop/rtl/strcop_regs.r
139 strcop.h: $(BASEDIR)/core/strcop/rtl/strcop.h
140 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
141 strmux_defs.h: $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
143 timer_defs.h: $(BASEDIR)/io/timer/rtl/timer_regs.r
145 usb_defs.h: $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
148 ## copy - Copy files from official location
150 @for HFILE in $(INCL_FILES); do \
152 cat $(OFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
154 @for HFILE in $(INCL_ASMFILES); do \
156 cat $(OFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
158 ## ls_official - List official location
160 (cd $(OFFICIAL_INCDIR); ls -l *.h )
162 ## diff_official - Diff current directory with official location
164 diff . $(OFFICIAL_INCDIR)
166 ## doc - Generate .axw files from register description.
169 $(RDES2TXT) $$RDES; \
173 ## %.axw - Generate the specified .axw file (doesn't work for all files
174 ## due to inconsistent naming ir .r files.
176 @for RDES in $(REGDESC); do \
177 if echo "$$RDES" | grep $* ; then \
178 $(RDES2TXT) $$RDES; \
183 ## clean - Remove .h files and .axw files.
185 rm -rf $(INCL_FILES) *.axw