-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChangeLog
1629 lines (1218 loc) · 55.6 KB
/
ChangeLog
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2025-03-03 Georg-Johann Lay <avr@gjlay.de>
Fix wrong H flag computation in SUB and SUBI.
* gen-flag-tables.c (gen_flag_update_tables): Fix
computation of flag_update_table_sub8[].
* flag-tables.c: Rebuild.
2024-06-12 Georg-Johann Lay <avr@gjlay.de>
Support -mint8 in avrtest.h.
* avrtest.h: Use __INT32_TYPE__ instead of long, etc.
2024-06-10 Georg-Johann Lay <avr@gjlay.de>
Support syscalls LOG_FMT_F7T etc. to log libgcc's
internal IEEE double representation.
* avrtest.h (LOG_F7T_CMD): New enum.
(LOG_F7T, LOG_FMT_F7T, LOG_PFMT_F7T): New macros.
* host.c (get_mem_byte): New function.
(layout[LOG_F7T_CMD]): New entry.
(sys_log_dump) [what = LOG_F7T_CMD]: Print neat f7_t.
2024-06-02 Georg-Johann Lay <avr@gjlay.de>
* avr51-flash1.x (.text): Add *(.progmemx.*)
2024-03-02 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/gen-exp.sh: Generate code with avrtest_opts.
* dejagnuboards/avrtest.exp (sim_load): Use avrtest_opts
in avrtest command options.
* dejagnuboards/*-sim.exp: Rebuild.
2024-01-21 Georg-Johann Lay <avr@gjlay.de>
Make code for 0-series ATmega from avrxmega3 work without -pm 0x4000.
* load-flash.c (load_elf) <load_sections()>: Move call up and prior to
the load of the program headers.
<arch.flash_pm_offset>: Set to 0x4000 when ATmega808/9, ATmega1608/9,
ATmega3208/9 or ATmega4808/9 is found in deviceinfo.
2024-01-15 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/avrtest.exp (avrlibc_include_dir): Use -isystem to
add include path, not -I.
2024-01-09 Georg-Johann Lay <avr@gjlay.de>
Ditch output to stderr from tested programs.
* dejagnuboards/avrtest.exp (sim_load): Add -no-stderr to avrtest
options.
2023-12-18 Georg-Johann Lay <avr@gjlay.de>
Generate the <mcu>-sim.exp board descriptions so that RAM layout
is described thoroughly.
* dejagnuboards/gen-exp.sh: Generate board descriptions that define
Tdata and symbols: __DATA_REGION_ORIGIN__, __DATA_REGION_LENGTH__,
__stack, __heap_end.
* dejagnuboards/<mcu>-sim.exp: Regenerate.
* dejagnuboards/avr128da32-sim.exp: New file.
2023-12-06 Georg-Johann Lay <avr@gjlay.de>
Add limited support for NVMCTRL_CTRLB.FLMAP Devices from
the AVR64* and AVR128* families see a 32 KiB block of their
program memeory in the RAM address space. avrtest_init_rodata()
is called from exit.c and copies that block from flash to RAM.
* avrtest.h (avrtest_misc_flmap): New syscall.
* avrtest.c (sys_misc): New static function.
(func_SYSCALL) [sysno=21]: Call sys_misc.
* dejagnuboards/exit.c (avr/io.h) [XMEGA]: Include it.
(avrtest_init_flmap): New static function in section .init0.
(avrtest_init_rodata): New static function in section .init4.
2023-12-04 Georg-Johann Lay <avr@gjlay.de>
* options.c (arch_desc) [avrxmega4]: Fix flash mask.
* load-flash.c (phdr_name, phdr_flags_str): New static functions.
(load_elf): Use them for better verbosity.
Load all program headers to flash memory that have a
load memory address below 0x800000 (data VMA).
2023-11-20 Georg-Johann Lay <avr@gjlay.de>
Don't use __typeof__(x) when x might be an address. Otherwise, it's
not possible to print the address of a static array.
* avrtest.h (LOG_DUMP_A_): New macro.
(LOG_FMT_ADDR, LOG_PFMT_ADDR): Use it instead of LOG_DUMP_F_.
2023-11-14 Georg-Johann Lay <avr@gjlay.de>
* load-flash.c (load_elf) [arch.flash_pm_offset]: Include 0x10000
in the valid range for addr + memsz + arch.flash_pm_offset.
2023-11-14 Georg-Johann Lay <avr@gjlay.de>
Support IEEE single and IEEE double emulation.
* avrtest.h (avrtest_<name>f, avrtest_<name>l, avrtest_<name>_d64):
New syscalls for <name> in:
sin, asin, sinh, asinh, cos, acos, cosh, acosh, tan, atan,
tanh, atanh, sqrt, cbrt, exp, log, trunc, ceil, floor, round,
pow, atan2, hypot, fmin, fmax, fmod, mul, div, add, sub.
* host.h (sys_emul_float, sys_emul_double): New protos.
* host.c (host_double_t): New typedef.
(sys_emul_float, sys_emul_double, emul_float2, emul_double2)
(get_reg_float, get_reg_double, set_reg_float, set_reg_double): New
functions.
* avrtest.c (func_SYSCALL) [sysno=23]: Call sys_emul_double.
[sysno=22]: Call sys_emul_float.
2023-10-01 Georg-Johann Lay <avr@gjlay.de>
Use flash size from section .note.gnu.avr.deviceinfo.
* testavr.h (exact_log2): New inline function.
* options.c (get_valid_kilo): Use it, and allow size of -1.
(parse_args): Move setting of program.pc_mask from here...
* load-flash.c (load_to_flash): ...to here.
Adjust check for program size overflow.
2023-09-23 Georg-Johann Lay <avr@gjlay.de>
Support logging of values like LOG_U8 or LOG_FMT_S32 also with avrtest.
* avrtest.c (func_SYSCALL): Call sys_log_dump directly.
* logging.c (sys_log_dump, layout, LEN_LOG_STRING)
(LEN_LOG_XFMT): Move to...
* host.c: ...here. And use log_add() instead of log_append().
* logging.h (layout_t): Move to host.h.
* logging.c (do_syscall): Remove cases 7, 8: Don't call sys_log_dump().
2023-09-21 Georg-Johann Lay <avr@gjlay.de>
Read note section .note.gnu.avr.deviceinfo and info therein like flash size.
* avrtest.c (get_mem): Allow for avrtest.
* load-flash.c (Elf32_Nhdr, avr_deviceinfo_t): New typedefs.
(NOTE_AVR_DEVICEINFO): Define to ".note.gnu.avr.deviceinfo".
(have_strtab, have_deviceinfo, avr_deviceinfo, avr_devicename)
(decode_avr_deviceinfo): New static vars.
(load_symbol_table, load_string_table, load_deviceinfo_note)
(decode_avr_deviceinfo): New stati static functions.
(load_sections): Renamed from load_symbol_string_table, relevant
parts out-sourced to the new functions above.
(load_elf): Always run load_sections(), but only load symtab if
is_avrtest_log. Postpone check_arch() until after deviceinfo note
has been read.
(check_arch): If available, print MCU name in diagnostics.
2023-05-28 Georg-Johann Lay <avr@gjlay.de>
Ignore some labels with non-printable characters in them.
* logging.c (log_set_function_symbol): Ignore symbols like "L0^A".
2023-05-26 Georg-Johann Lay <avr@gjlay.de>
Support a new syscall avrtest_abort_2nd_hit() that calls abort if
it is executed more than once. This is useful for programs that go
haywire and execute startup code more than once. The startup code in
dejagnuboards/exit.c now calls this syscall.
* avrtest.c (sys_abort_2nd_hit): New static function.
(func_SYSCALL) [sysno=25]: Call it.
* acrtest.h (avr_syscall_25, avrtest_abort_2nd_hit): New static
inline functions.
[assembler] <AVRTEST_ABORT_2ND_HIT>: New define.
* dejagnuboards/exit.c (avrtest_init_argc_argv): Call
avrtest_abort_2nd_hit.
2023-05-26 Georg-Johann Lay <avr@gjlay.de>
Add command line option -s SIZE to specify the size of the
simulated program memory. The value is used when the program
counter needs wrap-around. SIZE must be a power of 2.
* testavr.h (program_t) [max_pc, pc_mask]: New fields.
* options.def (-s): New option.
* options.c (USAGE) [-s SIZE]: Document.
(get_valid_kilo): New static function.
(parse_args) [OPT_size]: Handle.
Set program.pc_mask.
* load-flash.c (decode_flash) [program.max_pc]: Set.
* avrtest.c (set_pc, add_pc): New static functions to set PC.
Use them throughout the module.
2023-05-22 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/avrtest.exp: set_board_info gcc,signal_suppress
in order to skip more tests involving <signal.h> etc.
2023-05-19 Georg-Johann Lay <avr@gjlay.de>
* load-flash.c (check_elf): New function.
(load_elf): Use it.
2022-09-19 Georg-Johann Lay <avr@gjlay.de>
Support 64-bit values in option -m MAXCOUNT.
* options.c (get_valid_number): Return uint64_t.
(parse_args): Adjust accordingly.
* testavr.h (inttypes.h): Include it.
(program_t) [max_insns, n_insns, n_cycles]: Turn to uint64_t.
* avrtest.c (leave, execute): Adjust accordingly.
* host.c (ticks_port_t) [n_insns, n_cycles]: Turn to uint64_t.
(sys_ticks_cmd): Adjust to it.
* perf.c (perf_start, perf_stop, perf_instruction): Adjust to
new type of program.n_cycles, and program.n_insns.
2022-09-19 Georg-Johann Lay <avr@gjlay.de>
Introduce new command line option -flush that flushes the host's
stdout stream in each call of avrtest_putchar (syscall 29).
* options.def (AVRTEST_OPT) [flush]: New option.
* options.c (USAGE) [-flush]: Document it.
* avrtest.c (sys_stdout): Also log a "%c" version if the char that's
just being printed provided it is isprint().
2020-01-15 Georg-Johann Lay <avr@gjlay.de>
Adjust copyright years.
2019-12-18 Georg-Johann Lay <avr@gjlay.de>
Make parallel builds work.
* Makefile (exit-%.o, fileio-%.o): Use save-temps=obj instead
of -save-temps.
2019-12-17 Georg-Johann Lay <avr@gjlay.de>
Support avrtest_cycles/insns/rand/prand also in avrtest.
* logging.c (ticks_port_t, sys_ticks_cmd): Move to...
* host.c (ticks_port_t, sys_ticks_cmd): ...here.
Replace calls to log_append by calls to lod_add.
* host.h (sys_ticks_cmd): New proto.
* avrtest.c (do_syscall) [sysno=4]: Call sys_ticks_cmd
instead of do_syscall.
2019-12-16 Georg-Johann Lay <avr@gjlay.de>
Support printing 64-bit floating point values.
* host.c (decode_avr_double): New function.
* host.h (stdint.h): Include.
(decode_avr_double): New proto.
(avr_float_t) <mant,mant1>: Use uint64_t for these components.
* logging.c (sys_log_dump) [what=LOG_D64_CMD]: Handle.
(layout) <LOG_D64_CMD>: New element.
* avrtest.h (LOG_D64_CMD): New enum.
(LOG_D64, LOG_FMT_D64, LOG_PFMT_D64): New macros.
(LOG_DOUBLE, LOG_FMT_DOUBLE, LOG_PFMT_DOUBLE): New macros.
(LOG_LDOUBLE, LOG_FMT_LDOUBLE, LOG_PFMT_LDOUBLE): New macros.
2019-11-16 Georg-Johann Lay <avr@gjlay.de>
Refurbish leave codes so that LEAVE_ABORTED is only used when the
target program actually called abort().
2019-11-16 Georg-Johann Lay <avr@gjlay.de>
Implement host file i/o access via new syscall.
* Makefile: Simplify object file dependencies.
(fileio, fileio-%.o, clean-fileio): New targets.
(all-avr): Depend on fileio.
(FILEIO_MCUS, FILEIO_O): New vars.
* avrtest.h (AVRTEST_fopen, AVRTEST_fclose, AVRTEST_fgetc,
AVRTEST_fputc, AVRTEST_feof, AVRTEST_clearerr, AVRTEST_fread,
AVRTEST_fwrite, AVRTEST_fseek, AVRTEST_fflush): New enum values.
(AVRTEST_DEF_SYSCALL2_R20): New syscall def macro.
(avrtest_fileio_p/1/2/4) [!IN_AVRTEST]: New inline functions.
* avrtest.c (put_word_reg_raw, _log_va, sys_fileio): New static funcs.
(log_va): New global function pointer.
(func_SYSCALL): Handle syscall 26.
* testavr.h (stdarg.h): Include it.
(log_va): New proto.
(log_append_va): New macro.
* logging.c (log_append_va): New function.
* host.h (host_fileio): New proto.
* host.c (stdint.h, stdlib.h, stdio.h, stdarg.h, string.h,
avrtest.h): Include them.
(log_add_, find_file, host_fopen, host_fclose, host_fputc,
host_fgetc, host_feof, host_clearerr, host_fflush, host_fseek,
host_fread, host_fwrite): New static function.
(handle_t, file_t, avrlibc_stdio_seek_t): New typedefs.
(host_fileio): New function.
* options.def (AVRTEST_OPT): Add -sbox.
* options.h (fileio_sandbox): New proto.
* options.c (USAGE) <-sbox SANDBOX>: Explain.
(fileio_sandbox): New global var.
(parse_args) <OPT_sandbox>: Handle.
* fileio.h: New target header.
* dejagnuboards/fileio.c: New target module.
* README: Typo. Document file i/o.
2019-11-11 Georg-Johann Lay <avr@gjlay.de>
* host.c (get_mem_value): New function and...
* host.h (get_mem_value): ...proto.
2019-11-11 Georg-Johann Lay <avr@gjlay.de>
Add a new module host.c for some routines that serve
host <-> target transportation.
* logging.h (avr_float_t, get_r20_value, get_r18_value)
(decode_avr_float, read_string): Move typedef and protos to...
* host.h: ...this new file.
* avrtest.c (host.h): Include.
(cpu_address): Renamed from log_cpu_address.
* testavr.h: Same.
* graph.c (graph_update_call_depth): Same.
* logging.c (sys_ticks_cmd): Same.
(host.h): Include.
(math.h): Don't include.
(decode_avr_float, read_string, get_r20_value, get_r18_value):
Move to...
* host.c: ...this new file.
* perf.c (host.h): Include.
* Makefile (DEP_OPTIONS) <host.h>: Add.
(DEPS_HOST): New var.
(host.o, host$(W).o): New rules to build them.
2019-10-30 Georg-Johann Lay <avr@gjlay.de>
Bump copyrigth years.
2019-10-19 Georg-Johann Lay <avr@gjlay.de>
* avrtest.h (LOG_FMT_STR, LOG_FMT_PSTR, LOG_PFMT_STR, LOG_PFMT_PSTR): Use
const char* for the type of _x instead of __typeof__(X).
2019-09-09 Georg-Johann Lay <avr@gjlay.de>
* avrtest.c (load_indirect, store_indirect): Show the address offset
of LDD, STD when logging.
2019-09-09 Georg-Johann Lay <avr@gjlay.de>
BUGFIX: Don't read SP during an update when measuring performance.
Fix a fatal error that might occor with with LOG_PERF.
* avrtest.c (func_OUT): Call log_maybe_change_SP.
(addr_SPL): New global variable.
* testavr.h (addr_SPL, get_nonglitch_SP, log_maybe_change_SP): New protos.
* logging.c (maybe_SP_glitch): New global variable.
(log_maybe_change_SP, get_nonglitch_SP): New functions.
(log_add_instr) <maybe_SP_glitch>: Update it.
<maybe_used>: Syscall #5 might turn on logging.
* logging.h (maybe_SP_glitch): New proto.
* perf.c (perf_instruction): Use get_nonglitch_SP to get SP.
* graph.c (update_call_stack, graph_update_call_depth): Same.
2019-08-25 Georg-Johann Lay <avr@gjlay.de>
Support LOG_PUSH_ON, LOG_PUSH_OFF, LOG_POP to push / pop logging status.
* avrtest.h (avrtest_syscall_9/10/11): New AVRTEST_DEF_SYSCALLs.
(LOG_PUSH_ON, LOG_PUSH_OFF, LOG_POP) [C/C++, Assembler]: New macros.
* avrtest.c (func_SYSCALL) [sysno=9,10,11]: Forward to do_syscall().
* logging.c (log_stack_t): New typedef.
(do_syscall) [sysno=9,10,11]: Forward to...
(sys_log_pushpop): ...this new static function.
(log_set_logging): New static function.
(sys_log_config): Use it instead of this...
(SYS_LOGGING): ...removed macro.
(log_add_instr, log_init): Syscalls 10 and 11 might turn on logging.
(pc_string): New static function.
* README: Document LOG_PUSH_ON, LOG_PUSH_OFF, LOG_POP.
2019-08-21 Georg-Johann Lay <avr@gjlay.de>
BUGFIX: Correctly decode sub-normal floats
* logging.c (decode_avr_float) <af.exp> [FT_DENORM]: For sub-normals,
the exponent is 1 - bias, not -bias.
* avrtest.h (LOG_DUMP_F): Avoid early-clobber of F
if X is a function call with side-effect on F.
(LOG_FMT_*, LOG_PFMT_*): Adjust accordingly.
2019-08-13 Georg-Johann Lay <avr@gjlay.de>
BUGFIX: Don't use entry points from ELF header that are an
address in the RAM address space (or above). This
allows a global variable to be named 'start' which
is a specuial symbol name for the GNU linker.
* load-flash.c (load_elf) <program.entry_point>: Don't use
ehdr.e_entry that appear to be in .data as program entry int.
2019-08-10 Georg-Johann Lay <avr@gjlay.de>
* Makefile (clean-host): New phony target.
(clean): Depend on: clean-host, clean-exit.
2019-08-08 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/exit.c (avrtest_init_argc_argv) [pargs]: Set
to 0x1600 for avrxmega3.
2019-07-27 Georg-Johann Lay <avr@gjlay.de>
Add new option '-pm OFFSET' to set the address where the program
memory is seen in the RAM address space. This can be used to
simulate programs for ATmega4808 from -mmcu=avrxmega3 that use
an offset of 0x4000 instead of the avrxmega3 default of 0x8000.
* options.def (-pm): Add new option.
* options.c (flash_pm_offset): New static variable.
(parse_args) [OPT_flash_pm_offset]: Set it from the -pm option.
[arch.flash_pm_offset]: Set it from flash_pm_offset after all
args have been parsed.
(USAGE) [-pm OFFSET]: Document it.
* README: Document the new option.
2018-07-19 Georg-Johann Lay <avr@gjlay.de>
Correctly adjust RAMPX, RAMPY, RAMPZ in pre-decrement and
post-increment loads and stores.
* avrtest.c (update_reg_and_ramp, add_address): New static
functions.
(load_indirect, store_indirect): Use them to adjust the full
address, including RAMPX/Y/Z if appropriate, for pre-decrement
and post-increment loads and stores.
(ram_valid_mask): New static var.
(execute): Initialize it.
(load_program_memory): Only log writeback of RAMPZ if it is
actually changed by ELPM Z+.
2018-07-18 Georg-Johann Lay <avr@gjlay.de>
Support -mmcu=avrxmega7 that uses RAMPX, RAMPY, RAMPZ
resp. RAMPD as bits 16...23 for RAM accesses.
* options.h (arch_t): Add field .has_rampd.
* options.c (arch_desc): Add entry for "avrxmega7".
Add initializers for new field .has_rampd.
* testavr.h (MAX_RAM_SIZE) [ISA_XMEGA]: Increase size to 256 * 64 KiB.
* avrtest.c (RAMPX, RAMPY, RAMPD): New macros.
(named_sfr) [ISA_XMEGA]: Add entries for RAMPX/Y/D.
(get_ramp): New static function.
(load_indirect, store_indirect) [ISA_XMEGA & arch.has_rampd]:
Extend effective address by content of RAMPX/Y/Z.
(func_LDS, func_STS) [ISA_XMEGA & arch.has_rampd]: Extend effective
address by content of RAMPD.
* logging.c (log_add_data_mov) [addr >= 0x10000 & arch.has_rampd]:
Print address as %02x:%04x.
2018-02-01 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/avrtest.exp (sim_load): If a test PASSes, then
also return the program's output.
2018-01-24 Georg-Johann Lay <avr@gjlay.de>
Make LOG_PSTR etc. also work for flash-strings in .rodata.
* logging.c (read_string) [flash_p=true]: If addr appears to
be a RAM address due to addr >= arch.flash_pm_offset,
then read from RAM.
2018-01-24 Georg-Johann Lay <avr@gjlay.de>
* .dejagnurc: Adjust comments.
(avrlibc_include_dir): Set it.
* dejagnuboards/gen-exp.sh: New script to generate *-sim.exp
board descriptions.
* dejagnuboards/*.exp: Regenerate. No more set extra_cflags.
* dejagnuboards/atxmega128-sim.exp: Rename to atxmega128a3-sim.exp
2018-01-23 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/exit.c (avrtest_init_argc_argv) [pargs]: Set
to 0x7000 for avrxmega3.
2018-01-22 Georg-Johann Lay <avr@gjlay.de>
* .dejagnurc (avrtest_dir): Set it. Add more comments.
* README (Running avr-gcc testsuite): Adjust.
* dejagnuboards/*.exp: No more set avrtest_dir. Adjust comments.
2018-01-22 Georg-Johann Lay <avr@gjlay.de>
Add support for devices with program memory seen in RAM
address space (avrxmega3).
* README: Mention avrxmega3 as valid option.
* Makefile (EXIT_MCUS): Add attiny3216.
* load-flash.c (load_elf) [arch.flash_pm_offset != 0]: Copy
flash-data to RAM at offset arch.flash_pm_offset.
* avrtest.c (load_indirect) [AVR_TINY, AVR_XMEGA]: Use
arch.flash_pm_offset nstead of magic 0x4000. Always read from RAM.
(func_LDS): Also log flash address if LDS actually reads from flash.
* options.h (arch_t) [flash_pm_offset]: New field.
* options.c (arch_desc): Add "avrxmega3" row. Add initializer
for .flash_pm_offset.
* dejagnuboards/attiny3216-sim.exp: New file.
2018-01-22 Georg-Johann Lay <avr@gjlay.de>
Add DejaGnu board description for ATmega8.
* dejagnuboards/atmega8-sim.exp: New file.
2017-07-03 Georg-Johann Lay <avr@gjlay.de>
Handle RETI in call-depth computation.
* graph.c (graph_update_call_depth) [ID_RETI]: Adjust depth by -1.
2016-12-16 Georg-Johann Lay <avr@gjlay.de>
Fix problems with negative colors and with .dot file name.
* graph.c (make_dot_filename): Fix problem with basename length
which was 1 character too short.
(write_dot_node): Use fabs() aroung value for red color component.
Use "%f" print modifier for double.
2016-12-12 Georg-Johann Lay <avr@gjlay.de>
Add assembler support to avrtest.h.
* avrtest.h: Protect C-code with #if !defined (__ASSEMBLER__).
(LOG_ON, LOG_OFF) [ASSEMBLER]: New C macros.
(AVRTEST_ABORT, AVRTEST_EXIT) [ASSEMBLER]: New C macros.
(avrtest_syscall <N>) [ASSEMBLER]: New asm macro.
2016-12-12 Georg-Johann Lay <avr@gjlay.de>
Support logging of 64-bit values.
* avrtest.h (LOG_U64_CMD, LOG_S64_CMD, LOG_S64_CMD): New macros.
(LOG_U64, LOG_S64, LOG_X64): New macros.
(LOG_FMT_U64, LOG_FMT_S64, LOG_FMT_X64): New macros.
(LOG_PFMT_U64, LOG_PFMT_S64, LOG_PFMT_X64): New macros.
(avrtest_syscall_8_u64): New inline function.
(avrtest_syscall_8_s64): New inline function.
* logging.h (get_r18_value): New prototype.
* logging.c (get_r18_value): New function.
(sys_log_dump) [LOG_U64_CMD, LOG_S64_CMD, LOG_S64_CMD]: Handle.
(do_syscall) [sysno=8]: Handle.
(layout) [LOG_U64_CMD, LOG_S64_CMD, LOG_S64_CMD]: Add entries.
* avrtest.c (func_SYSCALL) [sysno=8]: Handle.
* README (Logging values to the host computer): Adjust.
2016-12-12 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/attiny40-sim.exp (extra_ldflags)
[__DATA_REGION_LENGTH__]: Increase from 2K to 8K.
2016-11-23 Martin Ettl <ettlmartin@users.sf.net>
* gen-flag-tables.c (main): Close input file in case of an error.
2016-11-21 Georg-Johann Lay <avr@gjlay.de>
For ATtiny40, use a linker description file which leaves .rodata
in flash and adds 0x4000 to VMAs (virtual memory addresses).
* avrtiny-rodata.x: New file.
* dejagnuboards/attiny40-sim.exp (extra_ldflags):
Add -Tavrtiny-rodata.x.
2016-11-21 Georg-Johann Lay <avr@gjlay.de>
* dejagnuboards/atmega2560-sim.exp (extra_ldflags) [__stack]:
Define symbol to 0x1fff.
2016-07-11 Georg-Johann Lay <avr@gjlay.de>
Support reduced AVR Tiny cores in new avrtest-tiny[_log].
Supply boad description for ATtiny40.
* Makefile: Add rules to build avrtest-tiny, avrtest-tiny_log as
simulator variants for ISA_TINY.
(EXIT_MCUS): Add attiny40.
* avr-opcode.def (LDS1, STS1): New AVR_OPCODE.
* testavr.h (is_tiny): New prototype.
* avrtest.c (is_tiny): New global const variable.
(IOBASE, CX, cpu_reg): Set depending on ISA_TINY.
(get_reg, put_reg) [ISA_TINY]: Abort if regno < 16.
(load_indirect): Handle ISA_TINY.
(func_LDS1, func_STS1): Implement Tiny's LDS, STS.
* load-flash.c (decode_opcode) [is_tiny]: Only decode to ID_LDD_Y,
ID_STD_Y, ID_LDD_Z, ID_STD_Z if offset is 0.
Handle LDS1 and STS1.
(tiny_opcode_maybe_illegal): New static function.
(decode_flash) [is_tiny]: Use it to invalidate opcodes that are
not valid for Tiny.
* logging.c (log_patch_mnemo): Patch "LDD Y+q" etc. to "LD Y".
* options.h (arch_t.is_tiny): New field.
* options.c (arch_desc) ["avrtiny"]: New entry.
(usage, parse_args): Handle is_tiny cases.
* dejagnuboards/exit.c (avrtest_init_argc_argv): Use placement of
argv[] that does not interfere with __AVR_TINY_PM_BASE_ADDRESS__.
(exit) [__AVR_TINY__]: Use ST instead of STS in inline asm.
* dejagnuboards/attiny40-sim.exp: New board description for ATtiny40.
* dejagnuboards/avrtest.exp (sim_load): Query avrtest_mcu for
"tiny" so we can select the right simulator executable: avrtest-tiny.
2016-07-11 Georg-Johann Lay <avr@gjlay.de>
Fix some build warnings.
* perf.c (print_tag): Don't use printf without format string.
(perf_stop) [call_only.sp]: Compare against INT_MAX, ont LONG_MAX.
* testavr.h (FASTCALL): Only define if __i386__ or __i686__.
2016-06-27 Georg-Johann Lay <avr@gjlay.de>
Use new file avrtest.exp that holds common parts of the board
description files.
* dejagnuboards/atmega103-sim.exp:
* dejagnuboards/atxmega128-sim.exp:
* dejagnuboards/atmega128-sim.exp: Factor out common code to...
* dejagnuboards/avrtest.exp: ...this new file.
* dejagnuboards/atmega2560-sim.exp: New file.
* dejagnuboards/atmega64-sim.exp: New file.
* README: Adjust.
2016-06-27 Georg-Johann Lay <avr@gjlay.de>
* avrtest.h: Don't use // comments.
[!IN_AVRTEST]: Use __extension__ with enum outside of range of int.
2016-06-25 Georg-Johann Lay <avr@gjlay.de>
BUGFIX: Fix wrong decoding of 1st instruction if entry-point
is not 0x0.
* load-flash.c (decode_flash): Decode first opcode from
program.code_start, not from 0x0.
2014-11-13 Georg-Johann Lay <avr@gjlay.de>
Add call graph generation with -graph.
New modules graph.c and perf.c.
* perf.c: New file.
* graph.c: New file.
* Makefile: Add rules to graph.o, perf.o.
* options.h (arch_t): Boolify.
(options_t): Add s_<VAR> fields.
* options.c (comma_list_to_array): New function
* options.def (-syms): Remove.
(-graph*): New options.
* load-flash.c (load_symbol_string_table): Call
set_elf_string_table, finish_elf_string_table.
(load_to_flash): Provide emty string table if the executable does
not have one.
(decode_opcode): Set have_syscall[] on SYSCALL.
* logging.c: Factor out performance meters to perf.c. Factor out
symbol handling to graph.c.
* logging.h: Same. And add include guards.
(graph.h, perf.h): New includes.
* perf.c: New file.
* perf.h: New file.
* graph.h: New file.
* graph.c: New file.
2014-10-29 Georg-Johann Lay <avr@gjlay.de>
Remove dead -[no-]ticks option.
* options.def (ticks): Remove.
* options.c (USAGE): Adjust.
2014-10-29 Georg-Johann Lay <avr@gjlay.de>
Avoid unspecified order when reading GPRs.
* avrtest.c (CPSE, AND, OR, EOR, CP, CPC, SUB, SBC): Apply get_reg
for first input operand first.
2014-10-26 Georg-Johann Lay <avr@gjlay.de>
Fix PERF_TAG_[P]FMT_FLOAT. Tidy perf_instruction.
* avrtest.h (PERF_TAG_FMT_FLOAT, PERF_TAG_PFMT_FLOAT): Fix.
* testavr.h (AR_SP): Remove and use...
(pSP): ...this instead.
* avrtest.c: Same.
* logging.h (perf_t.cmd): Turn from array to scalar.
* logginc.c: Adjust.
(perf_instruction, do_log_config, perf_verbose_start): Tidy.
(perf_start, perf_stat, perf_dump, perf_stop): Tidy.
2014-10-25 Georg-Johann Lay <avr@gjlay.de>
Fix options.o <- testavr.h dependency.
* Makefile (options.o): Depend on testavr.h.
* options.c (usage): Fix LEAVE_USAGE.
2014-10-25 Georg-Johann Lay <avr@gjlay.de>
Remove last remains of "magic" paradigm.
* testavr.h (magic_t): Rename to sfr_t.
(named_port): Rename to named_sfr.
* avrtest.c (data_read_magic_byte, data_write_magic_byte): Remove.
Adjust callers to use data_read_byte / data_write_byte instead.
2014-10-25 Georg-Johann Lay <avr@gjlay.de>
Switch from TICKS_PORT to SYSCALL.
* avrtest.h (TICKS_PORT): Remove define.
(TICKS_IS_CYCLES, TICKS_IS_INSNS, TICKS_IS_PRAND, TICKS_IS_RAND)
(TICKS_RESET, TICKS_RESET_ALL): Remove.
(avrtest_syscall_8): Remove.
(DEF_SYSCALL1_0, DEF_SYSCALL1_1, AT_INLINE): New.
(avrtest_cycles, avrtest_insns, avrtest_rand, avrtest_prand)
(avrtest_reset_cycles, avrtest_reset_insns, avrtest_reset_prand)
(avrtest_reset_all): New.
* testavr.h (AR_TICKS_PORT, log_get_ticks): Remove.
* avrtest.c (named_port) [TICKS_PORT]: Remove entries.
(log_cpu_address) [AR_TICKS_PORT]: Remove.
(func_SYSCALL) [8]: Don't handle.
* logging.c (do_ticks_cmd): Rewrite.
(s_ti, log_get_ticks, do_get_ticks): Remove.
(do_syscall) [8]: Don't handle.
2014-10-23 Georg-Johann Lay <avr@gjlay.de>
Fail on undefined pre-decrement / post-increment Operations.
* avr-opcode.def (UNDEF): New.
* load_flash.c (decode_opcode) [X+, Y+, Z+, -X, -Y, -Z]: Map
instructions with these addressing modes to ID_UNDEF if register
overlaps it.
* avrtest.c (func_UNDEF): New.
* logging.c (mnemonic): Move to...
* testavr.h (opcode_t.mnemonic): ... here.
2014-10-22 Georg-Johann Lay <avr@gjlay.de>
Support PERF_TAG_S16, PERF_TAG_S32.
* avrtest.h (PERF_TAG_S16, PERF_TAG_S32): New.
(PERF_TAG_FMT_S16, PERF_TAG_FMT_S32): New.
(PERF_TAG_PFMT_S16, PERF_TAG_PFMT_S32): New.
* logging.c (do_perf_tag_cmd): Handle PERF_TAG_S16_CMD,
PERF_TAG_S32_CMD.
2014-10-20 Georg-Johann Lay <avr@gjlay.de>
BUGFIX: Wrong SBRC / SBRS / SBIC / SBIS / CPSE skip offset
introduced 2014-10-11 SVN r157.
* load-flash.c (mask_LDS_STS): Fix mask.
* BUGS: New file.
2014-10-19 Georg-Johann Lay <avr@gjlay.de>
Implement __vector_default to call abort.
* dejagnuboards/exit.c (__vector_default): New, call abort.
2014-10-19 Georg-Johann Lay <avr@gjlay.de>
Use SYSCALLs instead of magic ports.
* dejagnuboards/exit.c: Adjust to syscall interfaces.
* avrtest.h: Adjust to syscall.
(ABORT_PORT_ADDR, LOG_PORT_ADDR, EXIT_PORT_ADDR, STDIN_PORT_ADDR)
(STDOUT_PORT_ADDR): Remove.
(avrtest_abort, avrtest_exit, avrtest_putchar, avrtest_getchar)
(avrtest_ticks) [!IN_AVRTEST]: New user functions.
* avr-opcode.def (SYSCALL): New.
* load-flash.c (decode_opcode) [CPSE]: Map special skips to SYSCALLs.
* logging.c (log_set_func_symbol): Ignore weird addresses.
(log_add_instr) [maybe_used]: Adjust to SYSCALL.
(do_log_dump, do_ticks_cmd): Dito.
(perf_verbose_start, perf_stat, perf_stop, perf_dump)
(perf_instruction): Adjust to new CMDs.
(log_init): Don't set RAM[0xffff].
(get_raw_value): Rename to...
(get_r20_value): ...this.
(flush_ticks_port, log_get_ticks, s_ti[], do_get_ticks): New.
(do_log_port_cmd): Removed and diffuse code to...
(do_log_config, do_perf_cmd, do_perf_tag_cmd): ... new functions.
(do_syscall): New. Use them.
(putchar_escaped, do_put_args): Move to...
* options.c: ...here.
* avrtest.c (invalid_opcode, get_word_reg_raw): New.
(data_read_magic_port, data_write_magic_port): Remove.
(data_read_magic_byte): Just handle TICKS_PORT.
(named_port) [LOG_PORT, STDOUT_PORT, STDIN_PORT, EXIT_PORT]
[ABORT_PORT]: Remove.
(do_argc_argv, do_stdin, do_stdout, do_abort, do_exit): New.
(func_SYSCALL): New, use them.
* testavr.h (do_log_port_cmd, flush_ticks_port): Remove.
(do_syscall, log_get_ticks, put_argv): New.
2014-10-15 Georg-Johann Lay <avr@gjlay.de>
Make ID = 0 bad_pc instruction.
* avr-opcodes.def (_bad_pc, DES): New.
(_null, _last__fast): Remove.
* avrtest.c (func__bad_pc, func_DES): New.
(do_step): ID = 0 is no more a special case.
(do_fast): Remove.
(func_ILLEGAL): Read bad opcode from flash.
2014-10-15 Georg-Johann Lay <avr@gjlay.de>
Make clean-up. Use "+r" to constrain regs in exit.c.
* logging.c (perf_instruction): Read SP via log_cpu_address.
* avrtest.c (log_cpu_address): More AR_* address ranges.
(log_data_write_byte, addr_TICKS_PORT, log_data_read_byte)
(addr_SP, log_put_word_reg, log_data_write_word): Remove.
* testavr.h: Same.
(AR_REG, AR_RAM, AR_FLASH, AR_EEPROM, AR_SP, AR_TICKS_PORT): New.
2014-10-15 Georg-Johann Lay <avr@gjlay.de>
Support BREAK and PERF_START_CALL.
* avr-opcode.def (BREAK): New.
* avrtest.c (func_BREAK): New.
* avrtest.h (PERF_START_CALL): New.
* logging.h (perfs_t.call_only): New.
* loggin.g.c (print_tag): Tidy.
(do_log_port_cmd, perf_start, perf_stop, perf_instructions):
Handle PERF_START_CALL.
2014-10-14 Georg-Johann Lay <avr@gjlay.de>
Postpone writing EXIT_PORT from exit to .fini1.
* dejagnuboards/exit.c (putchar_exit_c, init_exit_c, file_exit_c)
(init_args): Rename...
(avrtest_fputc, avrtest_init_stream, avrtest_output_stream)
(avrtest_init_argc_argv): ...to these.
(avrtest_output_stream): Use FDEV_SETUP_STREAM to initialize.
(avrtest_exit_code): New variable.
(exit): Set it. And jump to _exit.
(avrtest_fini1): New .fini1 function.
2014-10-13 Georg-Johann Lay <avr@gjlay.de>
Load EEPROM, -v option (verbose), more TICKS_PORT.
* optiond.def (-v): New option.
* load-flash.c (load_elf): Load .eeprom section to eeprom.
[-v]: Print PHDR.
(decode_flash): Only decode from program code_start to code_end.
* testavr.h (MAX_EEPROM_SIZE): New define.
(program_t, program, flush_ticks_port): New type and protos.
* logging.c (ticks_port_t, ticks_port): New type and variable.
(flush_ticks_port, do_ticks_cmd): New functions.
(do_log_dump): Handle TICKS_*_CMD.
* avrtest.h (TICKS_IS_RAND_CMD, TICKS_RESET_CMD, TICKS_IS_CYCLES_CMD)
(TICKS_IS_INSNS_CMD, TICKS_IS_PRAND_CMD, TICKS_RESET_ALL_CMD)
(TICKS_IS_RAND, TICKS_RESET, TICKS_IS_CYCLES, TICKS_IS_INSNS)
(TICKS_IS_PRAND, TICKS_RESET_ALL): New macros.
* avrtest.c (max_instr_count, instr_count, program_size)
(program_cycles, program_entry_point): Move data to...
(program): ...this new structure.
(cpu_eeprom[]): New...
(main): ...pass it to load_to_flash. Pass time to log_init.
(data_read_magic_port): Move TICKS_PORT handling to flush_ticks_port.
2014-10-11 Georg-Johann Lay <avr@gjlay.de>
Tidy up leave(). Pre-decode 32-bit skips. Don't strip programs.
* load-flash.c (decode_opcode) [CPSE, SBRC, SBRS, SBIC, SBIS]:
Map to 32-bit variant as needed.
[BRBS/BRBC]: Precompute jump offset.
* avr-opcode.def (CPSE1, SBIC1, SBIS1, SBRC1, SBRS1): Remove.
* logging.c (log_patch_mnemo): Dito.
* avrtest.c (exit_status_t): New type.
(exit_status[]): New.
(exit_status_text): Remove.
(leave): Tidy up. Factor out runtime statistics to...
(print_runtime): ...this new function.
(skip_instruction_on_condition): Don't handle size==0.
(branch_on_sreg_condition): Simplify delta computation.
(func_CPSE/SBIC/SBIS/SBRC/SBRS): Pass 1 as words to skip.
(func_CPSE1/SBIC1/SBIS1/SBRC1/SBRS1): Remove.
(Makefile): Don't strip executables.
2014-10-10 Georg-Johann Lay <avr@gjlay.de>
Refactoring and minor tweaks.
* avr-insn.def: Move to...
* avr-opcode.def: ...here. And rename AVR_INSN to AVR_OPCODE.
* load-flash.c (decode_opcode): Filter opcodes.
[ID_RJMP, ID_RCALL]: Pre-compute jump offset (op2).
* testavr.h (decoded_op): Rename to decoded_t.
Rename .oper1/2 to .op1/2.
(opcode_func_array): Rename to opcodes.
(opcode_t.mnemo): Move to...
* logging.c (mnemonic): ...this new array.
* gen-flag-tables.c (main): Make output depend on argv[1].
(TB_NOTHING, TB_EXTERN, TB_STATIC, TB_GOBAL): New.
(table_start, table_end, table_add): Depend code generation on them.
* flag-tables.c: Regenerate.
* flag-tables.h: New generated file.
* Makefile (avr-insn.def): Rename to: avr-opcode.def.
(flag-tables.o): New rule to build it.
(XOBJ): Add flag-tables.o.
(avrtest*.o): Depend on flag-tables.o.
(flag-tables): Also generate flag-tables.h.
* avrtest.c (flag-tables.h): #include instead of flag-tables.c.
(func_ASR): Minor tweak.
(func_RCALL, func_RJMP): Use pre-computed jump offset.
(xmega_atomic): Add magic_p and mnemo arguments.
[ISA_XMEGA]: Abort.
(func_XCH/LAC/LAS/LAT): Less magic, pass mnemo, don't depend
on is_xmega.
2014-10-09 Georg-Johann Lay <avr@gjlay.de>
Handle "RCALL ." and unknown function names.
* logging.c (log_add_instr): Pass decoded_op* to set_call_depth.
(set_call_depth): Adjust interface. Set unknown function names
to "?". [ID_RCALL]: Handle offset = 0.
2014-10-09 Georg-Johann Lay <avr@gjlay.de>
More elaborate exit stati with quiet operation (-q).
Show usage with -h or --help.
* README (-q): Document exit stati.
* avrtest.c (exit_status_text): Initialize EXIT_STATUS_FILE,
EXIT_STATUS_MEMORY with "ABORTED".
(is_avrtest_log): New const.
(leave): Don't print runtime statistics if failing.
[options.do_quiet]: Return exit status 10, 11, 12, 13, 42 as
documented in README.
(get_mem): New function.
* load-flash.c (load_elf): Leave with EXIT_STATUS_FILE if something
is wrong with the executable file.
(load_symbol_string_table): Same. And call it only if is_avrtest_log.
Use get_mem to allocate heap.
* options.c (USAGE): Document -h, --help.
(usage) [fmt=NULL]: Show usage for --help etc. and exit 0.
(parse_args): Silently support ?, -?, /?, -h, --help to show usage.
* options.def: Reorder.
* testavr.h: Include stdlib.h.
(is_avrtest_log, get_mem): New protos.
(EXIT_STATUS_FILE, EXIT_STATUS_MEMORY): New enum.
2014-10-09 Georg-Johann Lay <avr@gjlay.de>
Display function symbols from ELF when logging.
New option -no-syms to switch that off.
* options.def (-[no-]syms): New option.
* testavr.h (program_size, io_base, log_set_func_symbol)
(load_to_flash, decode_flash, set_function_symbol): New protos.
* avr-insn.def (xmega): New pseudo insn.
(XCH, LAS, LAC, LAT): Don't depend on ISA_XMEGA.
* logging.c (func_symbol[]): New static array.
(LEN_SYMBOL_STACK): New macro.
(log_set_func_symbol, func_name): New functions.
(perf_instruction): Factor out code to track call depth to...
(set_call_depth): ...this new function.
(log_add_instr): Use it.
(log_init): Set RAM[MAX_RAM_SIZE-1] to 1.
(log_dump_line): Typo.
* avrtest.c (io_base): New const.
(program_size): Make global.
(set_function_symbol): New function.