-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat_commit.awk
More file actions
40 lines (39 loc) · 1.04 KB
/
format_commit.awk
File metadata and controls
40 lines (39 loc) · 1.04 KB
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
# format_commit.awk - format git commit id for inserting text_rom_init.mem
# awk used to format git commmit id into seven lines of a 12 bit mem file. ie:
# INPUT generated by: git rev-parse HEAD | head -c7 | basenc --base2msbf --wrap=8
# 01100100
# 01100110
# 00110001
# 00110010
# 01100101
# 01100100
# 00110111
# Run after checkout, before synthesis to embed commit into video overlay lower right corner
# git rev-parse HEAD | head -c7 | basenc --base2msbf --wrap=8 | awk -f format_commit.aw
#
# The 7 liens of output replace the lines 3833,+7 in the text_rom_init.mem
# upon checkout are: 0123abc
# 000000110000
# 000000110001
# 000000110010
# 000000110011
# 000001100001
# 000001100010
# 000001100011
BEGIN { # read the 7 lines of 8 bits from masenc command
getline; b0 = $0;
getline; b1 = $0;
getline; b2 = $0;
getline; b3 = $0;
getline; b4 = $0;
getline; b5 = $0;
getline; b6 = $0;
# format them for a mif file substiturion
print "0000" b0
print "0000" b1
print "0000" b2
print "0000" b3
print "0000" b4
print "0000" b5
print "0000" b6
}