summaryrefslogtreecommitdiffstats
path: root/treemap/Makefile
blob: 386bc20ff56bc0fd6161bbe6d4e0315c21db0bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#TOP        = top
#DIR        = ../s3estarter/syn/xst
#SCREENSHOT = s3estarter_ressources

TOP        = top
DIR        = ../beam_position_monitor/hardware/board_sp601_amba/synthsis/xst
SCREENSHOT = bpm_sp601_amba

#TOP        = top
#DIR        = ../beam_position_monitor/hardware/board_sp605/synthsis/xst
#SCREENSHOT = bpm_sp605

#TOP        = top
#DIR        = ../central_trigger_generator/syn/xst
#SCREENSHOT = central_trigger_ressources


# derived Variables
MAPREPORTXML = $(DIR)/$(TOP)_map.xrpt 
MAPREPORT    = $(DIR)/$(TOP)_map.mrp


start = $(shell grep --line-number  "^Logic Utilization:" $(DIR)/$(TOP)_map.mrp | cut -d":" -f1)
end   = $(shell grep --line-number  "^Peak Memory Usage:" $(DIR)/$(TOP)_map.mrp | cut -d":" -f1)


help:
	@echo "run     - run Treeviz"
	@echo "convert - convert data (on unix)"
	@echo "util    - grep for utilization"
	@echo "combine - two screenshots for better overview"
	@echo "clean   - tidy up"

run:	ressources.xml
	@echo "save screeshot as $(SCREENSHOT)_grob.png and $(SCREENSHOT)_fein.png"
	java -jar Treeviz/dist/Treeviz.jar $<

convert: ressources.xml


# useful for printing with graphic report
# cut lines beetween "Logic Utilization" and "Average Fanout..."
util: $(MAPREPORT)
	@sed -n '/Logic Utilization:/,/^Average Fanout of Non-Clock Nets:/p' $(MAPREPORT)

# not so useful -> confusing if hierachy to deep
# cut lines from "Section 13" (2nd occurence) and end of file
util_hier: $(MAPREPORT)
	@tail -n +$(shell grep --line-number  "^Section 13" $(MAPREPORT) | tail -1 | cut -d":" -f1) $(MAPREPORT)



ressources.xml: $(MAPREPORTXML) convert.xsl
	saxon-xslt $(MAPREPORTXML)  convert.xsl > tmp.xml
	# prune empty lines with sed
	sed -e '/^[ ]*$$/d' tmp.xml > ressources.xml
	# cleanup
	rm -f tmp.xml


combine: $(SCREENSHOT)_fein.png $(SCREENSHOT)_grob.png
	composite -blend 33 $(SCREENSHOT)_fein.png $(SCREENSHOT)_grob.png $(SCREENSHOT)_mixed.png


clean:
	rm -f ressources.xml

OpenPOWER on IntegriCloud