hello_world: Debug print the gitinfo syscon register

.oOOo.
 ."      ".
 ;  .mw.  ;   Microwatt, it works.
  . '  ' .
   \ || /     HDL Git SHA1: 211d23c4ad4fb5-dirty
    ;..;
    ;..;
    `ww'

Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Michael Neuling <mikey@neuling.org>
pull/400/head
Dan Horák 4 years ago committed by Michael Neuling
parent 1ddbacb67f
commit bd5e4bafba

@ -25,7 +25,8 @@ hello_world.bin: hello_world.elf
$(OBJCOPY) -O binary $^ $@ $(OBJCOPY) -O binary $^ $@


hello_world.hex: hello_world.bin hello_world.hex: hello_world.bin
../scripts/bin2hex.py $^ > $@ ../scripts/bin2hex.py $^ > hello_world.hex.tmp
mv -f hello_world.hex.tmp hello_world.hex


clean: clean:
@rm -f *.o hello_world.elf hello_world.bin hello_world.hex @rm -f *.o hello_world.elf hello_world.bin hello_world.hex

Binary file not shown.

@ -2,24 +2,46 @@
#include <stdbool.h> #include <stdbool.h>


#include "console.h" #include "console.h"
#include "io.h"
#include "microwatt_soc.h"


static char mw_logo[] = static char mw_logo1[] =

"\n" "\n"
" .oOOo. \n" " .oOOo. \n"
" .\" \". \n" " .\" \". \n"
" ; .mw. ; Microwatt, it works.\n" " ; .mw. ; Microwatt, it works.\n"
" . ' ' . \n" " . ' ' . \n"
" \\ || / \n" " \\ || / HDL Git SHA1: ";

static char mw_logo2[] =
"\n"
" ;..; \n" " ;..; \n"
" ;..; \n" " ;..; \n"
" `ww' \n"; " `ww' \n\n";


int main(void) int main(void)
{ {
uint64_t gitinfo;
uint8_t c;
bool dirty;

console_init(); console_init();


puts(mw_logo); puts(mw_logo1);

gitinfo = readq(SYSCON_BASE + SYS_REG_GIT_INFO);
dirty = gitinfo >> 63;
for (int i = 0; i < 14; i++) {
c = (gitinfo >> 52) & 0xf;
if (c >= 10)
putchar(0x61 + c - 10); // a-f
else
putchar(0x30 + c); // 0-9
gitinfo <<= 4;
}
if (dirty)
puts("-dirty");
puts(mw_logo2);


while (1) { while (1) {
unsigned char c = getchar(); unsigned char c = getchar();

Binary file not shown.

@ -48,11 +48,11 @@ a64b5a7d14004a39
782107c660210000 782107c660210000
6021398064210000 6021398064210000
f801ffe138000000 f801ffe138000000
3d8000007c1243a6 618c00003d800000
798c07c6618c0000 658c0000798c07c6
618c1000658c0000 7d8903a6618c1000
4e8004217d8903a6 000002004e800421
4800000000000200 0000000048000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
@ -511,172 +511,172 @@ f801ffe138000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
384298003c400001 384298003c400001
fbe1fff87c0802a6 4800042d7c0802a6
f821ffd1f8010010 3fe0c000f821ffc1
60000000480001ed 7bff002063ff0050
6000000048000269
3862803060000000
60000000480001d1
7fe0feea7c0004ac
7bfd0fe03bc0000e
280300097be36720
386300574081007c
7bff26e47c6307b4
6000000048000119
4082ffdc37deffff
418200142c3d0000
38637c303c62ffff
6000000048000181
3862800060000000 3862800060000000
6000000048000155 6000000048000171
6000000048000049 6000000048000051
5463063e7c7f1b78 5463063e7c7f1b78
480000b957ff063e 480000cd57ff063e
2c1f000d60000000 2c1f000d60000000
3860000a4082ffe0 3860000a4082ffe0
60000000480000a5 60000000480000b9
000000004bffffd0 386300304bffffd0
0000018001000000 000000004bffff88
0000038001000000
384298003c400001 384298003c400001
8922810860000000 8922810860000000
3942810060000000 3942810060000000
418200302c090000 418200382c090000
39290014e92a0000 39290014e92a0000
7d204eaa7c0004ac 7d204eaa7c0004ac
4182ffec71290001 4182ffec71290001
7c0004ace86a0000 e862810060000000
5463063e7c601eaa 7c601eaa7c0004ac
7c6307b45463063e
e92a00004e800020 e92a00004e800020
7c0004ac39290010 7c0004ac39290010
712900017d204eea 712900017d204eea
e86a00004082ffec 600000004082ffec
7c0004ac38630008 38630008e8628100
4bffffd07c601eea 7c601eea7c0004ac
0000000000000000 000000004bffffc8
3c40000100000000 0000000000000000
6000000038429800 384298003c400001
6000000089228108 8922810860000000
2c09000039428100 3942810060000000
e92a00004182002c 418200302c090000
7c0004ac39290014 39290014e92a0000
712900207d204eaa 7d204eaa7c0004ac
e92a00004182ffec 4182ffec71290020
e922810060000000
7c604faa7c0004ac 7c604faa7c0004ac
e92a00004e800020 e92a00004e800020
7c0004ac39290010 7c0004ac39290010
712900087d204eea 712900087d204eea
5469063e4082ffec 5469063e4082ffec
7c0004ace94a0000 e942810060000000
4e8000207d2057ea 7d2057ea7c0004ac
0000000000000000 000000004e800020
3c40000100000000 0000000000000000
7c0802a638429800 384298003c400001
fbc1fff0fbe1fff8 fbe1fff87c0802a6
f80100103be3ffff 3be3fffffbc1fff0
8fdf0001f821ffd1 f821ffd1f8010010
408200102c3e0000 2c1e00008fdf0001
3860000038210030 3821003040820010
281e000a480001e8 4800022038600000
3860000d4082000c 4082000c2c1e000a
7fc3f3784bffff45 4bffff3d3860000d
4bffffd04bffff3d 4bffff357fc307b4
0100000000000000 000000004bffffd0
7c691b7800000280 0000028001000000
7d4918ae38600000 386000007c691b78
4d8200202c0a0000 2c0a00007d4918ae
4bfffff038630001 386300014d820020
0000000000000000 000000004bfffff0
3c40000100000000 0000000000000000
3d40c00038429800 384298003c400001
794a0020614a0020 612900203d20c000
7d4056ea7c0004ac
794a06003d20c000
7929002061290008
7d204eea7c0004ac
4182001871290020
612900403d20c000
7c0004ac79290020 7c0004ac79290020
7929f8047d204eea 3d40c0007d204eea
79290fc33d00c000 614a000879290600
7908002061082000 7c0004ac794a0020
f902810060000000 714a00207d4056ea
610820003d00001c 614a20003d40c000
418200847d4a4392 40820040794a0020
3920000160000000 f942810060000000
3d00c00099228108 6000000039400000
3920ff806108200c 3d40001c99428108
7c0004ac79080020 7d295392614a2000
e92281007d2047aa 614a20183d40c000
7d404faa7c0004ac 3929ffff794a0020
794ac202e9228100 7d2057ea7c0004ac
7c0004ac39290004 3d00c0004e800020
7908002061080040
7d0046ea7c0004ac
60000000790807e3
3d40001cf9428100
7d495392614a2000
600000004182ffa0
9922810839200001
6108200c3d00c000
790800203920ff80
7d2047aa7c0004ac
7c0004ace9228100
e92281007d404faa e92281007d404faa
3929000c39400003 39290004794ac202
7d404faa7c0004ac 7d404faa7c0004ac
39290010e9228100 39400003e9228100
7c0004ac3929000c
e92281007d404faa
7c0004ac39290010
e92281007d404faa
3929000839400007
7d404faa7c0004ac 7d404faa7c0004ac
39400007e9228100
7c0004ac39290008
4e8000207d404faa
394affff60000000
3d20c00099228108
7929002061292018
7d404fea7c0004ac
000000004e800020 000000004e800020
0000000000000000 0000000000000000
384298003c400001 384298003c400001
8922810860000000 8922810860000000
600000002c090000 600000002c090000
41820024e9228100 41820028e9228100
78840e282c230000 5484083c2c230000
6084000141820008 418200087c8a2378
7c0004ac39290004 39290004608a0001
4e8000207c804faa 7d404faa7c0004ac
418200082c240000 2c2400004e800020
3929002060630002 6063000241820008
7c604fea7c0004ac 7c0004ac39290020
000000004e800020 4e8000207c604fea
0000000000000000 0000000000000000
e8010010ebc1fff0 6000000000000000
7c0803a6ebe1fff8 000079747269642d
000000104e800020 fbc1fff0fba1ffe8
00527a0100000000 f8010010fbe1fff8
00010c1b01417804 ebc1fff04e800020
0000001800000018 ebe1fff8e8010010
00000070fffffc40 4e8000207c0803a6
9f7e4111300e4600 0000000000000010
0000001000000001 0141780400527a01
00527a0100000000 0000002000010c1b
00010c1b01417804 fffffb8400000018
0000001800000010 41094300000000e0
00000084fffffc80 019f029e039d4100
0000001000000000 0000400e417e4111
fffffcf00000002c 0000000000000010
0000000000000080 0141780400527a01
0000004000000028 0000001000010c1b
00000060fffffd5c fffffc2c00000018
9e019f0041094500 0000000000000090
447e4111300e4302 0000002c00000010
4106dedf42000e0a 00000088fffffca8
000000100000000b 0000002800000000
fffffd900000006c fffffd1c00000040
0000000000000028 4109450000000060
0000008000000010 300e43029e019f00
0000012cfffffda4 42000e0a447e4111
0000000b4106dedf
0000006c00000010
00000028fffffd50
0000001000000000 0000001000000000
fffffebc00000094 fffffd6400000080
0000000000000068 0000000000000140
0000000000000000 0000009400000010
0000000000000000 0000006cfffffe90
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
@ -766,6 +766,12 @@ fffffebc00000094
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
2e2e3b202020200a
0a2020202020203b
3b2e2e3b20202020
200a202020202020
2027777760202020
000a0a2020202020
4f4f6f2e2020200a 4f4f6f2e2020200a
0a20202020202e6f 0a20202020202e6f
2020202020222e20 2020202020222e20
@ -777,9 +783,6 @@ fffffebc00000094
27202027202e2020 27202027202e2020
200a202020202e20 200a202020202e20
2f207c7c205c2020 2f207c7c205c2020
2020200a20202020 4c44482020202020
2020203b2e2e3b20 4148532074694720
202020200a202020 0000000000203a31
202020203b2e2e3b
60202020200a2020
000a202020277777

Loading…
Cancel
Save