diff options
Diffstat (limited to 'assembly')
| -rw-r--r-- | assembly/beacon/Makefile | 24 | ||||
| -rw-r--r-- | assembly/beacon/beacon.S | 85 | ||||
| -rwxr-xr-x | assembly/beacon/beacon.elf | bin | 0 -> 5872 bytes | |||
| -rw-r--r-- | assembly/beacon/beacon.hex | 25 | ||||
| -rw-r--r-- | assembly/beacon/beacon.o | bin | 0 -> 3080 bytes | |||
| l--------- | assembly/beacon/rvcontroller.ld | 1 | ||||
| -rw-r--r-- | assembly/digitalsign/Makefile | 24 | ||||
| -rw-r--r-- | assembly/digitalsign/digitalsign.S | 96 | ||||
| -rwxr-xr-x | assembly/digitalsign/digitalsign.elf | bin | 0 -> 6072 bytes | |||
| -rw-r--r-- | assembly/digitalsign/digitalsign.hex | 25 | ||||
| -rw-r--r-- | assembly/digitalsign/digitalsign.o | bin | 0 -> 3444 bytes | |||
| l--------- | assembly/digitalsign/rvcontroller.ld | 1 |
12 files changed, 281 insertions, 0 deletions
diff --git a/assembly/beacon/Makefile b/assembly/beacon/Makefile new file mode 100644 index 0000000..84d76c4 --- /dev/null +++ b/assembly/beacon/Makefile @@ -0,0 +1,24 @@ +MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt + +.PHONY: all dump load clean + +all: beacon.hex + +beacon.o: beacon.S + riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o beacon.o beacon.S + +beacon.elf: beacon.o + riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o beacon.elf beacon.o + +dump: beacon.elf + riscv32-none-elf-objdump -d beacon.elf + +beacon.hex: beacon.elf + riscv32-none-elf-objcopy -O ihex beacon.elf beacon.hex + +load: beacon.hex + bash -c "wl-copy < beacon.hex" + +clean: + rm -f beacon.bin beacon.elf beacon.o + diff --git a/assembly/beacon/beacon.S b/assembly/beacon/beacon.S new file mode 100644 index 0000000..26c271e --- /dev/null +++ b/assembly/beacon/beacon.S @@ -0,0 +1,85 @@ +# Initialize timer +la a0,timerchannel +la a1,timerinit1 +li a7,129 # Send digilines message +ecall +la a1,timerinit2 +ecall + +loop: + +# Check if the timer has ticked +li a7,133 # Get digilines buffer level +ecall +beqz a0,sleep # Sleep if it hasn't +li a7,134 # Clear digilines receive buffer +ecall + +# Do the actual flashing +li a7,129 # Send digilines message +la a0,lightchannel1 +la a1,lightonmsg +ecall # Light 1 on +pause +la a1,lightoffmsg +ecall # Light 1 off +pause +la a1,lightonmsg +ecall # Light 1 on +pause +la a1,lightoffmsg +ecall # Light 1 off +pause +la a1,lightonmsg +ecall # Light 1 on +pause +la a1,lightoffmsg +ecall # Light 1 off +pause +la a1,lightonmsg +ecall # Light 1 on +pause +la a1,lightoffmsg +ecall # Light 1 off +pause +la a0,lightchannel2 +la a1,lightonmsg +ecall # Light 2 on +pause +la a1,lightoffmsg +ecall # Light 2 off +pause +la a1,lightonmsg +ecall # Light 2 on +pause +la a1,lightoffmsg +ecall # Light 2 off +pause +la a1,lightonmsg +ecall # Light 2 on +pause +la a1,lightoffmsg +ecall # Light 2 off +pause +la a1,lightonmsg +ecall # Light 2 on +pause +la a1,lightoffmsg +ecall # Light 2 off +pause +j loop + +sleep: +csrw 0x800,1 # Lightweight on +pause +csrw 0x800,0 # Lightweight off +j loop + + +timerchannel: .asciz "timer" +timerinit1: .asciz "loop_on" +timerinit2: .asciz "1" +lightchannel1: .asciz "light1" +lightchannel2: .asciz "light2" +lightonmsg: .asciz "14" +lightoffmsg: .asciz "0" diff --git a/assembly/beacon/beacon.elf b/assembly/beacon/beacon.elf Binary files differnew file mode 100755 index 0000000..e1c0b55 --- /dev/null +++ b/assembly/beacon/beacon.elf diff --git a/assembly/beacon/beacon.hex b/assembly/beacon/beacon.hex new file mode 100644 index 0000000..418d25b --- /dev/null +++ b/assembly/beacon/beacon.hex @@ -0,0 +1,25 @@ +:10000000170500001305C515970500009385A51574
+:1000100093081008730000009705000093852515CC
+:10002000730000009308500873000000630105127C
+:10003000930860087300000093081008170500007B
+:1000400013050513970500009385651373000000E1
+:100050000F000001970500009385951273000000C2
+:100060000F000001970500009385651173000000E3
+:100070000F000001970500009385951073000000A4
+:100080000F000001970500009385650F73000000C5
+:100090000F000001970500009385950E7300000086
+:1000A0000F000001970500009385650D73000000A7
+:1000B0000F000001970500009385950C7300000068
+:1000C0000F000001170500001305F50A9705000051
+:1000D0009385E50A730000000F00000197050000FA
+:1000E0009385150A730000000F00000197050000BA
+:1000F0009385E508730000000F00000197050000DC
+:1001000093851508730000000F000001970500009B
+:100110009385E506730000000F00000197050000BD
+:1001200093851506730000000F000001970500007D
+:100130009385E504730000000F000001970500009F
+:1001400093851504730000000F000001E1BD73D01A
+:1001500000800F00000173500080E9B574696D657F
+:1001600072006C6F6F705F6F6E0031006C69676852
+:100170007431006C696768743200313400300000FB
+:00000001FF
diff --git a/assembly/beacon/beacon.o b/assembly/beacon/beacon.o Binary files differnew file mode 100644 index 0000000..e5cafbb --- /dev/null +++ b/assembly/beacon/beacon.o diff --git a/assembly/beacon/rvcontroller.ld b/assembly/beacon/rvcontroller.ld new file mode 120000 index 0000000..bc01402 --- /dev/null +++ b/assembly/beacon/rvcontroller.ld @@ -0,0 +1 @@ +../../rvcontroller.ld
\ No newline at end of file diff --git a/assembly/digitalsign/Makefile b/assembly/digitalsign/Makefile new file mode 100644 index 0000000..d8d4833 --- /dev/null +++ b/assembly/digitalsign/Makefile @@ -0,0 +1,24 @@ +MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt + +.PHONY: all dump load clean + +all: digitalsign.hex + +digitalsign.o: digitalsign.S + riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o digitalsign.o digitalsign.S + +digitalsign.elf: digitalsign.o + riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o digitalsign.elf digitalsign.o + +dump: digitalsign.elf + riscv32-none-elf-objdump -d digitalsign.elf + +digitalsign.hex: digitalsign.elf + riscv32-none-elf-objcopy -O ihex digitalsign.elf digitalsign.hex + +load: digitalsign.hex + bash -c "wl-copy < digitalsign.hex" + +clean: + rm -f digitalsign.bin digitalsign.elf digitalsign.o + diff --git a/assembly/digitalsign/digitalsign.S b/assembly/digitalsign/digitalsign.S new file mode 100644 index 0000000..c5e5468 --- /dev/null +++ b/assembly/digitalsign/digitalsign.S @@ -0,0 +1,96 @@ +start: +call blankall +pause +pause +call senda +call sleep +call blankall +pause +pause +call sendb +call sleep +j start + + +blankall: +la a0,channel1 +la a1,msgblank +li a7,129 # Send digilines message +ecall +la a0,channel2 +ecall +la a0,channel3 +ecall +la a0,channel4 +ecall +ret + +senda: +la a0,channel1 +la a1,msg1a +la a7,129 # Send digilines message +ecall +la a0,channel2 +la a1,msg2a +ecall +la a0,channel3 +la a1,msg3a +ecall +la a0,channel4 +la a1,msg4a +ecall +ret + +sendb: +la a0,channel1 +la a1,msg1b +la a7,129 # Send digilines message +ecall +la a0,channel2 +la a1,msg2b +ecall +la a0,channel3 +la a1,msg3b +ecall +la a0,channel4 +la a1,msg4b +ecall +ret + +sleep: +rdtime t0 +addi t0,t0,4 +sleep_loop: +rdtime t1 +csrw 0x800,1 # Lightweight mode on +pause +csrw 0x800,0 # Lightweight mode off +bltu t1,t0,sleep_loop +ret + +channel1: .asciz "1" +channel2: .asciz "2" +channel3: .asciz "3" +channel4: .asciz "4" + +# "RINGROAD" +# " CLOSED " +# " AT " +# "NORTH ST" + +# " FOLLOW " +# " DETOUR " +# " " +# " " + +msg1a: .asciz "RING CLO" +msg2a: .asciz "ROADSED " +msg3a: .asciz " ANORT" +msg4a: .asciz "T H ST" + +msg1b: .asciz " FOL DET" +msg2b: .asciz "LOW OUR " +msg3b: .asciz " " +msg4b: .asciz " " + +msgblank: .asciz " " diff --git a/assembly/digitalsign/digitalsign.elf b/assembly/digitalsign/digitalsign.elf Binary files differnew file mode 100755 index 0000000..5da7730 --- /dev/null +++ b/assembly/digitalsign/digitalsign.elf diff --git a/assembly/digitalsign/digitalsign.hex b/assembly/digitalsign/digitalsign.hex new file mode 100644 index 0000000..130052c --- /dev/null +++ b/assembly/digitalsign/digitalsign.hex @@ -0,0 +1,25 @@ +:1000000039280F0000010F0000018928F528012878
+:100010000F0000010F0000016928FD20D5B717056A
+:10002000000013056510970500009385E5149308FB
+:10003000100873000000170500001305050F73007A
+:100040000000170500001305650E7300000017057A
+:1000500000001305C50D7300000082801705000025
+:100060001305850C970500009385850C93081008EF
+:1000700073000000170500001305250B970500000D
+:100080009385950B73000000170500001305050A02
+:10009000970500009385E50A73000000170500002E
+:1000A0001305E508970500009385350A73000000E5
+:1000B000828017050000130525079705000093852A
+:1000C0006509930810087300000017050000130568
+:1000D000C505970500009385750873000000170596
+:1000E00000001305A504970500009385C50773005C
+:1000F0000000170500001305850397050000938590
+:100100001507730000008280F32210C09102732350
+:1001100010C073D000800F00000173500080E368AE
+:1001200053FE8280310032003300340052494E4782
+:1001300020434C4F00524F4144534544200020205F
+:1001400020414E4F52540054202020482053540048
+:1001500020464F4C20444554004C4F57204F555299
+:1001600020002020202020202020002020202020CF
+:0E017000202020002020202020202020000021
+:00000001FF
diff --git a/assembly/digitalsign/digitalsign.o b/assembly/digitalsign/digitalsign.o Binary files differnew file mode 100644 index 0000000..96ec5fc --- /dev/null +++ b/assembly/digitalsign/digitalsign.o diff --git a/assembly/digitalsign/rvcontroller.ld b/assembly/digitalsign/rvcontroller.ld new file mode 120000 index 0000000..bc01402 --- /dev/null +++ b/assembly/digitalsign/rvcontroller.ld @@ -0,0 +1 @@ +../../rvcontroller.ld
\ No newline at end of file |
